~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table_list.cc

  • Committer: Mark Atwood
  • Date: 2011-08-03 15:44:55 UTC
  • mfrom: (2318.8.15 refactor2)
  • Revision ID: me@mark.atwood.name-20110803154455-jqg3gnxofkq8wetv
mergeĀ lp:~olafvdspek/drizzle/refactor2

Show diffs side-by-side

added added

removed removed

Lines of Context:
156
156
    key_map index_join[INDEX_HINT_FORCE + 1];
157
157
    key_map index_order[INDEX_HINT_FORCE + 1];
158
158
    key_map index_group[INDEX_HINT_FORCE + 1];
159
 
    Index_hint *hint;
160
 
    int type;
161
159
    bool have_empty_use_join= false, have_empty_use_order= false,
162
160
         have_empty_use_group= false;
163
161
    List_iterator <Index_hint> iter(index_hints->begin());
164
162
 
165
163
    /* initialize temporary variables used to collect hints of each kind */
166
 
    for (type= INDEX_HINT_IGNORE; type <= INDEX_HINT_FORCE; type++)
 
164
    for (int type= INDEX_HINT_IGNORE; type <= INDEX_HINT_FORCE; type++)
167
165
    {
168
166
      index_join[type].reset();
169
167
      index_order[type].reset();
171
169
    }
172
170
 
173
171
    /* iterate over the hints list */
174
 
    while ((hint= iter++))
 
172
    while (Index_hint* hint= iter++)
175
173
    {
176
 
      uint32_t pos= 0;
177
 
 
178
174
      /* process empty USE INDEX () */
179
175
      if (hint->type == INDEX_HINT_USE && !hint->key_name.str)
180
176
      {
200
196
        Check if an index with the given name exists and get his offset in
201
197
        the keys bitmask for the table
202
198
      */
 
199
      uint32_t pos= 0;
203
200
      if (not tbl->getShare()->doesKeyNameExist(hint->key_name.str, hint->key_name.length, pos))
204
201
      {
205
202
        my_error(ER_KEY_DOES_NOT_EXITS, MYF(0), hint->key_name.str, alias);
292
289
      if (alias && alias[0])
293
290
      {
294
291
        str->append(' ');
295
 
 
296
292
        string t_alias(alias);
297
293
        boost::to_lower(t_alias);
298
 
        str->append_identifier(t_alias.c_str(), t_alias.length());
 
294
        str->append_identifier(t_alias);
299
295
      }
300
296
    }
301
297
 
304
300
      List<Index_hint>::iterator it(index_hints->begin());
305
301
      while (Index_hint* hint= it++)
306
302
      {
307
 
        str->append (STRING_WITH_LEN(" "));
308
 
        hint->print (session, str);
 
303
        str->append(STRING_WITH_LEN(" "));
 
304
        hint->print(session, str);
309
305
      }
310
306
    }
311
307
  }