38
39
case E_DEC_TRUNCATED:
39
push_warning_printf(current_session, DRIZZLE_ERROR::WARN_LEVEL_WARN,
40
push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_WARN,
40
41
ER_WARN_DATA_TRUNCATED, ER(ER_WARN_DATA_TRUNCATED),
43
44
case E_DEC_OVERFLOW:
44
push_warning_printf(current_session, DRIZZLE_ERROR::WARN_LEVEL_ERROR,
45
push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_ERROR,
45
46
ER_TRUNCATED_WRONG_VALUE,
46
47
ER(ER_TRUNCATED_WRONG_VALUE),
49
50
case E_DEC_DIV_ZERO:
50
push_warning_printf(current_session, DRIZZLE_ERROR::WARN_LEVEL_ERROR,
51
push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_ERROR,
51
52
ER_DIVISION_BY_ZERO, ER(ER_DIVISION_BY_ZERO));
53
54
case E_DEC_BAD_NUM:
54
push_warning_printf(current_session, DRIZZLE_ERROR::WARN_LEVEL_ERROR,
55
push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_ERROR,
55
56
ER_TRUNCATED_WRONG_VALUE_FOR_FIELD,
56
57
ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD),
57
58
"decimal", "", "", (long)-1);
88
int my_decimal2string(uint32_t mask, const my_decimal *d,
89
uint32_t fixed_prec, uint32_t fixed_dec,
89
int my_decimal2string(uint mask, const my_decimal *d,
90
uint fixed_prec, uint fixed_dec,
90
91
char filler, String *str)
138
int my_decimal2binary(uint32_t mask, const my_decimal *d, unsigned char *bin, int prec,
139
int my_decimal2binary(uint mask, const my_decimal *d, uchar *bin, int prec,
141
142
int err1= E_DEC_OK, err2;
177
int str2my_decimal(uint32_t mask, const char *from, uint32_t length,
178
int str2my_decimal(uint mask, const char *from, uint length,
178
179
const CHARSET_INFO * charset, my_decimal *decimal_value)
180
181
char *end, *from_end;
183
184
String tmp(buff, sizeof(buff), &my_charset_bin);
184
185
if (charset->mbminlen > 1)
186
uint32_t dummy_errors;
187
tmp.copy(from, length, charset, &my_charset_utf8_general_ci, &dummy_errors);
188
tmp.copy(from, length, charset, &my_charset_latin1, &dummy_errors);
189
190
length= tmp.length();
190
191
charset= &my_charset_bin;
196
197
/* Give warning if there is something other than end space */
197
198
for ( ; end < from_end; end++)
199
if (!my_isspace(&my_charset_utf8_general_ci, *end))
200
if (!my_isspace(&my_charset_latin1, *end))
201
202
err= E_DEC_TRUNCATED;