~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_derived.cc

  • Committer: Brian Aker
  • Date: 2008-08-18 22:20:43 UTC
  • mto: This revision was merged to the branch mainline in revision 352.
  • Revision ID: brian@tangent.org-20080818222043-et6zf93ogrgx1cz9
Refactoring table.h

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
    true   Error
34
34
*/
35
35
bool
36
 
mysql_handle_derived(LEX *lex, bool (*processor)(THD*, LEX*, TABLE_LIST*))
 
36
mysql_handle_derived(LEX *lex, bool (*processor)(THD*, LEX*, TableList*))
37
37
{
38
38
  bool res= false;
39
39
  if (lex->derived_tables)
43
43
         sl;
44
44
         sl= sl->next_select_in_list())
45
45
    {
46
 
      for (TABLE_LIST *cursor= sl->get_table_list();
 
46
      for (TableList *cursor= sl->get_table_list();
47
47
           cursor;
48
48
           cursor= cursor->next_local)
49
49
      {
74
74
    mysql_derived_prepare()
75
75
    thd                 Thread handle
76
76
    lex                 LEX for this thread
77
 
    orig_table_list     TABLE_LIST for the upper SELECT
 
77
    orig_table_list     TableList for the upper SELECT
78
78
 
79
79
  IMPLEMENTATION
80
80
    Derived table is resolved with temporary table.
81
81
 
82
 
    After table creation, the above TABLE_LIST is updated with a new table.
 
82
    After table creation, the above TableList is updated with a new table.
83
83
 
84
84
    This function is called before any command containing derived table
85
85
    is executed.
93
93
*/
94
94
 
95
95
bool mysql_derived_prepare(THD *thd, LEX *lex __attribute__((unused)),
96
 
                           TABLE_LIST *orig_table_list)
 
96
                           TableList *orig_table_list)
97
97
{
98
98
  SELECT_LEX_UNIT *unit= orig_table_list->derived;
99
99
  uint64_t create_options;
182
182
    thd                 Thread handle
183
183
    lex                 LEX for this thread
184
184
    unit                node that contains all SELECT's for derived tables
185
 
    orig_table_list     TABLE_LIST for the upper SELECT
 
185
    orig_table_list     TableList for the upper SELECT
186
186
 
187
187
  IMPLEMENTATION
188
188
    Derived table is resolved with temporary table. It is created based on the
197
197
    true   Error
198
198
*/
199
199
 
200
 
bool mysql_derived_filling(THD *thd, LEX *lex, TABLE_LIST *orig_table_list)
 
200
bool mysql_derived_filling(THD *thd, LEX *lex, TableList *orig_table_list)
201
201
{
202
202
  Table *table= orig_table_list->table;
203
203
  SELECT_LEX_UNIT *unit= orig_table_list->derived;
222
222
 
223
223
      lex->current_select= first_select;
224
224
      res= mysql_select(thd, &first_select->ref_pointer_array,
225
 
                        (TABLE_LIST*) first_select->table_list.first,
 
225
                        (TableList*) first_select->table_list.first,
226
226
                        first_select->with_wild,
227
227
                        first_select->item_list, first_select->where,
228
228
                        (first_select->order_list.elements+
238
238
    if (!res)
239
239
    {
240
240
      /*
241
 
        Here we entirely fix both TABLE_LIST and list of SELECT's as
 
241
        Here we entirely fix both TableList and list of SELECT's as
242
242
        there were no derived tables
243
243
      */
244
244
      if (derived_result->flush())