141
141
switch (cached_result_type) {
142
142
case REAL_RESULT:
144
save_result.vreal= use_result_field ? result_field->val_real() :
144
save_result.vreal= use_result_field ? result_field->val_real() :
150
save_result.vint= use_result_field ? result_field->val_int() :
152
unsigned_flag= use_result_field ? ((Field_num*)result_field)->unsigned_flag:
153
args[0]->unsigned_flag;
150
save_result.vint= use_result_field ? result_field->val_int() :
152
unsigned_flag= use_result_field ? ((Field_num*)result_field)->unsigned_flag:
153
args[0]->unsigned_flag;
156
156
case STRING_RESULT:
158
save_result.vstr= use_result_field ? result_field->val_str_internal(&value) :
159
args[0]->val_str(&value);
158
save_result.vstr= use_result_field ? result_field->val_str_internal(&value) :
159
args[0]->val_str(&value);
162
162
case DECIMAL_RESULT:
164
save_result.vdec= use_result_field ?
165
result_field->val_decimal(&decimal_buff) :
166
args[0]->val_decimal(&decimal_buff);
164
save_result.vdec= use_result_field ?
165
result_field->val_decimal(&decimal_buff) :
166
args[0]->val_decimal(&decimal_buff);
171
170
// This case should never be chosen
198
198
switch (cached_result_type) {
199
199
case REAL_RESULT:
201
res= update_hash((void*) &save_result.vreal,sizeof(save_result.vreal),
202
REAL_RESULT, &my_charset_bin, DERIVATION_IMPLICIT, 0);
201
res= update_hash((void*) &save_result.vreal,sizeof(save_result.vreal),
202
REAL_RESULT, &my_charset_bin, DERIVATION_IMPLICIT, 0);
207
res= update_hash((void*) &save_result.vint, sizeof(save_result.vint),
208
INT_RESULT, &my_charset_bin, DERIVATION_IMPLICIT,
208
res= update_hash((void*) &save_result.vint, sizeof(save_result.vint),
209
INT_RESULT, &my_charset_bin, DERIVATION_IMPLICIT,
212
214
case STRING_RESULT:
214
if (!save_result.vstr) // Null value
215
res= update_hash((void*) 0, 0, STRING_RESULT, &my_charset_bin,
216
DERIVATION_IMPLICIT, 0);
218
res= update_hash((void*) save_result.vstr->ptr(),
219
save_result.vstr->length(), STRING_RESULT,
220
save_result.vstr->charset(),
221
DERIVATION_IMPLICIT, 0);
216
if (!save_result.vstr) // Null value
217
res= update_hash((void*) 0, 0, STRING_RESULT, &my_charset_bin,
218
DERIVATION_IMPLICIT, 0);
220
res= update_hash((void*) save_result.vstr->ptr(),
221
save_result.vstr->length(), STRING_RESULT,
222
save_result.vstr->charset(),
223
DERIVATION_IMPLICIT, 0);
224
227
case DECIMAL_RESULT:
226
if (!save_result.vdec) // Null value
227
res= update_hash((void*) 0, 0, DECIMAL_RESULT, &my_charset_bin,
228
DERIVATION_IMPLICIT, 0);
230
res= update_hash((void*) save_result.vdec,
231
sizeof(my_decimal), DECIMAL_RESULT,
232
&my_charset_bin, DERIVATION_IMPLICIT, 0);
229
if (!save_result.vdec) // Null value
230
res= update_hash((void*) 0, 0, DECIMAL_RESULT, &my_charset_bin,
231
DERIVATION_IMPLICIT, 0);
233
res= update_hash((void*) save_result.vdec,
234
sizeof(my_decimal), DECIMAL_RESULT,
235
&my_charset_bin, DERIVATION_IMPLICIT, 0);
237
240
// This case should never be chosen