summaryrefslogtreecommitdiff
path: root/libmysql
diff options
context:
space:
mode:
authorunknown <gshchepa/uchum@gleb.loc>2007-06-24 03:35:27 +0500
committerunknown <gshchepa/uchum@gleb.loc>2007-06-24 03:35:27 +0500
commit26b526dc608ffb16e46729de6638d1ee9d668907 (patch)
treed8246af6017c853cb8d2e86ed1cc7972bf2bd9ea /libmysql
parentfdbefa8d528faf8e1d99d251c23c8a77f14b1aa2 (diff)
parentd37471b4ef931a0b945e20753203dbc3a266bcd5 (diff)
downloadmariadb-git-26b526dc608ffb16e46729de6638d1ee9d668907.tar.gz
Merge gleb.loc:/home/uchum/work/bk/5.0-opt
into gleb.loc:/home/uchum/work/bk/5.1-opt libmysql/libmysql.c: Merge with 5.0-opt. mysql-test/r/insert_select.result: Merge with 5.0-opt. mysql-test/r/mysqlbinlog.result: Merge with 5.0-opt. mysql-test/r/rpl_change_master.result: Merge with 5.0-opt. mysql-test/r/view.result: Merge with 5.0-opt. mysql-test/t/insert_select.test: Merge with 5.0-opt. mysql-test/t/mysqlbinlog.test: Merge with 5.0-opt. mysql-test/t/rpl_change_master.test: Merge with 5.0-opt. mysql-test/t/view.test: Merge with 5.0-opt. sql/item.cc: Merge with 5.0-opt. sql/item.h: Merge with 5.0-opt. sql/log_event.cc: Merge with 5.0-opt. sql/sql_select.cc: Merge with 5.0-opt.
Diffstat (limited to 'libmysql')
-rw-r--r--libmysql/libmysql.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index e2ff1799ba3..f994397b8fd 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -3657,33 +3657,38 @@ static void fetch_long_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
case MYSQL_TYPE_FLOAT:
{
/*
- We need to store data in the buffer before the truncation check to
+ We need to mark the local variable volatile to
workaround Intel FPU executive precision feature.
(See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=323 for details)
- AFAIU it does not guarantee to work.
*/
- float data;
+ volatile float data;
if (is_unsigned)
+ {
data= (float) ulonglong2double(value);
+ *param->error= ((ulonglong) value) != ((ulonglong) data);
+ }
else
- data= (float) value;
+ {
+ data= (float)value;
+ *param->error= value != ((longlong) data);
+ }
floatstore(buffer, data);
- *param->error= is_unsigned ?
- ((ulonglong) value) != ((ulonglong) (*(float*) buffer)) :
- ((longlong) value) != ((longlong) (*(float*) buffer));
break;
}
case MYSQL_TYPE_DOUBLE:
{
- double data;
+ volatile double data;
if (is_unsigned)
+ {
data= ulonglong2double(value);
+ *param->error= ((ulonglong) value) != ((ulonglong) data);
+ }
else
+ {
data= (double)value;
+ *param->error= value != ((longlong) data);
+ }
doublestore(buffer, data);
- *param->error= is_unsigned ?
- ((ulonglong) value) != ((ulonglong) (*(double*) buffer)) :
- ((longlong) value) != ((longlong) (*(double*) buffer));
break;
}
case MYSQL_TYPE_TIME: