summaryrefslogtreecommitdiff
path: root/mysql-test/r/select.result
diff options
context:
space:
mode:
authorAlexey Kopytov <Alexey.Kopytov@sun.com>2009-01-28 20:59:08 +0300
committerAlexey Kopytov <Alexey.Kopytov@sun.com>2009-01-28 20:59:08 +0300
commita01946373d5752c921c4daddfec5c6cdfdbfa627 (patch)
tree962a3f82ee7d0566806f3cb9f83f5b70d6ca86a6 /mysql-test/r/select.result
parent386ec13b590a29608bf8ddea39e1acc875c702a7 (diff)
downloadmariadb-git-a01946373d5752c921c4daddfec5c6cdfdbfa627.tar.gz
Fix for bug #21205: Different number of digits for float/double/real in --ps-protocol
Various parts of code used different 'precision' arguments for sprintf("%g") when converting floating point numbers to a string. This led to differences in results in some cases depending on whether the text-based or prepared statements protocol is used for a query. Fixed by changing arguments to sprintf("%g") to always be 15 (DBL_DIG) so that results are consistent regardless of the protocol. This patch will be null-merged to 6.0 as the problem does not exists there (fixed by the patch for WL#2934). client/sql_string.cc: Use 15 (DBL_DIG) as a precision argument for sprintf(), as Field_double::val_str() does. libmysql/libmysql.c: Use 15 (DBL_DIG) as a precision argument for sprintf(), as Field_double::val_str() does. mysql-test/r/archive_gis.result: Fixed test results to take additional precision into account. mysql-test/r/func_group.result: Fixed test results to take additional precision into account. mysql-test/r/func_math.result: Fixed test results to take additional precision into account. mysql-test/r/func_str.result: Fixed test results to take additional precision into account. mysql-test/r/gis.result: Fixed test results to take additional precision into account. mysql-test/r/innodb_gis.result: Fixed test results to take additional precision into account. mysql-test/r/select.result: Fixed test results to take additional precision into account. mysql-test/r/sp.result: Fixed test results to take additional precision into account. mysql-test/r/type_float.result: Fixed test results to take additional precision into account. mysql-test/t/type_float.test: Fixed test results to take additional precision into account. sql/sql_string.cc: Use 15 (DBL_DIG) as a precision argument for sprintf(), as Field_double::val_str() does.
Diffstat (limited to 'mysql-test/r/select.result')
-rw-r--r--mysql-test/r/select.result14
1 files changed, 7 insertions, 7 deletions
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index 67ce231a157..9558b0533ad 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -2790,26 +2790,26 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
select max(key1) from t1 where key1 <= 0.6158;
max(key1)
-0.61580002307892
+0.615800023078918
select max(key2) from t2 where key2 <= 1.6158;
max(key2)
-1.6158000230789
+1.61580002307892
select min(key1) from t1 where key1 >= 0.3762;
min(key1)
-0.37619999051094
+0.376199990510941
select min(key2) from t2 where key2 >= 1.3762;
min(key2)
-1.3761999607086
+1.37619996070862
select max(key1), min(key2) from t1, t2
where key1 <= 0.6158 and key2 >= 1.3762;
max(key1) min(key2)
-0.61580002307892 1.3761999607086
+0.615800023078918 1.37619996070862
select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5;
max(key1)
-0.61580002307892
+0.615800023078918
select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5;
min(key1)
-0.37619999051094
+0.376199990510941
DROP TABLE t1,t2;
create table t1(a bigint unsigned, b bigint);
insert into t1 values (0xfffffffffffffffff, 0xfffffffffffffffff),