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
commitfe09326edf3f3319d9e998630fc684d618c87bcb (patch)
tree8d737ed4160667b74a74e4c0dee88b3b4dfa7918 /mysql-test/t/variables.test
parentcd5744db13a186add2814da0aed0719817ac075b (diff)
parent71913e350a2dc1964d1298d14d4c5d692c419ce1 (diff)
downloadmariadb-git-fe09326edf3f3319d9e998630fc684d618c87bcb.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