~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/field.cc

  • Committer: Brian Aker
  • Date: 2010-07-16 05:40:08 UTC
  • mto: This revision was merged to the branch mainline in revision 1661.
  • Revision ID: brian@gaz-20100716054008-cfcvyu0akpwqnwqd
Encapsulate Table in field

Show diffs side-by-side

added added

removed removed

Lines of Context:
108
108
bool Item_field::register_field_in_read_map(unsigned char *arg)
109
109
{
110
110
  Table *table= (Table *) arg;
111
 
  if (field->table == table || !table)
112
 
    field->table->setReadSet(field->field_index);
 
111
  if (field->getTable() == table || !table)
 
112
    field->getTable()->setReadSet(field->field_index);
113
113
 
114
114
  return 0;
115
115
}
140
140
                       Name_resolution_context *context_arg,
141
141
                       Field *f) :
142
142
  Item_ident(context_arg,
143
 
             f->table->getShare()->getSchemaName(),
 
143
             f->getTable()->getShare()->getSchemaName(),
144
144
             *f->table_name,
145
145
             f->field_name),
146
146
   item_equal(0),
194
194
  max_length= field_par->max_display_length();
195
195
  table_name= *field_par->table_name;
196
196
  field_name= field_par->field_name;
197
 
  db_name= field_par->table->getShare()->getSchemaName();
198
 
  alias_name_used= field_par->table->alias_name_used;
 
197
  db_name= field_par->getTable()->getShare()->getSchemaName();
 
198
  alias_name_used= field_par->getTable()->alias_name_used;
199
199
  unsigned_flag=test(field_par->flags & UNSIGNED_FLAG);
200
200
  collation.set(field_par->charset(), field_par->derivation());
201
201
  fixed= 1;
372
372
 
373
373
table_map Item_field::used_tables() const
374
374
{
375
 
  if (field->table->const_table)
 
375
  if (field->getTable()->const_table)
376
376
    return 0;                                   // const item
377
 
  return (depended_from ? OUTER_REF_TABLE_BIT : field->table->map);
 
377
  return (depended_from ? OUTER_REF_TABLE_BIT : field->getTable()->map);
378
378
}
379
379
 
380
380
enum Item_result Item_field::result_type () const
530
530
      {
531
531
        if (*from_field != view_ref_found)
532
532
        {
533
 
          prev_subselect_item->used_tables_cache|= (*from_field)->table->map;
 
533
          prev_subselect_item->used_tables_cache|= (*from_field)->getTable()->map;
534
534
          prev_subselect_item->const_item_cache= 0;
535
535
          set_field(*from_field);
536
536
          if (!last_checked_context->select_lex->having_fix_field &&
888
888
  }
889
889
  else if (session->mark_used_columns != MARK_COLUMNS_NONE)
890
890
  {
891
 
    Table *table= field->table;
 
891
    Table *table= field->getTable();
892
892
    MyBitmap *current_bitmap, *other_bitmap;
893
893
    if (session->mark_used_columns == MARK_COLUMNS_READ)
894
894
    {
1200
1200
    need to set no_errors to prevent warnings about type conversion
1201
1201
    popping up.
1202
1202
  */
1203
 
  Session *session= field->table->in_use;
 
1203
  Session *session= field->getTable()->in_use;
1204
1204
  int no_errors;
1205
1205
 
1206
1206
  no_errors= session->no_errors;
1237
1237
  Select_Lex *select= (Select_Lex*)select_arg;
1238
1238
  assert(fixed);
1239
1239
 
1240
 
  if (field->table != select->context.table_list->table)
 
1240
  if (field->getTable() != select->context.table_list->table)
1241
1241
  {
1242
1242
    List<Item> *all_fields= &select->join->all_fields;
1243
1243
    Item **ref_pointer_array= select->ref_pointer_array;
1256
1256
 
1257
1257
void Item_field::print(String *str, enum_query_type query_type)
1258
1258
{
1259
 
  if (field && field->table->const_table)
 
1259
  if (field && field->getTable()->const_table)
1260
1260
  {
1261
1261
    char buff[MAX_FIELD_WIDTH];
1262
1262
    String tmp(buff,sizeof(buff),str->charset());