summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.h
diff options
context:
space:
mode:
authorunknown <jimw@mysql.com>2006-03-14 02:04:43 -0800
committerunknown <jimw@mysql.com>2006-03-14 02:04:43 -0800
commitd48cfa8ac7b7e240b883cbe2287c7f5729e37140 (patch)
tree2033188416a3c924f91998eeca2181e1a9de3508 /sql/item_strfunc.h
parent358e08836a1647a90ad3ecfc9dcef3549c00f4fe (diff)
downloadmariadb-git-d48cfa8ac7b7e240b883cbe2287c7f5729e37140.tar.gz
Bug #17043: Casting trimmed string to decimal loses precision
Results of string functions were being converted to decimals by first being converted to integers, resulting in a loss of precision. mysql-test/r/func_str.result: Add new results mysql-test/t/func_str.test: Add new regression test sql/item_strfunc.cc: Convert string function results to decimal using string-to-decimal conversion sql/item_strfunc.h: Add Item_str_func::val_decimal()
Diffstat (limited to 'sql/item_strfunc.h')
-rw-r--r--sql/item_strfunc.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h
index 6a95a9e5d1f..7d7b62df0dc 100644
--- a/sql/item_strfunc.h
+++ b/sql/item_strfunc.h
@@ -33,6 +33,7 @@ public:
Item_str_func(List<Item> &list) :Item_func(list) {decimals=NOT_FIXED_DEC; }
longlong val_int();
double val_real();
+ my_decimal *val_decimal(my_decimal *);
enum Item_result result_type () const { return STRING_RESULT; }
void left_right_max_length();
String *check_well_formed_result(String *str);