~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_base.cc

  • Committer: Mark Atwood
  • Date: 2011-08-12 04:08:33 UTC
  • mfrom: (2385.2.17 refactor5)
  • Revision ID: me@mark.atwood.name-20110812040833-u6j85nc6ahuc0dtz
mergeĀ lp:~olafvdspek/drizzle/refactor5

Show diffs side-by-side

added added

removed removed

Lines of Context:
3268
3268
                  List<TableList> *from_clause, TableList *tables,
3269
3269
                  TableList **leaves, bool select_insert)
3270
3270
{
3271
 
  uint32_t tablenr= 0;
3272
 
 
3273
 
  assert ((select_insert && !tables->next_name_resolution_table) || !tables ||
 
3271
  assert((select_insert && !tables->next_name_resolution_table) || !tables ||
3274
3272
          (context->table_list && context->first_name_resolution_table));
3275
3273
  /*
3276
3274
    this is used for INSERT ... SELECT.
3277
3275
    For select we setup tables except first (and its underlying tables)
3278
3276
  */
3279
 
  TableList *first_select_table= (select_insert ?  tables->next_local: NULL);
 
3277
  TableList *first_select_table= select_insert ? tables->next_local : NULL;
3280
3278
 
3281
 
  if (!(*leaves))
 
3279
  if (not *leaves)
3282
3280
    make_leaves_list(leaves, tables);
3283
3281
 
3284
 
  TableList *table_list;
3285
 
  for (table_list= *leaves;
3286
 
       table_list;
3287
 
       table_list= table_list->next_leaf, tablenr++)
 
3282
  uint32_t tablenr= 0;
 
3283
  for (TableList* table_list= *leaves; table_list; table_list= table_list->next_leaf, tablenr++)
3288
3284
  {
3289
3285
    Table *table= table_list->table;
3290
3286
    table->pos_in_table_list= table_list;
3345
3341
{
3346
3342
  TableList *leaves_tmp= NULL;
3347
3343
 
3348
 
  if (setup_tables(session, context, from_clause, tables,
3349
 
                   &leaves_tmp, select_insert))
 
3344
  if (setup_tables(session, context, from_clause, tables, &leaves_tmp, select_insert))
3350
3345
    return true;
3351
3346
 
3352
3347
  if (leaves)
3435
3430
 
3436
3431
    for (; !field_iterator.end_of_fields(); field_iterator.next())
3437
3432
    {
3438
 
      Item *item;
3439
 
 
3440
 
      if (!(item= field_iterator.create_item(session)))
 
3433
      Item *item= field_iterator.create_item(session);
 
3434
      if (not item)
3441
3435
        return true;
3442
3436
 
3443
 
      if (!found)
 
3437
      if (not found)
3444
3438
      {
3445
3439
        found= true;
3446
3440
        it->replace(item); /* Replace '*' with the first found item. */