diff options
author | unknown <vva@eagle.mysql.r18.ru> | 2004-03-06 03:00:21 +0400 |
---|---|---|
committer | unknown <vva@eagle.mysql.r18.ru> | 2004-03-06 03:00:21 +0400 |
commit | 17c4d7f36182e58047231472dbeb1a9f2af60560 (patch) | |
tree | 6f0b14624710df2135208a6cedc7fc3e19db1752 /sql/field.cc | |
parent | c8bfc2324b14584f39dd271fa0dd34b0f181d167 (diff) | |
download | mariadb-git-17c4d7f36182e58047231472dbeb1a9f2af60560.tar.gz |
- added commands --query_vertical and --query_horisontal to client/mysqltest.cc
- get my_strtod to return inf
- get Field_float::store(double) and Field_double::store(float) to set null for
nan value
(as extra serg's recomendations to fix for patch on
Bug #2082 'mysqldump converts "inf" to null')
client/mysqltest.c:
added commands --query_vertical and --query_horisontal
mysql-test/r/insert.result:
converted testcase so as my_strtod can return inf now
mysql-test/r/mysqldump.result:
converted testcase so as my_strtod can return inf now
mysql-test/t/insert.test:
corrected tests to using --query_vertical instead of
pair (vertical_results,horisontal_results)
sql/field.cc:
corrected Field_float::store(double) and Field_double::store(double)
to set null for nan value
strings/strtod.c:
get my_strtod to return inf
Diffstat (limited to 'sql/field.cc')
-rw-r--r-- | sql/field.cc | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/sql/field.cc b/sql/field.cc index a2771dc67e3..32d7149ce63 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -2291,7 +2291,14 @@ int Field_float::store(double nr) float j; int error= 0; - if (isnan(nr) || unsigned_flag && nr < 0) + if (isnan(nr)) + { + j= 0; + set_null(); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + error= 1; + } + else if (unsigned_flag && nr < 0) { j= 0; set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); @@ -2581,7 +2588,14 @@ int Field_double::store(double nr) { int error= 0; - if (isnan(nr) || unsigned_flag && nr < 0) + if (isnan(nr)) + { + nr= 0; + set_null(); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + error= 1; + } + else if (unsigned_flag && nr < 0) { nr= 0; set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); |