diff options
Diffstat (limited to 'mysql-test/t')
-rw-r--r-- | mysql-test/t/bdb_notembedded.test | 38 | ||||
-rw-r--r-- | mysql-test/t/cast.test | 2 | ||||
-rw-r--r-- | mysql-test/t/insert.test | 80 | ||||
-rw-r--r-- | mysql-test/t/mysqldump.test | 3 | ||||
-rw-r--r-- | mysql-test/t/type_decimal.test | 12 | ||||
-rw-r--r-- | mysql-test/t/type_float.test | 38 | ||||
-rw-r--r-- | mysql-test/t/type_newdecimal.test | 6 |
7 files changed, 164 insertions, 15 deletions
diff --git a/mysql-test/t/bdb_notembedded.test b/mysql-test/t/bdb_notembedded.test new file mode 100644 index 00000000000..24e64ebbfb2 --- /dev/null +++ b/mysql-test/t/bdb_notembedded.test @@ -0,0 +1,38 @@ +-- source include/not_embedded.inc +-- source include/have_bdb.inc + +# +# Bug #16206: Superfluous COMMIT event in binlog when updating BDB in autocommit mode +# +set autocommit=1; + +let $VERSION=`select version()`; + +reset master; +create table bug16206 (a int); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +--replace_result $VERSION VERSION +--replace_column 1 f 2 n 5 n +show binlog events; +drop table bug16206; + +reset master; +create table bug16206 (a int) engine= bdb; +insert into bug16206 values(0); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +insert into bug16206 values(3); +--replace_result $VERSION VERSION +--replace_column 1 f 2 n 5 n +show binlog events; +drop table bug16206; + +set autocommit=0; + + +--echo End of 5.0 tests diff --git a/mysql-test/t/cast.test b/mysql-test/t/cast.test index ab2859a5346..86018af4725 100644 --- a/mysql-test/t/cast.test +++ b/mysql-test/t/cast.test @@ -177,8 +177,6 @@ select cast(1.0e+300 as signed int); CREATE TABLE t1 (f1 double); INSERT INTO t1 SET f1 = -1.0e+30 ; INSERT INTO t1 SET f1 = +1.0e+30 ; -# Expected result is +-1e+30, but Windows returns +-1e+030. ---replace_result 1e+030 1e+30 SELECT f1 AS double_val, CAST(f1 AS SIGNED INT) AS cast_val FROM t1; DROP TABLE t1; diff --git a/mysql-test/t/insert.test b/mysql-test/t/insert.test index 3d32da9c3b7..7d843cbda6f 100644 --- a/mysql-test/t/insert.test +++ b/mysql-test/t/insert.test @@ -387,5 +387,85 @@ SELECT * FROM t2; DROP TABLE t1, t2; +# +# Bug #26788: mysqld (debug) aborts when inserting specific numbers into char +# fields +# + +CREATE TABLE t1 ( + a char(20) NOT NULL, + b char(7) DEFAULT NULL, + c char(4) DEFAULT NULL +); + +INSERT INTO t1(a,b,c) VALUES (9.999999e+0, 9.999999e+0, 9.999e+0); +INSERT INTO t1(a,b,c) VALUES (1.225e-05, 1.225e-05, 1.225e-05); +INSERT INTO t1(a,b) VALUES (1.225e-04, 1.225e-04); +INSERT INTO t1(a,b) VALUES (1.225e-01, 1.225e-01); +INSERT INTO t1(a,b) VALUES (1.225877e-01, 1.225877e-01); +INSERT INTO t1(a,b) VALUES (1.225e+01, 1.225e+01); +INSERT INTO t1(a,b,c) VALUES (1.225e+01, 1.225e+01, 1.225e+01); +INSERT INTO t1(a,b) VALUES (1.225e+05, 1.225e+05); +INSERT INTO t1(a,b) VALUES (1.225e+10, 1.225e+10); +INSERT INTO t1(a,b) VALUES (1.225e+15, 1.225e+15); +INSERT INTO t1(a,b) VALUES (5000000e+0, 5000000e+0); +INSERT INTO t1(a,b) VALUES (1.25e+78, 1.25e+78); +INSERT INTO t1(a,b) VALUES (1.25e-94, 1.25e-94); +INSERT INTO t1(a,b) VALUES (1.25e+203, 1.25e+203); +INSERT INTO t1(a,b) VALUES (1.25e-175, 1.25e-175); +INSERT INTO t1(a,c) VALUES (1.225e+0, 1.225e+0); +INSERT INTO t1(a,c) VALUES (1.37e+0, 1.37e+0); +INSERT INTO t1(a,c) VALUES (-1.37e+0, -1.37e+0); +INSERT INTO t1(a,c) VALUES (1.87e-3, 1.87e-3); +INSERT INTO t1(a,c) VALUES (-1.87e-2, -1.87e-2); +INSERT INTO t1(a,c) VALUES (5000e+0, 5000e+0); +INSERT INTO t1(a,c) VALUES (-5000e+0, -5000e+0); +SELECT * FROM t1; + +DROP TABLE t1; + +CREATE TABLE t1 ( + a char(20) NOT NULL, + b char(7) DEFAULT NULL, + c char(5) +); + + +INSERT INTO t1(a,b,c) VALUES (9.999999e+0, 9.999999e+0, 9.999e+0); +INSERT INTO t1(a,b,c) VALUES (1.225e-05, 1.225e-05, 1.225e-05); +INSERT INTO t1(a,b) VALUES (1.225e-04, 1.225e-04); +INSERT INTO t1(a,b) VALUES (1.225e-01, 1.225e-01); +INSERT INTO t1(a,b) VALUES (1.225877e-01, 1.225877e-01); +INSERT INTO t1(a,b) VALUES (1.225e+01, 1.225e+01); +INSERT INTO t1(a,b,c) VALUES (1.225e+01, 1.225e+01, 1.225e+01); +INSERT INTO t1(a,b) VALUES (1.225e+05, 1.225e+05); +INSERT INTO t1(a,b) VALUES (1.225e+10, 1.225e+10); +INSERT INTO t1(a,b) VALUES (1.225e+15, 1.225e+15); +INSERT INTO t1(a,b) VALUES (5000000e+0, 5000000e+0); +INSERT INTO t1(a,b) VALUES (1.25e+78, 1.25e+78); +INSERT INTO t1(a,b) VALUES (1.25e-94, 1.25e-94); +INSERT INTO t1(a,b) VALUES (1.25e+203, 1.25e+203); +INSERT INTO t1(a,b) VALUES (1.25e-175, 1.25e-175); +INSERT INTO t1(a,c) VALUES (1.225e+0, 1.225e+0); +INSERT INTO t1(a,c) VALUES (1.37e+0, 1.37e+0); +INSERT INTO t1(a,c) VALUES (-1.37e+0, -1.37e+0); +INSERT INTO t1(a,c) VALUES (1.87e-3, 1.87e-3); +INSERT INTO t1(a,c) VALUES (-1.87e-2, -1.87e-2); +INSERT INTO t1(a,c) VALUES (5000e+0, 5000e+0); +INSERT INTO t1(a,c) VALUES (-5000e+0, -5000e+0); + +SELECT * FROM t1; + +DROP TABLE t1; + +# +# Bug #31152: assertion in Field_str::store(double) +# + +CREATE TABLE t (a CHAR(10),b INT); +INSERT INTO t VALUES (),(),(); +INSERT INTO t(a) SELECT rand() FROM t; +DROP TABLE t; + --echo End of 5.0 tests. diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 0f1fee453a5..21dacb31ae4 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -36,9 +36,6 @@ DROP TABLE t1; CREATE TABLE t1 (a double); INSERT INTO t1 VALUES ('-9e999999'); -# The following replaces is here because some systems replaces the above -# double with '-inf' and others with MAX_DOUBLE ---replace_result (-1.79769313486232e+308) (RES) (NULL) (RES) --exec $MYSQL_DUMP --compact test t1 DROP TABLE t1; diff --git a/mysql-test/t/type_decimal.test b/mysql-test/t/type_decimal.test index 5538f19f5f9..a773578437c 100644 --- a/mysql-test/t/type_decimal.test +++ b/mysql-test/t/type_decimal.test @@ -408,3 +408,15 @@ INSERT INTO t1 VALUES (1.1325,3); SELECT ROUND(qty,3), dps, ROUND(qty,dps) FROM t1; DROP TABLE t1; + +# +# Bug #24541: "Data truncated..." on decimal type columns without any good reason +# + +create table t1 (c1 decimal(10,6)); +insert into t1 (c1) values (9.99e-4); +insert into t1 (c1) values (9.98e-4); +insert into t1 (c1) values (0.000999); +insert into t1 (c1) values (cast(9.99e-4 as decimal(10,6))); +select * from t1; +drop table t1; diff --git a/mysql-test/t/type_float.test b/mysql-test/t/type_float.test index a55200c8853..c912ff8d643 100644 --- a/mysql-test/t/type_float.test +++ b/mysql-test/t/type_float.test @@ -7,7 +7,7 @@ drop table if exists t1,t2; --enable_warnings SELECT 10,10.0,10.,.1e+2,100.0e-1; -SELECT 6e-05, -6e-05, --6e-05, -6e-05+1.000000; +SELECT 6e-16, -6e-16, --6e-16, -6e-16+1.000000; SELECT 1e1,1.e1,1.0e1,1e+1,1.e+1,1.0e+1,1e-1,1.e-1,1.0e-1; SELECT 0.001e+1,0.001e-1, -0.001e+01,-0.001e-01; SELECT 123.23E+02,-123.23E-02,"123.23E+02"+0.0,"-123.23E-02"+0.0; @@ -116,15 +116,10 @@ drop table if exists t1; # Check conversion of floats to character field (Bug #7774) create table t1 (c char(20)); insert into t1 values (5e-28); -# Expected result is "5e-28", but windows returns "5e-028" ---replace_result 5e-028 5e-28 select * from t1; drop table t1; create table t1 (c char(6)); insert into t1 values (2e5),(2e6),(2e-4),(2e-5); -# Expected result is "2e+06", but windows returns "2e+006" -# Expected result is "2e-05", but windows returns "2e-005" ---replace_result 2e+006 2e+06 2e-005 2e-05 select * from t1; drop table t1; @@ -241,4 +236,35 @@ insert into t1 values (2e30), (-2e30); select f1 + 0e0 from t1; drop table t1; +# +# Bug #12860 "Difference in zero padding of exponent between Unix and Windows" +# + +create table t1 (c char(6)); +insert into t1 values (2e6),(2e-5); +select * from t1; +drop table t1; + +# +# Bug #21497 "DOUBLE truncated to unusable value" +# + +CREATE TABLE d1 (d DOUBLE); +INSERT INTO d1 VALUES (1.7976931348623157E+308); +SELECT * FROM d1; +--error ER_ILLEGAL_VALUE_FOR_TYPE +INSERT INTO d1 VALUES (1.79769313486232e+308); +SELECT * FROM d1; +DROP TABLE d1; + +# +# Bug #26788 "mysqld (debug) aborts when inserting specific numbers into char +# fields" +# + +create table t1 (a char(20)); +insert into t1 values (1.225e-05); +select a+0 from t1; +drop table t1; + --echo End of 5.0 tests diff --git a/mysql-test/t/type_newdecimal.test b/mysql-test/t/type_newdecimal.test index e052ecfa82b..479012cfe0e 100644 --- a/mysql-test/t/type_newdecimal.test +++ b/mysql-test/t/type_newdecimal.test @@ -1054,10 +1054,8 @@ while ($max_power) } SELECT my_float, my_double, my_varchar FROM t1; -# Expected result 0.000000000011754943372854760000 -# On windows we get 0.000000000011754943372854770000 -# use replace_result to correct it ---replace_result 0.000000000011754943372854770000 0.000000000011754943372854760000 +# The following statement produces results with garbage past +# the significant digits. Improving it is a part of the WL#3977. SELECT CAST(my_float AS DECIMAL(65,30)), my_float FROM t1; SELECT CAST(my_double AS DECIMAL(65,30)), my_double FROM t1; SELECT CAST(my_varchar AS DECIMAL(65,30)), my_varchar FROM t1; |