summaryrefslogtreecommitdiff
path: root/mysql-test/t/variables.test
diff options
context:
space:
mode:
authorTatiana A. Nurnberg <azundris@mysql.com>2009-02-27 21:43:43 +0100
committerTatiana A. Nurnberg <azundris@mysql.com>2009-02-27 21:43:43 +0100
commit1126054c072a889554492ab87179336190913b65 (patch)
tree8d737ed4160667b74a74e4c0dee88b3b4dfa7918 /mysql-test/t/variables.test
parent3a29b7afaa40e40d33a3448dc07700f8ea3e5dca (diff)
parente3233c25b5292193b11044ef410fb2aae896a52a (diff)
downloadmariadb-git-1126054c072a889554492ab87179336190913b65.tar.gz
automerge
Diffstat (limited to 'mysql-test/t/variables.test')
-rw-r--r--mysql-test/t/variables.test35
1 files changed, 35 insertions, 0 deletions
diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test
index a54ac497c4c..94f81def5b2 100644
--- a/mysql-test/t/variables.test
+++ b/mysql-test/t/variables.test
@@ -1079,3 +1079,38 @@ SET @@session.thread_stack= 7;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@global.thread_stack= 7;
#
+
+#
+# Bug #40657 - assertion with out of range variables and traditional sql_mode
+#
+
+SELECT @@global.expire_logs_days INTO @old_eld;
+
+SET GLOBAL expire_logs_days = -1;
+--echo needs to've been adjusted (0)
+SELECT @@global.expire_logs_days;
+
+SET GLOBAL expire_logs_days = 11;
+SET @old_mode=@@sql_mode;
+SET SESSION sql_mode = 'TRADITIONAL';
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL expire_logs_days = 100;
+--echo needs to be unchanged (11)
+SELECT @@global.expire_logs_days;
+SET SESSION sql_mode = @old_mode;
+
+SET GLOBAL expire_logs_days = 100;
+--echo needs to've been adjusted (99)
+SELECT @@global.expire_logs_days;
+
+SET GLOBAL expire_logs_days = 11;
+SET GLOBAL expire_logs_days = 99;
+--echo needs to pass with no warnings (99)
+SELECT @@global.expire_logs_days;
+
+# cleanup
+SET GLOBAL expire_logs_days = @old_eld;
+
+
+
+--echo End of 5.1 tests