~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table_list.cc

  • Committer: Olaf van der Spek
  • Date: 2011-03-23 10:31:37 UTC
  • mto: (2247.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 2248.
  • Revision ID: olafvdspek@gmail.com-20110323103137-lwevis2tfchgu18u
Propogate return void

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
  along with this program; if not, write to the Free Software
14
14
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
15
15
 
16
 
#include "config.h"
 
16
#include <config.h>
17
17
 
18
18
#include <string>
19
19
 
20
 
#include "drizzled/error.h"
21
 
#include "drizzled/table_list.h"
22
 
#include "drizzled/item.h"
23
 
#include "drizzled/item/field.h"
24
 
#include "drizzled/nested_join.h"
25
 
#include "drizzled/sql_lex.h"
26
 
#include "drizzled/sql_select.h"
27
 
#include "drizzled/strfunc.h"
 
20
#include <drizzled/error.h>
 
21
#include <drizzled/table_list.h>
 
22
#include <drizzled/item.h>
 
23
#include <drizzled/item/field.h>
 
24
#include <drizzled/nested_join.h>
 
25
#include <drizzled/sql_lex.h>
 
26
#include <drizzled/sql_select.h>
28
27
 
29
28
using namespace std;
30
29
 
76
75
TableList *TableList::last_leaf_for_name_resolution()
77
76
{
78
77
  TableList *cur_table_ref= this;
79
 
  nested_join_st *cur_nested_join;
 
78
  NestedJoin *cur_nested_join;
80
79
 
81
80
  if (is_leaf_for_name_resolution())
82
81
    return this;
86
85
       cur_nested_join;
87
86
       cur_nested_join= cur_table_ref->nested_join)
88
87
  {
89
 
    cur_table_ref= cur_nested_join->join_list.head();
 
88
    cur_table_ref= &cur_nested_join->join_list.front();
90
89
    /*
91
90
      If the current nested is a RIGHT JOIN, the operands in
92
91
      'join_list' are in reverse order, thus the last operand is in the
94
93
    */
95
94
    if ((cur_table_ref->outer_join & JOIN_TYPE_RIGHT))
96
95
    {
97
 
      List_iterator_fast<TableList> it(cur_nested_join->join_list);
 
96
      List<TableList>::iterator it(cur_nested_join->join_list.begin());
98
97
      TableList *next;
99
98
      cur_table_ref= it++;
100
99
      while ((next= it++))
114
113
TableList *TableList::first_leaf_for_name_resolution()
115
114
{
116
115
  TableList *cur_table_ref= NULL;
117
 
  nested_join_st *cur_nested_join;
 
116
  NestedJoin *cur_nested_join;
118
117
 
119
118
  if (is_leaf_for_name_resolution())
120
119
    return this;
124
123
       cur_nested_join;
125
124
       cur_nested_join= cur_table_ref->nested_join)
126
125
  {
127
 
    List_iterator_fast<TableList> it(cur_nested_join->join_list);
 
126
    List<TableList>::iterator it(cur_nested_join->join_list.begin());
128
127
    cur_table_ref= it++;
129
128
    /*
130
129
      If the current nested join is a RIGHT JOIN, the operands in
165
164
    int type;
166
165
    bool have_empty_use_join= false, have_empty_use_order= false,
167
166
         have_empty_use_group= false;
168
 
    List_iterator <Index_hint> iter(*index_hints);
 
167
    List_iterator <Index_hint> iter(index_hints->begin());
169
168
 
170
169
    /* initialize temporary variables used to collect hints of each kind */
171
170
    for (type= INDEX_HINT_IGNORE; type <= INDEX_HINT_FORCE; type++)
262
261
  return 0;
263
262
}
264
263
 
265
 
void TableList::print(Session *session, String *str, enum_query_type query_type)
 
264
void TableList::print(Session *session, String *str)
266
265
{
267
266
  if (nested_join)
268
267
  {
269
268
    str->append('(');
270
 
    print_join(session, str, &nested_join->join_list, query_type);
 
269
    print_join(session, str, &nested_join->join_list);
271
270
    str->append(')');
272
271
  }
273
272
  else
277
276
    {
278
277
      // A derived table
279
278
      str->append('(');
280
 
      derived->print(str, query_type);
 
279
      derived->print(str);
281
280
      str->append(')');
282
281
      cmp_name= "";                               // Force printing of alias
283
282
    }
309
308
 
310
309
    if (index_hints)
311
310
    {
312
 
      List_iterator<Index_hint> it(*index_hints);
 
311
      List<Index_hint>::iterator it(index_hints->begin());
313
312
      Index_hint *hint;
314
313
 
315
314
      while ((hint= it++))