~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field_iterator.cc

  • Committer: Mark Atwood
  • Date: 2011-08-09 01:21:52 UTC
  • mfrom: (2380.1.2 drizzle-autoconf)
  • Revision ID: me@mark.atwood.name-20110809012152-zxq2dgan8e6nsvse
mergeĀ lp:~brianaker/drizzle/autoreconf

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#include "config.h"
 
20
#include <config.h>
21
21
#include <drizzled/field_iterator.h>
22
22
#include <drizzled/table_list.h>
23
23
#include <drizzled/session.h>
 
24
#include <drizzled/sql_lex.h>
24
25
#include <drizzled/table.h>
25
26
 
26
 
namespace drizzled
27
 
{
 
27
namespace drizzled {
28
28
 
29
29
const char *Field_iterator_table::name()
30
30
{
46
46
 
47
47
Item *Field_iterator_table::create_item(Session *session)
48
48
{
49
 
  Select_Lex *select= session->lex->current_select;
50
 
 
51
 
  Item_field *item= new Item_field(session, &select->context, *ptr);
52
 
 
53
 
  return item;
 
49
  return new Item_field(session, &session->lex().current_select->context, *ptr);
54
50
}
55
51
 
56
52
 
57
53
void Field_iterator_natural_join::set(TableList *table_ref)
58
54
{
59
55
  assert(table_ref->join_columns);
60
 
  column_ref_it.init(*(table_ref->join_columns));
 
56
  column_ref_it= table_ref->join_columns->begin();
61
57
  cur_column_ref= column_ref_it++;
62
58
}
63
59
 
229
225
    if (!add_table_ref->join_columns)
230
226
    {
231
227
      /* Create a list of natural join columns on demand. */
232
 
      if (!(add_table_ref->join_columns= new List<Natural_join_column>))
233
 
        return NULL;
 
228
      add_table_ref->join_columns= new List<Natural_join_column>;
234
229
      add_table_ref->is_join_columns_complete= false;
235
230
    }
236
231
    add_table_ref->join_columns->push_back(nj_col);
242
237
      must take care to mark when all fields are created/added.
243
238
    */
244
239
    if (!parent_table_ref &&
245
 
        add_table_ref->join_columns->elements == field_count)
 
240
        add_table_ref->join_columns->size() == field_count)
246
241
      add_table_ref->is_join_columns_complete= true;
247
242
  }
248
243