~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/field.cc

Remove dead memset call.

Show diffs side-by-side

added added

removed removed

Lines of Context:
84
84
 
85
85
bool Item_field::find_item_in_field_list_processor(unsigned char *arg)
86
86
{
87
 
  KEY_PART_INFO *first_non_group_part= *((KEY_PART_INFO **) arg);
88
 
  KEY_PART_INFO *last_part= *(((KEY_PART_INFO **) arg) + 1);
89
 
  KEY_PART_INFO *cur_part;
 
87
  KeyPartInfo *first_non_group_part= *((KeyPartInfo **) arg);
 
88
  KeyPartInfo *last_part= *(((KeyPartInfo **) arg) + 1);
 
89
  KeyPartInfo *cur_part;
90
90
 
91
91
  for (cur_part= first_non_group_part; cur_part != last_part; cur_part++)
92
92
  {
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
}
116
116
 
117
117
 
118
118
Item_field::Item_field(Field *f)
119
 
  :Item_ident(0, NULL, *f->table_name, f->field_name),
 
119
  :Item_ident(0, NULL, f->getTable()->getAlias(), f->field_name),
120
120
   item_equal(0), no_const_subst(0),
121
121
   have_privileges(0), any_privileges(0)
122
122
{
140
140
                       Name_resolution_context *context_arg,
141
141
                       Field *f) :
142
142
  Item_ident(context_arg,
143
 
             f->table->s->getSchemaName(),
144
 
             *f->table_name,
 
143
             f->getTable()->getShare()->getSchemaName(),
 
144
             f->getTable()->getAlias(),
145
145
             f->field_name),
146
146
   item_equal(0),
147
147
   no_const_subst(0),
192
192
  maybe_null=field->maybe_null();
193
193
  decimals= field->decimals();
194
194
  max_length= field_par->max_display_length();
195
 
  table_name= *field_par->table_name;
 
195
  table_name= field_par->getTable()->getAlias();
196
196
  field_name= field_par->field_name;
197
 
  db_name= field_par->table->s->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 &&
789
789
      {
790
790
        uint32_t counter;
791
791
        enum_resolution_type resolution;
792
 
        Item** res= find_item_in_list(this, session->lex->current_select->item_list,
 
792
        Item** res= find_item_in_list(session,
 
793
                                      this, session->lex->current_select->item_list,
793
794
                                      &counter, REPORT_EXCEPT_NOT_FOUND,
794
795
                                      &resolution);
795
796
        if (!res)
887
888
  }
888
889
  else if (session->mark_used_columns != MARK_COLUMNS_NONE)
889
890
  {
890
 
    Table *table= field->table;
 
891
    Table *table= field->getTable();
891
892
    MyBitmap *current_bitmap, *other_bitmap;
892
893
    if (session->mark_used_columns == MARK_COLUMNS_READ)
893
894
    {
1199
1200
    need to set no_errors to prevent warnings about type conversion
1200
1201
    popping up.
1201
1202
  */
1202
 
  Session *session= field->table->in_use;
 
1203
  Session *session= field->getTable()->in_use;
1203
1204
  int no_errors;
1204
1205
 
1205
1206
  no_errors= session->no_errors;
1236
1237
  Select_Lex *select= (Select_Lex*)select_arg;
1237
1238
  assert(fixed);
1238
1239
 
1239
 
  if (field->table != select->context.table_list->table)
 
1240
  if (field->getTable() != select->context.table_list->table)
1240
1241
  {
1241
1242
    List<Item> *all_fields= &select->join->all_fields;
1242
1243
    Item **ref_pointer_array= select->ref_pointer_array;
1255
1256
 
1256
1257
void Item_field::print(String *str, enum_query_type query_type)
1257
1258
{
1258
 
  if (field && field->table->const_table)
 
1259
  if (field && field->getTable()->const_table)
1259
1260
  {
1260
1261
    char buff[MAX_FIELD_WIDTH];
1261
1262
    String tmp(buff,sizeof(buff),str->charset());
1262
1263
    field->val_str(&tmp);
1263
 
    str->append('\'');
1264
 
    str->append(tmp);
1265
 
    str->append('\'');
 
1264
    if (field->is_null())  {
 
1265
      str->append("NULL");
 
1266
    }
 
1267
    else {
 
1268
      str->append('\'');
 
1269
      str->append(tmp);
 
1270
      str->append('\'');
 
1271
    }
1266
1272
    return;
1267
1273
  }
1268
1274
  Item_ident::print(str, query_type);