~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_select.cc

  • Committer: Monty Taylor
  • Date: 2010-12-02 22:51:54 UTC
  • mto: (1975.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 1976.
  • Revision ID: mordred@inaugust.com-20101202225154-h54ifmga9x6cckgs
Refactored syslog module and changed it to use sys_var directly.

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,
139
 
                      &select_lex->ref_pointer_array,
 
138
    res= mysql_select(session, &select_lex->ref_pointer_array,
140
139
                      (TableList*) select_lex->table_list.first,
141
 
                      select_lex->with_wild,
142
 
                      select_lex->item_list,
 
140
                      select_lex->with_wild, select_lex->item_list,
143
141
                      select_lex->where,
144
142
                      select_lex->order_list.elements +
145
143
                      select_lex->group_list.elements,
2377
2375
    Item *item;
2378
2376
    while ((item=li++))
2379
2377
      change_cond_ref_to_const(session, save_list, and_level ? cond : item, item, field, value);
2380
 
 
2381
2378
    return;
2382
2379
  }
2383
2380
  if (cond->eq_cmp_result() == Item::COND_OK)
2490
2487
      for (vector<COND_CMP>::iterator iter= save.begin(); iter != save.end(); ++iter)
2491
2488
      {
2492
2489
        Item **args= iter->cmp_func->arguments();
2493
 
        if (not args[0]->const_item())
 
2490
        if (!args[0]->const_item())
2494
2491
        {
2495
 
          change_cond_ref_to_const(session, save_list, iter->and_level,
2496
 
                                   iter->and_level, args[0], args[1] );
 
2492
          change_cond_ref_to_const( session, save, iter->and_level,
 
2493
                                    iter->and_level, args[0], args[1] );
2497
2494
        }
2498
2495
      }
2499
2496
    }
4009
4006
    if (idx < (int) join->send_group_parts)
4010
4007
    {
4011
4008
      copy_fields(&join->tmp_table_param);
4012
 
      if (copy_funcs(join->tmp_table_param.items_to_copy, join->session))
4013
 
        return NESTED_LOOP_ERROR;
 
4009
      copy_funcs(join->tmp_table_param.items_to_copy);
4014
4010
      if (init_sum_functions(join->sum_funcs, join->sum_funcs_end[idx+1]))
4015
4011
        return NESTED_LOOP_ERROR;
4016
4012
      return NESTED_LOOP_OK;
6198
6194
}
6199
6195
 
6200
6196
/** Copy result of functions to record in tmp_table. */
6201
 
bool copy_funcs(Item **func_ptr, const Session *session)
 
6197
void copy_funcs(Item **func_ptr)
6202
6198
{
6203
6199
  Item *func;
6204
6200
  for (; (func = *func_ptr) ; func_ptr++)
6205
 
  {
6206
6201
    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;
6217
6202
}
6218
6203
 
6219
6204
/**