~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table_list.cc

  • Committer: Brian Aker
  • Date: 2010-05-12 22:54:08 UTC
  • mto: This revision was merged to the branch mainline in revision 1528.
  • Revision ID: brian@gaz-20100512225408-ok21ur8j78ywkb9e
This is:
1) First pass to have Share use something other then mem_root allocated bits.
2) A bug fix on how keys are matched for with USE INDEX, etc.

Show diffs side-by-side

added added

removed removed

Lines of Context:
180
180
    /* iterate over the hints list */
181
181
    while ((hint= iter++))
182
182
    {
183
 
      uint32_t pos;
 
183
      uint32_t pos= 0;
184
184
 
185
185
      /* process empty USE INDEX () */
186
186
      if (hint->type == INDEX_HINT_USE && !hint->key_name.str)
207
207
        Check if an index with the given name exists and get his offset in
208
208
        the keys bitmask for the table
209
209
      */
210
 
      if (tbl->s->keynames.type_names == 0 ||
211
 
          (pos= find_type(&tbl->s->keynames, hint->key_name.str,
212
 
                          hint->key_name.length, 1)) <= 0)
 
210
      if (not tbl->s->doesKeyNameExist(hint->key_name.str, hint->key_name.length, pos))
213
211
      {
214
212
        my_error(ER_KEY_DOES_NOT_EXITS, MYF(0), hint->key_name.str, alias);
215
213
        return 1;
216
214
      }
217
 
 
218
 
      pos--;
219
 
 
220
215
      /* add to the appropriate clause mask */
221
216
      if (hint->clause & INDEX_HINT_MASK_JOIN)
222
217
        index_join[hint->type].set(pos);