summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <guilhem@mysql.com>2006-02-18 17:32:15 +0100
committerunknown <guilhem@mysql.com>2006-02-18 17:32:15 +0100
commit10ce919bda7379377cf36e352527449f5330ad45 (patch)
tree511d7e8f8e3f949e041ae1f5a254d0aeb39ed4f9 /mysql-test
parenta6fe7f7c8ddb652ed3f1baedec12f417f9c0056e (diff)
downloadmariadb-git-10ce919bda7379377cf36e352527449f5330ad45.tar.gz
Fix for BUG#13897 "failure to do SET SQL_MODE=N where N is a number > 31" (the original bug's title isn't the simplest
symptom). sys_var::check_set() was wrong. mysqlbinlog makes use of such SET SQL_MODE=N (where N is interpreted like if SQL_MODE was a field of type SET), so this bug affected recovery from binlogs if the server was running with certain SQL_MODE values, for example the default values on Windows (STRICT_TRANS_TABLES); to work around this bug people had to edit mysqlbinlog's output. mysql-test/r/sql_mode.result: result update mysql-test/t/sql_mode.test: test for various numeric SQL_MODE values sql/set_var.cc: For a set, it does not make sense to test if the supplied argument exceeds the number of elements in the set (such test would make sense for an enum), but rather to check if it exceeds 2^this (to verify that only reasonable bits are set).
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/sql_mode.result16
-rw-r--r--mysql-test/t/sql_mode.test9
2 files changed, 25 insertions, 0 deletions
diff --git a/mysql-test/r/sql_mode.result b/mysql-test/r/sql_mode.result
index 7d9d7fb333c..66df424919b 100644
--- a/mysql-test/r/sql_mode.result
+++ b/mysql-test/r/sql_mode.result
@@ -478,4 +478,20 @@ v1 CREATE ALGORITHM=UNDEFINED DEFINER="root"@"localhost" SQL SECURITY DEFINER VI
create view v2 as select a from t2 where a in (select a from v1);
drop view v2, v1;
drop table t1, t2;
+select @@sql_mode;
+@@sql_mode
+ANSI_QUOTES
+set sql_mode=2097152;
+select @@sql_mode;
+@@sql_mode
+STRICT_TRANS_TABLES
+set sql_mode=16384+(65536*4);
+select @@sql_mode;
+@@sql_mode
+REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,NO_TABLE_OPTIONS,ANSI
+set sql_mode=2147483648;
+ERROR 42000: Variable 'sql_mode' can't be set to the value of '2147483648'
+select @@sql_mode;
+@@sql_mode
+REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,NO_TABLE_OPTIONS,ANSI
SET @@SQL_MODE=@OLD_SQL_MODE;
diff --git a/mysql-test/t/sql_mode.test b/mysql-test/t/sql_mode.test
index 8ae9ced6c68..b67f1a73db6 100644
--- a/mysql-test/t/sql_mode.test
+++ b/mysql-test/t/sql_mode.test
@@ -255,4 +255,13 @@ create view v2 as select a from t2 where a in (select a from v1);
drop view v2, v1;
drop table t1, t2;
+select @@sql_mode;
+set sql_mode=2097152;
+select @@sql_mode;
+set sql_mode=16384+(65536*4);
+select @@sql_mode;
+--error 1231
+set sql_mode=2147483648; # that mode does not exist
+select @@sql_mode;
+
SET @@SQL_MODE=@OLD_SQL_MODE;