142
142
switch (cmp_type) {
145
int64_t nr=val_int();
148
str->set_int(nr, unsigned_flag, &my_charset_bin);
145
int64_t nr=val_int();
148
str->set_int(nr, unsigned_flag, &my_charset_bin);
152
151
case DECIMAL_RESULT:
154
my_decimal dec_buf, *dec_val= val_decimal(&dec_buf);
157
my_decimal2string(E_DEC_FATAL_ERROR, dec_val, 0, 0, 0, str);
153
my_decimal dec_buf, *dec_val= val_decimal(&dec_buf);
156
my_decimal2string(E_DEC_FATAL_ERROR, dec_val, 0, 0, 0, str);
161
159
case REAL_RESULT:
163
double nr= val_real();
166
str->set_real(nr,decimals,&my_charset_bin);
161
double nr= val_real();
164
str->set_real(nr,decimals,&my_charset_bin);
170
167
case STRING_RESULT:
171
for (uint32_t i=0; i < arg_count ; i++)
174
for (uint32_t i=0; i < arg_count ; i++)
174
res=args[i]->val_str(str);
177
res=args[i]->val_str(str);
181
res2= args[i]->val_str(res == str ? &tmp_value : str);
184
int cmp= sortcmp(res,res2,collation.collation);
185
if ((cmp_sign < 0 ? cmp : -cmp) < 0)
189
if ((null_value= args[i]->null_value))
178
res2= args[i]->val_str(res == str ? &tmp_value : str);
181
int cmp= sortcmp(res,res2,collation.collation);
182
if ((cmp_sign < 0 ? cmp : -cmp) < 0)
192
res->set_charset(collation.collation);
186
if ((null_value= args[i]->null_value))
189
res->set_charset(collation.collation);
197
194
// This case should never be chosen
202
198
return 0; // Keep compiler happy