~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field_iterator.cc

  • Committer: Olaf van der Spek
  • Date: 2011-02-12 18:24:24 UTC
  • mto: (2167.1.2 build) (2172.1.4 build)
  • mto: This revision was merged to the branch mainline in revision 2168.
  • Revision ID: olafvdspek@gmail.com-20110212182424-kgnm9osi7qo97at2
casts

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems
 
4
 *  Copyright (C) 2008 Sun Microsystems, Inc.
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
34
34
 
35
35
void Field_iterator_table::set(TableList *table)
36
36
{
37
 
  ptr= table->table->field;
 
37
  ptr= table->table->getFields();
38
38
}
39
39
 
40
40
 
41
41
void Field_iterator_table::set_table(Table *table)
42
42
{
43
 
  ptr= table->field;
 
43
  ptr= table->getFields();
44
44
}
45
45
 
46
46
 
67
67
  cur_column_ref= column_ref_it++;
68
68
  assert(!cur_column_ref || ! cur_column_ref->table_field ||
69
69
              cur_column_ref->table_ref->table ==
70
 
              cur_column_ref->table_field->table);
 
70
              cur_column_ref->table_field->getTable());
71
71
}
72
72
 
73
73
 
128
128
  if (table_ref->is_natural_join)
129
129
    return natural_join_it.column_ref()->table_name();
130
130
 
131
 
  assert(!strcmp(table_ref->table_name,
132
 
                      table_ref->table->s->table_name.str));
133
 
  return table_ref->table_name;
 
131
  assert(!strcmp(table_ref->getTableName(),
 
132
                 table_ref->table->getShare()->getTableName()));
 
133
  return table_ref->getTableName();
134
134
}
135
135
 
136
136
 
143
143
    Test that TableList::db is the same as TableShare::db to
144
144
    ensure consistency. 
145
145
  */
146
 
  assert(!strcmp(table_ref->db, table_ref->table->s->getSchemaName()));
147
 
  return table_ref->db;
 
146
  assert(!strcmp(table_ref->getSchemaName(), table_ref->table->getShare()->getSchemaName()));
 
147
  return table_ref->getSchemaName();
148
148
}
149
149
 
150
150
 
200
200
    /* The field belongs to a stored table. */
201
201
    Field *tmp_field= table_field_it.field();
202
202
    nj_col= new Natural_join_column(tmp_field, table_ref);
203
 
    field_count= table_ref->table->s->fields;
 
203
    field_count= table_ref->table->getShare()->sizeFields();
204
204
  }
205
205
  else
206
206
  {
215
215
    assert(nj_col);
216
216
  }
217
217
  assert(!nj_col->table_field ||
218
 
              nj_col->table_ref->table == nj_col->table_field->table);
 
218
              nj_col->table_ref->table == nj_col->table_field->getTable());
219
219
 
220
220
  /*
221
221
    If the natural join column was just created add it to the list of
280
280
  nj_col= natural_join_it.column_ref();
281
281
  assert(nj_col &&
282
282
              (!nj_col->table_field ||
283
 
               nj_col->table_ref->table == nj_col->table_field->table));
 
283
               nj_col->table_ref->table == nj_col->table_field->getTable()));
284
284
  return nj_col;
285
285
}
286
286