summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@mariadb.com>2017-01-30 18:35:26 -0500
committerNirbhay Choubey <nirbhay@mariadb.com>2017-01-30 18:35:26 -0500
commitf7e03d4419d2ac66a8d3a811647791c4f8b099b3 (patch)
treeba6d81bb399342c4d7083b3346a3037bfb990fa9
parent4e82aaab2f65268e3f206db38c3f10de555f0496 (diff)
downloadmariadb-git-f7e03d4419d2ac66a8d3a811647791c4f8b099b3.tar.gz
MDEV-4774: Fix test case
-rw-r--r--mysql-test/suite/binlog/r/binlog_max_binlog_stmt_cache_size.result53
-rw-r--r--mysql-test/suite/binlog/t/binlog_max_binlog_stmt_cache_size.test44
2 files changed, 51 insertions, 46 deletions
diff --git a/mysql-test/suite/binlog/r/binlog_max_binlog_stmt_cache_size.result b/mysql-test/suite/binlog/r/binlog_max_binlog_stmt_cache_size.result
index cf4d7004195..00f01b59732 100644
--- a/mysql-test/suite/binlog/r/binlog_max_binlog_stmt_cache_size.result
+++ b/mysql-test/suite/binlog/r/binlog_max_binlog_stmt_cache_size.result
@@ -1,31 +1,22 @@
-select @@max_binlog_stmt_cache_size;
-@@max_binlog_stmt_cache_size
-18446744073709547520
-set global max_binlog_stmt_cache_size= 18446744073709547520;
-select @@max_binlog_stmt_cache_size;
-@@max_binlog_stmt_cache_size
-18446744073709547520
-set global max_binlog_stmt_cache_size= 18446744073709547519;
-Warnings:
-Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '18446744073709547519'
-select @@max_binlog_stmt_cache_size;
-@@max_binlog_stmt_cache_size
-18446744073709543424
-set global max_binlog_stmt_cache_size= 18446744073709551615;
-Warnings:
-Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '18446744073709551615'
-select @@max_binlog_stmt_cache_size;
-@@max_binlog_stmt_cache_size
-18446744073709547520
-set global max_binlog_stmt_cache_size= 18446744073709551614;
-Warnings:
-Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '18446744073709551614'
-select @@max_binlog_stmt_cache_size;
-@@max_binlog_stmt_cache_size
-18446744073709547520
-set global max_binlog_stmt_cache_size= 18446744073709551616;
-ERROR 42000: Incorrect argument type to variable 'max_binlog_stmt_cache_size'
-select @@max_binlog_stmt_cache_size;
-@@max_binlog_stmt_cache_size
-18446744073709547520
-set global max_binlog_stmt_cache_size= 18446744073709547520;
+#
+# MDEV-4774: Strangeness with max_binlog_stmt_cache_size Settings
+#
+CALL mtr.add_suppression("unsigned value 18446744073709547520 adjusted to 4294963200");
+SELECT @@global.max_binlog_stmt_cache_size;
+@@global.max_binlog_stmt_cache_size
+MAX_BINLOG_STMT_CACHE_SIZE
+SET @cache_size= @@max_binlog_stmt_cache_size;
+SET @@global.max_binlog_stmt_cache_size= @cache_size+1;
+SELECT @@global.max_binlog_stmt_cache_size;
+@@global.max_binlog_stmt_cache_size
+MAX_BINLOG_STMT_CACHE_SIZE
+SET @@global.max_binlog_stmt_cache_size = @cache_size+4095;
+SELECT @@global.max_binlog_stmt_cache_size;
+@@global.max_binlog_stmt_cache_size
+MAX_BINLOG_STMT_CACHE_SIZE
+SET @@global.max_binlog_stmt_cache_size= @cache_size-1;
+SELECT @@global.max_binlog_stmt_cache_size = @cache_size-4096;
+@@global.max_binlog_stmt_cache_size = @cache_size-4096
+1
+SET @@global.max_binlog_stmt_cache_size= @cache_size;
+# End of test
diff --git a/mysql-test/suite/binlog/t/binlog_max_binlog_stmt_cache_size.test b/mysql-test/suite/binlog/t/binlog_max_binlog_stmt_cache_size.test
index f85eed3cea8..ca3f45c154c 100644
--- a/mysql-test/suite/binlog/t/binlog_max_binlog_stmt_cache_size.test
+++ b/mysql-test/suite/binlog/t/binlog_max_binlog_stmt_cache_size.test
@@ -1,22 +1,36 @@
-source include/have_log_bin.inc;
-select @@max_binlog_stmt_cache_size;
---let $cache_size=`select @@max_binlog_stmt_cache_size;`
+--echo #
+--echo # MDEV-4774: Strangeness with max_binlog_stmt_cache_size Settings
+--echo #
-set global max_binlog_stmt_cache_size= 18446744073709547520;
-select @@max_binlog_stmt_cache_size;
+CALL mtr.add_suppression("unsigned value 18446744073709547520 adjusted to 4294963200");
-set global max_binlog_stmt_cache_size= 18446744073709547519;
-select @@max_binlog_stmt_cache_size;
+--replace_result 18446744073709547520 MAX_BINLOG_STMT_CACHE_SIZE 4294963200 MAX_BINLOG_STMT_CACHE_SIZE
+SELECT @@global.max_binlog_stmt_cache_size;
-set global max_binlog_stmt_cache_size= 18446744073709551615;
-select @@max_binlog_stmt_cache_size;
+# Save the initial value of @@global.max_binlog_stmt_cache_size.
+--replace_result 18446744073709547520 MAX_BINLOG_STMT_CACHE_SIZE 4294963200 MAX_BINLOG_STMT_CACHE_SIZE
+SET @cache_size= @@max_binlog_stmt_cache_size;
-set global max_binlog_stmt_cache_size= 18446744073709551614;
-select @@max_binlog_stmt_cache_size;
+--disable_warnings
+SET @@global.max_binlog_stmt_cache_size= @cache_size+1;
+--enable_warnings
+--replace_result 18446744073709547520 MAX_BINLOG_STMT_CACHE_SIZE 4294963200 MAX_BINLOG_STMT_CACHE_SIZE
+SELECT @@global.max_binlog_stmt_cache_size;
---error ER_WRONG_TYPE_FOR_VAR
-set global max_binlog_stmt_cache_size= 18446744073709551616;
-select @@max_binlog_stmt_cache_size;
+--disable_warnings
+SET @@global.max_binlog_stmt_cache_size = @cache_size+4095;
+--enable_warnings
+--replace_result 4294963200 MAX_BINLOG_STMT_CACHE_SIZE 18446744073709547520 MAX_BINLOG_STMT_CACHE_SIZE
+SELECT @@global.max_binlog_stmt_cache_size;
+
+--disable_warnings
+SET @@global.max_binlog_stmt_cache_size= @cache_size-1;
+--enable_warnings
+SELECT @@global.max_binlog_stmt_cache_size = @cache_size-4096;
+
+# Restore @@global.max_binlog_stmt_cache_size to its initial value.
+SET @@global.max_binlog_stmt_cache_size= @cache_size;
+
+--echo # End of test
---eval set global max_binlog_stmt_cache_size= $cache_size