~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_derived.cc

  • Committer: Brian Aker
  • Date: 2010-12-17 00:08:06 UTC
  • mfrom: (2002.1.4 clean)
  • Revision ID: brian@tangent.org-20101217000806-fa6kmggjnhsl4q85
Rollup for field encapsulation, monty fix for bzrignore, and Andrew bug
fixes.

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