diff options
author | unknown <monty@mysql.com> | 2005-02-22 12:51:23 +0200 |
---|---|---|
committer | unknown <monty@mysql.com> | 2005-02-22 12:51:23 +0200 |
commit | cb8d9c3ad40f00018cff05168e731ff2547d6144 (patch) | |
tree | af26a8ec65a080dd408d6df18990ff71c50577aa /sql/item.cc | |
parent | ae8c3e130a91687839b570f82f6694f81c21dbaf (diff) | |
download | mariadb-git-cb8d9c3ad40f00018cff05168e731ff2547d6144.tar.gz |
Backport my_strntod() from 5.0
Change string->float conversion to delay division as long as possible.
This gives us more exact integer->float conversion for numbers of type '123.45E+02' (Bug #7740)
client/mysql.cc:
Fix wront usage of charset (found during review of pushed code)
include/m_string.h:
Backported my_strtod() from 5.0
mysql-test/mysql-test-run.sh:
Run also mysql_client_test with --debug
mysql-test/r/ps_1general.result:
Safety fix (if mysql_client_test.test fails)
mysql-test/r/type_float.result:
More test
mysql-test/t/mysql_client_test.test:
Comments for what to do if this test fails
mysql-test/t/ps_1general.test:
Safety fix (if mysql_client_test.test fails)
mysql-test/t/type_float.test:
More test to better test new strtod() function
Test also bug #7740 (wrong comparsion between integer and float-in-integer-range)
sql/field.cc:
Backport my_strntod() from 5.0
sql/item.cc:
Backport my_strntod() from 5.0
sql/item.h:
Backport my_strntod() from 5.0
sql/item_func.h:
Backport my_strntod() from 5.0
sql/item_strfunc.cc:
Backport my_strntod() from 5.0
sql/item_sum.cc:
Backport my_strntod() from 5.0
sql/item_sum.h:
Backport my_strntod() from 5.0
sql/procedure.h:
Backport my_strntod() from 5.0
strings/ctype-simple.c:
Backport my_strntod() from 5.0
strings/ctype-ucs2.c:
Backport my_strntod() from 5.0
strings/strtod.c:
Backport my_strntod() from 5.0
Change conversion to delay division as long as possible.
This gives us more exact integer-> float conversion for numbers of type '123.45E+02'
Diffstat (limited to 'sql/item.cc')
-rw-r--r-- | sql/item.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sql/item.cc b/sql/item.cc index 4b3acbe5a3c..76cbaa99029 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1140,8 +1140,9 @@ double Item_param::val() case LONG_DATA_VALUE: { int dummy_err; + char *end_not_used; return my_strntod(str_value.charset(), (char*) str_value.ptr(), - str_value.length(), (char**) 0, &dummy_err); + str_value.length(), &end_not_used, &dummy_err); } case TIME_VALUE: /* @@ -2585,10 +2586,12 @@ double Item_cache_str::val() DBUG_ASSERT(fixed == 1); int err; if (value) + { + char *end_not_used; return my_strntod(value->charset(), (char*) value->ptr(), - value->length(), (char**) 0, &err); - else - return (double)0; + value->length(), &end_not_used, &err); + } + return (double)0; } |