~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/insert_select.cc

  • Committer: Olaf van der Spek
  • Date: 2011-07-04 19:29:58 UTC
  • mto: This revision was merged to the branch mainline in revision 2367.
  • Revision ID: olafvdspek@gmail.com-20110704192958-xtkym2ph9jj7lwl9
Refactor

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
  TableList *all_tables= lex().query_tables;
37
37
  assert(first_table == all_tables && first_table != 0);
38
38
  Select_Lex *select_lex= &lex().select_lex;
39
 
  Select_Lex_Unit *unit= &lex().unit;
40
39
 
41
40
  if (insert_precheck(&session(), all_tables))
42
41
  {
46
45
  /* Don't unlock tables until command is written to binary log */
47
46
  select_lex->options|= SELECT_NO_UNLOCK;
48
47
 
49
 
  unit->set_limit(select_lex);
 
48
  lex().unit.set_limit(select_lex);
50
49
 
51
50
  if (session().wait_if_global_read_lock(false, true))
52
51
  {
64
63
    res= insert_select_prepare(&session());
65
64
    if (not res)
66
65
    {
67
 
      select_result* sel_result= new select_insert(first_table, first_table->table, &lex().field_list, &lex().update_list, &lex().value_list, lex().duplicates, lex().ignore);
68
 
      res= handle_select(&session(), &lex(), sel_result, OPTION_SETUP_TABLES_DONE);
 
66
      select_insert sel_result(first_table, first_table->table, &lex().field_list, &lex().update_list, &lex().value_list, lex().duplicates, lex().ignore);
 
67
      res= handle_select(&session(), &lex(), &sel_result, OPTION_SETUP_TABLES_DONE);
69
68
 
70
69
      /*
71
70
         Invalidate the table in the query cache if something changed
80
79
        first_table->next_local= 0;
81
80
        first_table->next_local= save_table;
82
81
      }
83
 
      delete sel_result;
84
82
    }
85
83
    /* revert changes for SP */
86
84
    select_lex->table_list.first= (unsigned char*) first_table;