diff options
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/func_math.result | 30 | ||||
-rw-r--r-- | mysql-test/r/mysqlbinlog.result | 10 | ||||
-rw-r--r-- | mysql-test/t/func_math.test | 21 | ||||
-rw-r--r-- | mysql-test/t/mysqlbinlog.test | 20 |
4 files changed, 81 insertions, 0 deletions
diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result index 74136816a95..c3d2db2d553 100644 --- a/mysql-test/r/func_math.result +++ b/mysql-test/r/func_math.result @@ -407,6 +407,36 @@ SELECT a DIV 2 FROM t1 UNION SELECT a DIV 2 FROM t1; a DIV 2 0 DROP TABLE t1; +CREATE TABLE t1 (a DOUBLE); +INSERT INTO t1 VALUES (-1.1), (1.1), +(-1.5), (1.5), +(-1.9), (1.9), +(-2.1), (2.1), +(-2.5), (2.5), +(-2.9), (2.9), +# Check numbers with absolute values > 2^53 - 1 +# (see comments for MAX_EXACT_INTEGER) +(-1e16 - 0.5), (1e16 + 0.5), +(-1e16 - 1.5), (1e16 + 1.5); +SELECT a, ROUND(a) FROM t1; +a ROUND(a) +-1.1 -1 +1.1 1 +-1.5 -2 +1.5 2 +-1.9 -2 +1.9 2 +-2.1 -2 +2.1 2 +-2.5 -2 +2.5 2 +-2.9 -3 +2.9 3 +-1e+16 -10000000000000000 +1e+16 10000000000000000 +-1e+16 -10000000000000002 +1e+16 10000000000000002 +DROP TABLE t1; End of 5.0 tests SELECT 1e308 + 1e308; 1e308 + 1e308 diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result index 75ed9e06437..2ded167e6bd 100644 --- a/mysql-test/r/mysqlbinlog.result +++ b/mysql-test/r/mysqlbinlog.result @@ -411,6 +411,16 @@ drop table t1; 1 drop table t1; shell> mysqlbinlog std_data/corrupt-relay-bin.000624 > var/tmp/bug31793.sql +set @@global.server_id= 4294967295; +reset master; +select +(@a:=load_file("MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug37313.binlog")) +is not null; +(@a:=load_file("MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug37313.binlog")) +is not null +1 +*** Unsigned server_id 4294967295 is found: 1 *** +set @@global.server_id= 1; End of 5.0 tests flush logs; BUG#31611: Security risk with BINLOG statement diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test index 87b172a6436..e67f5f29e3a 100644 --- a/mysql-test/t/func_math.test +++ b/mysql-test/t/func_math.test @@ -248,6 +248,27 @@ INSERT INTO t1 VALUES ('a'); SELECT a DIV 2 FROM t1 UNION SELECT a DIV 2 FROM t1; DROP TABLE t1; +# +# Bug #15936: "round" differs on Windows to Unix +# + +CREATE TABLE t1 (a DOUBLE); + +INSERT INTO t1 VALUES (-1.1), (1.1), + (-1.5), (1.5), + (-1.9), (1.9), + (-2.1), (2.1), + (-2.5), (2.5), + (-2.9), (2.9), +# Check numbers with absolute values > 2^53 - 1 +# (see comments for MAX_EXACT_INTEGER) + (-1e16 - 0.5), (1e16 + 0.5), + (-1e16 - 1.5), (1e16 + 1.5); + +SELECT a, ROUND(a) FROM t1; + +DROP TABLE t1; + --echo End of 5.0 tests # diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test index 0f8894d6849..96965ba1793 100644 --- a/mysql-test/t/mysqlbinlog.test +++ b/mysql-test/t/mysqlbinlog.test @@ -278,6 +278,26 @@ echo shell> mysqlbinlog std_data/corrupt-relay-bin.000624 > var/tmp/bug31793.sql error 1; exec $MYSQL_BINLOG $MYSQL_TEST_DIR/std_data/corrupt-relay-bin.000624 > $MYSQLTEST_VARDIR/tmp/bug31793.sql; +# +# Bug #37313 BINLOG Contains Incorrect server id +# + +let $save_server_id= `select @@global.server_id`; +let $s_id_max=`select (1 << 32) - 1`; +eval set @@global.server_id= $s_id_max; + +reset master; +--exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug37313.binlog +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +eval select +(@a:=load_file("$MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug37313.binlog")) +is not null; +let $s_id_unsigned= `select @a like "%server id $s_id_max%" /* must return 1 */`; +echo *** Unsigned server_id $s_id_max is found: $s_id_unsigned ***; + +eval set @@global.server_id= $save_server_id; +--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug37313.binlog + --echo End of 5.0 tests # |