~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_derived.cc

  • Committer: Brian Aker
  • Date: 2009-02-07 22:02:41 UTC
  • Revision ID: brian@tangent.org-20090207220241-ez3828o1246ab2sp
Removing on typedeffed class.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
  if (lex->derived_tables)
40
40
  {
41
41
    lex->session->derived_tables_processing= true;
42
 
    for (SELECT_LEX *sl= lex->all_selects_list;
 
42
    for (Select_Lex *sl= lex->all_selects_list;
43
43
         sl;
44
44
         sl= sl->next_select_in_list())
45
45
    {
95
95
bool mysql_derived_prepare(Session *session, LEX *,
96
96
                           TableList *orig_table_list)
97
97
{
98
 
  SELECT_LEX_UNIT *unit= orig_table_list->derived;
 
98
  Select_Lex_UNIT *unit= orig_table_list->derived;
99
99
  uint64_t create_options;
100
100
  bool res= false;
101
101
  if (unit)
102
102
  {
103
 
    SELECT_LEX *first_select= unit->first_select();
 
103
    Select_Lex *first_select= unit->first_select();
104
104
    Table *table= 0;
105
105
    select_union *derived_result;
106
106
 
107
107
    /* prevent name resolving out of derived table */
108
 
    for (SELECT_LEX *sl= first_select; sl; sl= sl->next_select())
 
108
    for (Select_Lex *sl= first_select; sl; sl= sl->next_select())
109
109
      sl->context.outer_context= 0;
110
110
 
111
111
    if (!(derived_result= new select_union))
112
112
      return(true); // out of memory
113
113
 
114
 
    // st_select_lex_unit::prepare correctly work for single select
 
114
    // Select_Lex_unit::prepare correctly work for single select
115
115
    if ((res= unit->prepare(session, derived_result, 0)))
116
116
      goto exit;
117
117
 
200
200
bool mysql_derived_filling(Session *session, LEX *lex, TableList *orig_table_list)
201
201
{
202
202
  Table *table= orig_table_list->table;
203
 
  SELECT_LEX_UNIT *unit= orig_table_list->derived;
 
203
  Select_Lex_UNIT *unit= orig_table_list->derived;
204
204
  bool res= false;
205
205
 
206
206
  /*check that table creation pass without problem and it is derived table */
207
207
  if (table && unit)
208
208
  {
209
 
    SELECT_LEX *first_select= unit->first_select();
 
209
    Select_Lex *first_select= unit->first_select();
210
210
    select_union *derived_result= orig_table_list->derived_result;
211
 
    SELECT_LEX *save_current_select= lex->current_select;
 
211
    Select_Lex *save_current_select= lex->current_select;
212
212
    if (unit->is_union())
213
213
    {
214
214
      // execute union without clean up