~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table_list.cc

  • Committer: Brian Aker
  • Date: 2010-05-27 01:22:55 UTC
  • mto: This revision was merged to the branch mainline in revision 1568.
  • Revision ID: brian@gaz-20100527012255-ssmjt4un8ptpg4jv
Remove dead .opt files. Removed two options from Innodb which do not relate
to drizzle (backwards compatible options for old MySQL). 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2009 Sun Microsystems, Inc.
 
1
/* Copyright (C) 2009 Sun Microsystems
2
2
 
3
3
  This program is free software; you can redistribute it and/or modify
4
4
  it under the terms of the GNU General Public License as published by
11
11
 
12
12
  You should have received a copy of the GNU General Public License
13
13
  along with this program; if not, write to the Free Software
14
 
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
 
14
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  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"
 
27
#include "drizzled/strfunc.h"
28
28
 
29
29
using namespace std;
30
30
 
34
34
class Item;
35
35
class Item_field;
36
36
 
37
 
bool TableList::set_insert_values(memory::Root *)
 
37
uint32_t TableList::create_table_def_key(char *key)
 
38
{
 
39
  return TableShare::createKey(key, db, table_name);
 
40
}
 
41
 
 
42
bool TableList::set_insert_values(memory::Root *mem_root)
38
43
{
39
44
  if (table)
40
45
  {
41
 
    table->insert_values.resize(table->getShare()->rec_buff_length);
 
46
    if (!table->insert_values &&
 
47
        !(table->insert_values= (unsigned char *)mem_root->alloc_root(table->s->rec_buff_length)))
 
48
      return true;
42
49
  }
43
50
 
44
51
  return false;
58
65
  return NULL;
59
66
}
60
67
 
61
 
bool TableList::isCartesian() const
62
 
{
63
 
  return false;
64
 
}
65
 
 
66
68
bool TableList::placeholder()
67
69
{
68
70
  return derived || (create && !table->getDBStat()) || !table;
76
78
TableList *TableList::last_leaf_for_name_resolution()
77
79
{
78
80
  TableList *cur_table_ref= this;
79
 
  NestedJoin *cur_nested_join;
 
81
  nested_join_st *cur_nested_join;
80
82
 
81
83
  if (is_leaf_for_name_resolution())
82
84
    return this;
94
96
    */
95
97
    if ((cur_table_ref->outer_join & JOIN_TYPE_RIGHT))
96
98
    {
97
 
      List<TableList>::iterator it(cur_nested_join->join_list.begin());
 
99
      List_iterator_fast<TableList> it(cur_nested_join->join_list);
98
100
      TableList *next;
99
101
      cur_table_ref= it++;
100
102
      while ((next= it++))
114
116
TableList *TableList::first_leaf_for_name_resolution()
115
117
{
116
118
  TableList *cur_table_ref= NULL;
117
 
  NestedJoin *cur_nested_join;
 
119
  nested_join_st *cur_nested_join;
118
120
 
119
121
  if (is_leaf_for_name_resolution())
120
122
    return this;
124
126
       cur_nested_join;
125
127
       cur_nested_join= cur_table_ref->nested_join)
126
128
  {
127
 
    List<TableList>::iterator it(cur_nested_join->join_list.begin());
 
129
    List_iterator_fast<TableList> it(cur_nested_join->join_list);
128
130
    cur_table_ref= it++;
129
131
    /*
130
132
      If the current nested join is a RIGHT JOIN, the operands in
153
155
{
154
156
  /* initialize the result variables */
155
157
  tbl->keys_in_use_for_query= tbl->keys_in_use_for_group_by=
156
 
    tbl->keys_in_use_for_order_by= tbl->getShare()->keys_in_use;
 
158
    tbl->keys_in_use_for_order_by= tbl->s->keys_in_use;
157
159
 
158
160
  /* index hint list processing */
159
161
  if (index_hints)
165
167
    int type;
166
168
    bool have_empty_use_join= false, have_empty_use_order= false,
167
169
         have_empty_use_group= false;
168
 
    List_iterator <Index_hint> iter(index_hints->begin());
 
170
    List_iterator <Index_hint> iter(*index_hints);
169
171
 
170
172
    /* initialize temporary variables used to collect hints of each kind */
171
173
    for (type= INDEX_HINT_IGNORE; type <= INDEX_HINT_FORCE; type++)
205
207
        Check if an index with the given name exists and get his offset in
206
208
        the keys bitmask for the table
207
209
      */
208
 
      if (not tbl->getShare()->doesKeyNameExist(hint->key_name.str, hint->key_name.length, pos))
 
210
      if (not tbl->s->doesKeyNameExist(hint->key_name.str, hint->key_name.length, pos))
209
211
      {
210
212
        my_error(ER_KEY_DOES_NOT_EXITS, MYF(0), hint->key_name.str, alias);
211
213
        return 1;
309
311
 
310
312
    if (index_hints)
311
313
    {
312
 
      List<Index_hint>::iterator it(index_hints->begin());
 
314
      List_iterator<Index_hint> it(*index_hints);
313
315
      Index_hint *hint;
314
316
 
315
317
      while ((hint= it++))