~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_derived.cc

  • Committer: Lee Bieber
  • Date: 2010-11-07 19:34:48 UTC
  • mfrom: (1910.1.2 build)
  • Revision ID: kalebral@gmail.com-20101107193448-64kdu912qej354sh
Merge Stewart - including adapting and expanding the "differences from mysql" page from the wiki.
Merge Stewart - fix bug 668143: drizzleslap with --commit runs second iteration data load in a transaction

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
  Call given derived table processor (preparing or filling tables)
28
28
 
29
29
  SYNOPSIS
30
 
    handle_derived()
 
30
    mysql_handle_derived()
31
31
    lex                 LEX for this thread
32
32
    processor           procedure of derived table processing
33
33
 
35
35
    false  OK
36
36
    true   Error
37
37
*/
38
 
bool handle_derived(LEX *lex, bool (*processor)(Session*, LEX*, TableList*))
 
38
bool mysql_handle_derived(LEX *lex, bool (*processor)(Session*, LEX*, TableList*))
39
39
{
40
40
  bool res= false;
41
41
  if (lex->derived_tables)
68
68
  Create temporary table structure (but do not fill it)
69
69
 
70
70
  SYNOPSIS
71
 
    derived_prepare()
 
71
    mysql_derived_prepare()
72
72
    session                     Thread handle
73
73
    lex                 LEX for this thread
74
74
    orig_table_list     TableList for the upper SELECT
88
88
    false  OK
89
89
    true   Error
90
90
*/
91
 
bool derived_prepare(Session *session, LEX *, TableList *orig_table_list)
 
91
bool mysql_derived_prepare(Session *session, LEX *, TableList *orig_table_list)
92
92
{
93
93
  Select_Lex_Unit *unit= orig_table_list->derived;
94
94
  uint64_t create_options;
154
154
      /* Force read of table stats in the optimizer */
155
155
      table->cursor->info(HA_STATUS_VARIABLE);
156
156
      /* Add new temporary table to list of open derived tables */
157
 
      table->setNext(session->getDerivedTables());
158
 
      session->setDerivedTables(table);
 
157
      table->setNext(session->derived_tables);
 
158
      session->derived_tables= table;
159
159
    }
160
160
  }
161
161
 
166
166
  fill derived table
167
167
 
168
168
  SYNOPSIS
169
 
    derived_filling()
 
169
    mysql_derived_filling()
170
170
    session                     Thread handle
171
171
    lex                 LEX for this thread
172
172
    unit                node that contains all SELECT's for derived tables
184
184
    false  OK
185
185
    true   Error
186
186
*/
187
 
bool derived_filling(Session *session, LEX *lex, TableList *orig_table_list)
 
187
bool mysql_derived_filling(Session *session, LEX *lex, TableList *orig_table_list)
188
188
{
189
189
  Table *table= orig_table_list->table;
190
190
  Select_Lex_Unit *unit= orig_table_list->derived;
208
208
              first_select->options&= ~OPTION_FOUND_ROWS;
209
209
 
210
210
      lex->current_select= first_select;
211
 
      res= select_query(session, &first_select->ref_pointer_array,
 
211
      res= mysql_select(session, &first_select->ref_pointer_array,
212
212
                        (TableList*) first_select->table_list.first,
213
213
                        first_select->with_wild,
214
214
                        first_select->item_list, first_select->where,