~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_derived.cc

  • Committer: Olaf van der Spek
  • Date: 2011-07-04 19:11:47 UTC
  • mto: This revision was merged to the branch mainline in revision 2367.
  • Revision ID: olafvdspek@gmail.com-20110704191147-s99ojek811zi1fzj
RemoveĀ unusedĀ Name_resolution_context::error_reporter

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
  Derived tables
18
18
  These were introduced by Sinisa <sinisa@mysql.com>
19
19
*/
20
 
#include "config.h"
21
 
#include "drizzled/sql_select.h"
22
 
 
23
 
namespace drizzled
24
 
{
 
20
#include <config.h>
 
21
 
 
22
#include <drizzled/sql_lex.h>
 
23
#include <drizzled/select_union.h>
 
24
#include <drizzled/sql_select.h>
 
25
#include <drizzled/session.h>
 
26
#include <drizzled/open_tables_state.h>
 
27
 
 
28
namespace drizzled {
25
29
 
26
30
/*
27
31
  Call given derived table processor (preparing or filling tables)
103
107
    for (Select_Lex *sl= first_select; sl; sl= sl->next_select())
104
108
      sl->context.outer_context= 0;
105
109
 
106
 
    if (!(derived_result= new select_union))
107
 
      return(true); // out of memory
 
110
    derived_result= new select_union;
108
111
 
109
112
    // Select_Lex_Unit::prepare correctly work for single select
110
113
    if ((res= unit->prepare(session, derived_result, 0)))
136
139
    */
137
140
    if (res)
138
141
    {
139
 
      if (table)
140
 
      {
141
 
        table= 0;
142
 
      }
 
142
      table= 0;
143
143
      delete derived_result;
144
144
    }
145
145
    else
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->open_tables.getDerivedTables());
 
158
      session->open_tables.setDerivedTables(table);
159
159
    }
160
160
  }
161
161
 
162
 
  return(res);
 
162
  return res;
163
163
}
164
164
 
165
165
/*