~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/set_user_var.cc

  • Committer: Mark Atwood
  • Date: 2011-10-08 04:50:51 UTC
  • mfrom: (2430.1.1 rf)
  • Revision ID: me@mark.atwood.name-20111008045051-6ha1qiy7k2a9c3jv
Tags: 2011.10.27
mergeĀ lp:~olafvdspek/drizzle/refactor2

Show diffs side-by-side

added added

removed removed

Lines of Context:
99
99
 
100
100
 
101
101
void
102
 
Item_func_set_user_var::update_hash(data_ref data,
 
102
Item_func_set_user_var::update_hash(void *ptr, uint32_t length,
103
103
                                    Item_result res_type,
104
104
                                    const charset_info_st * const cs, Derivation dv,
105
105
                                    bool unsigned_arg)
110
110
  */
111
111
  if ((null_value= args[0]->null_value) && null_item)
112
112
    res_type= entry->type;                      // Don't change type of item
113
 
  entry->update_hash((null_value= args[0]->null_value), data, res_type, cs, dv, unsigned_arg);
 
113
  entry->update_hash((null_value= args[0]->null_value), ptr, length, res_type, cs, dv, unsigned_arg);
114
114
}
115
115
 
116
116
/**
193
193
  switch (cached_result_type) {
194
194
  case REAL_RESULT:
195
195
    {
196
 
      update_hash(data_ref(&save_result.vreal, sizeof(save_result.vreal)), REAL_RESULT, &my_charset_bin, DERIVATION_IMPLICIT, 0);
 
196
      update_hash((void*) &save_result.vreal,sizeof(save_result.vreal),
 
197
                       REAL_RESULT, &my_charset_bin, DERIVATION_IMPLICIT, 0);
197
198
      break;
198
199
    }
199
200
 
200
201
  case INT_RESULT:
201
202
    {
202
 
      update_hash(data_ref(&save_result.vint, sizeof(save_result.vint)), INT_RESULT, &my_charset_bin, DERIVATION_IMPLICIT, unsigned_flag);
 
203
      update_hash((void*) &save_result.vint, sizeof(save_result.vint),
 
204
                       INT_RESULT, &my_charset_bin, DERIVATION_IMPLICIT,
 
205
                       unsigned_flag);
203
206
      break;
204
207
    }
205
208
 
206
209
  case STRING_RESULT:
207
210
    {
208
211
      if (!save_result.vstr)                                      // Null value
209
 
        update_hash(data_ref(), STRING_RESULT, &my_charset_bin, DERIVATION_IMPLICIT, 0);
 
212
        update_hash((void*) 0, 0, STRING_RESULT, &my_charset_bin,
 
213
                         DERIVATION_IMPLICIT, 0);
210
214
      else
211
 
        update_hash(*save_result.vstr, STRING_RESULT, save_result.vstr->charset(), DERIVATION_IMPLICIT, 0);
 
215
        update_hash((void*) save_result.vstr->ptr(),
 
216
                         save_result.vstr->length(), STRING_RESULT,
 
217
                         save_result.vstr->charset(),
 
218
                         DERIVATION_IMPLICIT, 0);
212
219
      break;
213
220
    }
214
221
 
215
222
  case DECIMAL_RESULT:
216
223
    {
217
224
      if (!save_result.vdec)                                      // Null value
218
 
        update_hash(data_ref(), DECIMAL_RESULT, &my_charset_bin, DERIVATION_IMPLICIT, 0);
 
225
        update_hash((void*) 0, 0, DECIMAL_RESULT, &my_charset_bin,
 
226
                         DERIVATION_IMPLICIT, 0);
219
227
      else
220
 
        update_hash(data_ref(save_result.vdec, sizeof(type::Decimal)), DECIMAL_RESULT, &my_charset_bin, DERIVATION_IMPLICIT, 0);
 
228
        update_hash((void*) save_result.vdec,
 
229
                         sizeof(type::Decimal), DECIMAL_RESULT,
 
230
                         &my_charset_bin, DERIVATION_IMPLICIT, 0);
221
231
      break;
222
232
    }
223
233
 
224
234
  case ROW_RESULT:
225
235
    // This case should never be chosen
226
 
    assert(false);
 
236
    assert(0);
227
237
    break;
228
238
  }
229
239
}