summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <vva@eagle.mysql.r18.ru>2004-03-06 03:00:21 +0400
committerunknown <vva@eagle.mysql.r18.ru>2004-03-06 03:00:21 +0400
commit17c4d7f36182e58047231472dbeb1a9f2af60560 (patch)
tree6f0b14624710df2135208a6cedc7fc3e19db1752 /mysql-test
parentc8bfc2324b14584f39dd271fa0dd34b0f181d167 (diff)
downloadmariadb-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 'mysql-test')
-rw-r--r--mysql-test/r/insert.result10
-rw-r--r--mysql-test/r/mysqldump.result2
-rw-r--r--mysql-test/t/insert.test47
3 files changed, 23 insertions, 36 deletions
diff --git a/mysql-test/r/insert.result b/mysql-test/r/insert.result
index 9c066d67af1..6602704ccec 100644
--- a/mysql-test/r/insert.result
+++ b/mysql-test/r/insert.result
@@ -169,6 +169,7 @@ set @value= "1e+1111111111a";
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
Warnings:
Warning 1265 Data truncated for column 'f_double ' at row 1
+Warning 1264 Data truncated, out of range for column 'f_double ' at row 1
Warning 1265 Data truncated for column 'f_float ' at row 1
Warning 1264 Data truncated, out of range for column 'f_float ' at row 1
Warning 1265 Data truncated for column 'f_double_7_2 ' at row 1
@@ -176,6 +177,7 @@ Warning 1264 Data truncated, out of range for column 'f_double_7_2 ' at row 1
Warning 1265 Data truncated for column 'f_float_4_3 ' at row 1
Warning 1264 Data truncated, out of range for column 'f_float_4_3 ' at row 1
Warning 1265 Data truncated for column 'f_double_u ' at row 1
+Warning 1264 Data truncated, out of range for column 'f_double_u ' at row 1
Warning 1265 Data truncated for column 'f_float_u ' at row 1
Warning 1264 Data truncated, out of range for column 'f_float_u ' at row 1
Warning 1265 Data truncated for column 'f_double_15_1_u ' at row 1
@@ -197,6 +199,7 @@ set @value= "-1e+1111111111a";
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
Warnings:
Warning 1265 Data truncated for column 'f_double ' at row 1
+Warning 1264 Data truncated, out of range for column 'f_double ' at row 1
Warning 1265 Data truncated for column 'f_float ' at row 1
Warning 1264 Data truncated, out of range for column 'f_float ' at row 1
Warning 1265 Data truncated for column 'f_double_7_2 ' at row 1
@@ -225,15 +228,17 @@ f_float_3_1_u 0.0
set @value= 1e+1111111111;
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
Warnings:
+Warning 1264 Data truncated, out of range for column 'f_double ' at row 1
Warning 1264 Data truncated, out of range for column 'f_float ' at row 1
Warning 1264 Data truncated, out of range for column 'f_double_7_2 ' at row 1
Warning 1264 Data truncated, out of range for column 'f_float_4_3 ' at row 1
+Warning 1264 Data truncated, out of range for column 'f_double_u ' at row 1
Warning 1264 Data truncated, out of range for column 'f_float_u ' at row 1
Warning 1264 Data truncated, out of range for column 'f_double_15_1_u ' at row 1
Warning 1264 Data truncated, out of range for column 'f_float_3_1_u ' at row 1
select * from t1 where `number `=last_insert_id();
number 6
-original_value 1.7976931348623e+308
+original_value inf
f_double 1.79769313486232e+308
f_float 3.40282e+38
f_double_7_2 99999.99
@@ -245,6 +250,7 @@ f_float_3_1_u 99.9
set @value= -1e+1111111111;
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
Warnings:
+Warning 1264 Data truncated, out of range for column 'f_double ' at row 1
Warning 1264 Data truncated, out of range for column 'f_float ' at row 1
Warning 1264 Data truncated, out of range for column 'f_double_7_2 ' at row 1
Warning 1264 Data truncated, out of range for column 'f_float_4_3 ' at row 1
@@ -254,7 +260,7 @@ Warning 1264 Data truncated, out of range for column 'f_double_15_1_u ' at row 1
Warning 1264 Data truncated, out of range for column 'f_float_3_1_u ' at row 1
select * from t1 where `number `=last_insert_id();
number 7
-original_value -1.7976931348623e+308
+original_value -inf
f_double -1.79769313486232e+308
f_float -3.40282e+38
f_double_7_2 -99999.99
diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result
index fe1b83a1089..c8fbb504d25 100644
--- a/mysql-test/r/mysqldump.result
+++ b/mysql-test/r/mysqldump.result
@@ -46,6 +46,8 @@ UNLOCK TABLES;
DROP TABLE t1;
CREATE TABLE t1 (a double);
INSERT INTO t1 VALUES (-9e999999);
+Warnings:
+Warning 1264 Data truncated, out of range for column 'a' at row 1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT, CHARACTER_SET_CLIENT=utf8 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
diff --git a/mysql-test/t/insert.test b/mysql-test/t/insert.test
index b2fafe10192..b3d996c1475 100644
--- a/mysql-test/t/insert.test
+++ b/mysql-test/t/insert.test
@@ -90,7 +90,8 @@ drop database mysqltest;
#
# Test of wrong values for float data (bug #2082)
-#
+#
+
use test;
create table t1(
`number ` int auto_increment primary key,
@@ -107,68 +108,46 @@ create table t1(
set @value= "aa";
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
-vertical_results;
-select * from t1 where `number `=last_insert_id();
-horisontal_results;
+--query_vertical select * from t1 where `number `=last_insert_id()
set @value= "1aa";
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
-vertical_results;
-select * from t1 where `number `=last_insert_id();
-horisontal_results;
+--query_vertical select * from t1 where `number `=last_insert_id()
set @value= "aa1";
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
-vertical_results;
-select * from t1 where `number `=last_insert_id();
-horisontal_results;
+--query_vertical select * from t1 where `number `=last_insert_id()
set @value= "1e+1111111111a";
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
-vertical_results;
-select * from t1 where `number `=last_insert_id();
-horisontal_results;
+--query_vertical select * from t1 where `number `=last_insert_id()
set @value= "-1e+1111111111a";
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
-vertical_results;
-select * from t1 where `number `=last_insert_id();
-horisontal_results;
+--query_vertical select * from t1 where `number `=last_insert_id()
set @value= 1e+1111111111;
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
-vertical_results;
-select * from t1 where `number `=last_insert_id();
-horisontal_results;
+--query_vertical select * from t1 where `number `=last_insert_id()
set @value= -1e+1111111111;
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
-vertical_results;
-select * from t1 where `number `=last_insert_id();
-horisontal_results;
+--query_vertical select * from t1 where `number `=last_insert_id()
set @value= 1e+111;
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
-vertical_results;
-select * from t1 where `number `=last_insert_id();
-horisontal_results;
+--query_vertical select * from t1 where `number `=last_insert_id()
set @value= -1e+111;
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
-vertical_results;
-select * from t1 where `number `=last_insert_id();
-horisontal_results;
+--query_vertical select * from t1 where `number `=last_insert_id()
set @value= 1;
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
-vertical_results;
-select * from t1 where `number `=last_insert_id();
-horisontal_results;
+--query_vertical select * from t1 where `number `=last_insert_id()
set @value= -1;
insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
-vertical_results;
-select * from t1 where `number `=last_insert_id();
-horisontal_results;
+--query_vertical select * from t1 where `number `=last_insert_id()
drop table t1;