~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_derived.cc

  • Committer: Brian Aker
  • Date: 2011-02-22 06:12:02 UTC
  • mfrom: (2190.1.6 drizzle-build)
  • Revision ID: brian@tangent.org-20110222061202-k03czxykqy4x9hjs
List update, header fixes, multiple symbols, and David deletes some code.

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"
 
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>
22
26
 
23
27
namespace drizzled
24
28
{
27
31
  Call given derived table processor (preparing or filling tables)
28
32
 
29
33
  SYNOPSIS
30
 
    mysql_handle_derived()
 
34
    handle_derived()
31
35
    lex                 LEX for this thread
32
36
    processor           procedure of derived table processing
33
37
 
35
39
    false  OK
36
40
    true   Error
37
41
*/
38
 
bool mysql_handle_derived(LEX *lex, bool (*processor)(Session*, LEX*, TableList*))
 
42
bool handle_derived(LEX *lex, bool (*processor)(Session*, LEX*, TableList*))
39
43
{
40
44
  bool res= false;
41
45
  if (lex->derived_tables)
68
72
  Create temporary table structure (but do not fill it)
69
73
 
70
74
  SYNOPSIS
71
 
    mysql_derived_prepare()
 
75
    derived_prepare()
72
76
    session                     Thread handle
73
77
    lex                 LEX for this thread
74
78
    orig_table_list     TableList for the upper SELECT
88
92
    false  OK
89
93
    true   Error
90
94
*/
91
 
bool mysql_derived_prepare(Session *session, LEX *, TableList *orig_table_list)
 
95
bool derived_prepare(Session *session, LEX *, TableList *orig_table_list)
92
96
{
93
97
  Select_Lex_Unit *unit= orig_table_list->derived;
94
98
  uint64_t create_options;
166
170
  fill derived table
167
171
 
168
172
  SYNOPSIS
169
 
    mysql_derived_filling()
 
173
    derived_filling()
170
174
    session                     Thread handle
171
175
    lex                 LEX for this thread
172
176
    unit                node that contains all SELECT's for derived tables
184
188
    false  OK
185
189
    true   Error
186
190
*/
187
 
bool mysql_derived_filling(Session *session, LEX *lex, TableList *orig_table_list)
 
191
bool derived_filling(Session *session, LEX *lex, TableList *orig_table_list)
188
192
{
189
193
  Table *table= orig_table_list->table;
190
194
  Select_Lex_Unit *unit= orig_table_list->derived;
208
212
              first_select->options&= ~OPTION_FOUND_ROWS;
209
213
 
210
214
      lex->current_select= first_select;
211
 
      res= mysql_select(session, &first_select->ref_pointer_array,
 
215
      res= select_query(session, &first_select->ref_pointer_array,
212
216
                        (TableList*) first_select->table_list.first,
213
217
                        first_select->with_wild,
214
218
                        first_select->item_list, first_select->where,