~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_parse.cc

  • Committer: Olaf van der Spek
  • Date: 2011-06-27 14:23:35 UTC
  • mto: This revision was merged to the branch mainline in revision 2350.
  • Revision ID: olafvdspek@gmail.com-20110627142335-38y17d8xxczy6ilm
Refactor

Show diffs side-by-side

added added

removed removed

Lines of Context:
648
648
}
649
649
 
650
650
 
651
 
bool
652
 
new_select(LEX *lex, bool move_down)
 
651
bool new_select(LEX *lex, bool move_down)
653
652
{
654
 
  Select_Lex *select_lex;
655
 
  Session *session= lex->session;
656
 
 
657
 
  if (!(select_lex= new (session->mem_root) Select_Lex()))
658
 
    return true;
 
653
  Session* session= lex->session;
 
654
  Select_Lex* select_lex= new (session->mem_root) Select_Lex;
659
655
 
660
656
  select_lex->select_number= ++session->select_number;
661
657
  select_lex->parent_lex= lex; /* Used in init_query. */
672
668
  select_lex->nest_level= lex->nest_level;
673
669
  if (move_down)
674
670
  {
675
 
    Select_Lex_Unit *unit;
676
671
    /* first select_lex of subselect or derived table */
677
 
    if (!(unit= new (session->mem_root) Select_Lex_Unit()))
678
 
      return 1;
 
672
    Select_Lex_Unit* unit= new (session->mem_root) Select_Lex_Unit();
679
673
 
680
674
    unit->init_query();
681
675
    unit->init_select();
885
879
    return true;
886
880
  }
887
881
 
888
 
  if (!(new_field= new CreateField())
889
 
      || new_field->init(session, field_name->str, type, length, decimals,
890
 
                         type_modifier, comment, change, interval_list,
891
 
                         cs, 0, column_format)
 
882
  new_field= new CreateField;
 
883
  if (new_field->init(session, field_name->str, type, length, decimals,
 
884
                         type_modifier, comment, change, interval_list, cs, 0, column_format)
892
885
      || new_field->setDefaultValue(default_value, on_update_value))
893
886
    return true;
894
887
 
1279
1272
  Select_Lex *first_sl= first_select();
1280
1273
  assert(!fake_select_lex);
1281
1274
 
1282
 
  if (!(fake_select_lex= new (session_arg->mem_root) Select_Lex()))
1283
 
      return 1;
1284
 
  fake_select_lex->include_standalone(this,
1285
 
                                      (Select_Lex_Node**)&fake_select_lex);
 
1275
  fake_select_lex= new (session_arg->mem_root) Select_Lex();
 
1276
  fake_select_lex->include_standalone(this, (Select_Lex_Node**)&fake_select_lex);
1286
1277
  fake_select_lex->select_number= INT_MAX;
1287
1278
  fake_select_lex->parent_lex= &session_arg->lex(); /* Used in init_query. */
1288
1279
  fake_select_lex->make_empty_select();