~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table_list.cc

  • Committer: Brian Aker
  • Date: 2010-09-11 01:35:47 UTC
  • mto: (1759.2.1 build)
  • mto: This revision was merged to the branch mainline in revision 1762.
  • Revision ID: brian@tangent.org-20100911013547-b04k7f1qddr3ml4t
Shuffle native functions over to hash such that we have a specific container
for them.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
 
37
37
uint32_t TableList::create_table_def_key(char *key)
38
38
{
39
 
  return TableShare::createKey(key, db, table_name);
 
39
  return TableIdentifier::createKey(key, db, table_name);
40
40
}
41
41
 
42
 
bool TableList::set_insert_values(memory::Root *mem_root)
 
42
bool TableList::set_insert_values(memory::Root *)
43
43
{
44
44
  if (table)
45
45
  {
46
 
    if (!table->insert_values &&
47
 
        !(table->insert_values= (unsigned char *)alloc_root(mem_root,
48
 
                                                   table->s->rec_buff_length)))
49
 
      return true;
 
46
    table->insert_values.resize(table->getShare()->rec_buff_length);
50
47
  }
51
48
 
52
49
  return false;
66
63
  return NULL;
67
64
}
68
65
 
 
66
bool TableList::isCartesian() const
 
67
{
 
68
  return false;
 
69
}
 
70
 
69
71
bool TableList::placeholder()
70
72
{
71
73
  return derived || (create && !table->getDBStat()) || !table;
156
158
{
157
159
  /* initialize the result variables */
158
160
  tbl->keys_in_use_for_query= tbl->keys_in_use_for_group_by=
159
 
    tbl->keys_in_use_for_order_by= tbl->s->keys_in_use;
 
161
    tbl->keys_in_use_for_order_by= tbl->getShare()->keys_in_use;
160
162
 
161
163
  /* index hint list processing */
162
164
  if (index_hints)
181
183
    /* iterate over the hints list */
182
184
    while ((hint= iter++))
183
185
    {
184
 
      uint32_t pos;
 
186
      uint32_t pos= 0;
185
187
 
186
188
      /* process empty USE INDEX () */
187
189
      if (hint->type == INDEX_HINT_USE && !hint->key_name.str)
208
210
        Check if an index with the given name exists and get his offset in
209
211
        the keys bitmask for the table
210
212
      */
211
 
      if (tbl->s->keynames.type_names == 0 ||
212
 
          (pos= find_type(&tbl->s->keynames, hint->key_name.str,
213
 
                          hint->key_name.length, 1)) <= 0)
 
213
      if (not tbl->getShare()->doesKeyNameExist(hint->key_name.str, hint->key_name.length, pos))
214
214
      {
215
215
        my_error(ER_KEY_DOES_NOT_EXITS, MYF(0), hint->key_name.str, alias);
216
216
        return 1;
217
217
      }
218
 
 
219
 
      pos--;
220
 
 
221
218
      /* add to the appropriate clause mask */
222
219
      if (hint->clause & INDEX_HINT_MASK_JOIN)
223
220
        index_join[hint->type].set(pos);