~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_select.cc

  • Committer: Brian Aker
  • Date: 2010-12-18 00:43:02 UTC
  • Revision ID: brian@tangent.org-20101218004302-4ivzuuzdkblyqe18
Refactor naming for integers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
135
135
      every PS/SP execution new, we will not need reset this flag if
136
136
      setup_tables_done_option changed for next rexecution
137
137
    */
138
 
    res= mysql_select(session, &select_lex->ref_pointer_array,
 
138
    res= mysql_select(session,
 
139
                      &select_lex->ref_pointer_array,
139
140
                      (TableList*) select_lex->table_list.first,
140
 
                      select_lex->with_wild, select_lex->item_list,
 
141
                      select_lex->with_wild,
 
142
                      select_lex->item_list,
141
143
                      select_lex->where,
142
144
                      select_lex->order_list.elements +
143
145
                      select_lex->group_list.elements,
2375
2377
    Item *item;
2376
2378
    while ((item=li++))
2377
2379
      change_cond_ref_to_const(session, save_list, and_level ? cond : item, item, field, value);
 
2380
 
2378
2381
    return;
2379
2382
  }
2380
2383
  if (cond->eq_cmp_result() == Item::COND_OK)
2487
2490
      for (vector<COND_CMP>::iterator iter= save.begin(); iter != save.end(); ++iter)
2488
2491
      {
2489
2492
        Item **args= iter->cmp_func->arguments();
2490
 
        if (!args[0]->const_item())
 
2493
        if (not args[0]->const_item())
2491
2494
        {
2492
 
          change_cond_ref_to_const( session, save, iter->and_level,
2493
 
                                    iter->and_level, args[0], args[1] );
 
2495
          change_cond_ref_to_const(session, save_list, iter->and_level,
 
2496
                                   iter->and_level, args[0], args[1] );
2494
2497
        }
2495
2498
      }
2496
2499
    }
4006
4009
    if (idx < (int) join->send_group_parts)
4007
4010
    {
4008
4011
      copy_fields(&join->tmp_table_param);
4009
 
      copy_funcs(join->tmp_table_param.items_to_copy);
 
4012
      if (copy_funcs(join->tmp_table_param.items_to_copy, join->session))
 
4013
        return NESTED_LOOP_ERROR;
4010
4014
      if (init_sum_functions(join->sum_funcs, join->sum_funcs_end[idx+1]))
4011
4015
        return NESTED_LOOP_ERROR;
4012
4016
      return NESTED_LOOP_OK;
6194
6198
}
6195
6199
 
6196
6200
/** Copy result of functions to record in tmp_table. */
6197
 
void copy_funcs(Item **func_ptr)
 
6201
bool copy_funcs(Item **func_ptr, const Session *session)
6198
6202
{
6199
6203
  Item *func;
6200
6204
  for (; (func = *func_ptr) ; func_ptr++)
 
6205
  {
6201
6206
    func->save_in_result_field(1);
 
6207
    /*
 
6208
      Need to check the THD error state because Item::val_xxx() don't
 
6209
      return error code, but can generate errors
 
6210
      TODO: change it for a real status check when Item::val_xxx()
 
6211
      are extended to return status code.
 
6212
    */
 
6213
    if (session->is_error())
 
6214
      return true;
 
6215
  }
 
6216
  return false;
6202
6217
}
6203
6218
 
6204
6219
/**