diff options
429 files changed, 1479 insertions, 666 deletions
diff --git a/mysql-test/extra/binlog_tests/mysqlbinlog_row_engine.inc b/mysql-test/extra/binlog_tests/mysqlbinlog_row_engine.inc index 95440ab04a0..c072d503d00 100644 --- a/mysql-test/extra/binlog_tests/mysqlbinlog_row_engine.inc +++ b/mysql-test/extra/binlog_tests/mysqlbinlog_row_engine.inc @@ -16,6 +16,7 @@ # --source include/have_log_bin.inc +set sql_mode=""; SET NAMES 'utf8'; #SHOW VARIABLES LIKE 'character_set%'; diff --git a/mysql-test/extra/rpl_tests/rpl_ddl.test b/mysql-test/extra/rpl_tests/rpl_ddl.test index 34897d00733..21778a11df5 100644 --- a/mysql-test/extra/rpl_tests/rpl_ddl.test +++ b/mysql-test/extra/rpl_tests/rpl_ddl.test @@ -128,6 +128,8 @@ ############################################################### # Some preparations ############################################################### +set global sql_mode=''; +set local sql_mode=''; # The sync_slave_with_master is needed to make the xids deterministic. sync_slave_with_master; @@ -609,3 +611,5 @@ DROP TEMPORARY TABLE mysqltest1.t22; DROP DATABASE mysqltest1; # mysqltest2 was alreday DROPPED some tests before. DROP DATABASE mysqltest3; + +set global sql_mode=default; diff --git a/mysql-test/include/concurrent.inc b/mysql-test/include/concurrent.inc index 0b7299a3c34..2912287be8e 100644 --- a/mysql-test/include/concurrent.inc +++ b/mysql-test/include/concurrent.inc @@ -26,6 +26,7 @@ # connection default; +SET SQL_MODE=""; # # Show prerequisites for this test. # @@ -670,3 +671,4 @@ connection default; drop table t1; drop user mysqltest@localhost; +SET SQL_MODE=default; diff --git a/mysql-test/include/ctype_innodb_like.inc b/mysql-test/include/ctype_innodb_like.inc index ae43342885a..4f3201f51fb 100644 --- a/mysql-test/include/ctype_innodb_like.inc +++ b/mysql-test/include/ctype_innodb_like.inc @@ -2,6 +2,10 @@ # Bug#11650: LIKE pattern matching using prefix index # doesn't return correct result # +--disable_query_log +set @ctype_save_sql_mode=@@sql_mode; +set sql_mode=""; +--enable_query_log --disable_warnings # # This query creates a column using @@ -10,6 +14,9 @@ # create table t1 engine=innodb select repeat('a',50) as c1; --enable_warnings +--disable_query_log +set sql_mode=@ctype_save_sql_mode; +--enable_query_log alter table t1 add index(c1(5)); insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111'); diff --git a/mysql-test/include/ctype_utf8mb4.inc b/mysql-test/include/ctype_utf8mb4.inc index 152316e6158..71993a946b3 100644 --- a/mysql-test/include/ctype_utf8mb4.inc +++ b/mysql-test/include/ctype_utf8mb4.inc @@ -688,9 +688,16 @@ eval create table t1 ( insert into t1 values(1,'foo'),(2,'foobar'); --sorted_result select * from t1 where b like 'foob%'; +--disable_query_log +set @ctype_save_sql_mode=@@sql_mode; +set sql_mode=""; +--enable_query_log --disable_warnings alter table t1 engine=innodb; --enable_warnings +--disable_query_log +set sql_mode=@ctype_save_sql_mode; +--enable_query_log --sorted_result select * from t1 where b like 'foob%'; drop table t1; diff --git a/mysql-test/include/explain_non_select.inc b/mysql-test/include/explain_non_select.inc index a0f86e744b0..57b96994d20 100644 --- a/mysql-test/include/explain_non_select.inc +++ b/mysql-test/include/explain_non_select.inc @@ -771,7 +771,7 @@ DROP TABLE t1,t2; --echo #74 -CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE t1(a INT PRIMARY KEY); INSERT INTO t1 VALUES (1), (2), (3), (4), (5); --echo # used key is modified & Using temporary diff --git a/mysql-test/include/grant_cache.inc b/mysql-test/include/grant_cache.inc index 47eef1cdb67..111b35d6940 100644 --- a/mysql-test/include/grant_cache.inc +++ b/mysql-test/include/grant_cache.inc @@ -37,12 +37,16 @@ --source include/add_anonymous_users.inc +set GLOBAL sql_mode=""; +set LOCAL sql_mode=""; # --disable_warnings drop table if exists test.t1,mysqltest.t1,mysqltest.t2; drop database if exists mysqltest; --enable_warnings +set GLOBAL query_cache_type=ON; +set LOCAL query_cache_type=ON; set GLOBAL query_cache_size=1355776; reset query cache; @@ -214,5 +218,9 @@ drop table test.t1,mysqltest.t1,mysqltest.t2; drop database mysqltest; set GLOBAL query_cache_size=default; +set GLOBAL query_cache_type=ON; +set LOCAL query_cache_type=ON; --source include/delete_anonymous_users.inc +set GLOBAL sql_mode=default; +set GLOBAL query_cache_type=default; diff --git a/mysql-test/include/icp_tests.inc b/mysql-test/include/icp_tests.inc index 6807d6eb1bd..88d6923d8f9 100644 --- a/mysql-test/include/icp_tests.inc +++ b/mysql-test/include/icp_tests.inc @@ -443,13 +443,13 @@ DROP TABLE t1; --echo # when ICP is on" --echo # -CREATE TABLE t1 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL) ENGINE=InnoDB; +CREATE TABLE t1 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL); INSERT INTO t1 VALUES (11,0); INSERT INTO t1 VALUES (12,5); INSERT INTO t1 VALUES (15,0); -CREATE TABLE t2 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL) ENGINE=InnoDB; +CREATE TABLE t2 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL); INSERT INTO t2 VALUES (11,1); INSERT INTO t2 VALUES (12,2); diff --git a/mysql-test/include/query_cache.inc b/mysql-test/include/query_cache.inc index 29a82f112c3..56dae83db2f 100644 --- a/mysql-test/include/query_cache.inc +++ b/mysql-test/include/query_cache.inc @@ -15,6 +15,8 @@ # main code went into include/query_cache.inc # +SET global query_cache_type=ON; +SET local query_cache_type=ON; eval SET SESSION STORAGE_ENGINE = $engine_type; # Initialise @@ -193,3 +195,5 @@ disconnect connection1; connection default; set @@global.query_cache_size = @save_query_cache_size; drop table t2; + +SET global query_cache_type=default; diff --git a/mysql-test/include/query_cache_partitions.inc b/mysql-test/include/query_cache_partitions.inc index e5bb7406c10..c69356f907d 100644 --- a/mysql-test/include/query_cache_partitions.inc +++ b/mysql-test/include/query_cache_partitions.inc @@ -4,6 +4,8 @@ # $engine_type -- storage engine to be tested # have to be set before sourcing this script. +SET global query_cache_type=ON; +SET local query_cache_type=ON; eval SET SESSION STORAGE_ENGINE = $engine_type; # Initialise @@ -124,3 +126,4 @@ show status like "Qcache_hits"; drop table t1; set @@global.query_cache_size = @save_query_cache_size; +SET global query_cache_type=default; diff --git a/mysql-test/include/query_cache_sql_prepare.inc b/mysql-test/include/query_cache_sql_prepare.inc index 769cd535f37..41276ed5a79 100644 --- a/mysql-test/include/query_cache_sql_prepare.inc +++ b/mysql-test/include/query_cache_sql_prepare.inc @@ -20,6 +20,8 @@ --source include/have_query_cache.inc # embedded can't make more than one connection, which this test needs -- source include/not_embedded.inc +set GLOBAL query_cache_type=ON; +set LOCAL query_cache_type=ON; --echo ---- establish connection con1 (root) ---- connect (con1,localhost,root,,test,$MASTER_MYPORT,); @@ -528,3 +530,4 @@ drop table t1; set @@global.query_cache_size=@initial_query_cache_size; flush status; # reset Qcache status variables for next tests +set GLOBAL query_cache_type=default; diff --git a/mysql-test/r/analyze_format_json.result b/mysql-test/r/analyze_format_json.result index 0f747068ebb..f77db650866 100644 --- a/mysql-test/r/analyze_format_json.result +++ b/mysql-test/r/analyze_format_json.result @@ -143,7 +143,7 @@ ANALYZE "attached_condition": "(tbl2.b < 60)" }, "buffer_type": "flat", - "buffer_size": "128Kb", + "buffer_size": "256Kb", "join_type": "BNL", "r_filtered": 100 } @@ -181,7 +181,7 @@ ANALYZE "attached_condition": "(tbl2.b < 60)" }, "buffer_type": "flat", - "buffer_size": "128Kb", + "buffer_size": "256Kb", "join_type": "BNL", "attached_condition": "(tbl1.c > tbl2.c)", "r_filtered": 15.833 diff --git a/mysql-test/r/analyze_stmt_orderby.result b/mysql-test/r/analyze_stmt_orderby.result index 86259a78b11..be1f01a2a52 100644 --- a/mysql-test/r/analyze_stmt_orderby.result +++ b/mysql-test/r/analyze_stmt_orderby.result @@ -422,7 +422,7 @@ ANALYZE "r_filtered": 100 }, "buffer_type": "flat", - "buffer_size": "128Kb", + "buffer_size": "256Kb", "join_type": "BNL", "attached_condition": "(t3.a = t0.a)", "r_filtered": 10 @@ -491,7 +491,7 @@ ANALYZE "r_filtered": 100 }, "buffer_type": "flat", - "buffer_size": "128Kb", + "buffer_size": "256Kb", "join_type": "BNL", "attached_condition": "(t5.a = t6.a)", "r_filtered": 21.429 @@ -528,7 +528,7 @@ EXPLAIN "filtered": 100 }, "buffer_type": "flat", - "buffer_size": "128Kb", + "buffer_size": "256Kb", "join_type": "BNL", "attached_condition": "(t5.a = t6.a)" } diff --git a/mysql-test/r/analyze_stmt_privileges.result b/mysql-test/r/analyze_stmt_privileges.result index d382b0b3bb6..d54b5b37863 100644 --- a/mysql-test/r/analyze_stmt_privileges.result +++ b/mysql-test/r/analyze_stmt_privileges.result @@ -7,6 +7,7 @@ use db; create table t1 (i int, c varchar(8)); insert into t1 values (1,'foo'),(2,'bar'),(3,'baz'),(4,'qux'); create view v1 as select * from t1 where i > 1; +CREATE USER u1@localhost; grant ALL on db.v1 to u1@localhost; connect con1,localhost,u1,,; select * from db.t1; diff --git a/mysql-test/r/analyze_stmt_privileges2.result b/mysql-test/r/analyze_stmt_privileges2.result index 3dded4bc7cc..892791dd8f8 100644 --- a/mysql-test/r/analyze_stmt_privileges2.result +++ b/mysql-test/r/analyze_stmt_privileges2.result @@ -1,3 +1,5 @@ +set GLOBAL sql_mode=""; +set LOCAL sql_mode=""; CREATE DATABASE privtest_db; CREATE TABLE privtest_db.t1 (a INT, b VARCHAR(3)) ENGINE=MyISAM; CREATE TABLE privtest_db.t2 (a INT, b VARCHAR(3)) ENGINE=MyISAM; @@ -5232,3 +5234,4 @@ connection default; DROP USER 'privtest'@localhost; USE test; DROP DATABASE privtest_db; +set GLOBAL sql_mode=default; diff --git a/mysql-test/r/blackhole_plugin.result b/mysql-test/r/blackhole_plugin.result index dd1b95ab0d9..2884441056a 100644 --- a/mysql-test/r/blackhole_plugin.result +++ b/mysql-test/r/blackhole_plugin.result @@ -1,7 +1,9 @@ +set sql_mode=""; CREATE TABLE t1(a int) ENGINE=BLACKHOLE; Warnings: Warning 1286 Unknown storage engine 'BLACKHOLE' Warning 1266 Using storage engine MyISAM for table 't1' +set sql_mode=default; DROP TABLE t1; INSTALL PLUGIN blackhole SONAME 'ha_blackhole.so'; INSTALL PLUGIN BLACKHOLE SONAME 'ha_blackhole.so'; diff --git a/mysql-test/r/cache_innodb.result b/mysql-test/r/cache_innodb.result index 85eef0b3418..971750e3da2 100644 --- a/mysql-test/r/cache_innodb.result +++ b/mysql-test/r/cache_innodb.result @@ -1,3 +1,5 @@ +SET global query_cache_type=ON; +SET local query_cache_type=ON; SET SESSION STORAGE_ENGINE = InnoDB; drop table if exists t1,t2,t3; set @save_query_cache_size = @@global.query_cache_size; @@ -221,6 +223,7 @@ Variable_name Value Qcache_hits 1 set @@global.query_cache_size = @save_query_cache_size; drop table t2; +SET global query_cache_type=default; CREATE TABLE t1 (a INT) ENGINE=InnoDB; BEGIN; INSERT INTO t1 VALUES(1); diff --git a/mysql-test/r/change_user.result b/mysql-test/r/change_user.result index 18c53a5e22b..1de97ed02e6 100644 --- a/mysql-test/r/change_user.result +++ b/mysql-test/r/change_user.result @@ -1,6 +1,10 @@ +set global secure_auth=0; +create user test_nopw; grant select on test.* to test_nopw; -grant select on test.* to test_oldpw identified by password "09301740536db389"; -grant select on test.* to test_newpw identified by "newpw"; +create user test_oldpw identified by password "09301740536db389"; +grant select on test.* to test_oldpw; +create user test_newpw identified by "newpw"; +grant select on test.* to test_newpw; select concat('<', user(), '>'), concat('<', current_user(), '>'), database(); concat('<', user(), '>') concat('<', current_user(), '>') database() <root@localhost> <root@localhost> test @@ -85,3 +89,4 @@ IS_USED_LOCK('bug31418') NULL FLUSH STATUS; Value of com_select did not change +set global secure_auth=default; diff --git a/mysql-test/r/compound.result b/mysql-test/r/compound.result index dc1f33147a0..92d3226ec00 100644 --- a/mysql-test/r/compound.result +++ b/mysql-test/r/compound.result @@ -155,7 +155,7 @@ drop function fn| drop table t1| begin not atomic select @@sql_mode; end| @@sql_mode - +NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION create table t1 (a int)| select a from t1 having a > 1| a diff --git a/mysql-test/r/concurrent_innodb_safelog.result b/mysql-test/r/concurrent_innodb_safelog.result index 24a84afb9ce..03d20f40be3 100644 --- a/mysql-test/r/concurrent_innodb_safelog.result +++ b/mysql-test/r/concurrent_innodb_safelog.result @@ -1,4 +1,5 @@ SET GLOBAL TRANSACTION ISOLATION LEVEL REPEATABLE READ; +SET SQL_MODE=""; SELECT @@global.tx_isolation; @@global.tx_isolation REPEATABLE-READ @@ -790,3 +791,4 @@ eta tipo c ** connection default drop table t1; drop user mysqltest@localhost; +SET SQL_MODE=default; diff --git a/mysql-test/r/concurrent_innodb_unsafelog.result b/mysql-test/r/concurrent_innodb_unsafelog.result index 35fc2d89cfe..4a140d9e610 100644 --- a/mysql-test/r/concurrent_innodb_unsafelog.result +++ b/mysql-test/r/concurrent_innodb_unsafelog.result @@ -1,4 +1,5 @@ SET GLOBAL TRANSACTION ISOLATION LEVEL REPEATABLE READ; +SET SQL_MODE=""; SELECT @@global.tx_isolation; @@global.tx_isolation REPEATABLE-READ @@ -786,3 +787,4 @@ eta tipo c ** connection default drop table t1; drop user mysqltest@localhost; +SET SQL_MODE=default; diff --git a/mysql-test/r/connect.result b/mysql-test/r/connect.result index 778219f6ed9..315aea0ef46 100644 --- a/mysql-test/r/connect.result +++ b/mysql-test/r/connect.result @@ -1,3 +1,4 @@ +SET global secure_auth=0; drop table if exists t1,t2; show tables; Tables_in_mysql @@ -143,6 +144,7 @@ drop table t1; # -- Bug#33507: Event scheduler creates more threads than max_connections # -- which results in user lockout. +CREATE USER mysqltest_u1@localhost; GRANT USAGE ON *.* TO mysqltest_u1@localhost; SET GLOBAL max_connections = 3; @@ -313,3 +315,4 @@ test test test drop procedure p1; +SET global secure_auth=default; diff --git a/mysql-test/r/create_drop_function.result b/mysql-test/r/create_drop_function.result index f358c24461a..e9db636ab87 100644 --- a/mysql-test/r/create_drop_function.result +++ b/mysql-test/r/create_drop_function.result @@ -4,7 +4,7 @@ RETURNS CHAR(100) RETURN CONCAT('Hello, ', str, '!'); SELECT * FROM mysql.proc WHERE name like 'f1'; db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8 -test f1 FUNCTION f1 SQL CONTAINS_SQL NO DEFINER str char(20) char(100) CHARSET latin1 RETURN CONCAT('Hello, ', str, '!') root@localhost 2014-09-30 08:00:00 2014-09-30 08:00:00 latin1 latin1_swedish_ci latin1_swedish_ci RETURN CONCAT('Hello, ', str, '!') +test f1 FUNCTION f1 SQL CONTAINS_SQL NO DEFINER str char(20) char(100) CHARSET latin1 RETURN CONCAT('Hello, ', str, '!') root@localhost 2014-09-30 08:00:00 2014-09-30 08:00:00 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION latin1 latin1_swedish_ci latin1_swedish_ci RETURN CONCAT('Hello, ', str, '!') SELECT f1('world'); f1('world') Hello, world! diff --git a/mysql-test/r/create_or_replace_permission.result b/mysql-test/r/create_or_replace_permission.result index d9c5a6f1d64..f662bf1bfd8 100644 --- a/mysql-test/r/create_or_replace_permission.result +++ b/mysql-test/r/create_or_replace_permission.result @@ -1,3 +1,5 @@ +set local sql_mode=""; +set global sql_mode=""; # # Tests for checking permission denied on CREATE OR REPLACE if DROP # access is revoked @@ -48,3 +50,4 @@ Warnings: Note 1008 Can't drop database 'db2'; database doesn't exist DROP DATABASE db1; DROP USER mysqltest_1@localhost; +set global sql_mode=default; diff --git a/mysql-test/r/ctype_latin2_ch.result b/mysql-test/r/ctype_latin2_ch.result index 6e73affeef6..da5c8076fca 100644 --- a/mysql-test/r/ctype_latin2_ch.result +++ b/mysql-test/r/ctype_latin2_ch.result @@ -333,6 +333,7 @@ Y z Z DROP TABLE t1; +set sql_mode=""; CREATE TABLE t1 ENGINE=INNODB AS SELECT repeat('a', 5) AS s1 LIMIT 0; INSERT INTO t1 VALUES ('x'),('y'),('z'),('X'),('Y'),('Z'); SELECT * FROM t1 GROUP BY s1; diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index ad08359bd9c..4da9e95a806 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -1184,7 +1184,9 @@ hex(a) 005B 803D drop table t1; +set sql_mode=""; create table t1(f1 varchar(5) CHARACTER SET ucs2 COLLATE ucs2_bin NOT NULL) engine=InnoDB; +set sql_mode=default; insert into t1 values('a'); create index t1f1 on t1(f1); select f1 from t1 where f1 like 'a%'; diff --git a/mysql-test/r/ctype_ujis.result b/mysql-test/r/ctype_ujis.result index 4deabb7513f..61541ec7678 100644 --- a/mysql-test/r/ctype_ujis.result +++ b/mysql-test/r/ctype_ujis.result @@ -126,6 +126,7 @@ Field Type Null Key Default Extra a char(1) NO b enum('¤¢','¤¤') YES NULL DROP TABLE t1; +set sql_mode=""; CREATE TABLE t1 ( a INTEGER NOT NULL, @@ -133,6 +134,7 @@ b VARCHAR(50) NOT NULL DEFAULT '', PRIMARY KEY (a), KEY b (b(10)) ) ENGINE=InnoDB CHARACTER SET 'ujis' COLLATE 'ujis_japanese_ci'; +set sql_mode=default; INSERT INTO t1 (a, b) VALUES (0, 'aaabbbcccddd'); INSERT INTO t1 (a, b) VALUES (1, 'eeefffggghhh'); INSERT INTO t1 (a, b) VALUES (2, 'iiijjjkkkl'); diff --git a/mysql-test/r/ctype_utf16.result b/mysql-test/r/ctype_utf16.result index 288aefaf7ce..bfcd65044d4 100644 --- a/mysql-test/r/ctype_utf16.result +++ b/mysql-test/r/ctype_utf16.result @@ -1549,7 +1549,7 @@ SELECT space(date_add(101, INTERVAL CHAR('1' USING utf16) hour_second)); space(date_add(101, INTERVAL CHAR('1' USING utf16) hour_second)) NULL Warnings: -Warning 1301 Result of space() was larger than max_allowed_packet (1048576) - truncated +Warning 1301 Result of space() was larger than max_allowed_packet (4194304) - truncated # # Bug#11750518 41090: ORDER BY TRUNCATES GROUP_CONCAT RESULT # diff --git a/mysql-test/r/ddl_i18n_koi8r.result b/mysql-test/r/ddl_i18n_koi8r.result index a57b1369d24..d81b6af0aeb 100644 --- a/mysql-test/r/ddl_i18n_koi8r.result +++ b/mysql-test/r/ddl_i18n_koi8r.result @@ -1,3 +1,4 @@ +set sql_mode=""; set names koi8r; ------------------------------------------------------------------- diff --git a/mysql-test/r/ddl_i18n_utf8.result b/mysql-test/r/ddl_i18n_utf8.result index 5409e58e774..5921a7f538d 100644 --- a/mysql-test/r/ddl_i18n_utf8.result +++ b/mysql-test/r/ddl_i18n_utf8.result @@ -1,3 +1,4 @@ +set sql_mode=""; set names utf8; ------------------------------------------------------------------- diff --git a/mysql-test/r/default.result b/mysql-test/r/default.result index 2ec961a4ce9..685b534b808 100644 --- a/mysql-test/r/default.result +++ b/mysql-test/r/default.result @@ -1,5 +1,6 @@ drop table if exists t1,t2,t3,t4,t5,t6; drop database if exists mysqltest; +set sql_mode=""; CREATE TABLE t1 (a varchar(30) binary NOT NULL DEFAULT ' ', b varchar(1) binary NOT NULL DEFAULT ' ', c varchar(4) binary NOT NULL DEFAULT '0000', @@ -29,6 +30,7 @@ z varchar(20) binary NOT NULL DEFAULT ' ', a1 varchar(30) binary NOT NULL DEFAULT ' ', b1 tinyblob NULL) ENGINE=InnoDB DEFAULT CHARACTER SET = latin1 COLLATE latin1_bin; +set sql_mode=default; INSERT into t1 (b) values ('1'); SHOW WARNINGS; Level Code Message diff --git a/mysql-test/r/delete_returning_grant.result b/mysql-test/r/delete_returning_grant.result index c15d3627a39..bdd171940ba 100644 --- a/mysql-test/r/delete_returning_grant.result +++ b/mysql-test/r/delete_returning_grant.result @@ -1,3 +1,5 @@ +set GLOBAL sql_mode=""; +set LOCAL sql_mode=""; CREATE TABLE t1 (a int(11), b varchar(32)); INSERT INTO t1 VALUES (7,'ggggggg'),(1,'a'),(3,'ccc'),(4,'dddd'),(1,'A'), (2,'BB'),(4,'DDDD'),(5,'EEEEE'),(7,'GGGGGGG'),(2,'bb'); @@ -67,3 +69,4 @@ DROP DATABASE mysqltest; DROP USER mysqltest_1@localhost; DROP VIEW v1; DROP TABLE t1; +set GLOBAL sql_mode=default; diff --git a/mysql-test/r/derived_view.result b/mysql-test/r/derived_view.result index fa0a69a487d..639942f0da9 100644 --- a/mysql-test/r/derived_view.result +++ b/mysql-test/r/derived_view.result @@ -2262,10 +2262,7 @@ CREATE TABLE IF NOT EXISTS `galleries` ( `year` int(11) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -Warnings: -Warning 1286 Unknown storage engine 'InnoDB' -Warning 1266 Using storage engine MyISAM for table 'galleries' +) DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `pictures` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(100) NOT NULL, @@ -2278,10 +2275,7 @@ CREATE TABLE IF NOT EXISTS `pictures` ( `type` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `gallery_id` (`gallery_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 ; -Warnings: -Warning 1286 Unknown storage engine 'InnoDB' -Warning 1266 Using storage engine MyISAM for table 'pictures' +) DEFAULT CHARSET=utf8 ; ALTER TABLE `pictures` ADD CONSTRAINT `pictures_ibfk_1` FOREIGN KEY (`gallery_id`) REFERENCES `galleries` (`id`); INSERT INTO `galleries` (`id`, `name`, `year`) VALUES diff --git a/mysql-test/r/enforce_storage_engine.result b/mysql-test/r/enforce_storage_engine.result index cef03cb6b87..4a0c3317765 100644 --- a/mysql-test/r/enforce_storage_engine.result +++ b/mysql-test/r/enforce_storage_engine.result @@ -1,3 +1,5 @@ +set local sql_mode=""; +set global sql_mode=""; drop table if exists t1; SET SESSION enforce_storage_engine=MyISAM; select @@session.enforce_storage_engine; @@ -117,5 +119,6 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`c1`) ) ENGINE=MEMORY DEFAULT CHARSET=latin1 DROP TABLE t1; +set global sql_mode=default; SET SESSION enforce_storage_engine=NULL; SET GLOBAL enforce_storage_engine=NULL; diff --git a/mysql-test/r/enforce_storage_engine_opt.result b/mysql-test/r/enforce_storage_engine_opt.result index a28461ef091..1b03aa281d9 100644 --- a/mysql-test/r/enforce_storage_engine_opt.result +++ b/mysql-test/r/enforce_storage_engine_opt.result @@ -1,3 +1,4 @@ +SET SQL_MODE=""; create table t1 (c1 int primary key auto_increment, c2 varchar(10)) engine=memory; Warnings: Note 1266 Using storage engine MyISAM for table 't1' diff --git a/mysql-test/r/events_1.result b/mysql-test/r/events_1.result index 5a64cf14ef5..78115497fc6 100644 --- a/mysql-test/r/events_1.result +++ b/mysql-test/r/events_1.result @@ -1,3 +1,4 @@ +set sql_mode=""; call mtr.add_suppression("Column count of mysql.event is wrong. Expected .*, found .*\. The table is probably corrupted"); drop database if exists events_test; drop database if exists db_x; diff --git a/mysql-test/r/events_2.result b/mysql-test/r/events_2.result index 3b7f3566cab..9a1f9d954e8 100644 --- a/mysql-test/r/events_2.result +++ b/mysql-test/r/events_2.result @@ -1,3 +1,4 @@ +set sql_mode=""; drop database if exists events_test; create database events_test; use events_test; diff --git a/mysql-test/r/events_bugs.result b/mysql-test/r/events_bugs.result index 7ce3c740cd4..3de6a6e48fc 100644 --- a/mysql-test/r/events_bugs.result +++ b/mysql-test/r/events_bugs.result @@ -1,3 +1,4 @@ +SET SQL_MODE=""; drop database if exists events_test; drop database if exists mysqltest_db1; drop database if exists mysqltest_db2; diff --git a/mysql-test/r/events_trans.result b/mysql-test/r/events_trans.result index 084587079ba..873f0441089 100644 --- a/mysql-test/r/events_trans.result +++ b/mysql-test/r/events_trans.result @@ -1,3 +1,4 @@ +set sql_mode=""; drop database if exists events_test; drop database if exists mysqltest_no_such_database; create database events_test; diff --git a/mysql-test/r/events_trans_notembedded.result b/mysql-test/r/events_trans_notembedded.result index 1e3dfffe232..fb68bc9ceab 100644 --- a/mysql-test/r/events_trans_notembedded.result +++ b/mysql-test/r/events_trans_notembedded.result @@ -2,6 +2,7 @@ drop database if exists events_test; drop database if exists mysqltest_db2; create database events_test; use events_test; +create user mysqltest_user1@localhost; grant create, insert, select, delete on mysqltest_db2.* to mysqltest_user1@localhost; create database mysqltest_db2; diff --git a/mysql-test/r/explain_json.result b/mysql-test/r/explain_json.result index f81a62ef23b..0507cee62b4 100644 --- a/mysql-test/r/explain_json.result +++ b/mysql-test/r/explain_json.result @@ -371,7 +371,7 @@ EXPLAIN "attached_condition": "(tbl2.b < 5)" }, "buffer_type": "flat", - "buffer_size": "128Kb", + "buffer_size": "256Kb", "join_type": "BNL", "attached_condition": "(tbl2.a = tbl1.a)" } @@ -638,7 +638,7 @@ EXPLAIN "filtered": 100 }, "buffer_type": "flat", - "buffer_size": "128Kb", + "buffer_size": "256Kb", "join_type": "BNL" } } @@ -672,7 +672,7 @@ EXPLAIN "first_match": "t2" }, "buffer_type": "flat", - "buffer_size": "128Kb", + "buffer_size": "256Kb", "join_type": "BNL", "attached_condition": "((t1.b = t2.b) and (t1.a = t2.a))" } @@ -709,7 +709,7 @@ EXPLAIN "filtered": 100 }, "buffer_type": "flat", - "buffer_size": "128Kb", + "buffer_size": "256Kb", "join_type": "BNL", "attached_condition": "((t1.b = t2.b) and (t1.a = t2.a))" } @@ -822,7 +822,7 @@ EXPLAIN "filtered": 100 }, "buffer_type": "flat", - "buffer_size": "128Kb", + "buffer_size": "256Kb", "join_type": "BNL", "attached_condition": "((t2.b <> outer_t1.a) and trigcond(((<cache>(outer_t1.a) = t1.a) or isnull(t1.a))))" } @@ -873,7 +873,7 @@ EXPLAIN "filtered": 100 }, "buffer_type": "flat", - "buffer_size": "128Kb", + "buffer_size": "256Kb", "join_type": "BNL", "attached_condition": "(tbl2.b = tbl1.b)" } diff --git a/mysql-test/r/features.result b/mysql-test/r/features.result index 04e0df98ec7..52650d118b3 100644 --- a/mysql-test/r/features.result +++ b/mysql-test/r/features.result @@ -1,4 +1,5 @@ drop table if exists t1; +set sql_mode=""; flush status; show status like "feature%"; Variable_name Value diff --git a/mysql-test/r/fix_priv_tables.result b/mysql-test/r/fix_priv_tables.result index e54330a5520..dea1ccdbd18 100644 --- a/mysql-test/r/fix_priv_tables.result +++ b/mysql-test/r/fix_priv_tables.result @@ -1,4 +1,5 @@ drop table if exists t1,t1aa,t2aa; +set sql_mode=""; DROP DATABASE IF EXISTS testdb; CREATE DATABASE testdb; CREATE TABLE testdb.t1 ( diff --git a/mysql-test/r/flush-innodb-notembedded.result b/mysql-test/r/flush-innodb-notembedded.result index 817d57d9d79..911abfe6daf 100644 --- a/mysql-test/r/flush-innodb-notembedded.result +++ b/mysql-test/r/flush-innodb-notembedded.result @@ -1,3 +1,4 @@ +set sql_mode=""; # Test 7: Check privileges required. # CREATE DATABASE db1; diff --git a/mysql-test/r/flush_read_lock.result b/mysql-test/r/flush_read_lock.result index c2e8531d01f..260edf8e51d 100644 --- a/mysql-test/r/flush_read_lock.result +++ b/mysql-test/r/flush_read_lock.result @@ -1,3 +1,5 @@ +set global sql_mode=""; +set local sql_mode=""; # FTWRL takes two global metadata locks -- a global shared # metadata lock and the commit blocker lock. # The first lock prevents DDL from taking place. @@ -1667,3 +1669,4 @@ drop database `#mysql50#mysqltest-2`; drop database mysqltest1; drop temporary tables t1_temp, t2_temp; drop tables t1_base, t2_base, t3_trans; +set global sql_mode=default; diff --git a/mysql-test/r/func_compress.result b/mysql-test/r/func_compress.result index 9fde006b377..4763d878cc6 100644 --- a/mysql-test/r/func_compress.result +++ b/mysql-test/r/func_compress.result @@ -1,3 +1,4 @@ +set global max_allowed_packet=1048576; select @test_compress_string:='string for test compress function aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa '; @test_compress_string:='string for test compress function aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ' string for test compress function aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa @@ -152,6 +153,7 @@ UNCOMPRESS(CAST(0 AS BINARY(5))) NULL Warnings: Warning 1259 ZLIB: Input data corrupted +set global max_allowed_packet=default; # # End of 5.5 tests # diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result index 62814b45675..73e486972ab 100644 --- a/mysql-test/r/func_math.result +++ b/mysql-test/r/func_math.result @@ -214,7 +214,9 @@ CAST(RAND(2) * 1000 AS UNSIGNED) CAST(RAND(?) * 1000 AS UNSIGNED) 122 122 645 645 DROP TABLE t1; +set sql_mode=""; create table t1 (a varchar(90), ts datetime not null, index (a)) engine=innodb default charset=utf8; +set sql_mode=default; insert into t1 values ('http://www.foo.com/', now()); select a from t1 where a='http://www.foo.com/' order by abs(timediff(ts, 0)); a diff --git a/mysql-test/r/func_misc.result b/mysql-test/r/func_misc.result index 62138819b0a..a9548aa70e9 100644 --- a/mysql-test/r/func_misc.result +++ b/mysql-test/r/func_misc.result @@ -334,10 +334,7 @@ CREATE TABLE t1 (a char(2) not null ); INSERT INTO t1 VALUES (4),(7),(1); set @optimizer_switch_save= @@optimizer_switch; set optimizer_switch='materialization=off'; -CREATE TABLE tv (e char(2) not null ) engine=mysql; -Warnings: -Warning 1286 Unknown storage engine 'mysql' -Warning 1266 Using storage engine MyISAM for table 'tv' +CREATE TABLE tv (e char(2) not null ); INSERT INTO tv VALUES (1); CREATE ALGORITHM=MERGE VIEW v_merge AS SELECT * FROM tv; CREATE ALGORITHM=MERGE VIEW vm AS SELECT * FROM tv; diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index aa3de4fc915..3ebb5f2d3eb 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -1,4 +1,5 @@ drop table if exists t1,t2; +set global max_allowed_packet=1048576; set names latin1; select 'hello',"'hello'",'""hello""','''h''e''l''l''o''',"hel""lo",'hel\'lo'; hello 'hello' ""hello"" 'h'e'l'l'o' hel"lo hel'lo @@ -4530,6 +4531,7 @@ SET NAMES latin2; EXECUTE stmt; COLLATION(space(2)) latin2_general_ci +set global max_allowed_packet=default; # # End of 5.6 tests # diff --git a/mysql-test/r/func_weight_string.result b/mysql-test/r/func_weight_string.result index 91ca9f68076..f28e5451af5 100644 --- a/mysql-test/r/func_weight_string.result +++ b/mysql-test/r/func_weight_string.result @@ -1,4 +1,5 @@ drop table if exists t1; +set global max_allowed_packet=1048576; set names latin1; select hex(weight_string(0x010203)); hex(weight_string(0x010203)) @@ -90,3 +91,4 @@ NULL Warnings: Warning 1301 Result of cast_as_binary() was larger than max_allowed_packet (1048576) - truncated Warning 1301 Result of weight_string() was larger than max_allowed_packet (1048576) - truncated +set global max_allowed_packet=default; diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index 2d451de1302..0d8f30d125f 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -809,7 +809,7 @@ drop procedure if exists fn3; create function fn3 () returns point deterministic return GeomFromText("point(1 1)"); show create function fn3; Function sql_mode Create Function character_set_client collation_connection Database Collation -fn3 CREATE DEFINER=`root`@`localhost` FUNCTION `fn3`() RETURNS point +fn3 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `fn3`() RETURNS point DETERMINISTIC return GeomFromText("point(1 1)") latin1 latin1_swedish_ci latin1_swedish_ci select astext(fn3()); diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index 499251ec3fc..3020c7deba7 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -1,3 +1,5 @@ +set GLOBAL sql_mode=""; +set LOCAL sql_mode=""; SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators; SET GLOBAL log_bin_trust_function_creators = 1; drop table if exists t1; @@ -2580,3 +2582,4 @@ Grants for mysqltest_u1@% GRANT USAGE ON *.* TO 'mysqltest_u1'@'%' drop database mysqltest_db1; drop user mysqltest_u1; +set GLOBAL sql_mode=default; diff --git a/mysql-test/r/grant2.result b/mysql-test/r/grant2.result index a1cee5741e4..bd14f21010b 100644 --- a/mysql-test/r/grant2.result +++ b/mysql-test/r/grant2.result @@ -1,3 +1,5 @@ +set GLOBAL sql_mode=""; +set LOCAL sql_mode=""; SET NAMES binary; drop database if exists mysqltest; drop database if exists mysqltest_1; @@ -845,3 +847,4 @@ DROP USER mysqltest_u2@localhost; DROP USER mysqltest_u3@localhost; DROP USER mysqltest_u4@localhost; DROP USER mysqltest_u5@localhost; +set GLOBAL sql_mode=default; diff --git a/mysql-test/r/grant3.result b/mysql-test/r/grant3.result index fd51a83d4b2..d1722fc8ea9 100644 --- a/mysql-test/r/grant3.result +++ b/mysql-test/r/grant3.result @@ -1,3 +1,5 @@ +set global sql_mode=""; +set local sql_mode=""; SET NAMES binary; drop table if exists t1; delete from mysql.user where user like 'mysqltest\_%'; @@ -177,4 +179,5 @@ SELECT b FROM temp.t1; ERROR 42000: SELECT command denied to user 'user2'@'localhost' for column 'b' in table 't1' DROP USER 'user2'@'%'; DROP DATABASE temp; +set global sql_mode=default; End of 5.0 tests diff --git a/mysql-test/r/grant4.result b/mysql-test/r/grant4.result index d96802d105c..5a0032cd338 100644 --- a/mysql-test/r/grant4.result +++ b/mysql-test/r/grant4.result @@ -1,4 +1,6 @@ drop database if exists mysqltest_db1; +set GLOBAL sql_mode=""; +set LOCAL sql_mode=""; create database mysqltest_db1; use mysqltest_db1; create table t_column_priv_only (a int, b int); @@ -212,3 +214,4 @@ create user foo3 identified via mysql_old_password using '00'; ERROR HY000: Password hash should be a 16-digit hexadecimal number create user foo4 identified via mysql_old_password using '11111111111111111111111111111111111111111'; ERROR HY000: Password hash should be a 16-digit hexadecimal number +set GLOBAL sql_mode=default; diff --git a/mysql-test/r/grant_4332.result b/mysql-test/r/grant_4332.result index 5a475bed6d8..93c0a24d164 100644 --- a/mysql-test/r/grant_4332.result +++ b/mysql-test/r/grant_4332.result @@ -1,3 +1,5 @@ +set GLOBAL sql_mode=""; +set LOCAL sql_mode=""; alter table mysql.user modify User char(16) binary not null default ''; alter table mysql.db modify User char(16) binary not null default ''; alter table mysql.tables_priv modify User char(16) binary not null default ''; @@ -30,3 +32,4 @@ Catalog Database Table Table_alias Column Column_alias Type Length Max length Is def user() 253 141 14 N 1 31 8 user() root@localhost +set GLOBAL sql_mode=default; diff --git a/mysql-test/r/grant_cache_no_prot.result b/mysql-test/r/grant_cache_no_prot.result index 777eb10cda6..34abd96f026 100644 --- a/mysql-test/r/grant_cache_no_prot.result +++ b/mysql-test/r/grant_cache_no_prot.result @@ -1,5 +1,9 @@ +set GLOBAL sql_mode=""; +set LOCAL sql_mode=""; drop table if exists test.t1,mysqltest.t1,mysqltest.t2; drop database if exists mysqltest; +set GLOBAL query_cache_type=ON; +set LOCAL query_cache_type=ON; set GLOBAL query_cache_size=1355776; reset query cache; flush status; @@ -219,3 +223,7 @@ flush privileges; drop table test.t1,mysqltest.t1,mysqltest.t2; drop database mysqltest; set GLOBAL query_cache_size=default; +set GLOBAL query_cache_type=ON; +set LOCAL query_cache_type=ON; +set GLOBAL sql_mode=default; +set GLOBAL query_cache_type=default; diff --git a/mysql-test/r/grant_cache_ps_prot.result b/mysql-test/r/grant_cache_ps_prot.result index b504dc4be35..5fe57c7c35d 100644 --- a/mysql-test/r/grant_cache_ps_prot.result +++ b/mysql-test/r/grant_cache_ps_prot.result @@ -1,5 +1,9 @@ +set GLOBAL sql_mode=""; +set LOCAL sql_mode=""; drop table if exists test.t1,mysqltest.t1,mysqltest.t2; drop database if exists mysqltest; +set GLOBAL query_cache_type=ON; +set LOCAL query_cache_type=ON; set GLOBAL query_cache_size=1355776; reset query cache; flush status; @@ -219,3 +223,7 @@ flush privileges; drop table test.t1,mysqltest.t1,mysqltest.t2; drop database mysqltest; set GLOBAL query_cache_size=default; +set GLOBAL query_cache_type=ON; +set LOCAL query_cache_type=ON; +set GLOBAL sql_mode=default; +set GLOBAL query_cache_type=default; diff --git a/mysql-test/r/grant_explain_non_select.result b/mysql-test/r/grant_explain_non_select.result index 8bce20f7a95..1dbb5b1e3c0 100644 --- a/mysql-test/r/grant_explain_non_select.result +++ b/mysql-test/r/grant_explain_non_select.result @@ -1,3 +1,5 @@ +set GLOBAL sql_mode=""; +set LOCAL sql_mode=""; CREATE DATABASE privtest_db; CREATE TABLE privtest_db.t1 (a INT); CREATE TABLE privtest_db.t2 (a INT); @@ -176,3 +178,5 @@ DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a; DROP USER 'privtest'@localhost; USE test; DROP DATABASE privtest_db; +set GLOBAL sql_mode=default; +set LOCAL sql_mode=default; diff --git a/mysql-test/r/grant_lowercase.result b/mysql-test/r/grant_lowercase.result index e2d50724cec..b449453a47a 100644 --- a/mysql-test/r/grant_lowercase.result +++ b/mysql-test/r/grant_lowercase.result @@ -1,3 +1,4 @@ +set sql_mode=""; grant file on *.* to user1@localhost with grant option; grant select on `a%`.* to user1@localhost with grant option; grant file on aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.* to 'user'@'%' identified by 'secret'; diff --git a/mysql-test/r/help.result b/mysql-test/r/help.result index 16719cc8193..3a266567175 100644 --- a/mysql-test/r/help.result +++ b/mysql-test/r/help.result @@ -148,10 +148,12 @@ help 'impossible_category_1'; source_category_name name is_it_category impossible_category_1 impossible_function_1 N impossible_category_1 impossible_function_2 N +set sql_mode=""; alter table mysql.help_relation engine=innodb; alter table mysql.help_keyword engine=innodb; alter table mysql.help_topic engine=innodb; alter table mysql.help_category engine=innodb; +set sql_mode=default; help 'function_of_my_dream'; name is_it_category help '%possible_f%'; diff --git a/mysql-test/r/host_cache_size_functionality.result b/mysql-test/r/host_cache_size_functionality.result index e7f9e09fd2f..069cf61bcad 100644 --- a/mysql-test/r/host_cache_size_functionality.result +++ b/mysql-test/r/host_cache_size_functionality.result @@ -6,7 +6,7 @@ echo '##' #################################################################### SELECT COUNT(@@GLOBAL.Host_Cache_Size) 1 Expected -set @Default_host_cache_size=128; +set @Default_host_cache_size=279; select @@global.Host_Cache_Size=@Default_host_cache_size; @@global.Host_Cache_Size=@Default_host_cache_size 1 diff --git a/mysql-test/r/implicit_commit.result b/mysql-test/r/implicit_commit.result index d568d05e7b7..07536ab0719 100644 --- a/mysql-test/r/implicit_commit.result +++ b/mysql-test/r/implicit_commit.result @@ -1,3 +1,4 @@ +SET SQL_MODE=""; SET GLOBAL EVENT_SCHEDULER = OFF; SET BINLOG_FORMAT = STATEMENT; CREATE DATABASE db1; diff --git a/mysql-test/r/index_intersect.result b/mysql-test/r/index_intersect.result index 1337c3fac2d..7a0633d4dc8 100644 --- a/mysql-test/r/index_intersect.result +++ b/mysql-test/r/index_intersect.result @@ -1013,10 +1013,7 @@ f4 varchar(32), f5 int, PRIMARY KEY (f1), KEY (f4) -) ENGINE=InnoDB; -Warnings: -Warning 1286 Unknown storage engine 'InnoDB' -Warning 1266 Using storage engine MyISAM for table 't1' +); INSERT INTO t1 VALUES (5,'H',1), (9,'g',0), (527,'i',0), (528,'y',1), (529,'S',6), (530,'m',7), (531,'b',2), (532,'N',1), (533,'V',NULL), (534,'l',1), diff --git a/mysql-test/r/index_intersect_innodb.result b/mysql-test/r/index_intersect_innodb.result index 33f2247e5d1..9c3a501111d 100644 --- a/mysql-test/r/index_intersect_innodb.result +++ b/mysql-test/r/index_intersect_innodb.result @@ -1014,7 +1014,7 @@ f4 varchar(32), f5 int, PRIMARY KEY (f1), KEY (f4) -) ENGINE=InnoDB; +); INSERT INTO t1 VALUES (5,'H',1), (9,'g',0), (527,'i',0), (528,'y',1), (529,'S',6), (530,'m',7), (531,'b',2), (532,'N',1), (533,'V',NULL), (534,'l',1), diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result index 8525cbf9b12..fa5280df2b4 100644 --- a/mysql-test/r/information_schema.result +++ b/mysql-test/r/information_schema.result @@ -1,3 +1,5 @@ +set global sql_mode=""; +set local sql_mode=""; DROP TABLE IF EXISTS t0,t1,t2,t3,t4,t5; DROP VIEW IF EXISTS v1; show variables where variable_name like "skip_show_database"; @@ -2066,3 +2068,4 @@ Variable_name Value Opened_tables 3 drop database mysqltest; drop database db1; +set global sql_mode=default; diff --git a/mysql-test/r/information_schema_db.result b/mysql-test/r/information_schema_db.result index 81a17e7ed3b..c09e04f786a 100644 --- a/mysql-test/r/information_schema_db.result +++ b/mysql-test/r/information_schema_db.result @@ -1,3 +1,5 @@ +set local sql_mode=""; +set global sql_mode=""; drop table if exists t1,t2; drop view if exists v1,v2; drop function if exists f1; @@ -216,3 +218,4 @@ show create view testdb_1.v1; ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 'v1' drop user mysqltest_1@localhost; drop database testdb_1; +set global sql_mode=default; diff --git a/mysql-test/r/information_schema_routines.result b/mysql-test/r/information_schema_routines.result index b8f4fb9b1ef..65e352e3af3 100644 --- a/mysql-test/r/information_schema_routines.result +++ b/mysql-test/r/information_schema_routines.result @@ -1,3 +1,5 @@ +set sql_mode=""; +set sql_mode=""; # ========== routines.1 ========== USE INFORMATION_SCHEMA; SHOW CREATE TABLE INFORMATION_SCHEMA.ROUTINES; diff --git a/mysql-test/r/innodb_icp.result b/mysql-test/r/innodb_icp.result index cff78e76664..bc1c24276ed 100644 --- a/mysql-test/r/innodb_icp.result +++ b/mysql-test/r/innodb_icp.result @@ -416,11 +416,11 @@ DROP TABLE t1; # Bug#59259 "Incorrect rows returned for a correlated subquery # when ICP is on" # -CREATE TABLE t1 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL) ENGINE=InnoDB; +CREATE TABLE t1 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL); INSERT INTO t1 VALUES (11,0); INSERT INTO t1 VALUES (12,5); INSERT INTO t1 VALUES (15,0); -CREATE TABLE t2 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL) ENGINE=InnoDB; +CREATE TABLE t2 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL); INSERT INTO t2 VALUES (11,1); INSERT INTO t2 VALUES (12,2); INSERT INTO t2 VALUES (15,4); diff --git a/mysql-test/r/insert_notembedded.result b/mysql-test/r/insert_notembedded.result index ba3e2221922..41e31508fe0 100644 --- a/mysql-test/r/insert_notembedded.result +++ b/mysql-test/r/insert_notembedded.result @@ -1,3 +1,5 @@ +set local sql_mode=""; +set global sql_mode=""; drop table if exists t1; create table t1 (n int); create view v1 as select * from t1; @@ -125,3 +127,5 @@ a b unlock tables; drop table t1; set low_priority_updates=default; +set local sql_mode=default; +set global sql_mode=default; diff --git a/mysql-test/r/join_cache.result b/mysql-test/r/join_cache.result index 68ea89949b2..90d305fb384 100644 --- a/mysql-test/r/join_cache.result +++ b/mysql-test/r/join_cache.result @@ -39,7 +39,7 @@ COUNT(*) 984 show variables like 'join_buffer_size'; Variable_name Value -join_buffer_size 131072 +join_buffer_size 262144 set join_cache_level=1; show variables like 'join_cache_level'; Variable_name Value @@ -774,7 +774,7 @@ set join_cache_level=default; set join_buffer_size=default; show variables like 'join_buffer_size'; Variable_name Value -join_buffer_size 131072 +join_buffer_size 262144 show variables like 'join_cache_level'; Variable_name Value join_cache_level 2 @@ -808,7 +808,7 @@ INDEX (Percentage) ); show variables like 'join_buffer_size'; Variable_name Value -join_buffer_size 131072 +join_buffer_size 262144 set join_cache_level=3; show variables like 'join_cache_level'; Variable_name Value @@ -1008,7 +1008,7 @@ Russian Federation NULL Vietnam NULL show variables like 'join_buffer_size'; Variable_name Value -join_buffer_size 131072 +join_buffer_size 262144 set join_cache_level=4; show variables like 'join_cache_level'; Variable_name Value @@ -1267,7 +1267,7 @@ Czech Republic 10278100 NULL NULL DROP INDEX City_Name ON City; show variables like 'join_buffer_size'; Variable_name Value -join_buffer_size 131072 +join_buffer_size 262144 set join_cache_level=5; show variables like 'join_cache_level'; Variable_name Value @@ -2688,7 +2688,7 @@ set join_cache_level=default; set join_buffer_size=default; show variables like 'join_buffer_size'; Variable_name Value -join_buffer_size 131072 +join_buffer_size 262144 show variables like 'join_cache_level'; Variable_name Value join_cache_level 2 @@ -5918,7 +5918,7 @@ select @@join_buffer_space_limit; 8192 select @@join_buffer_size; @@join_buffer_size -131072 +262144 explain select count(*) from t1, t1 t2 where t1.a=t2.a; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 11 diff --git a/mysql-test/r/kill.result b/mysql-test/r/kill.result index 091fdfbcc3c..d40c4ee758c 100644 --- a/mysql-test/r/kill.result +++ b/mysql-test/r/kill.result @@ -1,3 +1,5 @@ +set local sql_mode=""; +set global sql_mode=""; SET DEBUG_SYNC = 'RESET'; DROP TABLE IF EXISTS t1, t2, t3; DROP FUNCTION IF EXISTS MY_KILL; @@ -322,3 +324,4 @@ SLEEP(1000) DROP USER u1@localhost; SET DEBUG_SYNC = 'RESET'; DROP FUNCTION MY_KILL; +set global sql_mode=default; diff --git a/mysql-test/r/lock_multi.result b/mysql-test/r/lock_multi.result index f9e4a88fe95..12960a4f5f6 100644 --- a/mysql-test/r/lock_multi.result +++ b/mysql-test/r/lock_multi.result @@ -115,7 +115,9 @@ ERROR HY000: Can't execute the query because you have a conflicting read lock UNLOCK TABLES; DROP DATABASE mysqltest_1; ERROR HY000: Can't drop database 'mysqltest_1'; database doesn't exist +set sql_mode=""; create table t1 (f1 int(12) unsigned not null auto_increment, primary key(f1)) engine=innodb; +set sql_mode=default; lock tables t1 write; alter table t1 auto_increment=0; alter table t1 auto_increment=0; diff --git a/mysql-test/r/log_tables.result b/mysql-test/r/log_tables.result index dd2beb87974..ff5055e1ae4 100644 --- a/mysql-test/r/log_tables.result +++ b/mysql-test/r/log_tables.result @@ -1,3 +1,4 @@ +SET SQL_MODE=""; SET @old_general_log_state = @@global.general_log; SET @old_log_output= @@global.log_output; SET @old_slow_query_log= @@global.slow_query_log; diff --git a/mysql-test/r/lowercase_fs_off.result b/mysql-test/r/lowercase_fs_off.result index 9b819cf3843..4c4cdb76615 100644 --- a/mysql-test/r/lowercase_fs_off.result +++ b/mysql-test/r/lowercase_fs_off.result @@ -1,3 +1,5 @@ +set GLOBAL sql_mode=""; +set LOCAL sql_mode=""; create database d1; grant all on d1.* to 'sample'@'localhost' identified by 'password'; flush privileges; @@ -63,3 +65,4 @@ CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET new.a= 1; RENAME TABLE t1 TO T1; ALTER TABLE T1 RENAME t1; DROP TABLE t1; +set GLOBAL sql_mode=default; diff --git a/mysql-test/r/lowercase_table_grant.result b/mysql-test/r/lowercase_table_grant.result index afb54f8c472..009965c0c8e 100644 --- a/mysql-test/r/lowercase_table_grant.result +++ b/mysql-test/r/lowercase_table_grant.result @@ -1,4 +1,5 @@ use mysql; +set sql_mode=""; create database MYSQLtest; grant all on MySQLtest.* to mysqltest_1@localhost; show grants for mysqltest_1@localhost; diff --git a/mysql-test/r/lowercase_table_qcache.result b/mysql-test/r/lowercase_table_qcache.result index f8d34e0f592..9d7e1007e4c 100644 --- a/mysql-test/r/lowercase_table_qcache.result +++ b/mysql-test/r/lowercase_table_qcache.result @@ -1,4 +1,6 @@ set GLOBAL query_cache_size=1355776; +set GLOBAL query_cache_type=ON; +set LOCAL query_cache_type=ON; drop database if exists MySQLtesT; create database MySQLtesT; create table MySQLtesT.t1 (a int); @@ -21,4 +23,5 @@ select * from MySQL.db; show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 0 -set GLOBAL query_cache_size=0; +set GLOBAL query_cache_size=default; +set GLOBAL query_cache_type=default; diff --git a/mysql-test/r/max_statement_time.result b/mysql-test/r/max_statement_time.result index 1ad2de7f7e3..44ee03b813a 100644 --- a/mysql-test/r/max_statement_time.result +++ b/mysql-test/r/max_statement_time.result @@ -52,6 +52,7 @@ DROP TABLE t1; # MAX_STATEMENT_TIME account resource +set statement sql_mode="" for GRANT USAGE ON *.* TO user1@localhost WITH MAX_STATEMENT_TIME 1.005; # con1 SELECT @@max_statement_time; diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result index 89aaf48219e..804313af701 100644 --- a/mysql-test/r/merge.result +++ b/mysql-test/r/merge.result @@ -2270,7 +2270,7 @@ CREATE TABLE t3(a int) ENGINE = MERGE UNION(t1, t2); CREATE TRIGGER tr1 AFTER INSERT ON t3 FOR EACH ROW CALL foo(); SHOW CREATE TRIGGER tr1; Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -tr1 CREATE DEFINER=`root`@`localhost` TRIGGER tr1 AFTER INSERT ON t3 FOR EACH ROW CALL foo() latin1 latin1_swedish_ci latin1_swedish_ci +tr1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER tr1 AFTER INSERT ON t3 FOR EACH ROW CALL foo() latin1 latin1_swedish_ci latin1_swedish_ci DROP TRIGGER tr1; DROP TABLE t1, t2, t3; # @@ -2545,11 +2545,14 @@ DROP TABLE t1; # Test merge table with too many merge children. # drop table if exists t_parent; -set @save_table_definition_cache=@@global.table_definition_cache; +set @save_table_open_cache=@@global.table_open_cache; # -# Set @@global.table_definition_cache to minimum +# Set @@global.table_open_cache to minimum # -set @@global.table_definition_cache=400; +set @@global.table_open_cache=400; +select @@table_open_cache; +@@table_open_cache +400 set @a=null; # # Create 400 merge children @@ -2573,7 +2576,7 @@ deallocate prepare stmt; # Cleanup # drop table t_parent; -set @@global.table_definition_cache=@save_table_definition_cache; +set @@global.table_open_cache=@save_table_open_cache; DROP DATABASE IF EXISTS mysql_test1; CREATE DATABASE mysql_test1; CREATE TABLE t1 ... DATA DIRECTORY=... INDEX DIRECTORY=... diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result index 688184f2f83..b0265119eef 100644 --- a/mysql-test/r/multi_update.result +++ b/mysql-test/r/multi_update.result @@ -422,6 +422,7 @@ create database mysqltest; create table mysqltest.t1 (a int, b int, primary key (a)); create table mysqltest.t2 (a int, b int, primary key (a)); create table mysqltest.t3 (a int, b int, primary key (a)); +create user mysqltest_1@localhost; grant select on mysqltest.* to mysqltest_1@localhost; grant update on mysqltest.t1 to mysqltest_1@localhost; update t1, t2 set t1.b=1 where t1.a=t2.a; diff --git a/mysql-test/r/myisam_explain_non_select_all.result b/mysql-test/r/myisam_explain_non_select_all.result index 688c1ccfec1..fc0f54286a1 100644 --- a/mysql-test/r/myisam_explain_non_select_all.result +++ b/mysql-test/r/myisam_explain_non_select_all.result @@ -2785,10 +2785,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 DROP TABLE t1,t2; #74 -CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB; -Warnings: -Warning 1286 Unknown storage engine 'InnoDB' -Warning 1266 Using storage engine MyISAM for table 't1' +CREATE TABLE t1(a INT PRIMARY KEY); INSERT INTO t1 VALUES (1), (2), (3), (4), (5); # used key is modified & Using temporary # diff --git a/mysql-test/r/myisam_icp.result b/mysql-test/r/myisam_icp.result index 2792d75abb2..e726a50d89b 100644 --- a/mysql-test/r/myisam_icp.result +++ b/mysql-test/r/myisam_icp.result @@ -414,17 +414,11 @@ DROP TABLE t1; # Bug#59259 "Incorrect rows returned for a correlated subquery # when ICP is on" # -CREATE TABLE t1 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL) ENGINE=InnoDB; -Warnings: -Warning 1286 Unknown storage engine 'InnoDB' -Warning 1266 Using storage engine MyISAM for table 't1' +CREATE TABLE t1 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL); INSERT INTO t1 VALUES (11,0); INSERT INTO t1 VALUES (12,5); INSERT INTO t1 VALUES (15,0); -CREATE TABLE t2 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL) ENGINE=InnoDB; -Warnings: -Warning 1286 Unknown storage engine 'InnoDB' -Warning 1266 Using storage engine MyISAM for table 't2' +CREATE TABLE t2 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL); INSERT INTO t2 VALUES (11,1); INSERT INTO t2 VALUES (12,2); INSERT INTO t2 VALUES (15,4); diff --git a/mysql-test/r/mysql.result b/mysql-test/r/mysql.result index 82d69557f0d..ca19d2eb98b 100644 --- a/mysql-test/r/mysql.result +++ b/mysql-test/r/mysql.result @@ -1,3 +1,5 @@ +set GLOBAL sql_mode=""; +set LOCAL sql_mode=""; drop table if exists t1,t2,t3; create table t1(a int); insert into t1 values(1); @@ -531,5 +533,6 @@ a ERROR 1300 (HY000): Invalid utf8 character string: 'test\xF0\x9F\x98\x81 ' ERROR 1300 (HY000): Invalid binary character string: 'test\xF0\x9F\x98\x81 ' ERROR 1300 (HY000) at line 2: Invalid utf8 character string: 'test\xF0\x9F\x98\x81' +set GLOBAL sql_mode=default; End of tests diff --git a/mysql-test/r/mysql_comments.result b/mysql-test/r/mysql_comments.result index 7f1c0b50c5e..4865c7a7af0 100644 --- a/mysql-test/r/mysql_comments.result +++ b/mysql-test/r/mysql_comments.result @@ -1,3 +1,4 @@ +set global sql_mode=""; drop table if exists t1; drop function if exists foofct; drop procedure if exists empty; @@ -59,4 +60,5 @@ Trigger sql_mode SQL Original Statement character_set_client collation_connectio t1_bi CREATE DEFINER=`root`@`localhost` trigger t1_bi before insert on t1\nfor each row\nbegin\n# comment 1a\n-- comment 1b\n/*\n comment 1c\n*/\n -- declare some variables here\n declare b int;\n declare c float;\n\n -- do more stuff here\n -- commented nicely and so on\n\n -- famous last words ...\n set NEW.data := 12;\nend latin1 latin1_swedish_ci latin1_swedish_ci id data trig 12 +set global sql_mode=default; End of 5.0 tests diff --git a/mysql-test/r/mysql_upgrade.result b/mysql-test/r/mysql_upgrade.result index 737f8b63783..c34707383b0 100644 --- a/mysql-test/r/mysql_upgrade.result +++ b/mysql-test/r/mysql_upgrade.result @@ -1,3 +1,4 @@ +set sql_mode=""; Run mysql_upgrade once Phase 1/6: Checking and upgrading mysql database Processing databases @@ -457,4 +458,5 @@ even_longer_user_name_number_3_to_test_the_grantor_and_definer_field_length@loca even_longer_user_name_number_3_to_test_the_grantor_and_definer_field_length@localhost DROP USER very_long_user_name_number_1, very_long_user_name_number_2, even_longer_user_name_number_3_to_test_the_grantor_and_definer_field_length@localhost; DROP PROCEDURE test.pr; +set sql_mode=default; End of tests diff --git a/mysql-test/r/mysqlbinlog-innodb.result b/mysql-test/r/mysqlbinlog-innodb.result index f0358928c0e..2704be9e3ed 100644 --- a/mysql-test/r/mysqlbinlog-innodb.result +++ b/mysql-test/r/mysqlbinlog-innodb.result @@ -30,7 +30,7 @@ use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; -SET @@session.sql_mode=0/*!*/; +SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; @@ -61,7 +61,7 @@ use `foo`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; -SET @@session.sql_mode=0/*!*/; +SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result index b29fe0b9ec7..94aaee0c574 100644 --- a/mysql-test/r/mysqlbinlog.result +++ b/mysql-test/r/mysqlbinlog.result @@ -23,7 +23,7 @@ use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; -SET @@session.sql_mode=0/*!*/; +SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; @@ -103,7 +103,7 @@ use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; -SET @@session.sql_mode=0/*!*/; +SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; @@ -139,7 +139,7 @@ BEGIN SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; -SET @@session.sql_mode=0/*!*/; +SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; @@ -190,7 +190,7 @@ use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; -SET @@session.sql_mode=0/*!*/; +SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; @@ -217,7 +217,7 @@ use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; -SET @@session.sql_mode=0/*!*/; +SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; @@ -297,7 +297,7 @@ use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; -SET @@session.sql_mode=0/*!*/; +SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; @@ -333,7 +333,7 @@ BEGIN SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; -SET @@session.sql_mode=0/*!*/; +SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; @@ -384,7 +384,7 @@ use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; -SET @@session.sql_mode=0/*!*/; +SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; @@ -493,7 +493,7 @@ use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; -SET @@session.sql_mode=0/*!*/; +SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; @@ -545,7 +545,7 @@ use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; -SET @@session.sql_mode=0/*!*/; +SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; diff --git a/mysql-test/r/mysqld--help.result b/mysql-test/r/mysqld--help.result index 20f8eac7f8f..0c92b7785f1 100644 --- a/mysql-test/r/mysqld--help.result +++ b/mysql-test/r/mysqld--help.result @@ -21,9 +21,10 @@ The following options may be given as the first argument: --automatic-sp-privileges Creating and dropping stored procedures alters ACLs (Defaults to on; use --skip-automatic-sp-privileges to disable.) - --back-log=# The number of outstanding connection requests MySQL can + --back-log=# The number of outstanding connection requests MariaDB can have. This comes into play when the main MySQL thread gets very many connection requests in a very short time + (Automatically configured unless set explicitly) -b, --basedir=name Path to installation directory. All paths are usually resolved relative to this --big-tables Allow big result sets by saving all temporary sets on @@ -265,6 +266,7 @@ The following options may be given as the first argument: height-balanced, DOUBLE_PREC_HB - double precision height-balanced. --host-cache-size=# How many host names should be cached to avoid resolving. + (Automatically configured unless set explicitly) --ignore-builtin-innodb Disable initialization of builtin InnoDB plugin --ignore-db-dirs=name @@ -895,6 +897,7 @@ The following options may be given as the first argument: write privileges to the mysql.user table. --secure-auth Disallow authentication for accounts that have old (pre-4.1) passwords + (Defaults to on; use --skip-secure-auth to disable.) --secure-file-priv=name Limit LOAD DATA, SELECT ... OUTFILE, and LOAD_FILE() to files within specified directory @@ -1043,13 +1046,12 @@ The following options may be given as the first argument: (Defaults to on; use --skip-sync-frm to disable.) --sync-master-info=# Synchronously flush master info to disk after every #th - event. Use 0 (default) to disable synchronous flushing + event. Use 0 to disable synchronous flushing --sync-relay-log=# Synchronously flush relay log to disk after every #th - event. Use 0 (default) to disable synchronous flushing + event. Use 0 to disable synchronous flushing --sync-relay-log-info=# Synchronously flush relay log info to disk after every - #th transaction. Use 0 (default) to disable synchronous - flushing + #th transaction. Use 0 to disable synchronous flushing --sysdate-is-now Non-default option to alias SYSDATE() to NOW() to make it safe-replicable. Since 5.0, SYSDATE() returns a `dynamic' value different for different invocations, even within @@ -1131,7 +1133,7 @@ auto-increment-increment 1 auto-increment-offset 1 autocommit TRUE automatic-sp-privileges TRUE -back-log 150 +back-log 80 big-tables FALSE bind-address (No default value) binlog-annotate-row-events FALSE @@ -1199,7 +1201,7 @@ gtid-strict-mode FALSE help TRUE histogram-size 0 histogram-type SINGLE_PREC_HB -host-cache-size 128 +host-cache-size 279 ignore-builtin-innodb FALSE ignore-db-dirs init-connect @@ -1207,7 +1209,7 @@ init-file (No default value) init-rpl-role MASTER init-slave interactive-timeout 28800 -join-buffer-size 131072 +join-buffer-size 262144 join-buffer-space-limit 2097152 join-cache-level 2 keep-files-on-create FALSE @@ -1245,7 +1247,7 @@ lower-case-table-names 1 master-info-file master.info master-retry-count 86400 master-verify-checksum FALSE -max-allowed-packet 1048576 +max-allowed-packet 4194304 max-binlog-cache-size 18446744073709547520 max-binlog-size 1073741824 max-binlog-stmt-cache-size 18446744073709547520 @@ -1257,7 +1259,7 @@ max-error-count 64 max-heap-table-size 16777216 max-join-size 18446744073709551615 max-length-for-sort-data 1024 -max-long-data-size 1048576 +max-long-data-size 4194304 max-prepared-stmt-count 16382 max-relay-log-size 1073741824 max-seeks-for-key 18446744073709551615 @@ -1352,9 +1354,9 @@ protocol-version 10 query-alloc-block-size 16384 query-cache-limit 1048576 query-cache-min-res-unit 4096 -query-cache-size 0 +query-cache-size 1048576 query-cache-strip-comments FALSE -query-cache-type ON +query-cache-type OFF query-cache-wlock-invalidate FALSE query-prealloc-size 24576 range-alloc-block-size 4096 @@ -1376,7 +1378,7 @@ report-port 0 report-user (No default value) rowid-merge-buff-size 8388608 safe-user-create FALSE -secure-auth FALSE +secure-auth TRUE secure-file-priv (No default value) server-id 0 show-slave-auth-info FALSE @@ -1402,20 +1404,20 @@ slave-type-conversions slow-launch-time 2 slow-query-log FALSE sort-buffer-size 2097152 -sql-mode +sql-mode NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION stack-trace TRUE stored-program-cache 256 strict-password-validation TRUE symbolic-links FALSE sync-binlog 0 sync-frm FALSE -sync-master-info 0 -sync-relay-log 0 -sync-relay-log-info 0 +sync-master-info 10000 +sync-relay-log 10000 +sync-relay-log-info 10000 sysdate-is-now FALSE -table-cache 400 +table-cache 2000 table-definition-cache 400 -table-open-cache 400 +table-open-cache 2000 tc-heuristic-recover COMMIT thread-cache-size 0 thread-pool-idle-timeout 60 diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 7ae8e80cd00..e99cbe08fa6 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -2468,10 +2468,10 @@ if new.a > 10 then set new.a := 10; set new.a := 11; end if; -end BEFORE 0000-00-00 00:00:00 root@localhost latin1 latin1_swedish_ci latin1_swedish_ci +end BEFORE 0000-00-00 00:00:00 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION root@localhost latin1 latin1_swedish_ci latin1_swedish_ci trg2 UPDATE t1 begin if old.a % 2 = 0 then set new.b := 12; end if; -end BEFORE 0000-00-00 00:00:00 root@localhost latin1 latin1_swedish_ci latin1_swedish_ci +end BEFORE 0000-00-00 00:00:00 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION root@localhost latin1 latin1_swedish_ci latin1_swedish_ci trg3 UPDATE t1 begin if new.a = -1 then set @fired:= "Yes"; @@ -2515,7 +2515,7 @@ UNLOCK TABLES; /*!50003 SET character_set_results = latin1 */ ; /*!50003 SET collation_connection = latin1_swedish_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = '' */ ; +/*!50003 SET sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 trigger trg1 before insert on t1 for each row begin @@ -2536,7 +2536,7 @@ DELIMITER ; /*!50003 SET character_set_results = latin1 */ ; /*!50003 SET collation_connection = latin1_swedish_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = '' */ ; +/*!50003 SET sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 trigger trg2 before update on t1 for each row begin if old.a % 2 = 0 then set new.b := 12; end if; @@ -2671,10 +2671,10 @@ if new.a > 10 then set new.a := 10; set new.a := 11; end if; -end BEFORE # root@localhost latin1 latin1_swedish_ci latin1_swedish_ci +end BEFORE # NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION root@localhost latin1 latin1_swedish_ci latin1_swedish_ci trg2 UPDATE t1 begin if old.a % 2 = 0 then set new.b := 12; end if; -end BEFORE # root@localhost latin1 latin1_swedish_ci latin1_swedish_ci +end BEFORE # NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION root@localhost latin1 latin1_swedish_ci latin1_swedish_ci trg3 UPDATE t1 begin if new.a = -1 then set @fired:= "Yes"; diff --git a/mysql-test/r/openssl_1.result b/mysql-test/r/openssl_1.result index c5dd1500110..1d5c6d179df 100644 --- a/mysql-test/r/openssl_1.result +++ b/mysql-test/r/openssl_1.result @@ -1,3 +1,5 @@ +set local sql_mode=""; +set global sql_mode=""; drop table if exists t1; create table t1(f1 int); insert into t1 values (5); @@ -206,4 +208,5 @@ SHOW STATUS LIKE 'Ssl_cipher'; Variable_name Value Ssl_cipher DHE-RSA-AES256-SHA DROP USER bug42158@localhost; +set global sql_mode=default; End of 5.1 tests diff --git a/mysql-test/r/openssl_6975,tlsv10.result b/mysql-test/r/openssl_6975,tlsv10.result index 52d5978749e..6285faa0143 100644 --- a/mysql-test/r/openssl_6975,tlsv10.result +++ b/mysql-test/r/openssl_6975,tlsv10.result @@ -1,4 +1,6 @@ +create user ssl_sslv3@localhost; grant select on test.* to ssl_sslv3@localhost require cipher "RC4-SHA"; +create user ssl_tls12@localhost; grant select on test.* to ssl_tls12@localhost require cipher "AES128-SHA256"; TLS1.2 ciphers: user is ok with any cipher ERROR 2026 (HY000): SSL connection error: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure diff --git a/mysql-test/r/openssl_6975,tlsv12.result b/mysql-test/r/openssl_6975,tlsv12.result index 033220427be..31d2658c829 100644 --- a/mysql-test/r/openssl_6975,tlsv12.result +++ b/mysql-test/r/openssl_6975,tlsv12.result @@ -1,4 +1,6 @@ +create user ssl_sslv3@localhost; grant select on test.* to ssl_sslv3@localhost require cipher "RC4-SHA"; +create user ssl_tls12@localhost; grant select on test.* to ssl_tls12@localhost require cipher "AES128-SHA256"; TLS1.2 ciphers: user is ok with any cipher Variable_name Value diff --git a/mysql-test/r/partition_cache.result b/mysql-test/r/partition_cache.result index cd579d00952..39ba4841337 100644 --- a/mysql-test/r/partition_cache.result +++ b/mysql-test/r/partition_cache.result @@ -1,3 +1,5 @@ +SET global query_cache_type=ON; +SET local query_cache_type=ON; SET SESSION STORAGE_ENGINE = InnoDB; drop table if exists t1,t2,t3; set @save_query_cache_size = @@global.query_cache_size; @@ -203,3 +205,4 @@ Variable_name Value Qcache_hits 1 set @@global.query_cache_size = @save_query_cache_size; drop table t2; +SET global query_cache_type=default; diff --git a/mysql-test/r/partition_cache_innodb.result b/mysql-test/r/partition_cache_innodb.result index 0d0abbb096c..271b23eed92 100644 --- a/mysql-test/r/partition_cache_innodb.result +++ b/mysql-test/r/partition_cache_innodb.result @@ -1,3 +1,5 @@ +SET global query_cache_type=ON; +SET local query_cache_type=ON; SET SESSION STORAGE_ENGINE = innodb; drop table if exists t1; set @save_query_cache_size = @@global.query_cache_size; @@ -149,3 +151,4 @@ Variable_name Value Qcache_hits 1 drop table t1; set @@global.query_cache_size = @save_query_cache_size; +SET global query_cache_type=default; diff --git a/mysql-test/r/partition_cache_myisam.result b/mysql-test/r/partition_cache_myisam.result index 0b617c03590..b7d3dc53599 100644 --- a/mysql-test/r/partition_cache_myisam.result +++ b/mysql-test/r/partition_cache_myisam.result @@ -1,3 +1,5 @@ +SET global query_cache_type=ON; +SET local query_cache_type=ON; SET SESSION STORAGE_ENGINE = myisam; drop table if exists t1; set @save_query_cache_size = @@global.query_cache_size; @@ -151,3 +153,4 @@ Variable_name Value Qcache_hits 2 drop table t1; set @@global.query_cache_size = @save_query_cache_size; +SET global query_cache_type=default; diff --git a/mysql-test/r/partition_grant.result b/mysql-test/r/partition_grant.result index c334a473a2a..f036b0bcc28 100644 --- a/mysql-test/r/partition_grant.result +++ b/mysql-test/r/partition_grant.result @@ -3,6 +3,7 @@ create schema mysqltest_1; use mysqltest_1; create table t1 (a int) partition by list (a) (partition p1 values in (1), partition p2 values in (2), partition p3 values in (3)); insert into t1 values (1),(2); +create user mysqltest_1@localhost; grant usage on *.* to mysqltest_1@localhost; revoke all privileges on *.* from mysqltest_1@localhost; grant select,alter on mysqltest_1.* to mysqltest_1@localhost; diff --git a/mysql-test/r/partition_hash.result b/mysql-test/r/partition_hash.result index 90126bdd4fd..9a63db3f974 100644 --- a/mysql-test/r/partition_hash.result +++ b/mysql-test/r/partition_hash.result @@ -166,9 +166,11 @@ select * from t1; f1 f2 -1 ####### drop table t1; +set sql_mode=""; CREATE TABLE t1 (s1 int) ENGINE=BLACKHOLE PARTITION BY HASH (s1); INSERT INTO t1 VALUES (0); DROP TABLE t1; +set sql_mode=default; create table t1 (c1 int DEFAULT NULL, c2 varchar (30) DEFAULT NULL, c3 date DEFAULT NULL) diff --git a/mysql-test/r/partition_innodb.result b/mysql-test/r/partition_innodb.result index 798e3b9a6bf..8a72d5fe3b1 100644 --- a/mysql-test/r/partition_innodb.result +++ b/mysql-test/r/partition_innodb.result @@ -429,6 +429,7 @@ where a between '2006-01-01' and '2007-06-01'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p1 ALL NULL NULL NULL NULL 2 Using where drop table t1; +SET SQL_MODE=""; create table t1 (a int) engine = x partition by key (a); @@ -457,6 +458,7 @@ t1 CREATE TABLE `t1` ( /*!50100 PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0) ENGINE = InnoDB) */ drop table t1; +SET SQL_MODE=default; create table t1 ( id int unsigned auto_increment, diff --git a/mysql-test/r/plugin.result b/mysql-test/r/plugin.result index b92881ae7bc..c23c4f2d8a2 100644 --- a/mysql-test/r/plugin.result +++ b/mysql-test/r/plugin.result @@ -1,8 +1,5 @@ CREATE TABLE t1(a int) ENGINE=EXAMPLE; -Warnings: -Warning 1286 Unknown storage engine 'EXAMPLE' -Warning 1266 Using storage engine MyISAM for table 't1' -DROP TABLE t1; +ERROR 42000: Unknown storage engine 'EXAMPLE' INSTALL PLUGIN example SONAME 'ha_example'; INSTALL PLUGIN EXAMPLE SONAME 'ha_example'; ERROR HY000: Plugin 'EXAMPLE' already installed diff --git a/mysql-test/r/plugin_auth.result b/mysql-test/r/plugin_auth.result index 0d3948dd313..626722f9dd1 100644 --- a/mysql-test/r/plugin_auth.result +++ b/mysql-test/r/plugin_auth.result @@ -1,3 +1,5 @@ +SET GLOBAL SQL_MODE=""; +SET LOCAL SQL_MODE=""; SELECT PLUGIN_STATUS, PLUGIN_TYPE, PLUGIN_DESCRIPTION FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME='test_plugin_server'; PLUGIN_STATUS ACTIVE @@ -44,7 +46,7 @@ plug@localhost plug_dest@% ## test no_auto_create_user sql mode with plugin users SET @@sql_mode=no_auto_create_user; GRANT INSERT ON TEST.* TO grant_user IDENTIFIED WITH 'test_plugin_server'; -SET @@sql_mode=default; +SET @@sql_mode=""; DROP USER grant_user; ## test utf-8 user name CREATE USER `Ÿ` IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; @@ -426,4 +428,5 @@ USER() CURRENT_USER() bug12818542@localhost bug12818542_dest@localhost DROP USER bug12818542@localhost; DROP USER bug12818542_dest@localhost; +SET GLOBAL SQL_MODE=default; End of 5.5 tests diff --git a/mysql-test/r/plugin_auth_qa.result b/mysql-test/r/plugin_auth_qa.result index b86a01f6b52..4f274c45971 100644 --- a/mysql-test/r/plugin_auth_qa.result +++ b/mysql-test/r/plugin_auth_qa.result @@ -1,3 +1,4 @@ +set sql_mode=""; CREATE DATABASE test_user_db; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string diff --git a/mysql-test/r/plugin_not_embedded.result b/mysql-test/r/plugin_not_embedded.result index 27553366660..8106abc497f 100644 --- a/mysql-test/r/plugin_not_embedded.result +++ b/mysql-test/r/plugin_not_embedded.result @@ -1,6 +1,7 @@ # # Bug#51770: UNINSTALL PLUGIN requires no privileges # +CREATE USER bug51770@localhost; GRANT INSERT ON mysql.plugin TO bug51770@localhost; INSTALL PLUGIN example SONAME 'ha_example.so'; UNINSTALL PLUGIN example; diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index 706018d0129..1bdfaa7cc70 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -2390,15 +2390,15 @@ create procedure a() select 42; create procedure proc_1(a char(2)) show create procedure a; call proc_1("bb"); Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -a CREATE DEFINER=`root`@`localhost` PROCEDURE `a`() +a NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `a`() select 42 latin1 latin1_swedish_ci latin1_swedish_ci call proc_1("bb"); Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -a CREATE DEFINER=`root`@`localhost` PROCEDURE `a`() +a NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `a`() select 42 latin1 latin1_swedish_ci latin1_swedish_ci call proc_1("bb"); Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -a CREATE DEFINER=`root`@`localhost` PROCEDURE `a`() +a NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `a`() select 42 latin1 latin1_swedish_ci latin1_swedish_ci drop procedure proc_1; create function func_1() returns int begin show create procedure a; return 1; end| @@ -2410,15 +2410,15 @@ ERROR 42000: FUNCTION test.func_1 does not exist prepare abc from "show create procedure a"; execute abc; Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -a CREATE DEFINER=`root`@`localhost` PROCEDURE `a`() +a NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `a`() select 42 latin1 latin1_swedish_ci latin1_swedish_ci execute abc; Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -a CREATE DEFINER=`root`@`localhost` PROCEDURE `a`() +a NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `a`() select 42 latin1 latin1_swedish_ci latin1_swedish_ci execute abc; Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -a CREATE DEFINER=`root`@`localhost` PROCEDURE `a`() +a NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `a`() select 42 latin1 latin1_swedish_ci latin1_swedish_ci deallocate prepare abc; drop procedure a; @@ -2427,15 +2427,15 @@ create function a() returns int return 42+13; create procedure proc_1(a char(2)) show create function a; call proc_1("bb"); Function sql_mode Create Function character_set_client collation_connection Database Collation -a CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11) +a NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11) return 42+13 latin1 latin1_swedish_ci latin1_swedish_ci call proc_1("bb"); Function sql_mode Create Function character_set_client collation_connection Database Collation -a CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11) +a NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11) return 42+13 latin1 latin1_swedish_ci latin1_swedish_ci call proc_1("bb"); Function sql_mode Create Function character_set_client collation_connection Database Collation -a CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11) +a NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11) return 42+13 latin1 latin1_swedish_ci latin1_swedish_ci drop procedure proc_1; create function func_1() returns int begin show create function a; return 1; end| @@ -2447,15 +2447,15 @@ ERROR 42000: FUNCTION test.func_1 does not exist prepare abc from "show create function a"; execute abc; Function sql_mode Create Function character_set_client collation_connection Database Collation -a CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11) +a NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11) return 42+13 latin1 latin1_swedish_ci latin1_swedish_ci execute abc; Function sql_mode Create Function character_set_client collation_connection Database Collation -a CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11) +a NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11) return 42+13 latin1 latin1_swedish_ci latin1_swedish_ci execute abc; Function sql_mode Create Function character_set_client collation_connection Database Collation -a CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11) +a NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11) return 42+13 latin1 latin1_swedish_ci latin1_swedish_ci deallocate prepare abc; drop function a; diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result index 3ce52cb1595..2ed38dc5c11 100644 --- a/mysql-test/r/ps_1general.result +++ b/mysql-test/r/ps_1general.result @@ -308,7 +308,7 @@ Threads_running # prepare stmt4 from ' show variables like ''sql_mode'' '; execute stmt4; Variable_name Value -sql_mode +sql_mode NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION prepare stmt4 from ' show engine myisam logs '; execute stmt4; Type Name Status diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index 118c6785136..d34c96cd568 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -1,4 +1,13 @@ +SET GLOBAL query_cache_type= Off; +SET LOCAL query_cache_type= Off; +SET LOCAL query_cache_type= 0; +SET LOCAL query_cache_type= on; +ERROR HY000: Query cache is globally disabled and you can't enable it only for this session +SET LOCAL query_cache_type= 1; +ERROR HY000: Query cache is globally disabled and you can't enable it only for this session set GLOBAL query_cache_size=1355776; +SET GLOBAL query_cache_type= ON; +SET LOCAL query_cache_type= ON; flush query cache; flush query cache; reset query cache; @@ -1599,7 +1608,9 @@ show status like 'Qcache_free_blocks'; Variable_name Value Qcache_free_blocks 0 set global query_cache_size=102400; -ERROR HY000: Query cache is disabled; set query_cache_type to ON or DEMAND to enable it +show status like 'Qcache_free_blocks'; +Variable_name Value +Qcache_free_blocks 1 set global query_cache_type=on; set session query_cache_type=on; Restore default values. @@ -1660,6 +1671,8 @@ set GLOBAL query_cache_limit=default; set GLOBAL query_cache_min_res_unit=default; set GLOBAL query_cache_size=default; set local query_cache_type=default; +set GLOBAL query_cache_type=on; +set local query_cache_type=on; FLUSH STATUS; SET GLOBAL query_cache_size=10*1024*1024; SET @save_concurrent_insert= @@concurrent_insert; diff --git a/mysql-test/r/query_cache_debug.result b/mysql-test/r/query_cache_debug.result index 50a3a02fe4d..01c642b325b 100644 --- a/mysql-test/r/query_cache_debug.result +++ b/mysql-test/r/query_cache_debug.result @@ -1,3 +1,4 @@ +set global query_cache_type= ON; flush status; set query_cache_type=DEMAND; set global query_cache_size= 1024*768; diff --git a/mysql-test/r/query_cache_merge.result b/mysql-test/r/query_cache_merge.result index c324df65f77..e31ab05b396 100644 --- a/mysql-test/r/query_cache_merge.result +++ b/mysql-test/r/query_cache_merge.result @@ -1,3 +1,5 @@ +SET GLOBAL query_cache_type=ON; +SET LOCAL query_cache_type=ON; SET @@global.query_cache_size=1355776; flush status; select count(*) from t00; @@ -1690,6 +1692,7 @@ DROP TABLE t4; DROP TABLE t3; DROP TABLE t2; DROP TABLE t1; -SET @@global.query_cache_size = 0; +SET @@global.query_cache_size = default; SET @@global.table_definition_cache = @save_table_definition_cache; +SET GLOBAL query_cache_type=default; End of 5.1 tests diff --git a/mysql-test/r/query_cache_notembedded.result b/mysql-test/r/query_cache_notembedded.result index f2021f9d2e7..400ac2b2718 100644 --- a/mysql-test/r/query_cache_notembedded.result +++ b/mysql-test/r/query_cache_notembedded.result @@ -1,4 +1,8 @@ -set GLOBAL query_cache_size=1355776; +set @sql_mode_save=@@global.sql_mode; +set @query_cache_type_save=@@global.query_cache_type; +set @query_cache_size_save=@@global.query_cache_size; +set GLOBAL sql_mode=""; +set LOCAL sql_mode=""; flush query cache; flush query cache; reset query cache; @@ -379,7 +383,8 @@ Qcache_queries_in_cache 1 USE test; DROP DATABASE bug30269; DROP USER 'bug30269'@'localhost'; -set GLOBAL query_cache_type=default; +set GLOBAL query_cache_type=ON; +set LOCAL query_cache_type=ON; set GLOBAL query_cache_limit=default; set GLOBAL query_cache_min_res_unit=default; set GLOBAL query_cache_size=default; @@ -435,3 +440,6 @@ flush query cache| delete from t1| drop procedure bug3583| drop table t1| +SET GLOBAL query_cache_size=@query_cache_size_save; +SET GLOBAL query_cache_type=@query_cache_type_save; +set GLOBAL sql_mode=@sql_mode_save; diff --git a/mysql-test/r/query_cache_ps_no_prot.result b/mysql-test/r/query_cache_ps_no_prot.result index 02e660450d1..5076003a7fb 100644 --- a/mysql-test/r/query_cache_ps_no_prot.result +++ b/mysql-test/r/query_cache_ps_no_prot.result @@ -1,3 +1,5 @@ +set GLOBAL query_cache_type=ON; +set LOCAL query_cache_type=ON; ---- establish connection con1 (root) ---- ---- switch to connection default ---- set @initial_query_cache_size = @@global.query_cache_size; @@ -572,3 +574,4 @@ deallocate prepare stmt; drop table t1; set @@global.query_cache_size=@initial_query_cache_size; flush status; +set GLOBAL query_cache_type=default; diff --git a/mysql-test/r/query_cache_ps_ps_prot.result b/mysql-test/r/query_cache_ps_ps_prot.result index 2115ecc62ff..4105bc40f94 100644 --- a/mysql-test/r/query_cache_ps_ps_prot.result +++ b/mysql-test/r/query_cache_ps_ps_prot.result @@ -1,3 +1,5 @@ +set GLOBAL query_cache_type=ON; +set LOCAL query_cache_type=ON; ---- establish connection con1 (root) ---- ---- switch to connection default ---- set @initial_query_cache_size = @@global.query_cache_size; @@ -572,3 +574,4 @@ deallocate prepare stmt; drop table t1; set @@global.query_cache_size=@initial_query_cache_size; flush status; +set GLOBAL query_cache_type=default; diff --git a/mysql-test/r/query_cache_with_views.result b/mysql-test/r/query_cache_with_views.result index 7f0417a60c7..763113dbac3 100644 --- a/mysql-test/r/query_cache_with_views.result +++ b/mysql-test/r/query_cache_with_views.result @@ -1,5 +1,7 @@ drop table if exists t1,t2,v1,v2,v3; drop view if exists t1,t2,v1,v2,v3; +set GLOBAL query_cache_type=ON; +set LOCAL query_cache_type=ON; set GLOBAL query_cache_size=1355776; flush status; create table t1 (a int, b int); @@ -207,3 +209,4 @@ DROP TABLE t2; DROP VIEW t1_view; SET AUTOCOMMIT=DEFAULT; set GLOBAL query_cache_size=default; +set GLOBAL query_cache_type=default; diff --git a/mysql-test/r/read_only.result b/mysql-test/r/read_only.result index ae92d39a916..964c259ebf8 100644 --- a/mysql-test/r/read_only.result +++ b/mysql-test/r/read_only.result @@ -1,5 +1,6 @@ set @start_read_only= @@global.read_only; DROP TABLE IF EXISTS t1,t2,t3; +create user test@localhost; grant CREATE, SELECT, DROP on *.* to test@localhost; connect (con1,localhost,test,,test); connection default; @@ -139,6 +140,7 @@ delete from mysql.db where User like 'mysqltest_%'; delete from mysql.tables_priv where User like 'mysqltest_%'; delete from mysql.columns_priv where User like 'mysqltest_%'; flush privileges; +create user `mysqltest_u1`@`%`; grant all on mysqltest_db2.* to `mysqltest_u1`@`%`; create database mysqltest_db1; grant all on mysqltest_db1.* to `mysqltest_u1`@`%`; diff --git a/mysql-test/r/read_only_innodb.result b/mysql-test/r/read_only_innodb.result index 1e041395d3c..a276e6cbc19 100644 --- a/mysql-test/r/read_only_innodb.result +++ b/mysql-test/r/read_only_innodb.result @@ -1,4 +1,5 @@ DROP TABLE IF EXISTS table_11733 ; +create user test@localhost; grant CREATE, SELECT, DROP on *.* to test@localhost; set global read_only=0; create table table_11733 (a int) engine=InnoDb; @@ -16,6 +17,7 @@ ERROR HY000: The MariaDB server is running with the --read-only option so it can set global read_only=0; drop table table_11733 ; drop user test@localhost; +create user test@localhost; GRANT CREATE, SELECT, DROP ON *.* TO test@localhost; CREATE TABLE t1(a INT) ENGINE=INNODB; INSERT INTO t1 VALUES (0), (1); diff --git a/mysql-test/r/selectivity.result b/mysql-test/r/selectivity.result index 620bdc6bd50..4238359c201 100644 --- a/mysql-test/r/selectivity.result +++ b/mysql-test/r/selectivity.result @@ -1298,10 +1298,10 @@ Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` A select * from t1, t2, t1 as t3 where t1.b=t2.c and t2.d=t3.a and t3.b<5 and t1.a < 2000; a b c d a b -1495 89366 89366 28296 28296 3 -961 24512 24512 85239 85239 4 1063 89366 89366 28296 28296 3 +1495 89366 89366 28296 28296 3 221 56120 56120 28296 28296 3 +961 24512 24512 85239 85239 4 set optimizer_use_condition_selectivity=3; explain extended select * from t1, t2, t1 as t3 @@ -1315,10 +1315,10 @@ Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` A select * from t1, t2, t1 as t3 where t1.b=t2.c and t2.d=t3.a and t3.b<5 and t1.a < 2000; a b c d a b -961 24512 24512 85239 85239 4 -1495 89366 89366 28296 28296 3 1063 89366 89366 28296 28296 3 +1495 89366 89366 28296 28296 3 221 56120 56120 28296 28296 3 +961 24512 24512 85239 85239 4 set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; drop table t1,t2; set histogram_type=@save_histogram_type; @@ -1412,16 +1412,10 @@ drop table t0,t1,t2; # # Bug mdev-7316: a conjunct in WHERE with selectivity == 0 # -CREATE TABLE t1 (a varchar(16), b int, PRIMARY KEY(a), KEY(b)) ENGINE=INNODB; -Warnings: -Warning 1286 Unknown storage engine 'INNODB' -Warning 1266 Using storage engine MyISAM for table 't1' +CREATE TABLE t1 (a varchar(16), b int, PRIMARY KEY(a), KEY(b)); INSERT INTO t1 VALUES ('USAChinese',10), ('USAEnglish',20), ('USAFrench',30); -CREATE TABLE t2 (i int) ENGINE=INNODB; -Warnings: -Warning 1286 Unknown storage engine 'INNODB' -Warning 1266 Using storage engine MyISAM for table 't2' +CREATE TABLE t2 (i int); INSERT INTO t2 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(1),(2),(3),(4); ANALYZE TABLE t1, t2; diff --git a/mysql-test/r/selectivity_innodb.result b/mysql-test/r/selectivity_innodb.result index 0acbb465ba8..daf28073cf1 100644 --- a/mysql-test/r/selectivity_innodb.result +++ b/mysql-test/r/selectivity_innodb.result @@ -1308,10 +1308,10 @@ Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` A select * from t1, t2, t1 as t3 where t1.b=t2.c and t2.d=t3.a and t3.b<5 and t1.a < 2000; a b c d a b -1495 89366 89366 28296 28296 3 -961 24512 24512 85239 85239 4 1063 89366 89366 28296 28296 3 +1495 89366 89366 28296 28296 3 221 56120 56120 28296 28296 3 +961 24512 24512 85239 85239 4 set optimizer_use_condition_selectivity=3; explain extended select * from t1, t2, t1 as t3 @@ -1325,10 +1325,10 @@ Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` A select * from t1, t2, t1 as t3 where t1.b=t2.c and t2.d=t3.a and t3.b<5 and t1.a < 2000; a b c d a b -961 24512 24512 85239 85239 4 -1495 89366 89366 28296 28296 3 1063 89366 89366 28296 28296 3 +1495 89366 89366 28296 28296 3 221 56120 56120 28296 28296 3 +961 24512 24512 85239 85239 4 set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; drop table t1,t2; set histogram_type=@save_histogram_type; @@ -1422,10 +1422,10 @@ drop table t0,t1,t2; # # Bug mdev-7316: a conjunct in WHERE with selectivity == 0 # -CREATE TABLE t1 (a varchar(16), b int, PRIMARY KEY(a), KEY(b)) ENGINE=INNODB; +CREATE TABLE t1 (a varchar(16), b int, PRIMARY KEY(a), KEY(b)); INSERT INTO t1 VALUES ('USAChinese',10), ('USAEnglish',20), ('USAFrench',30); -CREATE TABLE t2 (i int) ENGINE=INNODB; +CREATE TABLE t2 (i int); INSERT INTO t2 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(1),(2),(3),(4); ANALYZE TABLE t1, t2; diff --git a/mysql-test/r/servers.result b/mysql-test/r/servers.result index ab5e444b134..585f0f62af0 100644 --- a/mysql-test/r/servers.result +++ b/mysql-test/r/servers.result @@ -1,3 +1,4 @@ +set sql_mode=""; # # MDEV-4594 - CREATE SERVER crashes embedded # diff --git a/mysql-test/r/set_statement.result b/mysql-test/r/set_statement.result index 08072fccba5..2b557de8e05 100644 --- a/mysql-test/r/set_statement.result +++ b/mysql-test/r/set_statement.result @@ -642,7 +642,7 @@ SELECT @@myisam_sort_buffer_size, '# Pre-STATEMENT variable value SELECT @@sql_mode; @@sql_mode - +NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION '' '' SET STATEMENT sql_mode='ansi' FOR PREPARE stmt FROM 'SELECT "t1".* FROM t1'; @@ -659,7 +659,7 @@ deallocate prepare stmt; '# Post-STATEMENT SELECT @@sql_mode; @@sql_mode - +NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION check the same behaviour in normal set SET sql_mode='ansi'; PREPARE stmt FROM 'SELECT "t1".* FROM t1'; @@ -675,7 +675,7 @@ ALTER TABLE t1 drop COLUMN v3; deallocate prepare stmt; SELECT @@sql_mode; @@sql_mode - +NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION SET sql_mode='ansi'; SELECT @@sql_mode; @@sql_mode @@ -704,7 +704,7 @@ ALTER TABLE t1 drop COLUMN v3; drop procedure p6; SELECT @@sql_mode; @@sql_mode - +NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION # SET and the statement parsed as one unit before the SET takes effect SET STATEMENT sql_mode='ansi' FOR CREATE PROCEDURE p6() BEGIN @@ -715,7 +715,7 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp END' at line 4 SELECT @@sql_mode; @@sql_mode - +NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION SET sql_mode='ansi'; SELECT @@sql_mode; @@sql_mode @@ -732,7 +732,7 @@ v1 v2 SET sql_mode=default; SELECT @@sql_mode; @@sql_mode - +NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION # SET and the statement parsed as one unit before the SET takes effect SET STATEMENT sql_mode='ansi' FOR BEGIN NOT ATOMIC diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index 1d2ab12dbb8..c281650ecf5 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -518,8 +518,11 @@ Database Create Database mysqltest CREATE DATABASE `mysqltest` /*!40100 DEFAULT CHARACTER SET latin1 */ create table mysqltest.t1(a int); insert into mysqltest.t1 values(1); +create user mysqltest_1@localhost; grant select on `mysqltest`.* to mysqltest_1@localhost; +create user mysqltest_2@localhost; grant usage on `mysqltest`.* to mysqltest_2@localhost; +create user mysqltest_3@localhost; grant drop on `mysqltest`.* to mysqltest_3@localhost; select * from t1; a @@ -997,13 +1000,13 @@ def information_schema TRIGGERS TRIGGERS EVENT_OBJECT_TABLE Table 253 192 2 N 1 def information_schema TRIGGERS TRIGGERS ACTION_STATEMENT Statement 252 589815 10 N 17 0 33 def information_schema TRIGGERS TRIGGERS ACTION_TIMING Timing 253 18 6 N 1 0 33 def information_schema TRIGGERS TRIGGERS CREATED Created 12 19 0 Y 128 0 63 -def information_schema TRIGGERS TRIGGERS SQL_MODE sql_mode 253 24576 0 N 1 0 33 +def information_schema TRIGGERS TRIGGERS SQL_MODE sql_mode 253 24576 42 N 1 0 33 def information_schema TRIGGERS TRIGGERS DEFINER Definer 253 567 14 N 1 0 33 def information_schema TRIGGERS TRIGGERS CHARACTER_SET_CLIENT character_set_client 253 96 6 N 1 0 33 def information_schema TRIGGERS TRIGGERS COLLATION_CONNECTION collation_connection 253 96 6 N 1 0 33 def information_schema TRIGGERS TRIGGERS DATABASE_COLLATION Database Collation 253 96 17 N 1 0 33 Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -t1_bi INSERT t1 SET @a = 1 BEFORE NULL root@localhost binary binary latin1_swedish_ci +t1_bi INSERT t1 SET @a = 1 BEFORE NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION root@localhost binary binary latin1_swedish_ci ---------------------------------------------------------------- SELECT TRIGGER_CATALOG, @@ -1041,10 +1044,10 @@ def information_schema TRIGGERS TRIGGERS ACTION_REFERENCE_OLD_TABLE ACTION_REFER def information_schema TRIGGERS TRIGGERS ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_NEW_TABLE 253 192 0 Y 0 0 33 def information_schema TRIGGERS TRIGGERS ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_OLD_ROW 253 9 3 N 1 0 33 def information_schema TRIGGERS TRIGGERS ACTION_REFERENCE_NEW_ROW ACTION_REFERENCE_NEW_ROW 253 9 3 N 1 0 33 -def information_schema TRIGGERS TRIGGERS SQL_MODE SQL_MODE 253 24576 0 N 1 0 33 +def information_schema TRIGGERS TRIGGERS SQL_MODE SQL_MODE 253 24576 42 N 1 0 33 def information_schema TRIGGERS TRIGGERS DEFINER DEFINER 253 567 14 N 1 0 33 TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW SQL_MODE DEFINER -def test t1_bi INSERT def test t1 NULL SET @a = 1 ROW BEFORE NULL NULL OLD NEW root@localhost +def test t1_bi INSERT def test t1 NULL SET @a = 1 ROW BEFORE NULL NULL OLD NEW NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION root@localhost ---------------------------------------------------------------- SHOW CREATE VIEW v1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -1076,13 +1079,13 @@ def test v1 select 1 AS `1` NONE NO root@localhost DEFINER binary binary UNDEFIN SHOW CREATE PROCEDURE p1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def Procedure 253 192 2 N 1 31 33 -def sql_mode 253 0 0 N 1 31 33 +def sql_mode 253 126 42 N 1 31 33 def Create Procedure 253 3072 59 Y 0 31 33 def character_set_client 253 96 6 N 1 31 33 def collation_connection 253 96 6 N 1 31 33 def Database Collation 253 96 17 N 1 31 33 Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`() +p1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`() SELECT 1 binary binary latin1_swedish_ci ---------------------------------------------------------------- SELECT @@ -1122,22 +1125,22 @@ def information_schema ROUTINES ROUTINES IS_DETERMINISTIC IS_DETERMINISTIC 253 9 def information_schema ROUTINES ROUTINES SQL_DATA_ACCESS SQL_DATA_ACCESS 253 192 12 N 1 0 33 def information_schema ROUTINES ROUTINES SQL_PATH SQL_PATH 253 192 0 Y 0 0 33 def information_schema ROUTINES ROUTINES SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33 -def information_schema ROUTINES ROUTINES SQL_MODE SQL_MODE 253 24576 0 N 1 0 33 +def information_schema ROUTINES ROUTINES SQL_MODE SQL_MODE 253 24576 42 N 1 0 33 def information_schema ROUTINES ROUTINES ROUTINE_COMMENT ROUTINE_COMMENT 252 589815 0 N 17 0 33 def information_schema ROUTINES ROUTINES DEFINER DEFINER 253 567 14 N 1 0 33 SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE SQL_MODE ROUTINE_COMMENT DEFINER -p1 def test p1 PROCEDURE NULL SQL SELECT 1 NULL NULL SQL NO CONTAINS SQL NULL DEFINER root@localhost +p1 def test p1 PROCEDURE NULL SQL SELECT 1 NULL NULL SQL NO CONTAINS SQL NULL DEFINER NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION root@localhost ---------------------------------------------------------------- SHOW CREATE FUNCTION f1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def Function 253 192 2 N 1 31 33 -def sql_mode 253 0 0 N 1 31 33 +def sql_mode 253 126 42 N 1 31 33 def Create Function 253 3072 74 Y 0 31 33 def character_set_client 253 96 6 N 1 31 33 def collation_connection 253 96 6 N 1 31 33 def Database Collation 253 96 17 N 1 31 33 Function sql_mode Create Function character_set_client collation_connection Database Collation -f1 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11) +f1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11) RETURN 1 binary binary latin1_swedish_ci ---------------------------------------------------------------- SELECT @@ -1177,11 +1180,11 @@ def information_schema ROUTINES ROUTINES IS_DETERMINISTIC IS_DETERMINISTIC 253 9 def information_schema ROUTINES ROUTINES SQL_DATA_ACCESS SQL_DATA_ACCESS 253 192 12 N 1 0 33 def information_schema ROUTINES ROUTINES SQL_PATH SQL_PATH 253 192 0 Y 0 0 33 def information_schema ROUTINES ROUTINES SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33 -def information_schema ROUTINES ROUTINES SQL_MODE SQL_MODE 253 24576 0 N 1 0 33 +def information_schema ROUTINES ROUTINES SQL_MODE SQL_MODE 253 24576 42 N 1 0 33 def information_schema ROUTINES ROUTINES ROUTINE_COMMENT ROUTINE_COMMENT 252 589815 0 N 17 0 33 def information_schema ROUTINES ROUTINES DEFINER DEFINER 253 567 14 N 1 0 33 SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE SQL_MODE ROUTINE_COMMENT DEFINER -f1 def test f1 FUNCTION int(11) SQL RETURN 1 NULL NULL SQL NO CONTAINS SQL NULL DEFINER root@localhost +f1 def test f1 FUNCTION int(11) SQL RETURN 1 NULL NULL SQL NO CONTAINS SQL NULL DEFINER NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION root@localhost ---------------------------------------------------------------- DROP DATABASE mysqltest1; DROP TABLE t1; @@ -1279,6 +1282,7 @@ Database Create Database mysqltest CREATE DATABASE `mysqltest` /*!40100 DEFAULT CHARACTER SET latin1 */ create table mysqltest.t1(a int); insert into mysqltest.t1 values(1); +create user mysqltest_4@localhost; grant select on `mysqltest`.`t1` to mysqltest_4@localhost; show create database mysqltest; Database Create Database @@ -1346,69 +1350,69 @@ CREATE TABLE t1(c1 INT); CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1; SHOW CREATE TRIGGER t1_bi; Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci +t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci CREATE PROCEDURE p1() SHOW CREATE TRIGGER t1_bi; CALL p1(); Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci +t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci CALL p1(); Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci +t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci CALL p1(); Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci +t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci CALL p1(); Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci +t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci CALL p1(); Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci +t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci CALL p1(); Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci +t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci CALL p1(); Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci +t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci CALL p1(); Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci +t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci CALL p1(); Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci +t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci CALL p1(); Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci +t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci PREPARE stmt1 FROM 'SHOW CREATE TRIGGER t1_bi'; EXECUTE stmt1; Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci +t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci EXECUTE stmt1; Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci +t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci EXECUTE stmt1; Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci +t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci EXECUTE stmt1; Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci +t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci EXECUTE stmt1; Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci +t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci EXECUTE stmt1; Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci +t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci EXECUTE stmt1; Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci +t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci EXECUTE stmt1; Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci +t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci EXECUTE stmt1; Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci +t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci EXECUTE stmt1; Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci +t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1 latin1 latin1_swedish_ci latin1_swedish_ci DROP TABLE t1; DROP PROCEDURE p1; DEALLOCATE PREPARE stmt1; @@ -1432,20 +1436,20 @@ View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 'теÑÑ‚' AS `test` koi8r koi8r_general_ci SHOW CREATE PROCEDURE p1; Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`() +p1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`() SELECT 'теÑÑ‚' AS test koi8r koi8r_general_ci latin1_swedish_ci SHOW CREATE FUNCTION f1; Function sql_mode Create Function character_set_client collation_connection Database Collation -f1 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS char(10) CHARSET latin1 +f1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS char(10) CHARSET latin1 RETURN 'теÑÑ‚' koi8r koi8r_general_ci latin1_swedish_ci SHOW CREATE TRIGGER t1_bi; Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 +t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET NEW.c1 = 'теÑÑ‚' koi8r koi8r_general_ci latin1_swedish_ci SHOW CREATE EVENT ev1; Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -ev1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 'теÑÑ‚' AS test koi8r koi8r_general_ci latin1_swedish_ci +ev1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 'теÑÑ‚' AS test koi8r koi8r_general_ci latin1_swedish_ci DROP VIEW v1; DROP PROCEDURE p1; DROP FUNCTION f1; @@ -1508,7 +1512,7 @@ LOCK TABLE t1 WRITE; # Connection default SHOW CREATE TRIGGER t1_bi; Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET new.a = 1 utf8 utf8_general_ci latin1_swedish_ci +t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET new.a = 1 utf8 utf8_general_ci latin1_swedish_ci # Connection con1 UNLOCK TABLES; # Test 2: ALTER TABLE with SHOW CREATE TRIGGER in transaction @@ -1516,7 +1520,7 @@ UNLOCK TABLES; START TRANSACTION; SHOW CREATE TRIGGER t1_bi; Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET new.a = 1 utf8 utf8_general_ci latin1_swedish_ci +t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET new.a = 1 utf8 utf8_general_ci latin1_swedish_ci # Connection con1 ALTER TABLE t1 CHARACTER SET = utf8; # Connection default diff --git a/mysql-test/r/show_explain.result b/mysql-test/r/show_explain.result index 8aefb552d57..0dc6f2b28ac 100644 --- a/mysql-test/r/show_explain.result +++ b/mysql-test/r/show_explain.result @@ -782,6 +782,7 @@ drop table t1,t3,t4; # # ---------- SHOW EXPLAIN and permissions ----------------- # +create user test2@localhost; grant ALL on test.* to test2@localhost; grant super on *.* to test2@localhost; # diff --git a/mysql-test/r/single_delete_update.result b/mysql-test/r/single_delete_update.result index 9332effeb56..cdf97e20238 100644 --- a/mysql-test/r/single_delete_update.result +++ b/mysql-test/r/single_delete_update.result @@ -1166,35 +1166,3 @@ a b c 25 25 10 25 25 10 DROP TABLE t1, t2; -# -# Bug #53742: UPDATEs have no effect after applying patch for bug 36569 -# -CREATE TABLE t1 ( -pk INT NOT NULL AUTO_INCREMENT, -c1_idx CHAR(1) DEFAULT 'y', -c2 INT, -PRIMARY KEY (pk), -INDEX c1_idx (c1_idx) -) ENGINE=InnoDB; -INSERT INTO t1 VALUES (), (), (), (); -SELECT * FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2; -pk c1_idx c2 -4 y NULL -3 y NULL -UPDATE t1 SET c2 = 0 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2; -SELECT * FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2; -pk c1_idx c2 -4 y 0 -3 y 0 -SELECT * FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC; -pk c1_idx c2 -4 y 0 -3 y 0 -2 y NULL -1 y NULL -DELETE FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2; -SELECT * FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC; -pk c1_idx c2 -2 y NULL -1 y NULL -DROP TABLE t1; diff --git a/mysql-test/r/single_delete_update_innodb.result b/mysql-test/r/single_delete_update_innodb.result new file mode 100644 index 00000000000..aca40974054 --- /dev/null +++ b/mysql-test/r/single_delete_update_innodb.result @@ -0,0 +1,32 @@ +# +# Bug #53742: UPDATEs have no effect after applying patch for bug 36569 +# +CREATE TABLE t1 ( +pk INT NOT NULL AUTO_INCREMENT, +c1_idx CHAR(1) DEFAULT 'y', +c2 INT, +PRIMARY KEY (pk), +INDEX c1_idx (c1_idx) +) ENGINE=InnoDB; +INSERT INTO t1 VALUES (), (), (), (); +SELECT * FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2; +pk c1_idx c2 +4 y NULL +3 y NULL +UPDATE t1 SET c2 = 0 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2; +SELECT * FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2; +pk c1_idx c2 +4 y 0 +3 y 0 +SELECT * FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC; +pk c1_idx c2 +4 y 0 +3 y 0 +2 y NULL +1 y NULL +DELETE FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2; +SELECT * FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC; +pk c1_idx c2 +2 y NULL +1 y NULL +DROP TABLE t1; diff --git a/mysql-test/r/skip_grants.result b/mysql-test/r/skip_grants.result index db3b6abdc8b..9852d6d12c1 100644 --- a/mysql-test/r/skip_grants.result +++ b/mysql-test/r/skip_grants.result @@ -39,11 +39,11 @@ View Create View character_set_client collation_connection v3 CREATE ALGORITHM=UNDEFINED DEFINER=`a`@`%` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`c` AS `c` from `t1` latin1 latin1_swedish_ci SHOW CREATE PROCEDURE p3; Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -p3 CREATE DEFINER=`a`@`%` PROCEDURE `p3`() +p3 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`a`@`%` PROCEDURE `p3`() SELECT 3 latin1 latin1_swedish_ci latin1_swedish_ci SHOW CREATE FUNCTION f3; Function sql_mode Create Function character_set_client collation_connection Database Collation -f3 CREATE DEFINER=`a`@`%` FUNCTION `f3`() RETURNS int(11) +f3 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`a`@`%` FUNCTION `f3`() RETURNS int(11) RETURN 3 latin1 latin1_swedish_ci latin1_swedish_ci DROP TRIGGER t1_bi; DROP TRIGGER ti_ai; diff --git a/mysql-test/r/skip_name_resolve.result b/mysql-test/r/skip_name_resolve.result index 1d92d52110d..b2230ccbd91 100644 --- a/mysql-test/r/skip_name_resolve.result +++ b/mysql-test/r/skip_name_resolve.result @@ -1,3 +1,4 @@ +CREATE USER mysqltest_1@'127.0.0.1/255.255.255.255'; GRANT ALL ON test.* TO mysqltest_1@'127.0.0.1/255.255.255.255'; SHOW GRANTS FOR mysqltest_1@'127.0.0.1/255.255.255.255'; Grants for mysqltest_1@127.0.0.1/255.255.255.255 diff --git a/mysql-test/r/sp-lock.result b/mysql-test/r/sp-lock.result index 860312dca3e..49ff0c7ba58 100644 --- a/mysql-test/r/sp-lock.result +++ b/mysql-test/r/sp-lock.result @@ -725,7 +725,7 @@ release_lock("test") get_lock("test", 10) 1 Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`() +p1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`() BEGIN SELECT get_lock("test", 10); SHOW CREATE PROCEDURE p1; diff --git a/mysql-test/r/sp-security.result b/mysql-test/r/sp-security.result index 7e89867963a..276da41a0fe 100644 --- a/mysql-test/r/sp-security.result +++ b/mysql-test/r/sp-security.result @@ -1,4 +1,5 @@ use test; +create user user1@localhost; grant usage on *.* to user1@localhost; flush privileges; drop table if exists t1; @@ -31,10 +32,13 @@ root@localhost 1 select db(); db() test +create user user1@'%'; grant execute on procedure db1_secret.stamp to user1@'%'; grant execute on function db1_secret.db to user1@'%'; +set sql_mode=''; grant execute on procedure db1_secret.stamp to ''@'%'; grant execute on function db1_secret.db to ''@'%'; +set sql_mode=default; call db1_secret.stamp(2); select db1_secret.db(); db1_secret.db() @@ -103,6 +107,7 @@ create table t2 (s1 int); insert into t2 values (0); grant usage on db2.* to user1@localhost; grant select on db2.* to user1@localhost; +create user user2@localhost; grant usage on db2.* to user2@localhost; grant select,insert,update,delete,create routine on db2.* to user2@localhost; grant create routine on db2.* to user1@localhost; @@ -156,8 +161,11 @@ delete from mysql.procs_priv where user='user1' or user='user2'; delete from mysql.procs_priv where user='' and host='%'; delete from mysql.db where user='user2'; flush privileges; +create user usera@localhost; grant usage on *.* to usera@localhost; +create user userb@localhost; grant usage on *.* to userb@localhost; +create user userc@localhost; grant usage on *.* to userc@localhost; create database sptest; create table t1 ( u varchar(64), i int ); @@ -220,9 +228,11 @@ delete from mysql.tables_priv where user='usera'; flush privileges; drop table t1; drop function if exists bug_9503; +drop user if exists user1@localhost; create database mysqltest// use mysqltest// create table t1 (s1 int)// +create user user1@localhost// grant select on t1 to user1@localhost// create function bug_9503 () returns int sql security invoker begin declare v int; select min(s1) into v from t1; return v; end// @@ -266,6 +276,7 @@ create procedure mysqltest_1.p1() begin select 1 from dual; end// +create user mysqltest_1@localhost; grant usage on *.* to mysqltest_1@localhost; call mysqltest_1.p1(); ERROR 42000: execute command denied to user 'mysqltest_1'@'localhost' for routine 'mysqltest_1.p1' @@ -366,19 +377,19 @@ Note 1449 The user specified as a definer ('a @ b @ c'@'localhost') does not exi USE mysqltest; SHOW CREATE PROCEDURE wl2897_p1; Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -wl2897_p1 CREATE DEFINER=`mysqltest_2`@`localhost` PROCEDURE `wl2897_p1`() +wl2897_p1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`mysqltest_2`@`localhost` PROCEDURE `wl2897_p1`() SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci SHOW CREATE PROCEDURE wl2897_p3; Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -wl2897_p3 CREATE DEFINER=`a @ b @ c`@`localhost` PROCEDURE `wl2897_p3`() +wl2897_p3 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`a @ b @ c`@`localhost` PROCEDURE `wl2897_p3`() SELECT 3 latin1 latin1_swedish_ci latin1_swedish_ci SHOW CREATE FUNCTION wl2897_f1; Function sql_mode Create Function character_set_client collation_connection Database Collation -wl2897_f1 CREATE DEFINER=`mysqltest_2`@`localhost` FUNCTION `wl2897_f1`() RETURNS int(11) +wl2897_f1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`mysqltest_2`@`localhost` FUNCTION `wl2897_f1`() RETURNS int(11) RETURN 1 latin1 latin1_swedish_ci latin1_swedish_ci SHOW CREATE FUNCTION wl2897_f3; Function sql_mode Create Function character_set_client collation_connection Database Collation -wl2897_f3 CREATE DEFINER=`a @ b @ c`@`localhost` FUNCTION `wl2897_f3`() RETURNS int(11) +wl2897_f3 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`a @ b @ c`@`localhost` FUNCTION `wl2897_f3`() RETURNS int(11) RETURN 3 latin1 latin1_swedish_ci latin1_swedish_ci DROP USER mysqltest_1@localhost; DROP USER mysqltest_2@localhost; @@ -444,7 +455,7 @@ SELECT a; END // SHOW CREATE PROCEDURE test.sp19857; Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -sp19857 CREATE DEFINER=`user19857`@`localhost` PROCEDURE `sp19857`() +sp19857 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`user19857`@`localhost` PROCEDURE `sp19857`() DETERMINISTIC BEGIN DECLARE a INT; @@ -612,7 +623,7 @@ GRANT SELECT ON mysql.proc TO user2@localhost; # This should work SHOW CREATE PROCEDURE db1.p1; Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`() +p1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`() SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci # Connection default DROP USER user2@localhost; diff --git a/mysql-test/r/sp-ucs2.result b/mysql-test/r/sp-ucs2.result index c7a3ed6e46a..3c444ad97de 100644 --- a/mysql-test/r/sp-ucs2.result +++ b/mysql-test/r/sp-ucs2.result @@ -40,7 +40,7 @@ BEGIN RETURN ''; END| Function sql_mode Create Function character_set_client collation_connection Database Collation -f CREATE DEFINER=`root`@`localhost` FUNCTION `f`() RETURNS varchar(64) CHARSET ucs2 COLLATE ucs2_bin +f NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `f`() RETURNS varchar(64) CHARSET ucs2 COLLATE ucs2_bin BEGIN RETURN ''; END latin1 latin1_swedish_ci latin1_swedish_ci @@ -55,7 +55,7 @@ BEGIN RETURN ''; END| Function sql_mode Create Function character_set_client collation_connection Database Collation -f CREATE DEFINER=`root`@`localhost` FUNCTION `f`() RETURNS varchar(64) CHARSET ucs2 COLLATE ucs2_bin +f NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `f`() RETURNS varchar(64) CHARSET ucs2 COLLATE ucs2_bin BEGIN RETURN ''; END latin1 latin1_swedish_ci latin1_swedish_ci @@ -67,7 +67,7 @@ BEGIN RETURN ''; END| Function sql_mode Create Function character_set_client collation_connection Database Collation -f CREATE DEFINER=`root`@`localhost` FUNCTION `f`() RETURNS varchar(64) CHARSET latin1 COLLATE latin1_bin +f NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `f`() RETURNS varchar(64) CHARSET latin1 COLLATE latin1_bin BEGIN RETURN ''; END latin1 latin1_swedish_ci latin1_swedish_ci @@ -83,7 +83,7 @@ SET f2= f1; SET f2= concat(collation(f1), ' ', collation(f2)); END| Function sql_mode Create Function character_set_client collation_connection Database Collation -f CREATE DEFINER=`root`@`localhost` FUNCTION `f`() RETURNS varchar(64) CHARSET latin1 COLLATE latin1_bin +f NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `f`() RETURNS varchar(64) CHARSET latin1 COLLATE latin1_bin BEGIN RETURN ''; END latin1 latin1_swedish_ci latin1_swedish_ci @@ -127,7 +127,7 @@ RETURNS ENUM( 'w' ) CHARACTER SET ucs2 RETURN 0; SHOW CREATE FUNCTION bug48766; Function sql_mode Create Function character_set_client collation_connection Database Collation -bug48766 CREATE DEFINER=`root`@`localhost` FUNCTION `bug48766`() RETURNS enum('w') CHARSET ucs2 +bug48766 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `bug48766`() RETURNS enum('w') CHARSET ucs2 RETURN 0 utf8 utf8_general_ci latin1_swedish_ci SELECT DTD_IDENTIFIER FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_NAME='bug48766'; @@ -139,7 +139,7 @@ RETURNS ENUM('а','б','в','г') CHARACTER SET ucs2 RETURN 0; SHOW CREATE FUNCTION bug48766; Function sql_mode Create Function character_set_client collation_connection Database Collation -bug48766 CREATE DEFINER=`root`@`localhost` FUNCTION `bug48766`() RETURNS enum('а','б','в','г') CHARSET ucs2 +bug48766 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `bug48766`() RETURNS enum('а','б','в','г') CHARSET ucs2 RETURN 0 utf8 utf8_general_ci latin1_swedish_ci SELECT DTD_IDENTIFIER FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_NAME='bug48766'; diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 27a21e190fd..fe81c96e811 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -791,7 +791,7 @@ comment 'Characteristics procedure test' insert into t1 values ("chistics", 1)| show create procedure chistics| Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -chistics CREATE DEFINER=`root`@`localhost` PROCEDURE `chistics`() +chistics NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `chistics`() MODIFIES SQL DATA COMMENT 'Characteristics procedure test' insert into t1 values ("chistics", 1) latin1 latin1_swedish_ci latin1_swedish_ci @@ -803,7 +803,7 @@ delete from t1| alter procedure chistics sql security invoker| show create procedure chistics| Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -chistics CREATE DEFINER=`root`@`localhost` PROCEDURE `chistics`() +chistics NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `chistics`() MODIFIES SQL DATA SQL SECURITY INVOKER COMMENT 'Characteristics procedure test' @@ -818,7 +818,7 @@ comment 'Characteristics procedure test' return 42| show create function chistics| Function sql_mode Create Function character_set_client collation_connection Database Collation -chistics CREATE DEFINER=`root`@`localhost` FUNCTION `chistics`() RETURNS int(11) +chistics NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `chistics`() RETURNS int(11) DETERMINISTIC SQL SECURITY INVOKER COMMENT 'Characteristics procedure test' @@ -831,7 +831,7 @@ no sql comment 'Characteristics function test'| show create function chistics| Function sql_mode Create Function character_set_client collation_connection Database Collation -chistics CREATE DEFINER=`root`@`localhost` FUNCTION `chistics`() RETURNS int(11) +chistics NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `chistics`() RETURNS int(11) NO SQL DETERMINISTIC SQL SECURITY INVOKER diff --git a/mysql-test/r/sp_notembedded.result b/mysql-test/r/sp_notembedded.result index 3cc4ff4238b..40a06d312a0 100644 --- a/mysql-test/r/sp_notembedded.result +++ b/mysql-test/r/sp_notembedded.result @@ -150,6 +150,7 @@ drop view v1| drop table t3| drop procedure if exists bug15298_1; drop procedure if exists bug15298_2; +create user 'mysqltest_1'@'localhost'; grant all privileges on test.* to 'mysqltest_1'@'localhost'; create procedure 15298_1 () sql security definer show grants for current_user; create procedure 15298_2 () sql security definer show grants; @@ -203,6 +204,8 @@ Warnings: Warning 1364 Field 'authentication_string' doesn't have a default value FLUSH PRIVILEGES; CREATE PROCEDURE p1(i INT) BEGIN END; +Warnings: +Warning 1404 Failed to grant EXECUTE and ALTER ROUTINE privileges DROP PROCEDURE p1; DELETE FROM mysql.user WHERE User='mysqltest_1'; FLUSH PRIVILEGES; diff --git a/mysql-test/r/sp_trans.result b/mysql-test/r/sp_trans.result index 5526fc19aae..c76615d644f 100644 --- a/mysql-test/r/sp_trans.result +++ b/mysql-test/r/sp_trans.result @@ -1,3 +1,4 @@ +set SQL_MODE=""; drop table if exists t1, t2, t3; drop procedure if exists bug8850| create table t1 (a int) engine=innodb| diff --git a/mysql-test/r/stack-crash.result b/mysql-test/r/stack-crash.result index be5b6464b9a..62870db79f3 100644 --- a/mysql-test/r/stack-crash.result +++ b/mysql-test/r/stack-crash.result @@ -23,10 +23,7 @@ CREATE TABLE t1 ( `sspo_lu_uid` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`sspo_id`), KEY `post_uid` (`sspo_uid`,`sspo_cr_date`) -) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8; -Warnings: -Warning 1286 Unknown storage engine 'InnoDB' -Warning 1266 Using storage engine MyISAM for table 't1' +) AUTO_INCREMENT=30 DEFAULT CHARSET=utf8; INSERT INTO t1 VALUES (1,2,'P','test1','',0,'','',NULL,'','','','','A','2013-09-30 00:19:32',2,'2013-09-30 00:19:32',2),(2,2,'P','bbb','',0,'','',NULL,'','','','','A','2013-10-02 15:06:35',2,'2013-10-02 15:06:35',2); CREATE TABLE `t2` ( `spoo_id` int(11) NOT NULL AUTO_INCREMENT, @@ -41,10 +38,7 @@ CREATE TABLE `t2` ( `spoo_lu_uid` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`spoo_id`), KEY `object_option_main_idx` (`spoo_user_type_id`,`spoo_uid`,`spoo_option_id`,`spoo_value`(255)) -) ENGINE=InnoDB AUTO_INCREMENT=107 DEFAULT CHARSET=utf8; -Warnings: -Warning 1286 Unknown storage engine 'InnoDB' -Warning 1266 Using storage engine MyISAM for table 't2' +) AUTO_INCREMENT=107 DEFAULT CHARSET=utf8; INSERT INTO `t2` VALUES (19,1,2,6,'Dortmund','A','2013-09-26 01:36:51',2,'2013-09-26 01:36:51',2),(20,1,2,8,'49','A','2013-09-26 01:36:51',2,'2013-09-26 01:36:51',2); SELECT Count(*) FROM t1 AS tbl diff --git a/mysql-test/r/status.result b/mysql-test/r/status.result index 140db7c5721..55afd159053 100644 --- a/mysql-test/r/status.result +++ b/mysql-test/r/status.result @@ -204,6 +204,7 @@ Com_drop_function 1 create database db37908; create table db37908.t1(f1 int); insert into db37908.t1 values(1); +create user mysqltest_1@localhost; grant usage,execute on test.* to mysqltest_1@localhost; create procedure proc37908() begin select 1; end | create function func37908() returns int sql security invoker diff --git a/mysql-test/r/subselect_sj.result b/mysql-test/r/subselect_sj.result index 46c799c4f6e..a937cc960f3 100644 --- a/mysql-test/r/subselect_sj.result +++ b/mysql-test/r/subselect_sj.result @@ -2821,10 +2821,7 @@ col_varchar_nokey varchar(1) DEFAULT NULL, PRIMARY KEY (pk), KEY col_int_key (col_int_key), KEY col_varchar_key (col_varchar_key, col_int_key) -) ENGINE=InnoDB; -Warnings: -Warning 1286 Unknown storage engine 'InnoDB' -Warning 1266 Using storage engine MyISAM for table 't1' +); INSERT INTO t1 VALUES (10,8,'x','x'), (11,7,'d','d'), diff --git a/mysql-test/r/subselect_sj_jcl6.result b/mysql-test/r/subselect_sj_jcl6.result index ba582d7e008..73dd69681d2 100644 --- a/mysql-test/r/subselect_sj_jcl6.result +++ b/mysql-test/r/subselect_sj_jcl6.result @@ -2835,10 +2835,7 @@ col_varchar_nokey varchar(1) DEFAULT NULL, PRIMARY KEY (pk), KEY col_int_key (col_int_key), KEY col_varchar_key (col_varchar_key, col_int_key) -) ENGINE=InnoDB; -Warnings: -Warning 1286 Unknown storage engine 'InnoDB' -Warning 1266 Using storage engine MyISAM for table 't1' +); INSERT INTO t1 VALUES (10,8,'x','x'), (11,7,'d','d'), diff --git a/mysql-test/r/table_elim.result b/mysql-test/r/table_elim.result index c633261bcd3..3e0cc480aec 100644 --- a/mysql-test/r/table_elim.result +++ b/mysql-test/r/table_elim.result @@ -682,20 +682,14 @@ SET optimizer_switch=@save_optimizer_switch; # (just a testcase) CREATE TABLE t1 ( PostID int(10) unsigned NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -Warnings: -Warning 1286 Unknown storage engine 'InnoDB' -Warning 1266 Using storage engine MyISAM for table 't1' +) DEFAULT CHARSET=utf8; INSERT INTO t1 (PostID) VALUES (1), (2); CREATE TABLE t2 ( VoteID int(10) unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, EntityID int(10) unsigned NOT NULL, UserID int(10) unsigned NOT NULL, UNIQUE KEY EntityID (EntityID,UserID) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -Warnings: -Warning 1286 Unknown storage engine 'InnoDB' -Warning 1266 Using storage engine MyISAM for table 't2' +) DEFAULT CHARSET=utf8; INSERT INTO t2 (EntityID, UserID) VALUES (1, 30), (2, 30); SELECT t1.*, T.Voted as Voted FROM diff --git a/mysql-test/r/timezone_grant.result b/mysql-test/r/timezone_grant.result index 49918038da5..d33d92dbc9e 100644 --- a/mysql-test/r/timezone_grant.result +++ b/mysql-test/r/timezone_grant.result @@ -7,6 +7,7 @@ delete from mysql.columns_priv where user like 'mysqltest\_%'; flush privileges; create table t1 (a int, b datetime); create table t2 (c int, d datetime); +create user mysqltest_1@localhost; grant all privileges on test.* to mysqltest_1@localhost; show grants for current_user(); Grants for mysqltest_1@localhost @@ -63,6 +64,7 @@ flush privileges; drop table t1, t2; create table t1 (a int, b datetime); insert into t1 values (1, 20010101000000), (2, 20020101000000); +create user mysqltest_1@localhost; grant all privileges on test.* to mysqltest_1@localhost; create view v1 as select a, convert_tz(b, 'UTC', 'Europe/Moscow') as lb from t1; select * from v1; diff --git a/mysql-test/r/trigger-compat.result b/mysql-test/r/trigger-compat.result index 8caba961624..7659667fb37 100644 --- a/mysql-test/r/trigger-compat.result +++ b/mysql-test/r/trigger-compat.result @@ -29,8 +29,8 @@ wl2818_trg2 mysqltest_dfn@localhost SELECT * FROM INFORMATION_SCHEMA.TRIGGERS ORDER BY trigger_name; TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION -def mysqltest_db1 wl2818_trg1 INSERT def mysqltest_db1 t1 0 NULL INSERT INTO t2 VALUES(CURRENT_USER()) ROW BEFORE NULL NULL OLD NEW NULL latin1 latin1_swedish_ci latin1_swedish_ci -def mysqltest_db1 wl2818_trg2 INSERT def mysqltest_db1 t1 0 NULL INSERT INTO t2 VALUES(CURRENT_USER()) ROW AFTER NULL NULL OLD NEW NULL mysqltest_dfn@localhost latin1 latin1_swedish_ci latin1_swedish_ci +def mysqltest_db1 wl2818_trg1 INSERT def mysqltest_db1 t1 0 NULL INSERT INTO t2 VALUES(CURRENT_USER()) ROW BEFORE NULL NULL OLD NEW NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION latin1 latin1_swedish_ci latin1_swedish_ci +def mysqltest_db1 wl2818_trg2 INSERT def mysqltest_db1 t1 0 NULL INSERT INTO t2 VALUES(CURRENT_USER()) ROW AFTER NULL NULL OLD NEW NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION mysqltest_dfn@localhost latin1 latin1_swedish_ci latin1_swedish_ci DROP TRIGGER wl2818_trg1; Warnings: Warning 1454 No definer attribute for trigger 'mysqltest_db1'.'wl2818_trg1'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger. diff --git a/mysql-test/r/trigger_notembedded.result b/mysql-test/r/trigger_notembedded.result index ef86e4c496c..795f722b0d4 100644 --- a/mysql-test/r/trigger_notembedded.result +++ b/mysql-test/r/trigger_notembedded.result @@ -138,8 +138,8 @@ INSERT INTO t1 VALUES(6); ERROR HY000: The user specified as a definer ('mysqltest_nonexs'@'localhost') does not exist SHOW TRIGGERS; Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -trg1 INSERT t1 SET @new_sum = 0 BEFORE NULL mysqltest_inv@localhost latin1 latin1_swedish_ci latin1_swedish_ci -trg2 INSERT t1 SET @new_sum = 0 AFTER NULL mysqltest_nonexs@localhost latin1 latin1_swedish_ci latin1_swedish_ci +trg1 INSERT t1 SET @new_sum = 0 BEFORE NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION mysqltest_inv@localhost latin1 latin1_swedish_ci latin1_swedish_ci +trg2 INSERT t1 SET @new_sum = 0 AFTER NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION mysqltest_nonexs@localhost latin1 latin1_swedish_ci latin1_swedish_ci DROP TRIGGER trg1; DROP TRIGGER trg2; CREATE TRIGGER trg1 BEFORE INSERT ON t1 @@ -168,11 +168,11 @@ trg5 @abcdef@@@hostname SELECT * FROM INFORMATION_SCHEMA.TRIGGERS ORDER BY trigger_name; TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION -def mysqltest_db1 trg1 INSERT def mysqltest_db1 t1 0 NULL SET @a = 1 ROW BEFORE NULL NULL OLD NEW NULL latin1 latin1_swedish_ci latin1_swedish_ci -def mysqltest_db1 trg2 INSERT def mysqltest_db1 t1 0 NULL SET @a = 2 ROW AFTER NULL NULL OLD NEW NULL @ latin1 latin1_swedish_ci latin1_swedish_ci -def mysqltest_db1 trg3 UPDATE def mysqltest_db1 t1 0 NULL SET @a = 3 ROW BEFORE NULL NULL OLD NEW NULL @abc@def@@% latin1 latin1_swedish_ci latin1_swedish_ci -def mysqltest_db1 trg4 UPDATE def mysqltest_db1 t1 0 NULL SET @a = 4 ROW AFTER NULL NULL OLD NEW NULL @hostname latin1 latin1_swedish_ci latin1_swedish_ci -def mysqltest_db1 trg5 DELETE def mysqltest_db1 t1 0 NULL SET @a = 5 ROW BEFORE NULL NULL OLD NEW NULL @abcdef@@@hostname latin1 latin1_swedish_ci latin1_swedish_ci +def mysqltest_db1 trg1 INSERT def mysqltest_db1 t1 0 NULL SET @a = 1 ROW BEFORE NULL NULL OLD NEW NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION latin1 latin1_swedish_ci latin1_swedish_ci +def mysqltest_db1 trg2 INSERT def mysqltest_db1 t1 0 NULL SET @a = 2 ROW AFTER NULL NULL OLD NEW NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION @ latin1 latin1_swedish_ci latin1_swedish_ci +def mysqltest_db1 trg3 UPDATE def mysqltest_db1 t1 0 NULL SET @a = 3 ROW BEFORE NULL NULL OLD NEW NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION @abc@def@@% latin1 latin1_swedish_ci latin1_swedish_ci +def mysqltest_db1 trg4 UPDATE def mysqltest_db1 t1 0 NULL SET @a = 4 ROW AFTER NULL NULL OLD NEW NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION @hostname latin1 latin1_swedish_ci latin1_swedish_ci +def mysqltest_db1 trg5 DELETE def mysqltest_db1 t1 0 NULL SET @a = 5 ROW BEFORE NULL NULL OLD NEW NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION @abcdef@@@hostname latin1 latin1_swedish_ci latin1_swedish_ci ---> connection: default DROP USER mysqltest_dfn@localhost; @@ -502,6 +502,7 @@ DROP DATABASE db1; DROP DATABASE IF EXISTS mysqltest_db1; CREATE DATABASE mysqltest_db1; USE mysqltest_db1; +CREATE USER mysqltest_u1@localhost; GRANT ALL ON mysqltest_db1.* TO mysqltest_u1@localhost; CREATE TABLE t1 ( a1 int, diff --git a/mysql-test/r/truncate.result b/mysql-test/r/truncate.result index 773075f9dae..9b4cb4a36d9 100644 --- a/mysql-test/r/truncate.result +++ b/mysql-test/r/truncate.result @@ -142,7 +142,7 @@ TRUNCATE p1; ERROR 42S02: Table 'test.p1' doesn't exist SHOW CREATE PROCEDURE p1; Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`() +p1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`() SET @a = 5 latin1 latin1_swedish_ci latin1_swedish_ci DROP PROCEDURE p1; # diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index ef1749eda52..d3498c27f13 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -1281,7 +1281,7 @@ t3 CREATE TABLE `t3` ( drop tables t1,t2,t3; SELECT @tmp_max:= @@global.max_allowed_packet; @tmp_max:= @@global.max_allowed_packet -1048576 +4194304 SET @@global.max_allowed_packet=25000000; Warnings: Warning 1292 Truncated incorrect max_allowed_packet value: '25000000' diff --git a/mysql-test/r/user_limits.result b/mysql-test/r/user_limits.result index 688704f528a..5ab98d1fc30 100644 --- a/mysql-test/r/user_limits.result +++ b/mysql-test/r/user_limits.result @@ -6,6 +6,7 @@ delete from mysql.db where user like 'mysqltest\_%'; delete from mysql.tables_priv where user like 'mysqltest\_%'; delete from mysql.columns_priv where user like 'mysqltest\_%'; flush privileges; +create user mysqltest_1@localhost; grant usage on *.* to mysqltest_1@localhost with max_queries_per_hour 2; flush user_resources; select * from t1; @@ -17,6 +18,7 @@ ERROR 42000: User 'mysqltest_1' has exceeded the 'max_queries_per_hour' resource select * from t1; ERROR 42000: User 'mysqltest_1' has exceeded the 'max_queries_per_hour' resource (current value: 2) drop user mysqltest_1@localhost; +create user mysqltest_1@localhost; grant usage on *.* to mysqltest_1@localhost with max_updates_per_hour 2; flush user_resources; select * from t1; @@ -36,6 +38,7 @@ ERROR 42000: User 'mysqltest_1' has exceeded the 'max_updates_per_hour' resource select * from t1; i drop user mysqltest_1@localhost; +create user mysqltest_1@localhost; grant usage on *.* to mysqltest_1@localhost with max_connections_per_hour 2; flush user_resources; select * from t1; @@ -50,6 +53,7 @@ connect(localhost,mysqltest_1,,test,MYSQL_PORT,MYSQL_SOCK); ERROR 42000: User 'mysqltest_1' has exceeded the 'max_connections_per_hour' resource (current value: 2) drop user mysqltest_1@localhost; flush privileges; +create user mysqltest_1@localhost; grant usage on *.* to mysqltest_1@localhost with max_user_connections 2; flush user_resources; select * from t1; @@ -86,6 +90,7 @@ set global max_user_connections= 2; select @@session.max_user_connections, @@global.max_user_connections; @@session.max_user_connections @@global.max_user_connections 2 2 +create user mysqltest_1@localhost; grant usage on *.* to mysqltest_1@localhost; flush user_resources; select @@session.max_user_connections, @@global.max_user_connections; diff --git a/mysql-test/r/user_var-binlog.result b/mysql-test/r/user_var-binlog.result index e6e9ddf9545..2e1eb15cad4 100644 --- a/mysql-test/r/user_var-binlog.result +++ b/mysql-test/r/user_var-binlog.result @@ -30,7 +30,7 @@ use `test`/*!*/; SET TIMESTAMP=10000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; -SET @@session.sql_mode=0/*!*/; +SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index 5ed6c5abd47..fef3e4a3e9e 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -1133,12 +1133,12 @@ ERROR HY000: Variable 'ft_stopword_file' is a read only variable # SHOW VARIABLES like 'back_log'; Variable_name Value -back_log 150 +back_log 80 SELECT @@session.back_log; ERROR HY000: Variable 'back_log' is a GLOBAL variable SELECT @@global.back_log; @@global.back_log -150 +80 SET @@session.back_log= 7; ERROR HY000: Variable 'back_log' is a read only variable SET @@global.back_log= 7; @@ -1528,7 +1528,7 @@ SET @@global.key_buffer_size=@kbs; SET @@global.key_cache_block_size=@kcbs; select @@max_long_data_size; @@max_long_data_size -1048576 +4194304 # # Bug#11766424 59527: # Assert in DECIMAL_BIN_SIZE: @@ -1743,7 +1743,9 @@ SET @@sql_quote_show_create = @sql_quote_show_create_saved; drop table if exists t1; drop function if exists t1_max; drop function if exists t1_min; +set sql_mode=""; create table t1 (a int) engine=innodb; +set sql_mode=default; insert into t1(a) values (0), (1); create function t1_max() returns int return (select max(a) from t1); create function t1_min() returns int return (select min(a) from t1); diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 4a39eb9d57a..df2b48564ad 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -2237,12 +2237,12 @@ drop table t1; create table t1 ( r_object_id char(16) NOT NULL, group_name varchar(32) NOT NULL -) engine = InnoDB; +); create table t2 ( r_object_id char(16) NOT NULL, i_position int(11) NOT NULL, users_names varchar(32) default NULL -) Engine = InnoDB; +); create view v1 as select r_object_id, group_name from t1; create view v2 as select r_object_id, i_position, users_names from t2; create unique index r_object_id on t1(r_object_id); @@ -2902,6 +2902,8 @@ Tables_in_test t1 DROP TABLE t1; DROP VIEW IF EXISTS v1; +set GLOBAL sql_mode=""; +set LOCAL sql_mode=""; CREATE DATABASE bug21261DB; USE bug21261DB; CREATE TABLE t1 (x INT); @@ -2924,6 +2926,8 @@ DROP VIEW v1; DROP TABLE t1; DROP DATABASE bug21261DB; USE test; +set GLOBAL sql_mode=default; +set LOCAL sql_mode=default; create table t1 (f1 datetime); create view v1 as select * from t1 where f1 between now() and now() + interval 1 minute; show create view v1; diff --git a/mysql-test/r/view_grant.result b/mysql-test/r/view_grant.result index 550ca12d19e..525f9fbb5e1 100644 --- a/mysql-test/r/view_grant.result +++ b/mysql-test/r/view_grant.result @@ -1,5 +1,6 @@ drop database if exists mysqltest; drop view if exists v1,v2,v3; +create user test@localhost; grant create view on test.* to test@localhost; show grants for test@localhost; Grants for test@localhost @@ -13,6 +14,7 @@ drop user test@localhost; create database mysqltest; create table mysqltest.t1 (a int, b int); create table mysqltest.t2 (a int, b int); +create user mysqltest_1@localhost; grant select on mysqltest.t1 to mysqltest_1@localhost; grant create view,select on test.* to mysqltest_1@localhost; create definer=root@localhost view v1 as select * from mysqltest.t1; @@ -46,18 +48,19 @@ c select d from mysqltest.v1; ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for column 'd' in table 'v1' revoke all privileges on mysqltest.v1 from mysqltest_1@localhost; -delete from mysql.user where user='mysqltest_1'; +drop user mysqltest_1@localhost; drop database mysqltest; create database mysqltest; create table mysqltest.t1 (a int, b int); create algorithm=temptable view mysqltest.v1 (c,d) as select a+1,b+1 from mysqltest.t1; +create user mysqltest_1@localhost; grant select (c) on mysqltest.v1 to mysqltest_1@localhost; select c from mysqltest.v1; c select d from mysqltest.v1; ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for column 'd' in table 'v1' revoke all privileges on mysqltest.v1 from mysqltest_1@localhost; -delete from mysql.user where user='mysqltest_1'; +drop user mysqltest_1@localhost; drop database mysqltest; create database mysqltest; create table mysqltest.t1 (a int, b int); @@ -67,6 +70,7 @@ create algorithm=temptable view mysqltest.v2 (c,d) as select a+1,b+1 from mysqlt create view mysqltest.v3 (c,d) as select a+1,b+1 from mysqltest.t2; create algorithm=temptable view mysqltest.v4 (c,d) as select a+1,b+1 from mysqltest.t2; create view mysqltest.v5 (c,d) as select a+1,b+1 from mysqltest.t1; +create user mysqltest_1@localhost; grant select on mysqltest.v1 to mysqltest_1@localhost; grant select on mysqltest.v2 to mysqltest_1@localhost; grant select on mysqltest.v3 to mysqltest_1@localhost; @@ -166,7 +170,7 @@ show create view mysqltest.v4; View Create View character_set_client collation_connection v4 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest`.`v4` AS select (`mysqltest`.`t2`.`a` + 1) AS `c`,(`mysqltest`.`t2`.`b` + 1) AS `d` from `mysqltest`.`t2` latin1 latin1_swedish_ci revoke all privileges on mysqltest.* from mysqltest_1@localhost; -delete from mysql.user where user='mysqltest_1'; +drop user mysqltest_1@localhost; drop database mysqltest; create database mysqltest; create table mysqltest.t1 (a int, b int, primary key(a)); @@ -176,6 +180,7 @@ insert into mysqltest.t2 values (3), (4), (5), (6); create view mysqltest.v1 (a,c) as select a, b+1 from mysqltest.t1; create view mysqltest.v2 (a,c) as select a, b from mysqltest.t1; create view mysqltest.v3 (a,c) as select a, b+1 from mysqltest.t1; +create user mysqltest_1@localhost; grant update (a) on mysqltest.v2 to mysqltest_1@localhost; grant update on mysqltest.v1 to mysqltest_1@localhost; grant select on mysqltest.* to mysqltest_1@localhost; @@ -222,6 +227,7 @@ update v3 set a=a+c; ERROR 42000: UPDATE command denied to user 'mysqltest_1'@'localhost' for table 'v3' use test; REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost; +drop user mysqltest_1@localhost; drop database mysqltest; create database mysqltest; create table mysqltest.t1 (a int, b int, primary key(a)); @@ -230,6 +236,7 @@ create table mysqltest.t2 (x int); insert into mysqltest.t2 values (3), (4), (5), (6); create view mysqltest.v1 (a,c) as select a, b+1 from mysqltest.t1; create view mysqltest.v2 (a,c) as select a, b+1 from mysqltest.t1; +create user mysqltest_1@localhost; grant delete on mysqltest.v1 to mysqltest_1@localhost; grant select on mysqltest.* to mysqltest_1@localhost; use mysqltest; @@ -250,6 +257,7 @@ delete from v2 where c < 4; ERROR 42000: DELETE command denied to user 'mysqltest_1'@'localhost' for table 'v2' use test; REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost; +drop user mysqltest_1@localhost; drop database mysqltest; create database mysqltest; create table mysqltest.t1 (a int, b int, primary key(a)); @@ -258,6 +266,7 @@ create table mysqltest.t2 (x int, y int); insert into mysqltest.t2 values (3,4); create view mysqltest.v1 (a,c) as select a, b from mysqltest.t1; create view mysqltest.v2 (a,c) as select a, b from mysqltest.t1; +create user mysqltest_1@localhost; grant insert on mysqltest.v1 to mysqltest_1@localhost; grant select on mysqltest.* to mysqltest_1@localhost; use mysqltest; @@ -280,10 +289,12 @@ insert into v2 select x,y from t2; ERROR 42000: INSERT command denied to user 'mysqltest_1'@'localhost' for table 'v2' use test; REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost; +drop user mysqltest_1@localhost; drop database mysqltest; create database mysqltest; create table mysqltest.t1 (a int, b int); create table mysqltest.t2 (a int, b int); +create user mysqltest_1@localhost; grant update on mysqltest.t1 to mysqltest_1@localhost; grant update(b) on mysqltest.t2 to mysqltest_1@localhost; grant create view,update on test.* to mysqltest_1@localhost; @@ -308,18 +319,22 @@ ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for column grant update,select(b) on mysqltest.t2 to mysqltest_1@localhost; create view v4 as select b+1 from mysqltest.t2; REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost; +drop user mysqltest_1@localhost; drop database mysqltest; drop view v1,v2,v4; create database mysqltest; create table mysqltest.t1 (a int); +create user mysqltest_1@localhost; grant all privileges on mysqltest.* to mysqltest_1@localhost; use mysqltest; create view v1 as select * from t1; use test; revoke all privileges on mysqltest.* from mysqltest_1@localhost; +drop user mysqltest_1@localhost; drop database mysqltest; create database mysqltest; create table mysqltest.t1 (a int, b int); +create user mysqltest_1@localhost; grant select on mysqltest.t1 to mysqltest_1@localhost; grant create view,select on test.* to mysqltest_1@localhost; create view v1 as select * from mysqltest.t1; @@ -333,6 +348,7 @@ grant select on mysqltest.t1 to mysqltest_1@localhost; select * from v1; a b REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost; +drop user mysqltest_1@localhost; drop view v1; drop database mysqltest; create database mysqltest; @@ -348,6 +364,7 @@ create algorithm=MERGE view v2 as select f2() from t1; create algorithm=TEMPTABLE SQL SECURITY INVOKER view v3 as select f2() from t1; create algorithm=MERGE SQL SECURITY INVOKER view v4 as select f2() from t1; create SQL SECURITY INVOKER view v5 as select * from v4; +create user mysqltest_1@localhost; grant select on v1 to mysqltest_1@localhost; grant select on v2 to mysqltest_1@localhost; grant select on v3 to mysqltest_1@localhost; @@ -372,6 +389,7 @@ drop function f2; drop table t1, t2; use test; REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost; +drop user mysqltest_1@localhost; drop database mysqltest; create database mysqltest; use mysqltest; @@ -381,6 +399,7 @@ create table t2 (s1 int); drop function if exists f2; create function f2 () returns int begin declare v int; select s1 from t2 into v; return v; end// +create user mysqltest_1@localhost; grant select on t1 to mysqltest_1@localhost; grant execute on function f2 to mysqltest_1@localhost; grant create view on mysqltest.* to mysqltest_1@localhost; @@ -409,12 +428,14 @@ drop function f2; drop table t1, t2; use test; REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost; +drop user mysqltest_1@localhost; drop database mysqltest; create database mysqltest; use mysqltest; create table t1 (a int); create table v1 (a int); insert into t1 values (1); +create user mysqltest_1@localhost; grant select on t1 to mysqltest_1@localhost; grant select on v1 to mysqltest_1@localhost; grant create view on mysqltest.* to mysqltest_1@localhost; @@ -442,6 +463,7 @@ ERROR HY000: View 'mysqltest.v5' references invalid table(s) or column(s) or fun drop table t1; use test; REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost; +drop user mysqltest_1@localhost; drop database mysqltest; create database mysqltest; use mysqltest; @@ -452,6 +474,7 @@ create algorithm=MERGE view v2 as select *, a as b from t1; create algorithm=TEMPTABLE SQL SECURITY INVOKER view v3 as select *, a as b from t1; create algorithm=MERGE SQL SECURITY INVOKER view v4 as select *, a as b from t1; create SQL SECURITY INVOKER view v5 as select * from v4; +create user mysqltest_1@localhost; grant select on v1 to mysqltest_1@localhost; grant select on v2 to mysqltest_1@localhost; grant select on v3 to mysqltest_1@localhost; @@ -475,12 +498,14 @@ drop view v1, v2, v3, v4, v5; drop table t1; use test; REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost; +drop user mysqltest_1@localhost; drop database mysqltest; drop view if exists v1; drop table if exists t1; create table t1 as select * from mysql.user where user=''; delete from mysql.user where user=''; flush privileges; +create user 'test14256'@'%'; grant all on test.* to 'test14256'@'%'; use test; create view v1 as select 42; @@ -511,6 +536,7 @@ CREATE VIEW v1 AS SELECT * FROM t1; SHOW CREATE VIEW v1; View Create View character_set_client collation_connection v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i` from `t1` latin1 latin1_swedish_ci +create user mysqltest_1@localhost; GRANT SELECT, LOCK TABLES ON mysqltest.* TO mysqltest_1@localhost; use mysqltest; LOCK TABLES v1 READ; @@ -853,6 +879,7 @@ INSERT INTO mysqltest1.t1 VALUES (11), (12), (13), (14); INSERT INTO mysqltest1.t2 VALUES (21), (22), (23), (24); INSERT INTO mysqltest1.t3 VALUES (31), (32), (33), (34); INSERT INTO mysqltest1.t4 VALUES (41), (42), (43), (44); +CREATE USER mysqltest_u1@localhost; GRANT SELECT ON mysqltest1.t1 TO mysqltest_u1@localhost; GRANT INSERT ON mysqltest1.t2 TO mysqltest_u1@localhost; GRANT SELECT, UPDATE ON mysqltest1.t3 TO mysqltest_u1@localhost; @@ -933,6 +960,7 @@ CREATE DATABASE db1; USE db1; CREATE TABLE t1(f1 INT, f2 INT); CREATE VIEW v1 AS SELECT f1, f2 FROM t1; +CREATE USER foo; GRANT SELECT (f1) ON t1 TO foo; GRANT SELECT (f1) ON v1 TO foo; USE db1; diff --git a/mysql-test/r/warnings_engine_disabled.result b/mysql-test/r/warnings_engine_disabled.result index 9fcd3b934c0..d9e490ba18f 100644 --- a/mysql-test/r/warnings_engine_disabled.result +++ b/mysql-test/r/warnings_engine_disabled.result @@ -1,3 +1,4 @@ +set sql_mode=""; create table t1 (id int) engine=InnoDB; Warnings: Warning 1286 Unknown storage engine 'InnoDB' @@ -6,6 +7,7 @@ alter table t1 engine=InnoDB; Warnings: Warning 1286 Unknown storage engine 'InnoDB' drop table t1; +set sql_mode=default; SELECT ENGINE, SUPPORT FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='InnoDB'; ENGINE SUPPORT InnoDB NO diff --git a/mysql-test/suite/archive/archive_plugin.result b/mysql-test/suite/archive/archive_plugin.result index feb825f20ee..5656704989e 100644 --- a/mysql-test/suite/archive/archive_plugin.result +++ b/mysql-test/suite/archive/archive_plugin.result @@ -1,8 +1,5 @@ CREATE TABLE t1(a int) ENGINE=ARCHIVE; -Warnings: -Warning 1286 Unknown storage engine 'ARCHIVE' -Warning 1266 Using storage engine MyISAM for table 't1' -DROP TABLE t1; +ERROR 42000: Unknown storage engine 'ARCHIVE' INSTALL PLUGIN archive SONAME 'ha_archive.so'; INSTALL PLUGIN ARCHIVE SONAME 'ha_archive.so'; ERROR HY000: Plugin 'ARCHIVE' already installed diff --git a/mysql-test/suite/archive/archive_plugin.test b/mysql-test/suite/archive/archive_plugin.test index 8ea40114cca..69bf9a5f4ce 100644 --- a/mysql-test/suite/archive/archive_plugin.test +++ b/mysql-test/suite/archive/archive_plugin.test @@ -2,8 +2,8 @@ if (!$HA_ARCHIVE_SO) { --skip Need archive plugin } +--error ER_UNKNOWN_STORAGE_ENGINE CREATE TABLE t1(a int) ENGINE=ARCHIVE; -DROP TABLE t1; --replace_regex /\.dll/.so/ eval INSTALL PLUGIN archive SONAME '$HA_ARCHIVE_SO'; --replace_regex /\.dll/.so/ diff --git a/mysql-test/suite/archive/discover_5438.result b/mysql-test/suite/archive/discover_5438.result index b5ab56aa364..0cd44c40a4e 100644 --- a/mysql-test/suite/archive/discover_5438.result +++ b/mysql-test/suite/archive/discover_5438.result @@ -3,6 +3,7 @@ create view t1 as select "I am a view" as a; ERROR 42S01: Table 't1' already exists drop table t1; create table t1 (a int) engine=archive; +create user foo@bar; grant select on test.t1 to foo@bar; drop user foo@bar; drop table t1; diff --git a/mysql-test/suite/archive/discover_5438.test b/mysql-test/suite/archive/discover_5438.test index c05955baaf3..892b9d49592 100644 --- a/mysql-test/suite/archive/discover_5438.test +++ b/mysql-test/suite/archive/discover_5438.test @@ -12,6 +12,7 @@ create view t1 as select "I am a view" as a; drop table t1; create table t1 (a int) engine=archive; +create user foo@bar; grant select on test.t1 to foo@bar; drop user foo@bar; drop table t1; diff --git a/mysql-test/suite/binlog/r/binlog_grant.result b/mysql-test/suite/binlog/r/binlog_grant.result index 09a3d709929..618e00af72a 100644 --- a/mysql-test/suite/binlog/r/binlog_grant.result +++ b/mysql-test/suite/binlog/r/binlog_grant.result @@ -22,6 +22,7 @@ ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) fo **** Clean up **** set global binlog_format = @saved_binlog_format; drop user mysqltest_1@localhost; +CREATE USER 'mysqltest_1'@'localhost'; GRANT REPLICATION CLIENT ON *.* TO 'mysqltest_1'@'localhost'; SHOW MASTER LOGS; SHOW BINARY LOGS; diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result index 7581a9a7cad..2719091f4dd 100644 --- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result +++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog2.result @@ -1,3 +1,4 @@ +set sql_mode=""; drop table if exists t1; reset master; set @a=UNIX_TIMESTAMP("2020-01-21 15:32:22"); diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result index 0372d2749a8..da48f4b2641 100644 --- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result +++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result @@ -363,7 +363,7 @@ use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; -SET @@session.sql_mode=0/*!*/; +SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result index 21b3d4f63be..4d92d3714c9 100644 --- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result +++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result @@ -1,3 +1,4 @@ +set sql_mode=""; SET NAMES 'utf8'; # # Preparatory cleanup. diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result index 5dea7c79bdb..11fa220e896 100644 --- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result +++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result @@ -1,3 +1,4 @@ +set sql_mode=""; SET NAMES 'utf8'; # # Preparatory cleanup. diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result index ad1a6ede9b7..92e8438094f 100644 --- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result +++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result @@ -147,7 +147,7 @@ use `test`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; -SET @@session.sql_mode=0/*!*/; +SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; diff --git a/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result b/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result index c446c0f4861..6b56c006518 100644 --- a/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result +++ b/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result @@ -20,7 +20,7 @@ BEGIN SET TIMESTAMP=10000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; -SET @@session.sql_mode=0/*!*/; +SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; diff --git a/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result b/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result index f2722924b6a..ad5d0500d19 100644 --- a/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result +++ b/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result @@ -51,7 +51,7 @@ use `new_test1`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; -SET @@session.sql_mode=0/*!*/; +SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; @@ -263,7 +263,7 @@ use `new_test1`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; -SET @@session.sql_mode=0/*!*/; +SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; diff --git a/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result b/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result index 55db2de4b52..825b9bf05a0 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result +++ b/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result @@ -22,7 +22,7 @@ use `test`/*!*/; SET TIMESTAMP=10000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; -SET @@session.sql_mode=0/*!*/; +SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; diff --git a/mysql-test/suite/binlog/t/binlog_grant.test b/mysql-test/suite/binlog/t/binlog_grant.test index 0c9d9a45ec9..8a76b11e707 100644 --- a/mysql-test/suite/binlog/t/binlog_grant.test +++ b/mysql-test/suite/binlog/t/binlog_grant.test @@ -58,6 +58,7 @@ drop user mysqltest_1@localhost; # Testing if REPLICATION CLIENT privilege is enough to execute # SHOW MASTER LOGS and SHOW BINARY. +CREATE USER 'mysqltest_1'@'localhost'; GRANT REPLICATION CLIENT ON *.* TO 'mysqltest_1'@'localhost'; --connect(rpl,localhost,mysqltest_1,,) diff --git a/mysql-test/suite/binlog/t/binlog_mysqlbinlog2.test b/mysql-test/suite/binlog/t/binlog_mysqlbinlog2.test index 367314d9643..76d6abf4d18 100644 --- a/mysql-test/suite/binlog/t/binlog_mysqlbinlog2.test +++ b/mysql-test/suite/binlog/t/binlog_mysqlbinlog2.test @@ -5,6 +5,7 @@ -- source include/have_binlog_format_mixed_or_statement.inc -- source include/binlog_start_pos.inc +set sql_mode=""; --disable_warnings drop table if exists t1; --enable_warnings diff --git a/mysql-test/suite/binlog/t/binlog_row_annotate.test b/mysql-test/suite/binlog/t/binlog_row_annotate.test index a0f72c9222c..e831b29df00 100644 --- a/mysql-test/suite/binlog/t/binlog_row_annotate.test +++ b/mysql-test/suite/binlog/t/binlog_row_annotate.test @@ -24,6 +24,8 @@ --disable_query_log +set sql_mode=""; + # Fix timestamp to avoid varying results SET timestamp=1000000000; diff --git a/mysql-test/suite/federated/federatedx.result b/mysql-test/suite/federated/federatedx.result index 522b286c545..5356fcad424 100644 --- a/mysql-test/suite/federated/federatedx.result +++ b/mysql-test/suite/federated/federatedx.result @@ -1810,6 +1810,7 @@ length(a) 5000 drop table t1; drop table t1; +set sql_mode=""; DROP TABLE IF EXISTS federated.test; CREATE TABLE federated.test ( `i` int(11) NOT NULL, @@ -1818,6 +1819,7 @@ CREATE TABLE federated.test ( PRIMARY KEY (`i`,`j`), UNIQUE KEY `i` (`i`,`c`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; +set sql_mode=default; DROP TABLE IF EXISTS federated.test1; DROP TABLE IF EXISTS federated.test2; create table federated.test1 ( diff --git a/mysql-test/suite/federated/federatedx.test b/mysql-test/suite/federated/federatedx.test index e79970f8dcd..87ef49e66e8 100644 --- a/mysql-test/suite/federated/federatedx.test +++ b/mysql-test/suite/federated/federatedx.test @@ -1633,6 +1633,7 @@ drop table t1; # connection slave; +set sql_mode=""; --disable_warnings DROP TABLE IF EXISTS federated.test; CREATE TABLE federated.test ( @@ -1643,6 +1644,7 @@ CREATE TABLE federated.test ( UNIQUE KEY `i` (`i`,`c`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; --enable_warnings +set sql_mode=default; connection master; --disable_warnings diff --git a/mysql-test/suite/funcs_1/datadict/is_routines.inc b/mysql-test/suite/funcs_1/datadict/is_routines.inc index 5ef88e2dffc..ecbb1b8c0da 100644 --- a/mysql-test/suite/funcs_1/datadict/is_routines.inc +++ b/mysql-test/suite/funcs_1/datadict/is_routines.inc @@ -18,6 +18,7 @@ # 2008-06-11 mleich Move t/is_routines.test to this file and # create variants for embedded/non embedded server. # +set sql_mode=""; let $engine_type = MEMORY; let $other_engine_type = MyISAM; diff --git a/mysql-test/suite/funcs_1/datadict/is_triggers.inc b/mysql-test/suite/funcs_1/datadict/is_triggers.inc index 5597bc816fc..6c618e533b2 100644 --- a/mysql-test/suite/funcs_1/datadict/is_triggers.inc +++ b/mysql-test/suite/funcs_1/datadict/is_triggers.inc @@ -19,6 +19,7 @@ # 2008-06-11 mleich Move t/is_triggers.test to this file and # create variants for embedded/non embedded server. # +set global sql_mode=""; let $engine_type = MEMORY; let $other_engine_type = MyISAM; @@ -257,3 +258,4 @@ ALTER TABLE information_schema.triggers RENAME information_schema.xtriggers; # Cleanup DROP DATABASE db_datadict; +set global sql_mode=default; diff --git a/mysql-test/suite/funcs_1/datadict/processlist_priv.inc b/mysql-test/suite/funcs_1/datadict/processlist_priv.inc index cc96f89f01a..e40ed39d49a 100644 --- a/mysql-test/suite/funcs_1/datadict/processlist_priv.inc +++ b/mysql-test/suite/funcs_1/datadict/processlist_priv.inc @@ -226,6 +226,7 @@ SELECT * FROM information_schema.processlist; --echo connection default (user=root) --echo #################################################################################### connection default; +create user ''@'localhost'; GRANT PROCESS ON *.* TO ''@'localhost'; --real_sleep 0.3 diff --git a/mysql-test/suite/funcs_1/r/innodb_storedproc_06.result b/mysql-test/suite/funcs_1/r/innodb_storedproc_06.result index fa8fb6c1eb2..1131477869a 100644 --- a/mysql-test/suite/funcs_1/r/innodb_storedproc_06.result +++ b/mysql-test/suite/funcs_1/r/innodb_storedproc_06.result @@ -1,3 +1,5 @@ +set sql_mode=""; +set GLOBAL sql_mode=""; --source suite/funcs_1/storedproc/load_sp_tb.inc -------------------------------------------------------------------------------- @@ -388,6 +390,7 @@ DROP USER 'user_2'@'localhost'; -------------------------------------------------------------------------------- DROP DATABASE IF EXISTS db_storedproc; DROP DATABASE IF EXISTS db_storedproc_1; +set GLOBAL sql_mode=default; . +++ END OF SCRIPT +++ -------------------------------------------------------------------------------- diff --git a/mysql-test/suite/funcs_1/r/innodb_storedproc_08.result b/mysql-test/suite/funcs_1/r/innodb_storedproc_08.result index 0dfc1f51b76..de63339ee95 100644 --- a/mysql-test/suite/funcs_1/r/innodb_storedproc_08.result +++ b/mysql-test/suite/funcs_1/r/innodb_storedproc_08.result @@ -1,3 +1,4 @@ +set sql_mode=""; --source suite/funcs_1/storedproc/load_sp_tb.inc -------------------------------------------------------------------------------- diff --git a/mysql-test/suite/funcs_1/r/innodb_trig_03.result b/mysql-test/suite/funcs_1/r/innodb_trig_03.result index db92ea56444..5edef4cf3af 100644 --- a/mysql-test/suite/funcs_1/r/innodb_trig_03.result +++ b/mysql-test/suite/funcs_1/r/innodb_trig_03.result @@ -1,3 +1,4 @@ +set sql_mode=""; USE test; drop table if exists tb3; create table tb3 ( diff --git a/mysql-test/suite/funcs_1/r/innodb_trig_03e.result b/mysql-test/suite/funcs_1/r/innodb_trig_03e.result index cf93657885c..6d8bba4714b 100644 --- a/mysql-test/suite/funcs_1/r/innodb_trig_03e.result +++ b/mysql-test/suite/funcs_1/r/innodb_trig_03e.result @@ -449,8 +449,8 @@ create trigger trg1_4 before UPDATE on t1 for each row set new.f1 = 'trig 1_4-yes'; show triggers; Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -trg1_3 INSERT t1 set new.f1 = 'trig 1_3-yes' BEFORE NULL test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci -trg1_4 UPDATE t1 set new.f1 = 'trig 1_4-yes' BEFORE NULL test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci +trg1_3 INSERT t1 set new.f1 = 'trig 1_3-yes' BEFORE NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci +trg1_4 UPDATE t1 set new.f1 = 'trig 1_4-yes' BEFORE NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci select current_user; current_user test_noprivs@localhost diff --git a/mysql-test/suite/funcs_1/r/innodb_trig_0407.result b/mysql-test/suite/funcs_1/r/innodb_trig_0407.result index 7f01975db16..c51347d5fa8 100644 --- a/mysql-test/suite/funcs_1/r/innodb_trig_0407.result +++ b/mysql-test/suite/funcs_1/r/innodb_trig_0407.result @@ -1,3 +1,5 @@ +set sql_mode=""; +set GLOBAL sql_mode=""; USE test; drop table if exists tb3; create table tb3 ( @@ -468,3 +470,4 @@ drop user test_general@localhost; drop user test_general; drop user test_super@localhost; DROP TABLE test.tb3; +set GLOBAL sql_mode=default; diff --git a/mysql-test/suite/funcs_1/r/innodb_trig_08.result b/mysql-test/suite/funcs_1/r/innodb_trig_08.result index f9454edce4b..20354088a0f 100644 --- a/mysql-test/suite/funcs_1/r/innodb_trig_08.result +++ b/mysql-test/suite/funcs_1/r/innodb_trig_08.result @@ -1,3 +1,5 @@ +set sql_mode=""; +set GLOBAL sql_mode=""; USE test; drop table if exists tb3; create table tb3 ( @@ -521,3 +523,4 @@ drop user test_general@localhost; drop user test_general; drop user test_super@localhost; DROP TABLE test.tb3; +set GLOBAL sql_mode=default; diff --git a/mysql-test/suite/funcs_1/r/is_routines.result b/mysql-test/suite/funcs_1/r/is_routines.result index a062e2d7b8f..525b5c92a68 100644 --- a/mysql-test/suite/funcs_1/r/is_routines.result +++ b/mysql-test/suite/funcs_1/r/is_routines.result @@ -1,3 +1,4 @@ +set sql_mode=""; SHOW TABLES FROM information_schema LIKE 'ROUTINES'; Tables_in_information_schema (ROUTINES) ROUTINES diff --git a/mysql-test/suite/funcs_1/r/is_triggers.result b/mysql-test/suite/funcs_1/r/is_triggers.result index 53bb54aa0f2..d6b5f3a42bf 100644 --- a/mysql-test/suite/funcs_1/r/is_triggers.result +++ b/mysql-test/suite/funcs_1/r/is_triggers.result @@ -1,3 +1,4 @@ +set global sql_mode=""; SHOW TABLES FROM information_schema LIKE 'TRIGGERS'; Tables_in_information_schema (TRIGGERS) TRIGGERS @@ -228,3 +229,4 @@ ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_ ALTER TABLE information_schema.triggers RENAME information_schema.xtriggers; ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' DROP DATABASE db_datadict; +set global sql_mode=default; diff --git a/mysql-test/suite/funcs_1/r/memory_storedproc_06.result b/mysql-test/suite/funcs_1/r/memory_storedproc_06.result index f08165b21f8..c38481bac50 100644 --- a/mysql-test/suite/funcs_1/r/memory_storedproc_06.result +++ b/mysql-test/suite/funcs_1/r/memory_storedproc_06.result @@ -1,4 +1,5 @@ SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION'; +set GLOBAL sql_mode=""; --source suite/funcs_1/storedproc/load_sp_tb.inc -------------------------------------------------------------------------------- @@ -389,6 +390,7 @@ DROP USER 'user_2'@'localhost'; -------------------------------------------------------------------------------- DROP DATABASE IF EXISTS db_storedproc; DROP DATABASE IF EXISTS db_storedproc_1; +set GLOBAL sql_mode=default; . +++ END OF SCRIPT +++ -------------------------------------------------------------------------------- diff --git a/mysql-test/suite/funcs_1/r/memory_trig_03e.result b/mysql-test/suite/funcs_1/r/memory_trig_03e.result index 5f05f7c0af5..cfa839b382c 100644 --- a/mysql-test/suite/funcs_1/r/memory_trig_03e.result +++ b/mysql-test/suite/funcs_1/r/memory_trig_03e.result @@ -450,8 +450,8 @@ create trigger trg1_4 before UPDATE on t1 for each row set new.f1 = 'trig 1_4-yes'; show triggers; Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -trg1_3 INSERT t1 set new.f1 = 'trig 1_3-yes' BEFORE NULL test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci -trg1_4 UPDATE t1 set new.f1 = 'trig 1_4-yes' BEFORE NULL test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci +trg1_3 INSERT t1 set new.f1 = 'trig 1_3-yes' BEFORE NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci +trg1_4 UPDATE t1 set new.f1 = 'trig 1_4-yes' BEFORE NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci select current_user; current_user test_noprivs@localhost diff --git a/mysql-test/suite/funcs_1/r/memory_trig_0407.result b/mysql-test/suite/funcs_1/r/memory_trig_0407.result index 2146c74b72e..7f3277f55e1 100644 --- a/mysql-test/suite/funcs_1/r/memory_trig_0407.result +++ b/mysql-test/suite/funcs_1/r/memory_trig_0407.result @@ -1,4 +1,5 @@ SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION'; +set GLOBAL sql_mode=""; USE test; drop table if exists tb3; create table tb3 ( @@ -469,3 +470,4 @@ drop user test_general@localhost; drop user test_general; drop user test_super@localhost; DROP TABLE test.tb3; +set GLOBAL sql_mode=default; diff --git a/mysql-test/suite/funcs_1/r/memory_trig_08.result b/mysql-test/suite/funcs_1/r/memory_trig_08.result index d19507e5f4d..4632cfe269c 100644 --- a/mysql-test/suite/funcs_1/r/memory_trig_08.result +++ b/mysql-test/suite/funcs_1/r/memory_trig_08.result @@ -1,4 +1,5 @@ SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION'; +set GLOBAL sql_mode=""; USE test; drop table if exists tb3; create table tb3 ( @@ -522,3 +523,4 @@ drop user test_general@localhost; drop user test_general; drop user test_super@localhost; DROP TABLE test.tb3; +set GLOBAL sql_mode=default; diff --git a/mysql-test/suite/funcs_1/r/myisam_storedproc_06.result b/mysql-test/suite/funcs_1/r/myisam_storedproc_06.result index f08165b21f8..c38481bac50 100644 --- a/mysql-test/suite/funcs_1/r/myisam_storedproc_06.result +++ b/mysql-test/suite/funcs_1/r/myisam_storedproc_06.result @@ -1,4 +1,5 @@ SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION'; +set GLOBAL sql_mode=""; --source suite/funcs_1/storedproc/load_sp_tb.inc -------------------------------------------------------------------------------- @@ -389,6 +390,7 @@ DROP USER 'user_2'@'localhost'; -------------------------------------------------------------------------------- DROP DATABASE IF EXISTS db_storedproc; DROP DATABASE IF EXISTS db_storedproc_1; +set GLOBAL sql_mode=default; . +++ END OF SCRIPT +++ -------------------------------------------------------------------------------- diff --git a/mysql-test/suite/funcs_1/r/myisam_trig_03e.result b/mysql-test/suite/funcs_1/r/myisam_trig_03e.result index c34525a52f8..fd796dd4550 100644 --- a/mysql-test/suite/funcs_1/r/myisam_trig_03e.result +++ b/mysql-test/suite/funcs_1/r/myisam_trig_03e.result @@ -450,8 +450,8 @@ create trigger trg1_4 before UPDATE on t1 for each row set new.f1 = 'trig 1_4-yes'; show triggers; Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -trg1_3 INSERT t1 set new.f1 = 'trig 1_3-yes' BEFORE NULL test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci -trg1_4 UPDATE t1 set new.f1 = 'trig 1_4-yes' BEFORE NULL test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci +trg1_3 INSERT t1 set new.f1 = 'trig 1_3-yes' BEFORE NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci +trg1_4 UPDATE t1 set new.f1 = 'trig 1_4-yes' BEFORE NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci select current_user; current_user test_noprivs@localhost diff --git a/mysql-test/suite/funcs_1/r/myisam_trig_0407.result b/mysql-test/suite/funcs_1/r/myisam_trig_0407.result index 2146c74b72e..7f3277f55e1 100644 --- a/mysql-test/suite/funcs_1/r/myisam_trig_0407.result +++ b/mysql-test/suite/funcs_1/r/myisam_trig_0407.result @@ -1,4 +1,5 @@ SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION'; +set GLOBAL sql_mode=""; USE test; drop table if exists tb3; create table tb3 ( @@ -469,3 +470,4 @@ drop user test_general@localhost; drop user test_general; drop user test_super@localhost; DROP TABLE test.tb3; +set GLOBAL sql_mode=default; diff --git a/mysql-test/suite/funcs_1/r/myisam_trig_08.result b/mysql-test/suite/funcs_1/r/myisam_trig_08.result index d19507e5f4d..4632cfe269c 100644 --- a/mysql-test/suite/funcs_1/r/myisam_trig_08.result +++ b/mysql-test/suite/funcs_1/r/myisam_trig_08.result @@ -1,4 +1,5 @@ SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION'; +set GLOBAL sql_mode=""; USE test; drop table if exists tb3; create table tb3 ( @@ -522,3 +523,4 @@ drop user test_general@localhost; drop user test_general; drop user test_super@localhost; DROP TABLE test.tb3; +set GLOBAL sql_mode=default; diff --git a/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result b/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result index 079aca6b25c..7733cc4c43b 100644 --- a/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result +++ b/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result @@ -206,6 +206,7 @@ ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY R 5 Grant PROCESS privilege to anonymous user. connection default (user=root) #################################################################################### +create user ''@'localhost'; GRANT PROCESS ON *.* TO ''@'localhost'; #################################################################################### 5.1 Establish connection (anonymous1,localhost,'',,information_schema) diff --git a/mysql-test/suite/funcs_1/r/processlist_priv_ps.result b/mysql-test/suite/funcs_1/r/processlist_priv_ps.result index 19631cfb820..04c309c3f54 100644 --- a/mysql-test/suite/funcs_1/r/processlist_priv_ps.result +++ b/mysql-test/suite/funcs_1/r/processlist_priv_ps.result @@ -206,6 +206,7 @@ ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY R 5 Grant PROCESS privilege to anonymous user. connection default (user=root) #################################################################################### +create user ''@'localhost'; GRANT PROCESS ON *.* TO ''@'localhost'; #################################################################################### 5.1 Establish connection (anonymous1,localhost,'',,information_schema) diff --git a/mysql-test/suite/funcs_1/r/storedproc.result b/mysql-test/suite/funcs_1/r/storedproc.result index cf3bc923b19..37609c770a5 100644 --- a/mysql-test/suite/funcs_1/r/storedproc.result +++ b/mysql-test/suite/funcs_1/r/storedproc.result @@ -1,3 +1,4 @@ +set sql_mode=""; --source suite/funcs_1/storedproc/load_sp_tb.inc -------------------------------------------------------------------------------- diff --git a/mysql-test/suite/funcs_1/storedproc/storedproc_06.inc b/mysql-test/suite/funcs_1/storedproc/storedproc_06.inc index 3e5ca055ae1..c4f8496fd06 100644 --- a/mysql-test/suite/funcs_1/storedproc/storedproc_06.inc +++ b/mysql-test/suite/funcs_1/storedproc/storedproc_06.inc @@ -4,6 +4,8 @@ # privileges. --source include/not_embedded.inc +set GLOBAL sql_mode=""; + --source suite/funcs_1/storedproc/load_sp_tb.inc # ============================================================================== @@ -451,6 +453,7 @@ DROP USER 'user_2'@'localhost'; # USE the same .inc to cleanup before and after the test --source suite/funcs_1/storedproc/cleanup_sp_tb.inc +set GLOBAL sql_mode=default; # ============================================================================== --echo --echo . +++ END OF SCRIPT +++ diff --git a/mysql-test/suite/funcs_1/t/innodb_storedproc_06.test b/mysql-test/suite/funcs_1/t/innodb_storedproc_06.test index ce061da2299..7bfc3153a61 100644 --- a/mysql-test/suite/funcs_1/t/innodb_storedproc_06.test +++ b/mysql-test/suite/funcs_1/t/innodb_storedproc_06.test @@ -4,6 +4,7 @@ --source include/have_innodb.inc # 2. Set $engine_type +set sql_mode=""; let $engine_type= innodb; --source suite/funcs_1/storedproc/storedproc_06.inc diff --git a/mysql-test/suite/funcs_1/t/innodb_storedproc_08.test b/mysql-test/suite/funcs_1/t/innodb_storedproc_08.test index c8c289c5f49..39c983ad2a0 100644 --- a/mysql-test/suite/funcs_1/t/innodb_storedproc_08.test +++ b/mysql-test/suite/funcs_1/t/innodb_storedproc_08.test @@ -4,6 +4,7 @@ --source include/have_innodb.inc # 2. Set $engine_type +set sql_mode=""; let $engine_type= innodb; --source suite/funcs_1/storedproc/storedproc_08.inc diff --git a/mysql-test/suite/funcs_1/t/innodb_trig_03.test b/mysql-test/suite/funcs_1/t/innodb_trig_03.test index 2a611c97fbf..f2a8fa3c1d9 100644 --- a/mysql-test/suite/funcs_1/t/innodb_trig_03.test +++ b/mysql-test/suite/funcs_1/t/innodb_trig_03.test @@ -5,6 +5,7 @@ # 1. Check if InnoDB is available --source include/have_innodb.inc # 2. Set $engine_type +set sql_mode=""; let $engine_type= innodb; --source suite/funcs_1/triggers/triggers_03.inc diff --git a/mysql-test/suite/funcs_1/t/innodb_trig_0407.test b/mysql-test/suite/funcs_1/t/innodb_trig_0407.test index d8081770f4b..dddb000cf18 100644 --- a/mysql-test/suite/funcs_1/t/innodb_trig_0407.test +++ b/mysql-test/suite/funcs_1/t/innodb_trig_0407.test @@ -5,6 +5,7 @@ # 1. Check if InnoDB is available --source include/have_innodb.inc # 2. Set $engine_type +set sql_mode=""; let $engine_type= innodb; --source suite/funcs_1/triggers/triggers_0407.inc diff --git a/mysql-test/suite/funcs_1/t/innodb_trig_08.test b/mysql-test/suite/funcs_1/t/innodb_trig_08.test index ba48b977ba2..c870c1a7895 100644 --- a/mysql-test/suite/funcs_1/t/innodb_trig_08.test +++ b/mysql-test/suite/funcs_1/t/innodb_trig_08.test @@ -5,6 +5,7 @@ # 1. Check if InnoDB is available --source include/have_innodb.inc # 2. Set $engine_type +set sql_mode=""; let $engine_type= innodb; --source suite/funcs_1/triggers/triggers_08.inc diff --git a/mysql-test/suite/funcs_1/t/storedproc.test b/mysql-test/suite/funcs_1/t/storedproc.test index ff417957c85..ca9dfcbbe2d 100644 --- a/mysql-test/suite/funcs_1/t/storedproc.test +++ b/mysql-test/suite/funcs_1/t/storedproc.test @@ -9,6 +9,7 @@ # - restore global sort_buffer_size after some subtest # ############################################################################ +set sql_mode=""; # Bug#37746 - Arithmetic range ("int") is smaller than expected # This code is in place to ensure this test is only skipped diff --git a/mysql-test/suite/funcs_1/triggers/triggers_0407.inc b/mysql-test/suite/funcs_1/triggers/triggers_0407.inc index 2bc9dd66478..907260a00f0 100644 --- a/mysql-test/suite/funcs_1/triggers/triggers_0407.inc +++ b/mysql-test/suite/funcs_1/triggers/triggers_0407.inc @@ -3,6 +3,7 @@ # Trigger Tests # (test case numbering refer to requirement document TP v1.1) #====================================================================== +set GLOBAL sql_mode=""; USE test; --source suite/funcs_1/include/tb3.inc @@ -622,3 +623,6 @@ let $message= Testcase 3.5.7.17 (see Testcase 3.5.1.1); drop user test_super@localhost; DROP TABLE test.tb3; + + +set GLOBAL sql_mode=default; diff --git a/mysql-test/suite/funcs_1/triggers/triggers_08.inc b/mysql-test/suite/funcs_1/triggers/triggers_08.inc index 996a5aa69ae..0aeb46896a6 100644 --- a/mysql-test/suite/funcs_1/triggers/triggers_08.inc +++ b/mysql-test/suite/funcs_1/triggers/triggers_08.inc @@ -4,6 +4,7 @@ # (test case numbering refer to requirement document TP v1.1) #====================================================================== # WL#4084: enable disabled parts, 2007-11-15 hhunger +set GLOBAL sql_mode=""; USE test; --source suite/funcs_1/include/tb3.inc @@ -557,3 +558,4 @@ let $message= Testcase 3.5.8.7; drop user test_super@localhost; DROP TABLE test.tb3; +set GLOBAL sql_mode=default; diff --git a/mysql-test/suite/maria/icp.result b/mysql-test/suite/maria/icp.result index 7a8c0dd44dd..42962b3a226 100644 --- a/mysql-test/suite/maria/icp.result +++ b/mysql-test/suite/maria/icp.result @@ -416,17 +416,11 @@ DROP TABLE t1; # Bug#59259 "Incorrect rows returned for a correlated subquery # when ICP is on" # -CREATE TABLE t1 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL) ENGINE=InnoDB; -Warnings: -Warning 1286 Unknown storage engine 'InnoDB' -Warning 1266 Using storage engine Aria for table 't1' +CREATE TABLE t1 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL); INSERT INTO t1 VALUES (11,0); INSERT INTO t1 VALUES (12,5); INSERT INTO t1 VALUES (15,0); -CREATE TABLE t2 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL) ENGINE=InnoDB; -Warnings: -Warning 1286 Unknown storage engine 'InnoDB' -Warning 1266 Using storage engine Aria for table 't2' +CREATE TABLE t2 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL); INSERT INTO t2 VALUES (11,1); INSERT INTO t2 VALUES (12,2); INSERT INTO t2 VALUES (15,4); diff --git a/mysql-test/suite/parts/inc/partition_auto_increment.inc b/mysql-test/suite/parts/inc/partition_auto_increment.inc index 45406bd145a..e3a8d681275 100644 --- a/mysql-test/suite/parts/inc/partition_auto_increment.inc +++ b/mysql-test/suite/parts/inc/partition_auto_increment.inc @@ -3,6 +3,9 @@ # auto_increment test # used variables: $engine # +--disable_query_log +set sql_mode=""; +--enable_query_log -- disable_warnings DROP TABLE IF EXISTS t1; diff --git a/mysql-test/suite/perfschema/include/connection_setup.inc b/mysql-test/suite/perfschema/include/connection_setup.inc index a661d43d063..93b8e959ee3 100644 --- a/mysql-test/suite/perfschema/include/connection_setup.inc +++ b/mysql-test/suite/perfschema/include/connection_setup.inc @@ -53,10 +53,15 @@ --disable_query_log +create user user1@localhost; grant ALL on *.* to user1@localhost; +create user user2@localhost; grant ALL on *.* to user2@localhost; +create user user3@localhost; grant ALL on *.* to user3@localhost; +create user user4@localhost; grant ALL on *.* to user4@localhost; +create user user5@localhost; grant ALL on *.* to user5@localhost; flush privileges; diff --git a/mysql-test/suite/perfschema/include/event_aggregate_setup.inc b/mysql-test/suite/perfschema/include/event_aggregate_setup.inc index ec35e60d463..7dfefd25235 100644 --- a/mysql-test/suite/perfschema/include/event_aggregate_setup.inc +++ b/mysql-test/suite/perfschema/include/event_aggregate_setup.inc @@ -66,10 +66,13 @@ --source ../include/wait_for_pfs_thread_count.inc --disable_query_log - +create user user1@localhost; grant ALL on *.* to user1@localhost; +create user user2@localhost; grant ALL on *.* to user2@localhost; +create user user3@localhost; grant ALL on *.* to user3@localhost; +create user user4@localhost; grant ALL on *.* to user4@localhost; flush privileges; diff --git a/mysql-test/suite/perfschema/include/stage_setup.inc b/mysql-test/suite/perfschema/include/stage_setup.inc index 639b1df8c02..85ade046939 100644 --- a/mysql-test/suite/perfschema/include/stage_setup.inc +++ b/mysql-test/suite/perfschema/include/stage_setup.inc @@ -28,9 +28,13 @@ --disable_query_log +create user user1@localhost; grant ALL on *.* to user1@localhost; +create user user2@localhost; grant ALL on *.* to user2@localhost; +create user user3@localhost; grant ALL on *.* to user3@localhost; +create user user4@localhost; grant ALL on *.* to user4@localhost; flush privileges; diff --git a/mysql-test/suite/perfschema/include/table_aggregate_setup.inc b/mysql-test/suite/perfschema/include/table_aggregate_setup.inc index 522cdb9346d..79aa5482838 100644 --- a/mysql-test/suite/perfschema/include/table_aggregate_setup.inc +++ b/mysql-test/suite/perfschema/include/table_aggregate_setup.inc @@ -71,9 +71,13 @@ --source ../include/wait_for_pfs_thread_count.inc --disable_query_log +create user user1@localhost; grant ALL on *.* to user1@localhost; +create user user2@localhost; grant ALL on *.* to user2@localhost; +create user user3@localhost; grant ALL on *.* to user3@localhost; +create user user4@localhost; grant ALL on *.* to user4@localhost; flush privileges; diff --git a/mysql-test/suite/perfschema/r/column_privilege.result b/mysql-test/suite/perfschema/r/column_privilege.result index e4ad9200272..ea901484d7e 100644 --- a/mysql-test/suite/perfschema/r/column_privilege.result +++ b/mysql-test/suite/perfschema/r/column_privilege.result @@ -2,6 +2,7 @@ show grants; Grants for root@localhost GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION +create user 'pfs_user_5'@localhost; grant usage on *.* to 'pfs_user_5'@localhost with GRANT OPTION; grant SELECT(thread_id, event_id) on performance_schema.events_waits_current to 'pfs_user_5'@localhost; diff --git a/mysql-test/suite/perfschema/r/global_read_lock.result b/mysql-test/suite/perfschema/r/global_read_lock.result index f7ff4382261..dab22c79100 100644 --- a/mysql-test/suite/perfschema/r/global_read_lock.result +++ b/mysql-test/suite/perfschema/r/global_read_lock.result @@ -1,5 +1,6 @@ use performance_schema; update performance_schema.setup_instruments set enabled='YES'; +create user pfsuser@localhost; grant SELECT, UPDATE, LOCK TABLES on performance_schema.* to pfsuser@localhost; flush privileges; connect (con1, localhost, pfsuser, , test); diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_allow.result index ffe3dc2e0eb..d146f5324d0 100644 --- a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_allow.result +++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_allow.result @@ -23,6 +23,7 @@ select `User`, `Host` from mysql.`user` where `user` like '2001:%'; User Host select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%'; User Host +create user 'root'@'192.0.2.4'; grant select on test.* to 'root'@'192.0.2.4'; select "Con1 is alive"; Con1 is alive diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_allow.result index 7c658e17c55..6c1bce7c9a0 100644 --- a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_allow.result +++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_allow.result @@ -23,6 +23,7 @@ select `User`, `Host` from mysql.`user` where `user` like '2001:%'; User Host select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%'; User Host +create user 'root'@'192.0.2.4'; grant select on test.* to 'root'@'192.0.2.4'; select "Con1 is alive"; Con1 is alive diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_allow.result index 5657887e439..d04a565508f 100644 --- a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_allow.result +++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_allow.result @@ -23,6 +23,7 @@ select `User`, `Host` from mysql.`user` where `user` like '2001:%'; User Host select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%'; User Host +create user 'root'@'santa.claus.ipv4.example.com'; grant select on test.* to 'root'@'santa.claus.ipv4.example.com'; select "Con1 is alive"; Con1 is alive diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_allow.result index 115af4792c3..ea5e91307c8 100644 --- a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_allow.result +++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_allow.result @@ -23,7 +23,9 @@ select `User`, `Host` from mysql.`user` where `user` like '2001:%'; User Host select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%'; User Host +create user 'root'@'santa.claus.ipv4.example.com'; grant select on test.* to 'root'@'santa.claus.ipv4.example.com'; +create user 'root'@'192.0.2.4'; grant select on test.* to 'root'@'192.0.2.4'; select "Con1 is alive"; Con1 is alive diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_blocked.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_blocked.result index 6f5affadd2f..4eae65c4618 100644 --- a/mysql-test/suite/perfschema/r/hostcache_ipv4_blocked.result +++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_blocked.result @@ -24,6 +24,7 @@ select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%'; User Host select @@global.max_connect_errors into @saved_max_connect_errors; set global max_connect_errors = 3; +create user 'root'@'santa.claus.ipv4.example.com'; grant select on test.* to 'root'@'santa.claus.ipv4.example.com'; create user 'quota'@'santa.claus.ipv4.example.com'; grant select on test.* to 'quota'@'santa.claus.ipv4.example.com'; diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_allow.result index 6531f7e69f0..1c893320340 100644 --- a/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_allow.result +++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_allow.result @@ -23,7 +23,9 @@ select `User`, `Host` from mysql.`user` where `user` like '2001:%'; User Host select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%'; User Host +create user 'root'@'192.0.2.4'; grant select on test.* to 'root'@'192.0.2.4'; +create user 'root'@'santa.claus.ipv4.example.com'; grant select on test.* to 'root'@'santa.claus.ipv4.example.com'; select "Con1 is alive"; Con1 is alive diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_allow.result index 315f90ce3e5..68855bbc0ce 100644 --- a/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_allow.result +++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_allow.result @@ -23,6 +23,7 @@ select `User`, `Host` from mysql.`user` where `user` like '2001:%'; User Host select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%'; User Host +create user 'root'@'192.0.2.4'; grant select on test.* to 'root'@'192.0.2.4'; select "Con1 is alive"; Con1 is alive diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_again_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_again_allow.result index 59a12495352..36d7692f824 100644 --- a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_again_allow.result +++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_again_allow.result @@ -23,6 +23,7 @@ select `User`, `Host` from mysql.`user` where `user` like '2001:%'; User Host select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%'; User Host +create user 'root'@'2001:db8::6:6'; grant select on test.* to 'root'@'2001:db8::6:6'; select "Con1 is alive"; Con1 is alive diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_bad_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_bad_allow.result index 904139875c6..37470bdc0bb 100644 --- a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_bad_allow.result +++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_bad_allow.result @@ -23,6 +23,7 @@ select `User`, `Host` from mysql.`user` where `user` like '2001:%'; User Host select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%'; User Host +create user 'root'@'2001:db8::6:6'; grant select on test.* to 'root'@'2001:db8::6:6'; select "Con1 is alive"; Con1 is alive diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_good_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_good_allow.result index f5b2f43ab91..410f116f4d0 100644 --- a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_good_allow.result +++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_good_allow.result @@ -23,6 +23,7 @@ select `User`, `Host` from mysql.`user` where `user` like '2001:%'; User Host select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%'; User Host +create user 'root'@'santa.claus.ipv6.example.com'; grant select on test.* to 'root'@'santa.claus.ipv6.example.com'; select "Con1 is alive"; Con1 is alive diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_noname_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_noname_allow.result index 9cc8a675fcc..6ccb3b66f22 100644 --- a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_noname_allow.result +++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_noname_allow.result @@ -23,7 +23,9 @@ select `User`, `Host` from mysql.`user` where `user` like '2001:%'; User Host select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%'; User Host +create user 'root'@'santa.claus.ipv6.example.com'; grant select on test.* to 'root'@'santa.claus.ipv6.example.com'; +create user 'root'@'2001:db8::6:6'; grant select on test.* to 'root'@'2001:db8::6:6'; select "Con1 is alive"; Con1 is alive diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_blocked.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_blocked.result index 5d1846f3354..a0c2d8bdfa6 100644 --- a/mysql-test/suite/perfschema/r/hostcache_ipv6_blocked.result +++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_blocked.result @@ -24,6 +24,7 @@ select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%'; User Host select @@global.max_connect_errors into @saved_max_connect_errors; set global max_connect_errors = 3; +create user 'root'@'santa.claus.ipv6.example.com'; grant select on test.* to 'root'@'santa.claus.ipv6.example.com'; create user 'quota'@'santa.claus.ipv6.example.com'; grant select on test.* to 'quota'@'santa.claus.ipv6.example.com'; diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_again_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_again_allow.result index a2107324c65..a2b9a32c764 100644 --- a/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_again_allow.result +++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_again_allow.result @@ -23,7 +23,9 @@ select `User`, `Host` from mysql.`user` where `user` like '2001:%'; User Host select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%'; User Host +create user 'root'@'2001:db8::6:6'; grant select on test.* to 'root'@'2001:db8::6:6'; +create user 'root'@'santa.claus.ipv6.example.com'; grant select on test.* to 'root'@'santa.claus.ipv6.example.com'; select "Con1 is alive"; Con1 is alive diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_noname_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_noname_allow.result index 809644cbe08..99b47be724f 100644 --- a/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_noname_allow.result +++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_noname_allow.result @@ -23,6 +23,7 @@ select `User`, `Host` from mysql.`user` where `user` like '2001:%'; User Host select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%'; User Host +create user 'root'@'2001:db8::6:6'; grant select on test.* to 'root'@'2001:db8::6:6'; select "Con1 is alive"; Con1 is alive diff --git a/mysql-test/suite/perfschema/r/privilege.result b/mysql-test/suite/perfschema/r/privilege.result index 49d72fc499f..f46c094b5ac 100644 --- a/mysql-test/suite/perfschema/r/privilege.result +++ b/mysql-test/suite/perfschema/r/privilege.result @@ -2,6 +2,9 @@ show grants; Grants for root@localhost GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION +create user 'pfs_user_1'@localhost; +create user 'pfs_user_2'@localhost; +create user 'pfs_user_3'@localhost; grant ALL on *.* to 'pfs_user_1'@localhost with GRANT OPTION; grant ALL on performance_schema.* to 'pfs_user_2'@localhost with GRANT OPTION; diff --git a/mysql-test/suite/perfschema/r/read_only.result b/mysql-test/suite/perfschema/r/read_only.result index 19108326f1b..b2502808821 100644 --- a/mysql-test/suite/perfschema/r/read_only.result +++ b/mysql-test/suite/perfschema/r/read_only.result @@ -1,5 +1,6 @@ use performance_schema; set @start_read_only= @@global.read_only; +create user pfsuser@localhost; grant SELECT, UPDATE on performance_schema.* to pfsuser@localhost; flush privileges; connect (con1, localhost, pfsuser, , test); diff --git a/mysql-test/suite/perfschema/r/setup_actors.result b/mysql-test/suite/perfschema/r/setup_actors.result index 038fb623ab6..187b558e827 100644 --- a/mysql-test/suite/perfschema/r/setup_actors.result +++ b/mysql-test/suite/perfschema/r/setup_actors.result @@ -17,10 +17,15 @@ hostb % % hosta user1 % % user2 % localhost user3 % +create user user1@localhost; grant ALL on *.* to user1@localhost; +create user user2@localhost; grant ALL on *.* to user2@localhost; +create user user3@localhost; grant ALL on *.* to user3@localhost; +create user user4@localhost; grant ALL on *.* to user4@localhost; +create user user5@localhost; grant select on test.* to user5@localhost; flush privileges; # Switch to (con1, localhost, user1, , ) diff --git a/mysql-test/suite/perfschema/r/socket_summary_by_instance_func.result b/mysql-test/suite/perfschema/r/socket_summary_by_instance_func.result index d725009d8fd..21b99360e64 100644 --- a/mysql-test/suite/perfschema/r/socket_summary_by_instance_func.result +++ b/mysql-test/suite/perfschema/r/socket_summary_by_instance_func.result @@ -33,11 +33,13 @@ ERROR 28000: Access denied for user 'boot0123456789'@'localhost' (using password # 2.5 Connect should pass, host = localhost # length of user name = 10 character # length of default db = 9 character +CREATE USER 'root012345'@'localhost'; GRANT ALL PRIVILEGES ON *.* TO 'root012345'@'localhost'; DROP USER 'root012345'@'localhost'; # 2.6 Connect should pass, host = localhost # length of user name = 14 character # length of default db = 9 character +CREATE USER 'root0123456789'@'localhost'; GRANT ALL PRIVILEGES ON *.* to 'root0123456789'@'localhost'; DROP USER 'root0123456789'@'localhost'; # 2.7 Connect should pass, host = my_localhost diff --git a/mysql-test/suite/perfschema/r/stage_mdl_global.result b/mysql-test/suite/perfschema/r/stage_mdl_global.result index 1a6f51a4acc..de5df8f189a 100644 --- a/mysql-test/suite/perfschema/r/stage_mdl_global.result +++ b/mysql-test/suite/perfschema/r/stage_mdl_global.result @@ -6,6 +6,8 @@ user1 statement/sql/flush flush tables with read lock username event_name nesting_event_type username event_name nesting_event_type user1 stage/sql/init STATEMENT +user1 stage/sql/Waiting for query cache lock STATEMENT +user1 stage/sql/init STATEMENT user1 stage/sql/query end STATEMENT user1 stage/sql/closing tables STATEMENT user1 stage/sql/freeing items STATEMENT diff --git a/mysql-test/suite/perfschema/t/column_privilege.test b/mysql-test/suite/perfschema/t/column_privilege.test index 6fabdfb4229..004492c6145 100644 --- a/mysql-test/suite/perfschema/t/column_privilege.test +++ b/mysql-test/suite/perfschema/t/column_privilege.test @@ -7,6 +7,7 @@ show grants; +create user 'pfs_user_5'@localhost; grant usage on *.* to 'pfs_user_5'@localhost with GRANT OPTION; # Test per column privileges on performance_schema diff --git a/mysql-test/suite/perfschema/t/global_read_lock.test b/mysql-test/suite/perfschema/t/global_read_lock.test index 1ab6005f7e2..0883ed1ed42 100644 --- a/mysql-test/suite/perfschema/t/global_read_lock.test +++ b/mysql-test/suite/perfschema/t/global_read_lock.test @@ -11,6 +11,7 @@ use performance_schema; # Ensure that instrumentation is turned on when we create new connection. update performance_schema.setup_instruments set enabled='YES'; +create user pfsuser@localhost; grant SELECT, UPDATE, LOCK TABLES on performance_schema.* to pfsuser@localhost; flush privileges; diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_again_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_again_allow.test index a96ccf86315..df82a5c047d 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_again_allow.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_again_allow.test @@ -18,6 +18,7 @@ call mtr.add_suppression("santa.claus.ipv4.example.com"); --source ../include/wait_for_pfs_thread_count.inc --source ../include/hostcache_set_state.inc +create user 'root'@'192.0.2.4'; grant select on test.* to 'root'@'192.0.2.4'; connect (con1,"127.0.0.1",root,,test,$MASTER_MYPORT,); diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_bad_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_bad_allow.test index 4bf041b1ada..08cbe8d15af 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_bad_allow.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_bad_allow.test @@ -20,6 +20,7 @@ call mtr.add_suppression("santa.claus.ipv4.example.com"); --source ../include/wait_for_pfs_thread_count.inc --source ../include/hostcache_set_state.inc +create user 'root'@'192.0.2.4'; grant select on test.* to 'root'@'192.0.2.4'; connect (con1,"127.0.0.1",root,,test,$MASTER_MYPORT,); diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_good_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_good_allow.test index 9931fa5ffba..808a1b927d7 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_good_allow.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_good_allow.test @@ -18,6 +18,7 @@ call mtr.add_suppression("192.0.2.4"); --source ../include/wait_for_pfs_thread_count.inc --source ../include/hostcache_set_state.inc +create user 'root'@'santa.claus.ipv4.example.com'; grant select on test.* to 'root'@'santa.claus.ipv4.example.com'; connect (con1,"127.0.0.1",root,,test,$MASTER_MYPORT,); diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_noname_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_noname_allow.test index 283d3a5841d..6f763d8c666 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_noname_allow.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_noname_allow.test @@ -18,7 +18,9 @@ call mtr.add_suppression("santa.claus.ipv4.example.com"); --source ../include/wait_for_pfs_thread_count.inc --source ../include/hostcache_set_state.inc +create user 'root'@'santa.claus.ipv4.example.com'; grant select on test.* to 'root'@'santa.claus.ipv4.example.com'; +create user 'root'@'192.0.2.4'; grant select on test.* to 'root'@'192.0.2.4'; connect (con1,"127.0.0.1",root,,test,$MASTER_MYPORT,); diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_blocked.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_blocked.test index 7c89aa3d44e..b18dcd5f494 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv4_blocked.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_blocked.test @@ -20,6 +20,7 @@ select @@global.max_connect_errors into @saved_max_connect_errors; set global max_connect_errors = 3; +create user 'root'@'santa.claus.ipv4.example.com'; grant select on test.* to 'root'@'santa.claus.ipv4.example.com'; create user 'quota'@'santa.claus.ipv4.example.com'; diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_again_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_again_allow.test index bce65b61cfc..ab72e0f4340 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_again_allow.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_again_allow.test @@ -18,7 +18,9 @@ call mtr.add_suppression("192.0.2.4"); --source ../include/wait_for_pfs_thread_count.inc --source ../include/hostcache_set_state.inc +create user 'root'@'192.0.2.4'; grant select on test.* to 'root'@'192.0.2.4'; +create user 'root'@'santa.claus.ipv4.example.com'; grant select on test.* to 'root'@'santa.claus.ipv4.example.com'; connect (con1,"127.0.0.1",root,,test,$MASTER_MYPORT,); diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_noname_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_noname_allow.test index 52b696831af..06776de6b27 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_noname_allow.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_noname_allow.test @@ -18,6 +18,7 @@ call mtr.add_suppression("192.0.2.4"); --source ../include/wait_for_pfs_thread_count.inc --source ../include/hostcache_set_state.inc +create user 'root'@'192.0.2.4'; grant select on test.* to 'root'@'192.0.2.4'; connect (con1,"127.0.0.1",root,,test,$MASTER_MYPORT,); diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow.test index c1af8516b79..f276e759f75 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_again_allow.test @@ -19,6 +19,7 @@ call mtr.add_suppression("santa.claus.ipv6.example.com"); --source ../include/wait_for_pfs_thread_count.inc --source ../include/hostcache_set_state.inc +create user 'root'@'2001:db8::6:6'; grant select on test.* to 'root'@'2001:db8::6:6'; connect (con1,"::1",root,,test,$MASTER_MYPORT,); diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow.test index ae1de4f032e..9f951273e98 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_bad_allow.test @@ -21,6 +21,7 @@ call mtr.add_suppression("santa.claus.ipv6.example.com"); --source ../include/wait_for_pfs_thread_count.inc --source ../include/hostcache_set_state.inc +create user 'root'@'2001:db8::6:6'; grant select on test.* to 'root'@'2001:db8::6:6'; connect (con1,"::1",root,,test,$MASTER_MYPORT,); diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow.test index 9dbd682681e..81427e86c5e 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_good_allow.test @@ -19,6 +19,7 @@ call mtr.add_suppression("192.0.2.4"); --source ../include/wait_for_pfs_thread_count.inc --source ../include/hostcache_set_state.inc +create user 'root'@'santa.claus.ipv6.example.com'; grant select on test.* to 'root'@'santa.claus.ipv6.example.com'; connect (con1,"::1",root,,test,$MASTER_MYPORT,); diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow.test index b675b5089a8..7ce12639b7f 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_addrinfo_noname_allow.test @@ -19,7 +19,9 @@ call mtr.add_suppression("santa.claus.ipv6.example.com"); --source ../include/wait_for_pfs_thread_count.inc --source ../include/hostcache_set_state.inc +create user 'root'@'santa.claus.ipv6.example.com'; grant select on test.* to 'root'@'santa.claus.ipv6.example.com'; +create user 'root'@'2001:db8::6:6'; grant select on test.* to 'root'@'2001:db8::6:6'; connect (con1,"::1",root,,test,$MASTER_MYPORT,); diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_blocked.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_blocked.test index cd78087dad1..0a04ec306cf 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_blocked.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_blocked.test @@ -21,6 +21,7 @@ select @@global.max_connect_errors into @saved_max_connect_errors; set global max_connect_errors = 3; +create user 'root'@'santa.claus.ipv6.example.com'; grant select on test.* to 'root'@'santa.claus.ipv6.example.com'; create user 'quota'@'santa.claus.ipv6.example.com'; diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow.test index 983a6e80ff7..7e49ed62b93 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_again_allow.test @@ -19,7 +19,9 @@ call mtr.add_suppression("2001:db8::6:6"); --source ../include/wait_for_pfs_thread_count.inc --source ../include/hostcache_set_state.inc +create user 'root'@'2001:db8::6:6'; grant select on test.* to 'root'@'2001:db8::6:6'; +create user 'root'@'santa.claus.ipv6.example.com'; grant select on test.* to 'root'@'santa.claus.ipv6.example.com'; connect (con1,"::1",root,,test,$MASTER_MYPORT,); diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow.test index 3a30030413f..62876e859cb 100644 --- a/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow.test +++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_nameinfo_noname_allow.test @@ -19,6 +19,7 @@ call mtr.add_suppression("2001:db8::6:6"); --source ../include/wait_for_pfs_thread_count.inc --source ../include/hostcache_set_state.inc +create user 'root'@'2001:db8::6:6'; grant select on test.* to 'root'@'2001:db8::6:6'; connect (con1,"::1",root,,test,$MASTER_MYPORT,); diff --git a/mysql-test/suite/perfschema/t/nesting.test b/mysql-test/suite/perfschema/t/nesting.test index 29819770645..7f1c0b570ad 100644 --- a/mysql-test/suite/perfschema/t/nesting.test +++ b/mysql-test/suite/perfschema/t/nesting.test @@ -10,6 +10,7 @@ --disable_query_log +create user user1@localhost; grant ALL on *.* to user1@localhost; flush privileges; diff --git a/mysql-test/suite/perfschema/t/privilege.test b/mysql-test/suite/perfschema/t/privilege.test index 1864a34bcfe..f5bd5cc4036 100644 --- a/mysql-test/suite/perfschema/t/privilege.test +++ b/mysql-test/suite/perfschema/t/privilege.test @@ -5,6 +5,9 @@ show grants; +create user 'pfs_user_1'@localhost; +create user 'pfs_user_2'@localhost; +create user 'pfs_user_3'@localhost; grant ALL on *.* to 'pfs_user_1'@localhost with GRANT OPTION; # Test denied privileges on performance_schema.* @@ -328,4 +331,3 @@ UPDATE performance_schema.setup_timers SET timer_name = 'MICROSECOND' where name UPDATE performance_schema.setup_timers SET timer_name = 'CYCLE' where name="wait"; UPDATE performance_schema.setup_timers SET timer_name = 'NANOSECOND' where name="stage"; UPDATE performance_schema.setup_timers SET timer_name = 'NANOSECOND' where name="statement"; - diff --git a/mysql-test/suite/perfschema/t/read_only.test b/mysql-test/suite/perfschema/t/read_only.test index 3050cee9e72..7b0284a7a48 100644 --- a/mysql-test/suite/perfschema/t/read_only.test +++ b/mysql-test/suite/perfschema/t/read_only.test @@ -11,6 +11,7 @@ use performance_schema; set @start_read_only= @@global.read_only; +create user pfsuser@localhost; grant SELECT, UPDATE on performance_schema.* to pfsuser@localhost; flush privileges; diff --git a/mysql-test/suite/perfschema/t/setup_actors.test b/mysql-test/suite/perfschema/t/setup_actors.test index e975fa96782..39d60b0ab03 100644 --- a/mysql-test/suite/perfschema/t/setup_actors.test +++ b/mysql-test/suite/perfschema/t/setup_actors.test @@ -33,10 +33,15 @@ values ('hostb', '%', '%'); select * from performance_schema.setup_actors order by USER, HOST, ROLE; +create user user1@localhost; grant ALL on *.* to user1@localhost; +create user user2@localhost; grant ALL on *.* to user2@localhost; +create user user3@localhost; grant ALL on *.* to user3@localhost; +create user user4@localhost; grant ALL on *.* to user4@localhost; +create user user5@localhost; grant select on test.* to user5@localhost; flush privileges; diff --git a/mysql-test/suite/perfschema/t/socket_summary_by_instance_func.test b/mysql-test/suite/perfschema/t/socket_summary_by_instance_func.test index d06edb0d78f..bf04e62e1b5 100644 --- a/mysql-test/suite/perfschema/t/socket_summary_by_instance_func.test +++ b/mysql-test/suite/perfschema/t/socket_summary_by_instance_func.test @@ -493,6 +493,7 @@ let $connect_user= root; --echo # length of user name = 10 character --echo # length of default db = 9 character #======================================================================== +CREATE USER 'root012345'@'localhost'; GRANT ALL PRIVILEGES ON *.* TO 'root012345'@'localhost'; let $connect_host= localhost; let $connect_db= mysqltest; @@ -504,6 +505,7 @@ DROP USER 'root012345'@'localhost'; --echo # length of user name = 14 character --echo # length of default db = 9 character #======================================================================== +CREATE USER 'root0123456789'@'localhost'; GRANT ALL PRIVILEGES ON *.* to 'root0123456789'@'localhost'; let $connect_host= localhost; let $connect_db= mysqltest; diff --git a/mysql-test/suite/plugins/r/audit_null.result b/mysql-test/suite/plugins/r/audit_null.result index 584d10e3a3b..75eb5a9f682 100644 --- a/mysql-test/suite/plugins/r/audit_null.result +++ b/mysql-test/suite/plugins/r/audit_null.result @@ -1,5 +1,6 @@ set @old_global_general_log=@@global.general_log; set global general_log=OFF; +create user testuser@localhost; grant select on *.* to testuser@localhost; install plugin audit_null soname 'adt_null'; select 1; diff --git a/mysql-test/suite/plugins/r/auth_v0100.result b/mysql-test/suite/plugins/r/auth_v0100.result index 53affc94947..6b5f5c917f3 100644 --- a/mysql-test/suite/plugins/r/auth_v0100.result +++ b/mysql-test/suite/plugins/r/auth_v0100.result @@ -5,6 +5,7 @@ auth_0x0100 1.0 mysql_native_password 2.0 mysql_old_password 2.0 create user tt identified via auth_0x0100; +create user zzzzzzzzzzzzzzzz; grant select on test.* to zzzzzzzzzzzzzzzz; connect(localhost,tt,,test,MASTER_MYPORT,MASTER_MYSOCK); ERROR 28000: Access denied for user 'tt'@'localhost' (using password: YES) diff --git a/mysql-test/suite/plugins/r/qc_info.result b/mysql-test/suite/plugins/r/qc_info.result index 850e6db53f4..0924b5bd12d 100644 --- a/mysql-test/suite/plugins/r/qc_info.result +++ b/mysql-test/suite/plugins/r/qc_info.result @@ -1,3 +1,5 @@ +set global query_cache_type=ON; +set local query_cache_type=ON; set global query_cache_size=1355776; create table t1 (a int not null); insert into t1 values (1),(2),(3); @@ -16,6 +18,7 @@ set global query_cache_size = 0; select * from information_schema.query_cache_info; STATEMENT_SCHEMA STATEMENT_TEXT RESULT_BLOCKS_COUNT RESULT_BLOCKS_SIZE RESULT_BLOCKS_SIZE_USED set global query_cache_size= default; +set global query_cache_type=default; show query_cache_info; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'query_cache_info' at line 1 flush query_cache_info; diff --git a/mysql-test/suite/plugins/r/qc_info_priv.result b/mysql-test/suite/plugins/r/qc_info_priv.result index c723eca1ec0..f7b538f46e4 100644 --- a/mysql-test/suite/plugins/r/qc_info_priv.result +++ b/mysql-test/suite/plugins/r/qc_info_priv.result @@ -1,3 +1,5 @@ +set global query_cache_type=ON; +set local query_cache_type=ON; set global query_cache_size=1355776; create table t1 (a int not null); insert into t1 values (1),(2),(3); @@ -21,3 +23,4 @@ count(*) drop user mysqltest; drop table t1; set global query_cache_size= default; +set global query_cache_type=default; diff --git a/mysql-test/suite/plugins/t/audit_null.test b/mysql-test/suite/plugins/t/audit_null.test index 3e32154ec3d..199e4ba154e 100644 --- a/mysql-test/suite/plugins/t/audit_null.test +++ b/mysql-test/suite/plugins/t/audit_null.test @@ -8,6 +8,7 @@ if (!$ADT_NULL_SO) { set @old_global_general_log=@@global.general_log; set global general_log=OFF; +create user testuser@localhost; grant select on *.* to testuser@localhost; --disable_ps_protocol diff --git a/mysql-test/suite/plugins/t/auth_v0100.test b/mysql-test/suite/plugins/t/auth_v0100.test index 3cf93ba67f2..51f8d8941ef 100644 --- a/mysql-test/suite/plugins/t/auth_v0100.test +++ b/mysql-test/suite/plugins/t/auth_v0100.test @@ -9,6 +9,7 @@ install soname 'auth_0x0100'; select plugin_name, plugin_type_version from information_schema.plugins where plugin_type='authentication' order by plugin_name; create user tt identified via auth_0x0100; +create user zzzzzzzzzzzzzzzz; grant select on test.* to zzzzzzzzzzzzzzzz; --replace_result $MASTER_MYSOCK MASTER_MYSOCK $MASTER_MYPORT MASTER_MYPORT diff --git a/mysql-test/suite/plugins/t/qc_info.test b/mysql-test/suite/plugins/t/qc_info.test index fcb523eca2c..ef759ce8eb4 100644 --- a/mysql-test/suite/plugins/t/qc_info.test +++ b/mysql-test/suite/plugins/t/qc_info.test @@ -8,6 +8,7 @@ set global query_cache_size = 0; select * from information_schema.query_cache_info; set global query_cache_size= default; +set global query_cache_type=default; --error ER_PARSE_ERROR show query_cache_info; diff --git a/mysql-test/suite/plugins/t/qc_info_init.inc b/mysql-test/suite/plugins/t/qc_info_init.inc index 9422bd7f141..1de99cc9029 100644 --- a/mysql-test/suite/plugins/t/qc_info_init.inc +++ b/mysql-test/suite/plugins/t/qc_info_init.inc @@ -3,6 +3,8 @@ if (`select count(*) = 0 from information_schema.plugins where plugin_name = 'qu --skip QUERY_CACHE_INFO plugin is not active } +set global query_cache_type=ON; +set local query_cache_type=ON; set global query_cache_size=1355776; create table t1 (a int not null); diff --git a/mysql-test/suite/plugins/t/qc_info_priv.test b/mysql-test/suite/plugins/t/qc_info_priv.test index 31c394107c1..adcf882be9f 100644 --- a/mysql-test/suite/plugins/t/qc_info_priv.test +++ b/mysql-test/suite/plugins/t/qc_info_priv.test @@ -12,4 +12,4 @@ drop user mysqltest; drop table t1; set global query_cache_size= default; - +set global query_cache_type=default; diff --git a/mysql-test/suite/roles/admin.result b/mysql-test/suite/roles/admin.result index 44bf010b8ea..838f2ea165d 100644 --- a/mysql-test/suite/roles/admin.result +++ b/mysql-test/suite/roles/admin.result @@ -1,3 +1,4 @@ +create user foo@localhost; grant create user on *.* to foo@localhost; create role role1; create role role2 with admin current_user; diff --git a/mysql-test/suite/roles/admin.test b/mysql-test/suite/roles/admin.test index 03f3449200b..242518eb13d 100644 --- a/mysql-test/suite/roles/admin.test +++ b/mysql-test/suite/roles/admin.test @@ -1,5 +1,6 @@ source include/not_embedded.inc; +create user foo@localhost; grant create user on *.* to foo@localhost; ######################################## @@ -99,4 +100,3 @@ grant role4 to current_user; ######################################## drop role role1, role2, role3, role4, role5, role6; drop user foo@localhost; - diff --git a/mysql-test/suite/roles/create_and_drop_current.result b/mysql-test/suite/roles/create_and_drop_current.result index 382e5d10248..7e847677364 100644 --- a/mysql-test/suite/roles/create_and_drop_current.result +++ b/mysql-test/suite/roles/create_and_drop_current.result @@ -1,3 +1,4 @@ +create user foo@localhost; grant create user on *.* to foo@localhost; create user current_user; ERROR HY000: Operation CREATE USER failed for CURRENT_USER diff --git a/mysql-test/suite/roles/create_and_drop_current.test b/mysql-test/suite/roles/create_and_drop_current.test index 5250ef78f43..7ca8161a30c 100644 --- a/mysql-test/suite/roles/create_and_drop_current.test +++ b/mysql-test/suite/roles/create_and_drop_current.test @@ -12,6 +12,7 @@ --source include/not_embedded.inc +create user foo@localhost; grant create user on *.* to foo@localhost; --change_user foo diff --git a/mysql-test/suite/roles/definer.result b/mysql-test/suite/roles/definer.result index a2d84244c38..7ced6255629 100644 --- a/mysql-test/suite/roles/definer.result +++ b/mysql-test/suite/roles/definer.result @@ -9,6 +9,7 @@ grant role1 to current_user; create role role2; grant insert,select on mysqltest1.t1 to role2; grant event,execute,trigger on mysqltest1.* to role2; +create user foo@localhost; grant create view on mysqltest1.* to foo@localhost; create role role4; grant select on mysqltest1.t1 to role4; @@ -78,6 +79,7 @@ Warnings: Note 1449 The user specified as a definer ('role4'@'') does not exist select * from test.v5; ERROR HY000: The user specified as a definer ('role4'@'') does not exist +create user role4; grant select on mysqltest1.t1 to role4; show create view test.v5; View Create View character_set_client collation_connection @@ -104,7 +106,7 @@ create definer=current_role trigger tr1 before insert on t2 for each row insert t1 values (111, 222, 333); show create trigger tr1; Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -tr1 CREATE DEFINER=`role1` trigger tr1 before insert on t2 for each row +tr1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`role1` trigger tr1 before insert on t2 for each row insert t1 values (111, 222, 333) latin1 latin1_swedish_ci latin1_swedish_ci set role none; insert t2 values (11,22,33); @@ -121,7 +123,7 @@ create definer=role2 trigger tr2 before delete on t2 for each row insert t1 values (111, 222, 333); show create trigger tr2; Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -tr2 CREATE DEFINER=`role2` trigger tr2 before delete on t2 for each row +tr2 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`role2` trigger tr2 before delete on t2 for each row insert t1 values (111, 222, 333) latin1 latin1_swedish_ci latin1_swedish_ci delete from t2 where a=1; select * from t1; @@ -139,7 +141,7 @@ Warnings: Note 1449 The user specified as a definer ('role3'@'%') does not exist show create trigger tr3; Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -tr3 CREATE DEFINER=`role3`@`%` trigger tr3 before update on t2 for each row +tr3 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`role3`@`%` trigger tr3 before update on t2 for each row insert t1 values (111, 222, 333) latin1 latin1_swedish_ci latin1_swedish_ci update t2 set b=2 where a=2; ERROR HY000: The user specified as a definer ('role3'@'%') does not exist @@ -153,7 +155,7 @@ a b c flush tables; show create trigger tr2; Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -tr2 CREATE DEFINER=`role2`@`` trigger tr2 before delete on t2 for each row +tr2 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`role2`@`` trigger tr2 before delete on t2 for each row insert t1 values (111, 222, 333) latin1 latin1_swedish_ci latin1_swedish_ci delete from t2 where a=2; ERROR HY000: The user specified as a definer ('role2'@'%') does not exist @@ -170,7 +172,7 @@ set role role1; create definer=current_role procedure pr1() insert t1 values (111, 222, 333); show create procedure pr1; Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -pr1 CREATE DEFINER=`role1` PROCEDURE `pr1`() +pr1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`role1` PROCEDURE `pr1`() insert t1 values (111, 222, 333) latin1 latin1_swedish_ci latin1_swedish_ci set role none; call pr1(); @@ -182,7 +184,7 @@ a b c create definer=role2 procedure pr2() insert t1 values (111, 222, 333); show create procedure pr2; Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -pr2 CREATE DEFINER=`role2` PROCEDURE `pr2`() +pr2 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`role2` PROCEDURE `pr2`() insert t1 values (111, 222, 333) latin1 latin1_swedish_ci latin1_swedish_ci call pr2(); select * from t1; @@ -196,7 +198,7 @@ Warnings: Note 1449 The user specified as a definer ('role3'@'%') does not exist show create procedure pr3; Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -pr3 CREATE DEFINER=`role3`@`%` PROCEDURE `pr3`() +pr3 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`role3`@`%` PROCEDURE `pr3`() insert t1 values (111, 222, 333) latin1 latin1_swedish_ci latin1_swedish_ci call pr3(); ERROR HY000: The user specified as a definer ('role3'@'%') does not exist @@ -213,7 +215,7 @@ set role role1; create definer=current_role function fn1() returns int return (select sum(a+b) from t1); show create function fn1; Function sql_mode Create Function character_set_client collation_connection Database Collation -fn1 CREATE DEFINER=`role1` FUNCTION `fn1`() RETURNS int(11) +fn1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`role1` FUNCTION `fn1`() RETURNS int(11) return (select sum(a+b) from t1) latin1 latin1_swedish_ci latin1_swedish_ci set role none; select fn1(); @@ -225,7 +227,7 @@ a b c create definer=role2 function fn2() returns int return (select sum(a+b) from t1); show create function fn2; Function sql_mode Create Function character_set_client collation_connection Database Collation -fn2 CREATE DEFINER=`role2` FUNCTION `fn2`() RETURNS int(11) +fn2 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`role2` FUNCTION `fn2`() RETURNS int(11) return (select sum(a+b) from t1) latin1 latin1_swedish_ci latin1_swedish_ci select fn2(); fn2() @@ -235,7 +237,7 @@ Warnings: Note 1449 The user specified as a definer ('role3'@'%') does not exist show create function fn3; Function sql_mode Create Function character_set_client collation_connection Database Collation -fn3 CREATE DEFINER=`role3`@`%` FUNCTION `fn3`() RETURNS int(11) +fn3 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`role3`@`%` FUNCTION `fn3`() RETURNS int(11) return (select sum(a+b) from t1) latin1 latin1_swedish_ci latin1_swedish_ci select fn3(); ERROR HY000: The user specified as a definer ('role3'@'%') does not exist @@ -248,7 +250,7 @@ create definer=current_role event e1 on schedule every 1 second starts '2000-01- insert t1 values (111, 2, 0); show create event e1; Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -e1 SYSTEM CREATE DEFINER=`role1` EVENT `e1` ON SCHEDULE EVERY 1 SECOND STARTS '2000-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO insert t1 values (111, 2, 0) latin1 latin1_swedish_ci latin1_swedish_ci +e1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION SYSTEM CREATE DEFINER=`role1` EVENT `e1` ON SCHEDULE EVERY 1 SECOND STARTS '2000-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO insert t1 values (111, 2, 0) latin1 latin1_swedish_ci latin1_swedish_ci set role none; create definer=role3 event e3 on schedule every 1 second starts '2000-01-01' do insert t1 values (111, 3, 0); @@ -256,12 +258,12 @@ Warnings: Note 1449 The user specified as a definer ('role3'@'%') does not exist show create event e3; Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -e3 SYSTEM CREATE DEFINER=`role3`@`%` EVENT `e3` ON SCHEDULE EVERY 1 SECOND STARTS '2000-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO insert t1 values (111, 3, 0) latin1 latin1_swedish_ci latin1_swedish_ci +e3 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION SYSTEM CREATE DEFINER=`role3`@`%` EVENT `e3` ON SCHEDULE EVERY 1 SECOND STARTS '2000-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO insert t1 values (111, 3, 0) latin1 latin1_swedish_ci latin1_swedish_ci create definer=role2 event e2 on schedule every 1 second starts '2000-01-01' do insert t1 values (111, 4, 0); show create event e2; Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation -e2 SYSTEM CREATE DEFINER=`role2` EVENT `e2` ON SCHEDULE EVERY 1 SECOND STARTS '2000-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO insert t1 values (111, 4, 0) latin1 latin1_swedish_ci latin1_swedish_ci +e2 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION SYSTEM CREATE DEFINER=`role2` EVENT `e2` ON SCHEDULE EVERY 1 SECOND STARTS '2000-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO insert t1 values (111, 4, 0) latin1 latin1_swedish_ci latin1_swedish_ci set global event_scheduler=off; select distinct * from t1; a b c @@ -337,7 +339,7 @@ INSERT INTO `t2` VALUES (2,20,200); /*!50003 SET character_set_results = latin1 */ ; /*!50003 SET collation_connection = latin1_swedish_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = '' */ ; +/*!50003 SET sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; /*!50003 CREATE*/ /*!50017 DEFINER=`role1`*/ /*!50003 trigger tr1 before insert on t2 for each row insert t1 values (111, 222, 333) */;; @@ -353,7 +355,7 @@ DELIMITER ; /*!50003 SET character_set_results = latin1 */ ; /*!50003 SET collation_connection = latin1_swedish_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = '' */ ; +/*!50003 SET sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; /*!50003 CREATE*/ /*!50017 DEFINER=`role3`@`%`*/ /*!50003 trigger tr3 before update on t2 for each row insert t1 values (111, 222, 333) */;; @@ -369,7 +371,7 @@ DELIMITER ; /*!50003 SET character_set_results = latin1 */ ; /*!50003 SET collation_connection = latin1_swedish_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = '' */ ; +/*!50003 SET sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; /*!50003 CREATE*/ /*!50017 DEFINER=`role2`@``*/ /*!50003 trigger tr2 before delete on t2 for each row insert t1 values (111, 222, 333) */;; @@ -387,7 +389,7 @@ DELIMITER ;; /*!50003 SET character_set_results = latin1 */ ;; /*!50003 SET collation_connection = latin1_swedish_ci */ ;; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;; -/*!50003 SET sql_mode = '' */ ;; +/*!50003 SET sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;; /*!50003 SET @saved_time_zone = @@time_zone */ ;; /*!50003 SET time_zone = 'SYSTEM' */ ;; /*!50106 CREATE*/ /*!50117 DEFINER=`role1`*/ /*!50106 EVENT `e1` ON SCHEDULE EVERY 1 SECOND STARTS '2000-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO insert t1 values (111, 2, 0) */ ;; @@ -404,7 +406,7 @@ DELIMITER ;; /*!50003 SET character_set_results = latin1 */ ;; /*!50003 SET collation_connection = latin1_swedish_ci */ ;; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;; -/*!50003 SET sql_mode = '' */ ;; +/*!50003 SET sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;; /*!50003 SET @saved_time_zone = @@time_zone */ ;; /*!50003 SET time_zone = 'SYSTEM' */ ;; /*!50106 CREATE*/ /*!50117 DEFINER=`role2`*/ /*!50106 EVENT `e2` ON SCHEDULE EVERY 1 SECOND STARTS '2000-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO insert t1 values (111, 4, 0) */ ;; @@ -421,7 +423,7 @@ DELIMITER ;; /*!50003 SET character_set_results = latin1 */ ;; /*!50003 SET collation_connection = latin1_swedish_ci */ ;; /*!50003 SET @saved_sql_mode = @@sql_mode */ ;; -/*!50003 SET sql_mode = '' */ ;; +/*!50003 SET sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;; /*!50003 SET @saved_time_zone = @@time_zone */ ;; /*!50003 SET time_zone = 'SYSTEM' */ ;; /*!50106 CREATE*/ /*!50117 DEFINER=`role3`@`%`*/ /*!50106 EVENT `e3` ON SCHEDULE EVERY 1 SECOND STARTS '2000-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO insert t1 values (111, 3, 0) */ ;; @@ -439,7 +441,7 @@ DELIMITER ; /*!50003 SET character_set_results = latin1 */ ; /*!50003 SET collation_connection = latin1_swedish_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = '' */ ; +/*!50003 SET sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`role1` FUNCTION `fn1`() RETURNS int(11) return (select sum(a+b) from t1) ;; @@ -455,7 +457,7 @@ DELIMITER ; /*!50003 SET character_set_results = latin1 */ ; /*!50003 SET collation_connection = latin1_swedish_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = '' */ ; +/*!50003 SET sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`role2` FUNCTION `fn2`() RETURNS int(11) return (select sum(a+b) from t1) ;; @@ -471,7 +473,7 @@ DELIMITER ; /*!50003 SET character_set_results = latin1 */ ; /*!50003 SET collation_connection = latin1_swedish_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = '' */ ; +/*!50003 SET sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`role3`@`%` FUNCTION `fn3`() RETURNS int(11) return (select sum(a+b) from t1) ;; @@ -487,7 +489,7 @@ DELIMITER ; /*!50003 SET character_set_results = latin1 */ ; /*!50003 SET collation_connection = latin1_swedish_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = '' */ ; +/*!50003 SET sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`role1` PROCEDURE `pr1`() insert t1 values (111, 222, 333) ;; @@ -503,7 +505,7 @@ DELIMITER ; /*!50003 SET character_set_results = latin1 */ ; /*!50003 SET collation_connection = latin1_swedish_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = '' */ ; +/*!50003 SET sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`role2`@`%` PROCEDURE `pr2`() insert t1 values (111, 222, 333) ;; @@ -519,7 +521,7 @@ DELIMITER ; /*!50003 SET character_set_results = latin1 */ ; /*!50003 SET collation_connection = latin1_swedish_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = '' */ ; +/*!50003 SET sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`role3`@`%` PROCEDURE `pr3`() insert t1 values (111, 222, 333) ;; diff --git a/mysql-test/suite/roles/definer.test b/mysql-test/suite/roles/definer.test index 995c36a8511..3de4a6922c2 100644 --- a/mysql-test/suite/roles/definer.test +++ b/mysql-test/suite/roles/definer.test @@ -26,6 +26,7 @@ grant insert,select on mysqltest1.t1 to role2; grant event,execute,trigger on mysqltest1.* to role2; # create a non-priv user and a priv role granted to him +create user foo@localhost; grant create view on mysqltest1.* to foo@localhost; create role role4; grant select on mysqltest1.t1 to role4; @@ -99,6 +100,7 @@ show create view test.v5; --error ER_NO_SUCH_USER select * from test.v5; +create user role4; grant select on mysqltest1.t1 to role4; show create view test.v5; --error ER_NO_SUCH_USER diff --git a/mysql-test/suite/roles/drop_current_user-5176.result b/mysql-test/suite/roles/drop_current_user-5176.result index 42fb4ba36b7..ea9f4fa4f92 100644 --- a/mysql-test/suite/roles/drop_current_user-5176.result +++ b/mysql-test/suite/roles/drop_current_user-5176.result @@ -1,3 +1,4 @@ +create user foo@localhost; grant create user on *.* to foo@localhost; drop user foo@localhost; select * from information_schema.applicable_roles; diff --git a/mysql-test/suite/roles/drop_current_user-5176.test b/mysql-test/suite/roles/drop_current_user-5176.test index e022d3e8a86..27051345e8b 100644 --- a/mysql-test/suite/roles/drop_current_user-5176.test +++ b/mysql-test/suite/roles/drop_current_user-5176.test @@ -3,6 +3,7 @@ # --source include/not_embedded.inc +create user foo@localhost; grant create user on *.* to foo@localhost; --connect (foo,localhost,foo,,) drop user foo@localhost; diff --git a/mysql-test/suite/roles/grant-5771.result b/mysql-test/suite/roles/grant-5771.result index 4921641f3a5..5d79820e7a0 100644 --- a/mysql-test/suite/roles/grant-5771.result +++ b/mysql-test/suite/roles/grant-5771.result @@ -1,5 +1,6 @@ create database mysqltest1; create database mysqltest2; +create user foo@localhost; create role r1, r2; grant all on mysqltest1.* to r1; grant all on mysqltest2.* to r2; diff --git a/mysql-test/suite/roles/grant-5771.test b/mysql-test/suite/roles/grant-5771.test index 84c625a6067..3c8f5d2f7c0 100644 --- a/mysql-test/suite/roles/grant-5771.test +++ b/mysql-test/suite/roles/grant-5771.test @@ -6,6 +6,7 @@ create database mysqltest1; create database mysqltest2; +create user foo@localhost; create role r1, r2; grant all on mysqltest1.* to r1; grant all on mysqltest2.* to r2; diff --git a/mysql-test/suite/roles/grant_role_auto_create_user.result b/mysql-test/suite/roles/grant_role_auto_create_user.result index 81b25e5f527..674480758fb 100644 --- a/mysql-test/suite/roles/grant_role_auto_create_user.result +++ b/mysql-test/suite/roles/grant_role_auto_create_user.result @@ -1,8 +1,11 @@ create database db; create role auto_create; +create user auto_create; grant all on db.* to auto_create; +create user foo@localhost; grant auto_create to foo@localhost; -grant auto_create to bar@localhost identified by 'baz'; +create user bar@localhost identified by 'baz'; +grant auto_create to bar@localhost; set role 'auto_create'; use db; create table t1 (i int); diff --git a/mysql-test/suite/roles/grant_role_auto_create_user.test b/mysql-test/suite/roles/grant_role_auto_create_user.test index d2489a4ea74..0259d0a8ff6 100644 --- a/mysql-test/suite/roles/grant_role_auto_create_user.test +++ b/mysql-test/suite/roles/grant_role_auto_create_user.test @@ -5,10 +5,12 @@ create database db; create role auto_create; +create user auto_create; grant all on db.* to auto_create; - +create user foo@localhost; grant auto_create to foo@localhost; -grant auto_create to bar@localhost identified by 'baz'; +create user bar@localhost identified by 'baz'; +grant auto_create to bar@localhost; # Test if the users have been created and the role has been granted to them --connect (con1,localhost,foo,,) diff --git a/mysql-test/suite/roles/password.result b/mysql-test/suite/roles/password.result index 1992431e1a3..2d54db2ca64 100644 --- a/mysql-test/suite/roles/password.result +++ b/mysql-test/suite/roles/password.result @@ -1,3 +1,4 @@ +set sql_mode=''; create role r1; grant select on *.* to r1 identified by 'foobar'; drop user r1; diff --git a/mysql-test/suite/roles/password.test b/mysql-test/suite/roles/password.test index fed0f2f4a19..e5fff01ddbc 100644 --- a/mysql-test/suite/roles/password.test +++ b/mysql-test/suite/roles/password.test @@ -10,6 +10,7 @@ # max_queries_per_hour | max_updates_per_hour | max_connections_per_hour | max_user_connections #set password for ... = ... +set sql_mode=''; create role r1; # IDENTIFIED does not apply to roles, using it forces username context diff --git a/mysql-test/suite/roles/rpl_definer.result b/mysql-test/suite/roles/rpl_definer.result index eadb6315d9b..c9e4f66a267 100644 --- a/mysql-test/suite/roles/rpl_definer.result +++ b/mysql-test/suite/roles/rpl_definer.result @@ -21,19 +21,19 @@ create definer=current_role procedure pcr() select current_role; create definer=role1 procedure pr() select "role1"; show create procedure pcu; Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -pcu CREATE DEFINER=`root`@`localhost` PROCEDURE `pcu`() +pcu NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `pcu`() select current_user latin1 latin1_swedish_ci latin1_swedish_ci show create procedure pu; Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -pu CREATE DEFINER=`root`@`localhost` PROCEDURE `pu`() +pu NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `pu`() select "root@localhost" latin1 latin1_swedish_ci latin1_swedish_ci show create procedure pcr; Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -pcr CREATE DEFINER=`role1` PROCEDURE `pcr`() +pcr NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`role1` PROCEDURE `pcr`() select current_role latin1 latin1_swedish_ci latin1_swedish_ci show create procedure pr; Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -pr CREATE DEFINER=`role1` PROCEDURE `pr`() +pr NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`role1` PROCEDURE `pr`() select "role1" latin1 latin1_swedish_ci latin1_swedish_ci [connection slave] set role role1; @@ -49,19 +49,19 @@ GRANT role2 TO 'role1' GRANT role2 TO 'root'@'localhost' WITH ADMIN OPTION show create procedure pcu; Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -pcu CREATE DEFINER=`root`@`localhost` PROCEDURE `pcu`() +pcu NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `pcu`() select current_user latin1 latin1_swedish_ci latin1_swedish_ci show create procedure pu; Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -pu CREATE DEFINER=`root`@`localhost` PROCEDURE `pu`() +pu NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `pu`() select "root@localhost" latin1 latin1_swedish_ci latin1_swedish_ci show create procedure pcr; Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -pcr CREATE DEFINER=`role1` PROCEDURE `pcr`() +pcr NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`role1` PROCEDURE `pcr`() select current_role latin1 latin1_swedish_ci latin1_swedish_ci show create procedure pr; Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -pr CREATE DEFINER=`role1` PROCEDURE `pr`() +pr NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`role1` PROCEDURE `pr`() select "role1" latin1 latin1_swedish_ci latin1_swedish_ci drop procedure pcu; drop procedure pu; diff --git a/mysql-test/suite/rpl/r/rpl_binlog_grant.result b/mysql-test/suite/rpl/r/rpl_binlog_grant.result index ccc7116a949..0c780122e38 100644 --- a/mysql-test/suite/rpl/r/rpl_binlog_grant.result +++ b/mysql-test/suite/rpl/r/rpl_binlog_grant.result @@ -6,6 +6,7 @@ create table t (s1 int) engine=innodb; set @@autocommit=0; start transaction; insert into t values (1); +create user x@y; grant select on t to x@y; rollback; show grants for x@y; diff --git a/mysql-test/suite/rpl/r/rpl_create_drop_function.result b/mysql-test/suite/rpl/r/rpl_create_drop_function.result index 66b1f485aa7..fc10d1f7c25 100644 --- a/mysql-test/suite/rpl/r/rpl_create_drop_function.result +++ b/mysql-test/suite/rpl/r/rpl_create_drop_function.result @@ -7,7 +7,7 @@ CONCAT('Hello, ', str, '!'); ERROR 42000: FUNCTION hello already exists SHOW CREATE FUNCTION hello; Function sql_mode Create Function character_set_client collation_connection Database Collation -hello CREATE DEFINER=`root`@`localhost` FUNCTION `hello`(str CHAR(20)) RETURNS char(50) CHARSET latin1 +hello NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `hello`(str CHAR(20)) RETURNS char(50) CHARSET latin1 DETERMINISTIC RETURN CONCAT('Hello, ', str, '!') latin1 latin1_swedish_ci latin1_swedish_ci diff --git a/mysql-test/suite/rpl/r/rpl_current_user.result b/mysql-test/suite/rpl/r/rpl_current_user.result index a5e340b8850..3391af5de9c 100644 --- a/mysql-test/suite/rpl/r/rpl_current_user.result +++ b/mysql-test/suite/rpl/r/rpl_current_user.result @@ -8,6 +8,7 @@ CREATE VIEW test.v_procs_priv AS SELECT * FROM mysql.procs_priv WHERE User LIKE CREATE VIEW test.v_event AS SELECT definer FROM mysql.event WHERE name = 'e1'; CREATE PROCEDURE p1() SELECT 1; # bug48321_1-01234 has the max length(16) of user. +CREATE USER 'bug48321_1-01234'@'localhost'; GRANT ALL PRIVILEGES ON *.* TO 'bug48321_1-01234'@'localhost' WITH GRANT OPTION; # Test the max lengths of user and host names diff --git a/mysql-test/suite/rpl/r/rpl_ddl.result b/mysql-test/suite/rpl/r/rpl_ddl.result index 0173bf1e28d..df246cc547f 100644 --- a/mysql-test/suite/rpl/r/rpl_ddl.result +++ b/mysql-test/suite/rpl/r/rpl_ddl.result @@ -1,5 +1,7 @@ include/master-slave.inc [connection master] +set global sql_mode=''; +set local sql_mode=''; -------- switch to master ------- SET AUTOCOMMIT = 1; @@ -1620,4 +1622,5 @@ use test; DROP TEMPORARY TABLE mysqltest1.t22; DROP DATABASE mysqltest1; DROP DATABASE mysqltest3; +set global sql_mode=default; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_do_grant.result b/mysql-test/suite/rpl/r/rpl_do_grant.result index 4cbc2d7d9e9..a9f1d92cb42 100644 --- a/mysql-test/suite/rpl/r/rpl_do_grant.result +++ b/mysql-test/suite/rpl/r/rpl_do_grant.result @@ -6,6 +6,7 @@ flush privileges; delete from mysql.user where user=_binary'rpl_ignore_grant'; delete from mysql.db where user=_binary'rpl_ignore_grant'; flush privileges; +create user rpl_do_grant@localhost; grant select on *.* to rpl_do_grant@localhost; grant drop on test.* to rpl_do_grant@localhost; show grants for rpl_do_grant@localhost; @@ -113,7 +114,7 @@ GRANT EXECUTE, ALTER ROUTINE ON FUNCTION `bug42217_db`.`upgrade_del_func` TO 'cr USE bug42217_db; SHOW CREATE FUNCTION upgrade_del_func; Function sql_mode Create Function character_set_client collation_connection Database Collation -upgrade_del_func CREATE DEFINER=`create_rout_db`@`localhost` FUNCTION `upgrade_del_func`() RETURNS char(30) CHARSET latin1 +upgrade_del_func NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`create_rout_db`@`localhost` FUNCTION `upgrade_del_func`() RETURNS char(30) CHARSET latin1 BEGIN RETURN "INSIDE upgrade_del_func()"; END latin1 latin1_swedish_ci latin1_swedish_ci @@ -124,7 +125,7 @@ INSIDE upgrade_del_func() USE bug42217_db; SHOW CREATE FUNCTION upgrade_del_func; Function sql_mode Create Function character_set_client collation_connection Database Collation -upgrade_del_func CREATE DEFINER=`create_rout_db`@`localhost` FUNCTION `upgrade_del_func`() RETURNS char(30) CHARSET latin1 +upgrade_del_func NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`create_rout_db`@`localhost` FUNCTION `upgrade_del_func`() RETURNS char(30) CHARSET latin1 BEGIN RETURN "INSIDE upgrade_del_func()"; END latin1 latin1_swedish_ci latin1_swedish_ci @@ -149,7 +150,7 @@ upgrade_alter_func() INSIDE upgrade_alter_func() SHOW CREATE FUNCTION upgrade_alter_func; Function sql_mode Create Function character_set_client collation_connection Database Collation -upgrade_alter_func CREATE DEFINER=`create_rout_db`@`localhost` FUNCTION `upgrade_alter_func`() RETURNS char(30) CHARSET latin1 +upgrade_alter_func NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`create_rout_db`@`localhost` FUNCTION `upgrade_alter_func`() RETURNS char(30) CHARSET latin1 BEGIN RETURN "INSIDE upgrade_alter_func()"; END latin1 latin1_swedish_ci latin1_swedish_ci diff --git a/mysql-test/suite/rpl/r/rpl_hrtime.result b/mysql-test/suite/rpl/r/rpl_hrtime.result index 5a6787d37ac..3b29d339739 100644 --- a/mysql-test/suite/rpl/r/rpl_hrtime.result +++ b/mysql-test/suite/rpl/r/rpl_hrtime.result @@ -35,7 +35,7 @@ use `test`/*!*/; SET TIMESTAMP=1293832861/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; -SET @@session.sql_mode=0/*!*/; +SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; diff --git a/mysql-test/suite/rpl/r/rpl_ignore_grant.result b/mysql-test/suite/rpl/r/rpl_ignore_grant.result index ae6d6ddfc8d..40baaa60b01 100644 --- a/mysql-test/suite/rpl/r/rpl_ignore_grant.result +++ b/mysql-test/suite/rpl/r/rpl_ignore_grant.result @@ -1,8 +1,12 @@ include/master-slave.inc [connection master] +set global sql_mode=""; +set local sql_mode=""; delete from mysql.user where user=_binary'rpl_ignore_grant'; delete from mysql.db where user=_binary'rpl_ignore_grant'; flush privileges; +set global sql_mode=""; +set local sql_mode=""; delete from mysql.user where user=_binary'rpl_ignore_grant'; delete from mysql.db where user=_binary'rpl_ignore_grant'; flush privileges; @@ -31,4 +35,6 @@ flush privileges; delete from mysql.user where user=_binary'rpl_ignore_grant'; delete from mysql.db where user=_binary'rpl_ignore_grant'; flush privileges; +set global sql_mode=default; +set global sql_mode=default; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_ignore_table.result b/mysql-test/suite/rpl/r/rpl_ignore_table.result index 8e7166fa278..aa5f6d3e6db 100644 --- a/mysql-test/suite/rpl/r/rpl_ignore_table.result +++ b/mysql-test/suite/rpl/r/rpl_ignore_table.result @@ -17,6 +17,7 @@ DROP TABLE t4; **** Adding GRANTS on master **** create table test.t1(a int); create table test.t4(a int); +set sql_mode=""; GRANT SELECT ON test.t1 TO mysqltest1@localhost; GRANT INSERT ON test.t4 TO mysqltest2@localhost; GRANT select, update, insert, references on t1 @@ -65,6 +66,7 @@ flush privileges; show grants for mysqltest5@somehost; Grants for mysqltest5@somehost GRANT USAGE ON *.* TO 'mysqltest5'@'somehost' +set sql_mode=""; **** Checking grants on slave **** show grants for mysqltest2@localhost; Grants for mysqltest2@localhost diff --git a/mysql-test/suite/rpl/r/rpl_mdev382.result b/mysql-test/suite/rpl/r/rpl_mdev382.result index bc245a073cd..2e3faaba7b6 100644 --- a/mysql-test/suite/rpl/r/rpl_mdev382.result +++ b/mysql-test/suite/rpl/r/rpl_mdev382.result @@ -362,7 +362,7 @@ use `ts``et`/*!*/; SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; -SET @@session.sql_mode=0/*!*/; +SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; diff --git a/mysql-test/suite/rpl/r/rpl_replicate_do.result b/mysql-test/suite/rpl/r/rpl_replicate_do.result index 27fd92db31c..c1e3ee60e10 100644 --- a/mysql-test/suite/rpl/r/rpl_replicate_do.result +++ b/mysql-test/suite/rpl/r/rpl_replicate_do.result @@ -34,15 +34,15 @@ t1 t2 show triggers; Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -trg1 INSERT t1 set new.b=2 BEFORE NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci -trg2 INSERT t2 set new.b=2 BEFORE NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci +trg1 INSERT t1 set new.b=2 BEFORE NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION root@localhost latin1 latin1_swedish_ci latin1_swedish_ci +trg2 INSERT t2 set new.b=2 BEFORE NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION root@localhost latin1 latin1_swedish_ci latin1_swedish_ci *** slave *** show tables; Tables_in_test t1 show triggers; Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -trg1 INSERT t1 set new.b=2 BEFORE NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci +trg1 INSERT t1 set new.b=2 BEFORE NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION root@localhost latin1 latin1_swedish_ci latin1_swedish_ci *** master *** drop trigger trg1; drop trigger trg2; diff --git a/mysql-test/suite/rpl/r/rpl_row_USER.result b/mysql-test/suite/rpl/r/rpl_row_USER.result index 5298395da20..47b94074ecf 100644 --- a/mysql-test/suite/rpl/r/rpl_row_USER.result +++ b/mysql-test/suite/rpl/r/rpl_row_USER.result @@ -1,5 +1,7 @@ include/master-slave.inc [connection master] +set global sql_mode=""; +set local sql_mode=""; DROP DATABASE IF EXISTS mysqltest1; CREATE DATABASE mysqltest1; CREATE USER tester IDENTIFIED BY 'test'; @@ -33,3 +35,5 @@ REVOKE ALL ON mysqltest1.* FROM ''@'localhost%'; DROP USER tester@'%'; DROP USER ''@'localhost%'; include/rpl_end.inc +set global sql_mode=default; +set local sql_mode=default; diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result index 5e7c3c10c1e..71747e825b9 100644 --- a/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result +++ b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result @@ -103,7 +103,7 @@ a 7 8 9 -SET GLOBAL QUERY_CACHE_SIZE=0; +SET GLOBAL QUERY_CACHE_SIZE=default; DROP TABLE t1; ================ Test for BUG#22550 ================ include/rpl_reset.inc diff --git a/mysql-test/suite/rpl/r/rpl_row_sp012.result b/mysql-test/suite/rpl/r/rpl_row_sp012.result index 57d92386638..e084d43f90a 100644 --- a/mysql-test/suite/rpl/r/rpl_row_sp012.result +++ b/mysql-test/suite/rpl/r/rpl_row_sp012.result @@ -3,6 +3,7 @@ include/master-slave.inc DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p2; DROP PROCEDURE IF EXISTS test.p3; +create user user1@localhost; grant usage on *.* to user1@localhost; flush privileges; SELECT CURRENT_USER(); @@ -17,6 +18,7 @@ CREATE PROCEDURE test.p3 () SQL SECURITY INVOKER CALL test.p1(); GRANT EXECUTE ON PROCEDURE p1 TO user1@localhost; GRANT EXECUTE ON PROCEDURE p2 TO user1@localhost; GRANT EXECUTE ON PROCEDURE p3 TO user1@localhost; +set sql_mode=default; <******** Master user1 p3 & p2 calls *******> ---------------------------------------------- diff --git a/mysql-test/suite/rpl/r/rpl_set_statement.result b/mysql-test/suite/rpl/r/rpl_set_statement.result index 78d34bd0853..c9df74b0d3b 100644 --- a/mysql-test/suite/rpl/r/rpl_set_statement.result +++ b/mysql-test/suite/rpl/r/rpl_set_statement.result @@ -1,5 +1,7 @@ include/master-slave.inc [connection master] +set sql_mode=""; +set sql_mode=""; DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t2; call mtr.add_suppression("Unsafe statement written to the binary log*"); diff --git a/mysql-test/suite/rpl/r/rpl_sp.result b/mysql-test/suite/rpl/r/rpl_sp.result index 8ca72672073..ea9c8906217 100644 --- a/mysql-test/suite/rpl/r/rpl_sp.result +++ b/mysql-test/suite/rpl/r/rpl_sp.result @@ -1,5 +1,7 @@ include/master-slave.inc [connection master] +set local sql_mode=''; +set global sql_mode=''; drop database if exists mysqltest1; create database mysqltest1; use mysqltest1; @@ -1311,3 +1313,4 @@ drop table t1; drop procedure p1; # End of 5.5 tests. include/rpl_end.inc +set global sql_mode=default; diff --git a/mysql-test/suite/rpl/r/rpl_ssl.result b/mysql-test/suite/rpl/r/rpl_ssl.result index 35aaabc8c56..f02fa4e7b9f 100644 --- a/mysql-test/suite/rpl/r/rpl_ssl.result +++ b/mysql-test/suite/rpl/r/rpl_ssl.result @@ -1,5 +1,6 @@ include/master-slave.inc [connection master] +create user replssl@localhost; grant replication slave on *.* to replssl@localhost require ssl; create table t1 (t int auto_increment, KEY(t)); stop slave; diff --git a/mysql-test/suite/rpl/r/rpl_ssl1.result b/mysql-test/suite/rpl/r/rpl_ssl1.result index a7a56d7c5ee..c9fe21a7929 100644 --- a/mysql-test/suite/rpl/r/rpl_ssl1.result +++ b/mysql-test/suite/rpl/r/rpl_ssl1.result @@ -1,5 +1,6 @@ include/master-slave.inc [connection master] +create user replssl@localhost; grant replication slave on *.* to replssl@localhost require ssl; create table t1 (t int); stop slave; diff --git a/mysql-test/suite/rpl/t/rpl_binlog_grant.test b/mysql-test/suite/rpl/t/rpl_binlog_grant.test index 26ebb29ae8d..f8513021134 100644 --- a/mysql-test/suite/rpl/t/rpl_binlog_grant.test +++ b/mysql-test/suite/rpl/t/rpl_binlog_grant.test @@ -16,6 +16,7 @@ create table t (s1 int) engine=innodb; set @@autocommit=0; start transaction; insert into t values (1); +create user x@y; grant select on t to x@y; let $wait_binlog_event= grant select; source include/wait_for_binlog_event.inc; diff --git a/mysql-test/suite/rpl/t/rpl_current_user.test b/mysql-test/suite/rpl/t/rpl_current_user.test index c9ee6fcd576..1f5a82486e3 100644 --- a/mysql-test/suite/rpl/t/rpl_current_user.test +++ b/mysql-test/suite/rpl/t/rpl_current_user.test @@ -42,6 +42,7 @@ CREATE VIEW test.v_procs_priv AS SELECT * FROM mysql.procs_priv WHERE User LIKE CREATE VIEW test.v_event AS SELECT definer FROM mysql.event WHERE name = 'e1'; CREATE PROCEDURE p1() SELECT 1; --echo # bug48321_1-01234 has the max length(16) of user. +CREATE USER 'bug48321_1-01234'@'localhost'; GRANT ALL PRIVILEGES ON *.* TO 'bug48321_1-01234'@'localhost' WITH GRANT OPTION; --echo @@ -235,4 +236,3 @@ DROP PROCEDURE my_revoke; DROP FUNCTION my_user; DROP EVENT e1; --source include/rpl_end.inc - diff --git a/mysql-test/suite/rpl/t/rpl_do_grant.test b/mysql-test/suite/rpl/t/rpl_do_grant.test index 4d7d1bacc15..83b9a84744f 100644 --- a/mysql-test/suite/rpl/t/rpl_do_grant.test +++ b/mysql-test/suite/rpl/t/rpl_do_grant.test @@ -17,6 +17,7 @@ flush privileges; # test replication of GRANT connection master; +create user rpl_do_grant@localhost; grant select on *.* to rpl_do_grant@localhost; grant drop on test.* to rpl_do_grant@localhost; sync_slave_with_master; diff --git a/mysql-test/suite/rpl/t/rpl_ignore_grant.test b/mysql-test/suite/rpl/t/rpl_ignore_grant.test index 34074ba8ca9..ee049a515d7 100644 --- a/mysql-test/suite/rpl/t/rpl_ignore_grant.test +++ b/mysql-test/suite/rpl/t/rpl_ignore_grant.test @@ -6,11 +6,15 @@ source include/master-slave.inc; # do not be influenced by other tests. connection master; +set global sql_mode=""; +set local sql_mode=""; delete from mysql.user where user=_binary'rpl_ignore_grant'; delete from mysql.db where user=_binary'rpl_ignore_grant'; flush privileges; save_master_pos; connection slave; +set global sql_mode=""; +set local sql_mode=""; sync_with_master; # as these DELETE were not replicated, we need to do them manually on the # slave. @@ -56,5 +60,8 @@ delete from mysql.user where user=_binary'rpl_ignore_grant'; delete from mysql.db where user=_binary'rpl_ignore_grant'; flush privileges; +set global sql_mode=default; +connection master; +set global sql_mode=default; # End of 4.1 tests --source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_ignore_table.test b/mysql-test/suite/rpl/t/rpl_ignore_table.test index b0019b70dc8..f9b01c83917 100644 --- a/mysql-test/suite/rpl/t/rpl_ignore_table.test +++ b/mysql-test/suite/rpl/t/rpl_ignore_table.test @@ -49,6 +49,7 @@ connection master; create table test.t1(a int); create table test.t4(a int); +set sql_mode=""; # Simple user that should not replicate GRANT SELECT ON test.t1 TO mysqltest1@localhost; @@ -87,7 +88,7 @@ show grants for mysqltest6@localhost; flush privileges; show grants for mysqltest5@somehost; - +set sql_mode=""; sync_slave_with_master; --echo **** Checking grants on slave **** diff --git a/mysql-test/suite/rpl/t/rpl_row_USER.test b/mysql-test/suite/rpl/t/rpl_row_USER.test index 7e05e4e0041..31826812efa 100644 --- a/mysql-test/suite/rpl/t/rpl_row_USER.test +++ b/mysql-test/suite/rpl/t/rpl_row_USER.test @@ -11,6 +11,8 @@ # Includes -- source include/have_binlog_format_row.inc -- source include/master-slave.inc +set global sql_mode=""; +set local sql_mode=""; # Begin clean up test section connection master; @@ -58,3 +60,6 @@ sync_slave_with_master; # End of 5.0 test case --source include/rpl_end.inc + +set global sql_mode=default; +set local sql_mode=default; diff --git a/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test index f4b371b737f..82929d57db5 100644 --- a/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test +++ b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test @@ -91,7 +91,7 @@ INSERT INTO t1 VALUES (7),(8),(9); sync_slave_with_master; SELECT * FROM t1; -SET GLOBAL QUERY_CACHE_SIZE=0; +SET GLOBAL QUERY_CACHE_SIZE=default; --connection master DROP TABLE t1; diff --git a/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test b/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test index ed0f31b75be..a44cc18c0ed 100644 --- a/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test +++ b/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test @@ -21,6 +21,7 @@ --disable_query_log select "---Setup Section --" as ""; +set sql_mode=""; --enable_query_log set timestamp=1000000000; diff --git a/mysql-test/suite/rpl/t/rpl_row_sp012.test b/mysql-test/suite/rpl/t/rpl_row_sp012.test index 23bc92b51cf..80d312f1878 100644 --- a/mysql-test/suite/rpl/t/rpl_row_sp012.test +++ b/mysql-test/suite/rpl/t/rpl_row_sp012.test @@ -23,6 +23,7 @@ DROP PROCEDURE IF EXISTS test.p3; # Begin test section 1 # Create user user1 with no particular access rights +create user user1@localhost; grant usage on *.* to user1@localhost; flush privileges; @@ -34,6 +35,7 @@ CREATE PROCEDURE test.p3 () SQL SECURITY INVOKER CALL test.p1(); GRANT EXECUTE ON PROCEDURE p1 TO user1@localhost; GRANT EXECUTE ON PROCEDURE p2 TO user1@localhost; GRANT EXECUTE ON PROCEDURE p3 TO user1@localhost; +set sql_mode=default; # Need to wait for the rights to be applied at the slave sync_slave_with_master; diff --git a/mysql-test/suite/rpl/t/rpl_set_statement.test b/mysql-test/suite/rpl/t/rpl_set_statement.test index 8a3087bec6d..5bc54e44e34 100644 --- a/mysql-test/suite/rpl/t/rpl_set_statement.test +++ b/mysql-test/suite/rpl/t/rpl_set_statement.test @@ -1,5 +1,9 @@ --source include/master-slave.inc --source include/have_binlog_format_statement.inc +set sql_mode=""; +connection slave; +set sql_mode=""; +connection master; --disable_warnings DROP TABLE IF EXISTS t1; diff --git a/mysql-test/suite/rpl/t/rpl_sp.test b/mysql-test/suite/rpl/t/rpl_sp.test index c978a145a92..124d98cd29b 100644 --- a/mysql-test/suite/rpl/t/rpl_sp.test +++ b/mysql-test/suite/rpl/t/rpl_sp.test @@ -6,6 +6,8 @@ source include/have_binlog_format_mixed.inc; source include/master-slave.inc; +set local sql_mode=''; +set global sql_mode=''; # we need a db != test, where we don't have automatic grants --disable_warnings @@ -739,3 +741,4 @@ drop procedure p1; # Cleanup sync_slave_with_master; --source include/rpl_end.inc +set global sql_mode=default; diff --git a/mysql-test/suite/rpl/t/rpl_ssl.test b/mysql-test/suite/rpl/t/rpl_ssl.test index 43289428d45..9e42764715b 100644 --- a/mysql-test/suite/rpl/t/rpl_ssl.test +++ b/mysql-test/suite/rpl/t/rpl_ssl.test @@ -3,6 +3,7 @@ source include/master-slave.inc; # create a user for replication that requires ssl encryption connection master; +create user replssl@localhost; grant replication slave on *.* to replssl@localhost require ssl; create table t1 (t int auto_increment, KEY(t)); diff --git a/mysql-test/suite/rpl/t/rpl_ssl1.test b/mysql-test/suite/rpl/t/rpl_ssl1.test index f5f63a00033..d994dd21c1d 100644 --- a/mysql-test/suite/rpl/t/rpl_ssl1.test +++ b/mysql-test/suite/rpl/t/rpl_ssl1.test @@ -7,6 +7,7 @@ source include/master-slave.inc; # creating replication user for whom ssl auth is required # preparing playground connection master; +create user replssl@localhost; grant replication slave on *.* to replssl@localhost require ssl; create table t1 (t int); diff --git a/mysql-test/suite/sys_vars/r/back_log_basic.result b/mysql-test/suite/sys_vars/r/back_log_basic.result index d68e72a8a4a..0940ebeef8c 100644 --- a/mysql-test/suite/sys_vars/r/back_log_basic.result +++ b/mysql-test/suite/sys_vars/r/back_log_basic.result @@ -1,20 +1,20 @@ select @@global.back_log; @@global.back_log -150 +80 select @@session.back_log; ERROR HY000: Variable 'back_log' is a GLOBAL variable show global variables like 'back_log'; Variable_name Value -back_log 150 +back_log 80 show session variables like 'back_log'; Variable_name Value -back_log 150 +back_log 80 select * from information_schema.global_variables where variable_name='back_log'; VARIABLE_NAME VARIABLE_VALUE -BACK_LOG 150 +BACK_LOG 80 select * from information_schema.session_variables where variable_name='back_log'; VARIABLE_NAME VARIABLE_VALUE -BACK_LOG 150 +BACK_LOG 80 set global back_log=1; ERROR HY000: Variable 'back_log' is a read only variable set session back_log=1; diff --git a/mysql-test/suite/sys_vars/r/join_buffer_size_basic.result b/mysql-test/suite/sys_vars/r/join_buffer_size_basic.result index 2aa8b7dd80a..48131c96fce 100644 --- a/mysql-test/suite/sys_vars/r/join_buffer_size_basic.result +++ b/mysql-test/suite/sys_vars/r/join_buffer_size_basic.result @@ -1,20 +1,20 @@ SET @start_global_value = @@global.join_buffer_size; SELECT @start_global_value; @start_global_value -131072 +262144 SET @start_session_value = @@session.join_buffer_size; SELECT @start_session_value; @start_session_value -131072 +262144 '#--------------------FN_DYNVARS_053_01-------------------------#' SET @@global.join_buffer_size = DEFAULT; SELECT @@global.join_buffer_size; @@global.join_buffer_size -131072 +262144 SET @@session.join_buffer_size = DEFAULT; SELECT @@session.join_buffer_size; @@session.join_buffer_size -131072 +262144 '#--------------------FN_DYNVARS_053_03-------------------------#' SET @@global.join_buffer_size = 8200; Warnings: @@ -172,8 +172,8 @@ ERROR 42S22: Unknown column 'join_buffer_size' in 'field list' SET @@global.join_buffer_size = @start_global_value; SELECT @@global.join_buffer_size; @@global.join_buffer_size -131072 +262144 SET @@session.join_buffer_size = @start_session_value; SELECT @@session.join_buffer_size; @@session.join_buffer_size -131072 +262144 diff --git a/mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result b/mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result index ffa43415bd3..79708c480a8 100644 --- a/mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result +++ b/mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result @@ -1,7 +1,7 @@ SET @start_global_value = @@global.max_allowed_packet; SELECT @start_global_value; @start_global_value -1048576 +4194304 SET @@global.max_allowed_packet = DEFAULT; '#--------------------FN_DYNVARS_070_01-------------------------#' SET @@global.max_allowed_packet = 1000; @@ -11,19 +11,19 @@ Warning 1708 The value of 'max_allowed_packet' should be no less than the value SET @@global.max_allowed_packet = DEFAULT; SELECT @@global.max_allowed_packet; @@global.max_allowed_packet -1048576 +4194304 SET @@session.max_allowed_packet = 20000; ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value SET @@session.max_allowed_packet = DEFAULT; ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value SELECT @@session.max_allowed_packet; @@session.max_allowed_packet -1048576 +4194304 '#--------------------FN_DYNVARS_070_02-------------------------#' SET @@global.max_allowed_packet = DEFAULT; SELECT @@global.max_allowed_packet = 1048576; @@global.max_allowed_packet = 1048576 -1 +0 '#--------------------FN_DYNVARS_070_03-------------------------#' SET @@global.max_allowed_packet = 1024; Warnings: @@ -53,27 +53,27 @@ SET @@session.max_allowed_packet = 1024; ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value SELECT @@session.max_allowed_packet; @@session.max_allowed_packet -1048576 +4194304 SET @@session.max_allowed_packet = 1025; ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value SELECT @@session.max_allowed_packet; @@session.max_allowed_packet -1048576 +4194304 SET @@session.max_allowed_packet = 65535; ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value SELECT @@session.max_allowed_packet; @@session.max_allowed_packet -1048576 +4194304 SET @@session.max_allowed_packet = 1073741824; ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value SELECT @@session.max_allowed_packet; @@session.max_allowed_packet -1048576 +4194304 SET @@session.max_allowed_packet = 1073741823; ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value SELECT @@session.max_allowed_packet; @@session.max_allowed_packet -1048576 +4194304 '#------------------FN_DYNVARS_070_05-----------------------#' SET @@global.max_allowed_packet = 0; Warnings: @@ -116,29 +116,29 @@ SET @@session.max_allowed_packet = 0; ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value SELECT @@session.max_allowed_packet; @@session.max_allowed_packet -1048576 +4194304 SET @@session.max_allowed_packet = 1023; ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value SELECT @@session.max_allowed_packet; @@session.max_allowed_packet -1048576 +4194304 SET @@session.max_allowed_packet = -2; ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value SELECT @@session.max_allowed_packet; @@session.max_allowed_packet -1048576 +4194304 SET @@session.max_allowed_packet = 65530.34; ERROR 42000: Incorrect argument type to variable 'max_allowed_packet' SET @@session.max_allowed_packet = 10737418241; ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value SELECT @@session.max_allowed_packet; @@session.max_allowed_packet -1048576 +4194304 SET @@session.max_allowed_packet = test; ERROR 42000: Incorrect argument type to variable 'max_allowed_packet' SELECT @@session.max_allowed_packet; @@session.max_allowed_packet -1048576 +4194304 '#------------------FN_DYNVARS_070_06-----------------------#' SELECT @@global.max_allowed_packet = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES @@ -187,7 +187,7 @@ SET max_allowed_packet = 1024; ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value SELECT @@max_allowed_packet; @@max_allowed_packet -1048576 +4194304 SELECT local.max_allowed_packet; ERROR 42S02: Unknown table 'local' in field list SELECT session.max_allowed_packet; @@ -197,7 +197,7 @@ ERROR 42S22: Unknown column 'max_allowed_packet' in 'field list' SET @@global.max_allowed_packet = @start_global_value; SELECT @@global.max_allowed_packet; @@global.max_allowed_packet -1048576 +4194304 SELECT @@session.max_allowed_packet; @@session.max_allowed_packet -1048576 +4194304 diff --git a/mysql-test/suite/sys_vars/r/max_allowed_packet_func.result b/mysql-test/suite/sys_vars/r/max_allowed_packet_func.result index 1e20776973c..1a848cbae4b 100644 --- a/mysql-test/suite/sys_vars/r/max_allowed_packet_func.result +++ b/mysql-test/suite/sys_vars/r/max_allowed_packet_func.result @@ -14,7 +14,7 @@ SET @@session.max_allowed_packet = 1024; ERROR HY000: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value SELECT @@session.max_allowed_packet; @@session.max_allowed_packet -1048576 +4194304 SET @@session.net_buffer_length = 1024; ERROR HY000: SESSION variable 'net_buffer_length' is read-only. Use SET GLOBAL to assign the value SELECT @@session.net_buffer_length; diff --git a/mysql-test/suite/sys_vars/r/max_user_connections_func.result b/mysql-test/suite/sys_vars/r/max_user_connections_func.result index 04999a0a43f..4a71bf1b3f9 100644 --- a/mysql-test/suite/sys_vars/r/max_user_connections_func.result +++ b/mysql-test/suite/sys_vars/r/max_user_connections_func.result @@ -2,6 +2,7 @@ SET @default_max_user_connections = @@global.max_user_connections; Set Global max_user_connections=2; +CREATE USER test@localhost; GRANT USAGE on *.* TO test@localhost; '#--------------------FN_DYNVARS_114_01-------------------------#' ** Connecting conn1 using username 'test' ** diff --git a/mysql-test/suite/sys_vars/r/query_cache_limit_func.result b/mysql-test/suite/sys_vars/r/query_cache_limit_func.result index bbbb273428a..8dde5c3603b 100644 --- a/mysql-test/suite/sys_vars/r/query_cache_limit_func.result +++ b/mysql-test/suite/sys_vars/r/query_cache_limit_func.result @@ -3,6 +3,8 @@ SET @global_query_cache_limit = @@global.query_cache_limit; SET @global_query_cache_size = @@global.query_cache_size; SET @global_query_cache_type = @@global.query_cache_type; +SET GLOBAL query_cache_type= ON; +SET LOCAL query_cache_type= ON; ** warnings ** DROP TABLE IF EXISTS t; ** creating table ** diff --git a/mysql-test/suite/sys_vars/r/query_cache_size_basic.result b/mysql-test/suite/sys_vars/r/query_cache_size_basic.result index 319948deefa..ee959a45fa0 100644 --- a/mysql-test/suite/sys_vars/r/query_cache_size_basic.result +++ b/mysql-test/suite/sys_vars/r/query_cache_size_basic.result @@ -6,7 +6,7 @@ Warning 1292 Truncated incorrect query_cache_size value: '99' SET @@global.query_cache_size = DEFAULT; SELECT @@global.query_cache_size; @@global.query_cache_size -0 +1048576 '#---------------------FN_DYNVARS_133_02-------------------------#' SET @@global.query_cache_size = @start_value; SELECT @@global.query_cache_size = @start_value; diff --git a/mysql-test/suite/sys_vars/r/query_cache_type_basic.result b/mysql-test/suite/sys_vars/r/query_cache_type_basic.result index bb49d671840..dd59f503527 100644 --- a/mysql-test/suite/sys_vars/r/query_cache_type_basic.result +++ b/mysql-test/suite/sys_vars/r/query_cache_type_basic.result @@ -1,22 +1,22 @@ SET @global_start_value = @@global.query_cache_type; SELECT @global_start_value; @global_start_value -ON +OFF SET @session_start_value = @@session.query_cache_type; SELECT @session_start_value; @session_start_value -ON +OFF '#--------------------FN_DYNVARS_134_01------------------------#' SET @@global.query_cache_type = 0; SET @@global.query_cache_type = DEFAULT; SELECT @@global.query_cache_type; @@global.query_cache_type -ON +OFF SET @@session.query_cache_type = 0; SET @@session.query_cache_type = DEFAULT; SELECT @@session.query_cache_type; @@session.query_cache_type -ON +OFF '#---------------------FN_DYNVARS_134_02-------------------------#' SET @@global.query_cache_type = NULL; ERROR 42000: Variable 'query_cache_type' can't be set to the value of 'NULL' @@ -115,8 +115,8 @@ OFF SET @@global.query_cache_type = @global_start_value; SELECT @@global.query_cache_type; @@global.query_cache_type -ON +OFF SET @@session.query_cache_type = @session_start_value; SELECT @@session.query_cache_type; @@session.query_cache_type -ON +OFF diff --git a/mysql-test/suite/sys_vars/r/query_cache_type_func.result b/mysql-test/suite/sys_vars/r/query_cache_type_func.result index af121244572..c016f05e119 100644 --- a/mysql-test/suite/sys_vars/r/query_cache_type_func.result +++ b/mysql-test/suite/sys_vars/r/query_cache_type_func.result @@ -18,9 +18,12 @@ SET @@GLOBAL.query_cache_size = 65536; SET @@query_cache_type = DEFAULT; SELECT @@query_cache_type; @@query_cache_type -ON -ON Expected +OFF +OFF Expected +SET @@query_cache_type = ON; +ERROR HY000: Query cache is globally disabled and you can't enable it only for this session '#--------------------FN_DYNVARS_135_02-------------------------#' +SET GLOBAL query_cache_type= ON; SET @@query_cache_type = NULL; ERROR 42000: Variable 'query_cache_type' can't be set to the value of 'NULL' Expected error: Wrong value for variable diff --git a/mysql-test/suite/sys_vars/r/query_cache_wlock_invalidate_func.result b/mysql-test/suite/sys_vars/r/query_cache_wlock_invalidate_func.result index c4342f3bca8..5868bd597eb 100644 --- a/mysql-test/suite/sys_vars/r/query_cache_wlock_invalidate_func.result +++ b/mysql-test/suite/sys_vars/r/query_cache_wlock_invalidate_func.result @@ -7,6 +7,9 @@ SET @start_global_value = @@GLOBAL.query_cache_wlock_invalidate; SET @start_session_value = @@SESSION.query_cache_wlock_invalidate; SET @old_cache_size = @@GLOBAL.query_cache_size; SET @old_cache_type = @@GLOBAL.query_cache_type; +SET GLOBAL query_cache_type= ON; +SET LOCAL query_cache_type= ON; +SET LOCAL query_cache_type= ON; CREATE TABLE t1(id int, value varchar(10)); INSERT INTO t1 VALUES(1, 'val1'); INSERT INTO t1 VALUES(2, 'val2'); diff --git a/mysql-test/suite/sys_vars/r/secure_auth_basic.result b/mysql-test/suite/sys_vars/r/secure_auth_basic.result index 9f12a1760a4..35f283de278 100644 --- a/mysql-test/suite/sys_vars/r/secure_auth_basic.result +++ b/mysql-test/suite/sys_vars/r/secure_auth_basic.result @@ -1,19 +1,19 @@ SET @global_start_value = @@global.secure_auth; SELECT @global_start_value; @global_start_value -0 +1 '#--------------------FN_DYNVARS_143_01------------------------#' SET @@global.secure_auth = 1; SET @@global.secure_auth = DEFAULT; SELECT @@global.secure_auth; @@global.secure_auth -0 +1 '#---------------------FN_DYNVARS_143_02-------------------------#' SET secure_auth = 1; ERROR HY000: Variable 'secure_auth' is a GLOBAL variable and should be set with SET GLOBAL SELECT @@secure_auth; @@secure_auth -0 +1 SELECT global.secure_auth; ERROR 42S02: Unknown table 'global' in field list SET global secure_auth = 1; @@ -102,4 +102,4 @@ SELECT @@global.secure_auth; SET @@global.secure_auth = @global_start_value; SELECT @@global.secure_auth; @@global.secure_auth -0 +1 diff --git a/mysql-test/suite/sys_vars/r/sql_mode_basic.result b/mysql-test/suite/sys_vars/r/sql_mode_basic.result index c806fadc4ed..b3c76b12b64 100644 --- a/mysql-test/suite/sys_vars/r/sql_mode_basic.result +++ b/mysql-test/suite/sys_vars/r/sql_mode_basic.result @@ -1,22 +1,22 @@ SET @global_start_value = @@global.sql_mode; SELECT @global_start_value; @global_start_value - +NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION SET @session_start_value = @@session.sql_mode; SELECT @session_start_value; @session_start_value - +NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION '#--------------------FN_DYNVARS_152_01------------------------#' SET @@global.sql_mode = ANSI; SET @@global.sql_mode = DEFAULT; SELECT @@global.sql_mode; @@global.sql_mode - +NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION SET @@session.sql_mode = ANSI; SET @@session.sql_mode = DEFAULT; SELECT @@session.sql_mode; @@session.sql_mode - +NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION '#---------------------FN_DYNVARS_152_02-------------------------#' SET @@global.sql_mode = NULL; ERROR 42000: Variable 'sql_mode' can't be set to the value of 'NULL' @@ -420,8 +420,8 @@ ANSI_QUOTES SET @@global.sql_mode = @global_start_value; SELECT @@global.sql_mode; @@global.sql_mode - +NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION SET @@session.sql_mode = @session_start_value; SELECT @@session.sql_mode; @@session.sql_mode - +NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION diff --git a/mysql-test/suite/sys_vars/r/sync_master_info_basic.result b/mysql-test/suite/sys_vars/r/sync_master_info_basic.result index 940282f629a..ea8b7d7a483 100644 --- a/mysql-test/suite/sys_vars/r/sync_master_info_basic.result +++ b/mysql-test/suite/sys_vars/r/sync_master_info_basic.result @@ -1,24 +1,24 @@ SET @start_global_value = @@global.sync_master_info; SELECT @start_global_value; @start_global_value -0 +10000 select @@global.sync_master_info; @@global.sync_master_info -0 +10000 select @@session.sync_master_info; ERROR HY000: Variable 'sync_master_info' is a GLOBAL variable show global variables like 'sync_master_info'; Variable_name Value -sync_master_info 0 +sync_master_info 10000 show session variables like 'sync_master_info'; Variable_name Value -sync_master_info 0 +sync_master_info 10000 select * from information_schema.global_variables where variable_name='sync_master_info'; VARIABLE_NAME VARIABLE_VALUE -SYNC_MASTER_INFO 0 +SYNC_MASTER_INFO 10000 select * from information_schema.session_variables where variable_name='sync_master_info'; VARIABLE_NAME VARIABLE_VALUE -SYNC_MASTER_INFO 0 +SYNC_MASTER_INFO 10000 set global sync_master_info=1; select @@global.sync_master_info; @@global.sync_master_info @@ -45,4 +45,4 @@ select @@global.sync_master_info; SET @@global.sync_master_info = @start_global_value; SELECT @@global.sync_master_info; @@global.sync_master_info -0 +10000 diff --git a/mysql-test/suite/sys_vars/r/sync_relay_log_basic.result b/mysql-test/suite/sys_vars/r/sync_relay_log_basic.result index a98fcbfe44c..5196f8ff2dc 100644 --- a/mysql-test/suite/sys_vars/r/sync_relay_log_basic.result +++ b/mysql-test/suite/sys_vars/r/sync_relay_log_basic.result @@ -1,24 +1,24 @@ SET @start_global_value = @@global.sync_relay_log; SELECT @start_global_value; @start_global_value -0 +10000 select @@global.sync_relay_log; @@global.sync_relay_log -0 +10000 select @@session.sync_relay_log; ERROR HY000: Variable 'sync_relay_log' is a GLOBAL variable show global variables like 'sync_relay_log'; Variable_name Value -sync_relay_log 0 +sync_relay_log 10000 show session variables like 'sync_relay_log'; Variable_name Value -sync_relay_log 0 +sync_relay_log 10000 select * from information_schema.global_variables where variable_name='sync_relay_log'; VARIABLE_NAME VARIABLE_VALUE -SYNC_RELAY_LOG 0 +SYNC_RELAY_LOG 10000 select * from information_schema.session_variables where variable_name='sync_relay_log'; VARIABLE_NAME VARIABLE_VALUE -SYNC_RELAY_LOG 0 +SYNC_RELAY_LOG 10000 set global sync_relay_log=1; select @@global.sync_relay_log; @@global.sync_relay_log @@ -45,4 +45,4 @@ select @@global.sync_relay_log; SET @@global.sync_relay_log = @start_global_value; SELECT @@global.sync_relay_log; @@global.sync_relay_log -0 +10000 diff --git a/mysql-test/suite/sys_vars/r/sync_relay_log_info_basic.result b/mysql-test/suite/sys_vars/r/sync_relay_log_info_basic.result index 4900bf166b0..aa84affb7bb 100644 --- a/mysql-test/suite/sys_vars/r/sync_relay_log_info_basic.result +++ b/mysql-test/suite/sys_vars/r/sync_relay_log_info_basic.result @@ -1,24 +1,24 @@ SET @start_global_value = @@global.sync_relay_log_info; SELECT @start_global_value; @start_global_value -0 +10000 select @@global.sync_relay_log_info; @@global.sync_relay_log_info -0 +10000 select @@session.sync_relay_log_info; ERROR HY000: Variable 'sync_relay_log_info' is a GLOBAL variable show global variables like 'sync_relay_log_info'; Variable_name Value -sync_relay_log_info 0 +sync_relay_log_info 10000 show session variables like 'sync_relay_log_info'; Variable_name Value -sync_relay_log_info 0 +sync_relay_log_info 10000 select * from information_schema.global_variables where variable_name='sync_relay_log_info'; VARIABLE_NAME VARIABLE_VALUE -SYNC_RELAY_LOG_INFO 0 +SYNC_RELAY_LOG_INFO 10000 select * from information_schema.session_variables where variable_name='sync_relay_log_info'; VARIABLE_NAME VARIABLE_VALUE -SYNC_RELAY_LOG_INFO 0 +SYNC_RELAY_LOG_INFO 10000 set global sync_relay_log_info=1; select @@global.sync_relay_log_info; @@global.sync_relay_log_info @@ -45,4 +45,4 @@ select @@global.sync_relay_log_info; SET @@global.sync_relay_log_info = @start_global_value; SELECT @@global.sync_relay_log_info; @@global.sync_relay_log_info -0 +10000 diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result index f7470d93842..1f914394c26 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result +++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result @@ -81,13 +81,13 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME BACK_LOG SESSION_VALUE NULL -GLOBAL_VALUE 150 -GLOBAL_VALUE_ORIGIN COMPILE-TIME +GLOBAL_VALUE 80 +GLOBAL_VALUE_ORIGIN AUTO DEFAULT_VALUE 150 VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED -VARIABLE_COMMENT The number of outstanding connection requests MySQL can have. This comes into play when the main MySQL thread gets very many connection requests in a very short time -NUMERIC_MIN_VALUE 1 +VARIABLE_COMMENT The number of outstanding connection requests MariaDB can have. This comes into play when the main MySQL thread gets very many connection requests in a very short time +NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 65535 NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL @@ -1159,8 +1159,8 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME HOST_CACHE_SIZE SESSION_VALUE NULL -GLOBAL_VALUE 128 -GLOBAL_VALUE_ORIGIN COMPILE-TIME +GLOBAL_VALUE 279 +GLOBAL_VALUE_ORIGIN AUTO DEFAULT_VALUE 128 VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED @@ -1298,10 +1298,10 @@ ENUM_VALUE_LIST NULL READ_ONLY YES COMMAND_LINE_ARGUMENT NULL VARIABLE_NAME JOIN_BUFFER_SIZE -SESSION_VALUE 131072 -GLOBAL_VALUE 131072 +SESSION_VALUE 262144 +GLOBAL_VALUE 262144 GLOBAL_VALUE_ORIGIN COMPILE-TIME -DEFAULT_VALUE 131072 +DEFAULT_VALUE 262144 VARIABLE_SCOPE SESSION VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The size of the buffer that is used for joins @@ -1361,9 +1361,9 @@ DEFAULT_VALUE 134217728 VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The size of the buffer used for index blocks for MyISAM tables. Increase this to get better index handling (for all reads and multiple writes) to as much as you can afford -NUMERIC_MIN_VALUE NULL -NUMERIC_MAX_VALUE NULL -NUMERIC_BLOCK_SIZE NULL +NUMERIC_MIN_VALUE 0 +NUMERIC_MAX_VALUE 18446744073709551615 +NUMERIC_BLOCK_SIZE 4096 ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED @@ -1375,9 +1375,9 @@ DEFAULT_VALUE 300 VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT This characterizes the number of hits a hot block has to be untouched until it is considered aged enough to be downgraded to a warm block. This specifies the percentage ratio of that number of hits to the total number of blocks in key cache -NUMERIC_MIN_VALUE NULL -NUMERIC_MAX_VALUE NULL -NUMERIC_BLOCK_SIZE NULL +NUMERIC_MIN_VALUE 100 +NUMERIC_MAX_VALUE 4294967295 +NUMERIC_BLOCK_SIZE 100 ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED @@ -1389,9 +1389,9 @@ DEFAULT_VALUE 1024 VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The default size of key cache blocks -NUMERIC_MIN_VALUE NULL -NUMERIC_MAX_VALUE NULL -NUMERIC_BLOCK_SIZE NULL +NUMERIC_MIN_VALUE 512 +NUMERIC_MAX_VALUE 16384 +NUMERIC_BLOCK_SIZE 512 ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED @@ -1403,9 +1403,9 @@ DEFAULT_VALUE 100 VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The minimum percentage of warm blocks in key cache -NUMERIC_MIN_VALUE NULL -NUMERIC_MAX_VALUE NULL -NUMERIC_BLOCK_SIZE NULL +NUMERIC_MIN_VALUE 1 +NUMERIC_MAX_VALUE 100 +NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED @@ -1417,9 +1417,9 @@ DEFAULT_VALUE 512 VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Number of hash buckets for open and changed files. If you have a lot of MyISAM files open you should increase this for faster flush of changes. A good value is probably 1/10 of number of possible open MyISAM files. -NUMERIC_MIN_VALUE NULL -NUMERIC_MAX_VALUE NULL -NUMERIC_BLOCK_SIZE NULL +NUMERIC_MIN_VALUE 128 +NUMERIC_MAX_VALUE 16384 +NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED @@ -1431,9 +1431,9 @@ DEFAULT_VALUE 0 VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The number of segments in a key cache -NUMERIC_MIN_VALUE NULL -NUMERIC_MAX_VALUE NULL -NUMERIC_BLOCK_SIZE NULL +NUMERIC_MIN_VALUE 0 +NUMERIC_MAX_VALUE 64 +NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED @@ -1732,10 +1732,10 @@ ENUM_VALUE_LIST OFF,ON READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME MAX_ALLOWED_PACKET -SESSION_VALUE 1048576 -GLOBAL_VALUE 1048576 +SESSION_VALUE 4194304 +GLOBAL_VALUE 4194304 GLOBAL_VALUE_ORIGIN COMPILE-TIME -DEFAULT_VALUE 1048576 +DEFAULT_VALUE 4194304 VARIABLE_SCOPE SESSION VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Max packet length to send to or receive from the server @@ -1915,7 +1915,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MAX_LONG_DATA_SIZE SESSION_VALUE NULL -GLOBAL_VALUE 1048576 +GLOBAL_VALUE 4194304 GLOBAL_VALUE_ORIGIN AUTO DEFAULT_VALUE 1048576 VARIABLE_SCOPE GLOBAL @@ -3091,9 +3091,9 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME QUERY_CACHE_SIZE SESSION_VALUE NULL -GLOBAL_VALUE 0 +GLOBAL_VALUE 1048576 GLOBAL_VALUE_ORIGIN COMPILE-TIME -DEFAULT_VALUE 0 +DEFAULT_VALUE 1048576 VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The memory allocated to store results from old queries @@ -3118,10 +3118,10 @@ ENUM_VALUE_LIST OFF,ON READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME QUERY_CACHE_TYPE -SESSION_VALUE ON -GLOBAL_VALUE ON +SESSION_VALUE OFF +GLOBAL_VALUE OFF GLOBAL_VALUE_ORIGIN COMPILE-TIME -DEFAULT_VALUE ON +DEFAULT_VALUE OFF VARIABLE_SCOPE SESSION VARIABLE_TYPE ENUM VARIABLE_COMMENT OFF = Don't cache or retrieve results. ON = Cache all results except SELECT SQL_NO_CACHE ... queries. DEMAND = Cache only SELECT SQL_CACHE ... queries @@ -3231,9 +3231,9 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME SECURE_AUTH SESSION_VALUE NULL -GLOBAL_VALUE OFF +GLOBAL_VALUE ON GLOBAL_VALUE_ORIGIN COMPILE-TIME -DEFAULT_VALUE OFF +DEFAULT_VALUE ON VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BOOLEAN VARIABLE_COMMENT Disallow authentication for accounts that have old (pre-4.1) passwords @@ -3511,9 +3511,9 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT NULL VARIABLE_NAME SQL_MODE SESSION_VALUE ANSI_QUOTES -GLOBAL_VALUE +GLOBAL_VALUE NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION GLOBAL_VALUE_ORIGIN COMPILE-TIME -DEFAULT_VALUE +DEFAULT_VALUE NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION VARIABLE_SCOPE SESSION VARIABLE_TYPE SET VARIABLE_COMMENT Sets the sql mode @@ -3763,12 +3763,12 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME SYNC_MASTER_INFO SESSION_VALUE NULL -GLOBAL_VALUE 0 +GLOBAL_VALUE 10000 GLOBAL_VALUE_ORIGIN COMPILE-TIME -DEFAULT_VALUE 0 +DEFAULT_VALUE 10000 VARIABLE_SCOPE GLOBAL VARIABLE_TYPE INT UNSIGNED -VARIABLE_COMMENT Synchronously flush master info to disk after every #th event. Use 0 (default) to disable synchronous flushing +VARIABLE_COMMENT Synchronously flush master info to disk after every #th event. Use 0 to disable synchronous flushing NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 NUMERIC_BLOCK_SIZE 1 @@ -3791,9 +3791,9 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME TABLE_OPEN_CACHE SESSION_VALUE NULL -GLOBAL_VALUE 400 +GLOBAL_VALUE 2000 GLOBAL_VALUE_ORIGIN COMPILE-TIME -DEFAULT_VALUE 400 +DEFAULT_VALUE 2000 VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The number of cached open tables diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result index d98ca0129eb..8fa72a36026 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result +++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result @@ -81,13 +81,13 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME BACK_LOG SESSION_VALUE NULL -GLOBAL_VALUE 150 -GLOBAL_VALUE_ORIGIN COMPILE-TIME +GLOBAL_VALUE 80 +GLOBAL_VALUE_ORIGIN AUTO DEFAULT_VALUE 150 VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED -VARIABLE_COMMENT The number of outstanding connection requests MySQL can have. This comes into play when the main MySQL thread gets very many connection requests in a very short time -NUMERIC_MIN_VALUE 1 +VARIABLE_COMMENT The number of outstanding connection requests MariaDB can have. This comes into play when the main MySQL thread gets very many connection requests in a very short time +NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 65535 NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL @@ -1271,8 +1271,8 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME HOST_CACHE_SIZE SESSION_VALUE NULL -GLOBAL_VALUE 128 -GLOBAL_VALUE_ORIGIN COMPILE-TIME +GLOBAL_VALUE 279 +GLOBAL_VALUE_ORIGIN AUTO DEFAULT_VALUE 128 VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED @@ -1410,10 +1410,10 @@ ENUM_VALUE_LIST NULL READ_ONLY YES COMMAND_LINE_ARGUMENT NULL VARIABLE_NAME JOIN_BUFFER_SIZE -SESSION_VALUE 131072 -GLOBAL_VALUE 131072 +SESSION_VALUE 262144 +GLOBAL_VALUE 262144 GLOBAL_VALUE_ORIGIN COMPILE-TIME -DEFAULT_VALUE 131072 +DEFAULT_VALUE 262144 VARIABLE_SCOPE SESSION VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The size of the buffer that is used for joins @@ -1473,9 +1473,9 @@ DEFAULT_VALUE 134217728 VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The size of the buffer used for index blocks for MyISAM tables. Increase this to get better index handling (for all reads and multiple writes) to as much as you can afford -NUMERIC_MIN_VALUE NULL -NUMERIC_MAX_VALUE NULL -NUMERIC_BLOCK_SIZE NULL +NUMERIC_MIN_VALUE 0 +NUMERIC_MAX_VALUE 18446744073709551615 +NUMERIC_BLOCK_SIZE 4096 ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED @@ -1487,9 +1487,9 @@ DEFAULT_VALUE 300 VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT This characterizes the number of hits a hot block has to be untouched until it is considered aged enough to be downgraded to a warm block. This specifies the percentage ratio of that number of hits to the total number of blocks in key cache -NUMERIC_MIN_VALUE NULL -NUMERIC_MAX_VALUE NULL -NUMERIC_BLOCK_SIZE NULL +NUMERIC_MIN_VALUE 100 +NUMERIC_MAX_VALUE 4294967295 +NUMERIC_BLOCK_SIZE 100 ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED @@ -1501,9 +1501,9 @@ DEFAULT_VALUE 1024 VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The default size of key cache blocks -NUMERIC_MIN_VALUE NULL -NUMERIC_MAX_VALUE NULL -NUMERIC_BLOCK_SIZE NULL +NUMERIC_MIN_VALUE 512 +NUMERIC_MAX_VALUE 16384 +NUMERIC_BLOCK_SIZE 512 ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED @@ -1515,9 +1515,9 @@ DEFAULT_VALUE 100 VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The minimum percentage of warm blocks in key cache -NUMERIC_MIN_VALUE NULL -NUMERIC_MAX_VALUE NULL -NUMERIC_BLOCK_SIZE NULL +NUMERIC_MIN_VALUE 1 +NUMERIC_MAX_VALUE 100 +NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED @@ -1529,9 +1529,9 @@ DEFAULT_VALUE 512 VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Number of hash buckets for open and changed files. If you have a lot of MyISAM files open you should increase this for faster flush of changes. A good value is probably 1/10 of number of possible open MyISAM files. -NUMERIC_MIN_VALUE NULL -NUMERIC_MAX_VALUE NULL -NUMERIC_BLOCK_SIZE NULL +NUMERIC_MIN_VALUE 128 +NUMERIC_MAX_VALUE 16384 +NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED @@ -1543,9 +1543,9 @@ DEFAULT_VALUE 0 VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The number of segments in a key cache -NUMERIC_MIN_VALUE NULL -NUMERIC_MAX_VALUE NULL -NUMERIC_BLOCK_SIZE NULL +NUMERIC_MIN_VALUE 0 +NUMERIC_MAX_VALUE 64 +NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED @@ -1914,10 +1914,10 @@ ENUM_VALUE_LIST OFF,ON READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME MAX_ALLOWED_PACKET -SESSION_VALUE 1048576 -GLOBAL_VALUE 1048576 +SESSION_VALUE 4194304 +GLOBAL_VALUE 4194304 GLOBAL_VALUE_ORIGIN COMPILE-TIME -DEFAULT_VALUE 1048576 +DEFAULT_VALUE 4194304 VARIABLE_SCOPE SESSION VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Max packet length to send to or receive from the server @@ -2097,7 +2097,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MAX_LONG_DATA_SIZE SESSION_VALUE NULL -GLOBAL_VALUE 1048576 +GLOBAL_VALUE 4194304 GLOBAL_VALUE_ORIGIN AUTO DEFAULT_VALUE 1048576 VARIABLE_SCOPE GLOBAL @@ -3287,9 +3287,9 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME QUERY_CACHE_SIZE SESSION_VALUE NULL -GLOBAL_VALUE 0 +GLOBAL_VALUE 1048576 GLOBAL_VALUE_ORIGIN COMPILE-TIME -DEFAULT_VALUE 0 +DEFAULT_VALUE 1048576 VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The memory allocated to store results from old queries @@ -3314,10 +3314,10 @@ ENUM_VALUE_LIST OFF,ON READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME QUERY_CACHE_TYPE -SESSION_VALUE ON -GLOBAL_VALUE ON +SESSION_VALUE OFF +GLOBAL_VALUE OFF GLOBAL_VALUE_ORIGIN COMPILE-TIME -DEFAULT_VALUE ON +DEFAULT_VALUE OFF VARIABLE_SCOPE SESSION VARIABLE_TYPE ENUM VARIABLE_COMMENT OFF = Don't cache or retrieve results. ON = Cache all results except SELECT SQL_NO_CACHE ... queries. DEMAND = Cache only SELECT SQL_CACHE ... queries @@ -3693,9 +3693,9 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME SECURE_AUTH SESSION_VALUE NULL -GLOBAL_VALUE OFF +GLOBAL_VALUE ON GLOBAL_VALUE_ORIGIN COMPILE-TIME -DEFAULT_VALUE OFF +DEFAULT_VALUE ON VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BOOLEAN VARIABLE_COMMENT Disallow authentication for accounts that have old (pre-4.1) passwords @@ -4169,9 +4169,9 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT NULL VARIABLE_NAME SQL_MODE SESSION_VALUE ANSI_QUOTES -GLOBAL_VALUE +GLOBAL_VALUE NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION GLOBAL_VALUE_ORIGIN COMPILE-TIME -DEFAULT_VALUE +DEFAULT_VALUE NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION VARIABLE_SCOPE SESSION VARIABLE_TYPE SET VARIABLE_COMMENT Sets the sql mode @@ -4435,12 +4435,12 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME SYNC_MASTER_INFO SESSION_VALUE NULL -GLOBAL_VALUE 0 +GLOBAL_VALUE 10000 GLOBAL_VALUE_ORIGIN COMPILE-TIME -DEFAULT_VALUE 0 +DEFAULT_VALUE 10000 VARIABLE_SCOPE GLOBAL VARIABLE_TYPE INT UNSIGNED -VARIABLE_COMMENT Synchronously flush master info to disk after every #th event. Use 0 (default) to disable synchronous flushing +VARIABLE_COMMENT Synchronously flush master info to disk after every #th event. Use 0 to disable synchronous flushing NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 NUMERIC_BLOCK_SIZE 1 @@ -4449,12 +4449,12 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME SYNC_RELAY_LOG SESSION_VALUE NULL -GLOBAL_VALUE 0 +GLOBAL_VALUE 10000 GLOBAL_VALUE_ORIGIN COMPILE-TIME -DEFAULT_VALUE 0 +DEFAULT_VALUE 10000 VARIABLE_SCOPE GLOBAL VARIABLE_TYPE INT UNSIGNED -VARIABLE_COMMENT Synchronously flush relay log to disk after every #th event. Use 0 (default) to disable synchronous flushing +VARIABLE_COMMENT Synchronously flush relay log to disk after every #th event. Use 0 to disable synchronous flushing NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 NUMERIC_BLOCK_SIZE 1 @@ -4463,12 +4463,12 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME SYNC_RELAY_LOG_INFO SESSION_VALUE NULL -GLOBAL_VALUE 0 +GLOBAL_VALUE 10000 GLOBAL_VALUE_ORIGIN COMPILE-TIME -DEFAULT_VALUE 0 +DEFAULT_VALUE 10000 VARIABLE_SCOPE GLOBAL VARIABLE_TYPE INT UNSIGNED -VARIABLE_COMMENT Synchronously flush relay log info to disk after every #th transaction. Use 0 (default) to disable synchronous flushing +VARIABLE_COMMENT Synchronously flush relay log info to disk after every #th transaction. Use 0 to disable synchronous flushing NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 NUMERIC_BLOCK_SIZE 1 @@ -4478,7 +4478,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME TABLE_DEFINITION_CACHE SESSION_VALUE NULL GLOBAL_VALUE 400 -GLOBAL_VALUE_ORIGIN COMPILE-TIME +GLOBAL_VALUE_ORIGIN AUTO DEFAULT_VALUE 400 VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED @@ -4491,9 +4491,9 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME TABLE_OPEN_CACHE SESSION_VALUE NULL -GLOBAL_VALUE 400 +GLOBAL_VALUE 2000 GLOBAL_VALUE_ORIGIN COMPILE-TIME -DEFAULT_VALUE 400 +DEFAULT_VALUE 2000 VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The number of cached open tables diff --git a/mysql-test/suite/sys_vars/r/table_open_cache_basic.result b/mysql-test/suite/sys_vars/r/table_open_cache_basic.result index 2381dfe4900..d940ed69901 100644 --- a/mysql-test/suite/sys_vars/r/table_open_cache_basic.result +++ b/mysql-test/suite/sys_vars/r/table_open_cache_basic.result @@ -1,18 +1,18 @@ SET @start_value = @@global.table_open_cache ; SELECT @start_value; @start_value -400 +2000 '#--------------------FN_DYNVARS_001_01------------------------#' SET @@global.table_open_cache = 99; SET @@global.table_open_cache = DeFAULT; SELECT @@global.table_open_cache; @@global.table_open_cache -400 +2000 '#---------------------FN_DYNVARS_001_02-------------------------#' SET @@global.table_open_cache = Default; SELECT @@global.table_open_cache = 400; @@global.table_open_cache = 400 -1 +0 '#--------------------FN_DYNVARS_001_03------------------------#' SET @@global.table_open_cache = 8; SELECT @@global.table_open_cache ; @@ -104,4 +104,4 @@ ERROR 42S22: Unknown column 'table_open_cache' in 'field list' SET @@global.table_open_cache = @start_value; SELECT @@global.table_open_cache ; @@global.table_open_cache -400 +2000 diff --git a/mysql-test/suite/sys_vars/t/max_user_connections_func.test b/mysql-test/suite/sys_vars/t/max_user_connections_func.test index 74707c9b296..2af396b614f 100644 --- a/mysql-test/suite/sys_vars/t/max_user_connections_func.test +++ b/mysql-test/suite/sys_vars/t/max_user_connections_func.test @@ -39,6 +39,7 @@ SET @default_max_user_connections = @@global.max_user_connections; Set Global max_user_connections=2; +CREATE USER test@localhost; GRANT USAGE on *.* TO test@localhost; --echo '#--------------------FN_DYNVARS_114_01-------------------------#' diff --git a/mysql-test/suite/sys_vars/t/query_cache_limit_func.test b/mysql-test/suite/sys_vars/t/query_cache_limit_func.test index e90a0e6adda..c115524d49d 100644 --- a/mysql-test/suite/sys_vars/t/query_cache_limit_func.test +++ b/mysql-test/suite/sys_vars/t/query_cache_limit_func.test @@ -31,6 +31,9 @@ SET @global_query_cache_limit = @@global.query_cache_limit; SET @global_query_cache_size = @@global.query_cache_size; SET @global_query_cache_type = @@global.query_cache_type; +SET GLOBAL query_cache_type= ON; +SET LOCAL query_cache_type= ON; + --echo ** warnings ** --disable_warnings DROP TABLE IF EXISTS t; diff --git a/mysql-test/suite/sys_vars/t/query_cache_type_func.test b/mysql-test/suite/sys_vars/t/query_cache_type_func.test index 4679d1ec339..e015e374aeb 100644 --- a/mysql-test/suite/sys_vars/t/query_cache_type_func.test +++ b/mysql-test/suite/sys_vars/t/query_cache_type_func.test @@ -71,12 +71,15 @@ SET @@GLOBAL.query_cache_size = 65536; SET @@query_cache_type = DEFAULT; SELECT @@query_cache_type; ---echo ON Expected +--echo OFF Expected +--error ER_QUERY_CACHE_IS_GLOBALY_DISABLED +SET @@query_cache_type = ON; --echo '#--------------------FN_DYNVARS_135_02-------------------------#' # # Testing valid possible values # +SET GLOBAL query_cache_type= ON; --error ER_WRONG_VALUE_FOR_VAR SET @@query_cache_type = NULL; diff --git a/mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_func.test b/mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_func.test index e126a67ff30..5c7533eb50a 100644 --- a/mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_func.test +++ b/mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_func.test @@ -49,6 +49,11 @@ SET @start_session_value = @@SESSION.query_cache_wlock_invalidate; SET @old_cache_size = @@GLOBAL.query_cache_size; SET @old_cache_type = @@GLOBAL.query_cache_type; +SET GLOBAL query_cache_type= ON; +SET LOCAL query_cache_type= ON; +connection con1; +SET LOCAL query_cache_type= ON; +connection con0; # # Creating test table diff --git a/mysql-test/t/analyze_stmt_privileges.test b/mysql-test/t/analyze_stmt_privileges.test index 9dd8f274fce..b565f17c0f7 100644 --- a/mysql-test/t/analyze_stmt_privileges.test +++ b/mysql-test/t/analyze_stmt_privileges.test @@ -11,6 +11,7 @@ use db; create table t1 (i int, c varchar(8)); insert into t1 values (1,'foo'),(2,'bar'),(3,'baz'),(4,'qux'); create view v1 as select * from t1 where i > 1; +CREATE USER u1@localhost; grant ALL on db.v1 to u1@localhost; --connect (con1,localhost,u1,,) diff --git a/mysql-test/t/analyze_stmt_privileges2.test b/mysql-test/t/analyze_stmt_privileges2.test index 6fcdb7d4399..9a0299be535 100644 --- a/mysql-test/t/analyze_stmt_privileges2.test +++ b/mysql-test/t/analyze_stmt_privileges2.test @@ -24,6 +24,8 @@ --source include/count_sessions.inc --enable_connect_log +set GLOBAL sql_mode=""; +set LOCAL sql_mode=""; CREATE DATABASE privtest_db; @@ -5395,6 +5397,7 @@ DROP USER 'privtest'@localhost; USE test; DROP DATABASE privtest_db; +set GLOBAL sql_mode=default; --source include/wait_until_count_sessions.inc diff --git a/mysql-test/t/blackhole_plugin.test b/mysql-test/t/blackhole_plugin.test index 0cc7ae0817c..487fc5656f2 100644 --- a/mysql-test/t/blackhole_plugin.test +++ b/mysql-test/t/blackhole_plugin.test @@ -1,8 +1,9 @@ if (!$HA_BLACKHOLE_SO) { --skip Need blackhole plugin } - +set sql_mode=""; CREATE TABLE t1(a int) ENGINE=BLACKHOLE; +set sql_mode=default; DROP TABLE t1; --replace_regex /\.dll/.so/ eval INSTALL PLUGIN blackhole SONAME '$HA_BLACKHOLE_SO'; diff --git a/mysql-test/t/bootstrap.test b/mysql-test/t/bootstrap.test index 97376eb7412..840b9a12cee 100644 --- a/mysql-test/t/bootstrap.test +++ b/mysql-test/t/bootstrap.test @@ -78,6 +78,7 @@ EOF # Check that installed plugins are *not* automatically loaded in --bootstrap # --write_file $MYSQLTEST_VARDIR/tmp/bootstrap_plugins.sql +SET SQL_MODE=""; use test; create table t1(a int) engine=example; EOF diff --git a/mysql-test/t/change_user.test b/mysql-test/t/change_user.test index 659354e9c48..c918224520d 100644 --- a/mysql-test/t/change_user.test +++ b/mysql-test/t/change_user.test @@ -1,10 +1,14 @@ +# This test is checking that old password authentication works +set global secure_auth=0; # # functional change user tests # - +create user test_nopw; grant select on test.* to test_nopw; -grant select on test.* to test_oldpw identified by password "09301740536db389"; -grant select on test.* to test_newpw identified by "newpw"; +create user test_oldpw identified by password "09301740536db389"; +grant select on test.* to test_oldpw; +create user test_newpw identified by "newpw"; +grant select on test.* to test_newpw; select concat('<', user(), '>'), concat('<', current_user(), '>'), database(); @@ -136,3 +140,5 @@ if ($after != $before){ die The value of com_select changed during change_user; } echo Value of com_select did not change; + +set global secure_auth=default; diff --git a/mysql-test/t/connect.test b/mysql-test/t/connect.test index c4a6fb73b10..20989e70ef9 100644 --- a/mysql-test/t/connect.test +++ b/mysql-test/t/connect.test @@ -12,6 +12,7 @@ # Save the initial number of concurrent sessions --source include/count_sessions.inc +SET global secure_auth=0; --disable_warnings drop table if exists t1,t2; @@ -134,6 +135,7 @@ drop table t1; --echo # -- which results in user lockout. --echo +CREATE USER mysqltest_u1@localhost; GRANT USAGE ON *.* TO mysqltest_u1@localhost; # NOTE: if the test case fails sporadically due to spurious connections, @@ -452,3 +454,6 @@ delimiter ;| call p1(2); drop procedure p1; + + +SET global secure_auth=default; diff --git a/mysql-test/t/create_or_replace_permission.test b/mysql-test/t/create_or_replace_permission.test index f155e97198c..0e833a125bd 100644 --- a/mysql-test/t/create_or_replace_permission.test +++ b/mysql-test/t/create_or_replace_permission.test @@ -2,6 +2,8 @@ # Grant tests not performed with embedded server -- source include/not_embedded.inc +set local sql_mode=""; +set global sql_mode=""; --echo # --echo # Tests for checking permission denied on CREATE OR REPLACE if DROP --echo # access is revoked @@ -64,3 +66,6 @@ REVOKE ALL ON db1.* FROM mysqltest_1@localhost; DROP DATABASE IF EXISTS db2; DROP DATABASE db1; DROP USER mysqltest_1@localhost; + + +set global sql_mode=default; diff --git a/mysql-test/t/ctype_latin2_ch.test b/mysql-test/t/ctype_latin2_ch.test index c8ea54e6091..06ccd2c9782 100644 --- a/mysql-test/t/ctype_latin2_ch.test +++ b/mysql-test/t/ctype_latin2_ch.test @@ -144,6 +144,7 @@ SELECT * FROM t1 GROUP BY s1; SELECT * FROM t1 ORDER BY s1; DROP TABLE t1; +set sql_mode=""; --disable_warnings CREATE TABLE t1 ENGINE=INNODB AS SELECT repeat('a', 5) AS s1 LIMIT 0; --enable_warnings @@ -183,6 +184,7 @@ DROP TABLE t1; SET NAMES latin2; + # # Bug#37854 Test fails/aborts for collate latin2_czech_cs used with SET and ENUM datatypes # diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test index 6e5b0850eca..5dd0a5f426c 100644 --- a/mysql-test/t/ctype_ucs.test +++ b/mysql-test/t/ctype_ucs.test @@ -440,9 +440,11 @@ drop table t1; # # Bug #14583 Bug on query using a LIKE on indexed field with ucs2_bin collation # +set sql_mode=""; --disable_warnings create table t1(f1 varchar(5) CHARACTER SET ucs2 COLLATE ucs2_bin NOT NULL) engine=InnoDB; --enable_warnings +set sql_mode=default; insert into t1 values('a'); create index t1f1 on t1(f1); select f1 from t1 where f1 like 'a%'; diff --git a/mysql-test/t/ctype_ujis.test b/mysql-test/t/ctype_ujis.test index 6fc928c7e60..3f444580b13 100644 --- a/mysql-test/t/ctype_ujis.test +++ b/mysql-test/t/ctype_ujis.test @@ -87,6 +87,7 @@ DROP TABLE t1; # # Bug #6345 Unexpected behaviour with partial indices # +set sql_mode=""; --disable_warnings CREATE TABLE t1 ( @@ -96,6 +97,7 @@ CREATE TABLE t1 KEY b (b(10)) ) ENGINE=InnoDB CHARACTER SET 'ujis' COLLATE 'ujis_japanese_ci'; --enable_warnings +set sql_mode=default; INSERT INTO t1 (a, b) VALUES (0, 'aaabbbcccddd'); INSERT INTO t1 (a, b) VALUES (1, 'eeefffggghhh'); INSERT INTO t1 (a, b) VALUES (2, 'iiijjjkkkl'); diff --git a/mysql-test/t/ddl_i18n_koi8r.test b/mysql-test/t/ddl_i18n_koi8r.test index 40f8d07c55d..0a62a8ba0f8 100644 --- a/mysql-test/t/ddl_i18n_koi8r.test +++ b/mysql-test/t/ddl_i18n_koi8r.test @@ -24,6 +24,8 @@ # - restore object; # +set sql_mode=""; + ########################################################################### # # NOTE: this file contains text in UTF8 and KOI8-R encodings. diff --git a/mysql-test/t/ddl_i18n_utf8.test b/mysql-test/t/ddl_i18n_utf8.test index 35109e62100..023047b952e 100644 --- a/mysql-test/t/ddl_i18n_utf8.test +++ b/mysql-test/t/ddl_i18n_utf8.test @@ -30,6 +30,8 @@ # ########################################################################### +set sql_mode=""; + # Test requires server to accept client connections (for mysqldump portions) --source include/not_embedded.inc --source include/have_utf8.inc diff --git a/mysql-test/t/default.test b/mysql-test/t/default.test index 6904d9bb242..17f4383ae22 100644 --- a/mysql-test/t/default.test +++ b/mysql-test/t/default.test @@ -9,6 +9,7 @@ drop database if exists mysqltest; # Bug 10838 # Insert causes warnings for no default values and corrupts tables # +set sql_mode=""; CREATE TABLE t1 (a varchar(30) binary NOT NULL DEFAULT ' ', b varchar(1) binary NOT NULL DEFAULT ' ', c varchar(4) binary NOT NULL DEFAULT '0000', @@ -39,6 +40,7 @@ CREATE TABLE t1 (a varchar(30) binary NOT NULL DEFAULT ' ', b1 tinyblob NULL) ENGINE=InnoDB DEFAULT CHARACTER SET = latin1 COLLATE latin1_bin; --enable_warnings +set sql_mode=default; INSERT into t1 (b) values ('1'); SHOW WARNINGS; diff --git a/mysql-test/t/delete_returning_grant.test b/mysql-test/t/delete_returning_grant.test index f67a766b936..67613603a72 100644 --- a/mysql-test/t/delete_returning_grant.test +++ b/mysql-test/t/delete_returning_grant.test @@ -3,6 +3,9 @@ # --source include/not_embedded.inc +set GLOBAL sql_mode=""; +set LOCAL sql_mode=""; + CREATE TABLE t1 (a int(11), b varchar(32)); INSERT INTO t1 VALUES (7,'ggggggg'),(1,'a'),(3,'ccc'),(4,'dddd'),(1,'A'), (2,'BB'),(4,'DDDD'),(5,'EEEEE'),(7,'GGGGGGG'),(2,'bb'); @@ -76,3 +79,4 @@ DROP USER mysqltest_1@localhost; DROP VIEW v1; DROP TABLE t1; +set GLOBAL sql_mode=default; diff --git a/mysql-test/t/derived_view.test b/mysql-test/t/derived_view.test index 67899837bb2..3d9ab4e4477 100644 --- a/mysql-test/t/derived_view.test +++ b/mysql-test/t/derived_view.test @@ -1600,7 +1600,7 @@ CREATE TABLE IF NOT EXISTS `galleries` ( `year` int(11) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `pictures` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -1614,7 +1614,7 @@ CREATE TABLE IF NOT EXISTS `pictures` ( `type` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `gallery_id` (`gallery_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 ; +) DEFAULT CHARSET=utf8 ; ALTER TABLE `pictures` ADD CONSTRAINT `pictures_ibfk_1` FOREIGN KEY (`gallery_id`) REFERENCES `galleries` (`id`); diff --git a/mysql-test/t/enforce_storage_engine.test b/mysql-test/t/enforce_storage_engine.test index 8256fcd59fa..63f600d1879 100644 --- a/mysql-test/t/enforce_storage_engine.test +++ b/mysql-test/t/enforce_storage_engine.test @@ -1,5 +1,7 @@ -- source include/not_embedded.inc +set local sql_mode=""; +set global sql_mode=""; --disable_warnings drop table if exists t1; --enable_warnings @@ -82,5 +84,6 @@ DROP TABLE t1; connection default; disconnect con1; +set global sql_mode=default; SET SESSION enforce_storage_engine=NULL; SET GLOBAL enforce_storage_engine=NULL; diff --git a/mysql-test/t/enforce_storage_engine_opt.test b/mysql-test/t/enforce_storage_engine_opt.test index 82cc4117cdb..7ca7f94d3dc 100644 --- a/mysql-test/t/enforce_storage_engine_opt.test +++ b/mysql-test/t/enforce_storage_engine_opt.test @@ -1,3 +1,4 @@ +SET SQL_MODE=""; create table t1 (c1 int primary key auto_increment, c2 varchar(10)) engine=memory; show create table t1; set session sql_mode='no_engine_substitution'; diff --git a/mysql-test/t/events_1.test b/mysql-test/t/events_1.test index 89e8f9ca7dc..7cd488bc376 100644 --- a/mysql-test/t/events_1.test +++ b/mysql-test/t/events_1.test @@ -4,6 +4,8 @@ # Can't test with embedded server that doesn't support grants -- source include/not_embedded.inc +set sql_mode=""; + call mtr.add_suppression("Column count of mysql.event is wrong. Expected .*, found .*\. The table is probably corrupted"); --disable_warnings diff --git a/mysql-test/t/events_2.test b/mysql-test/t/events_2.test index 3d609654b21..ec69a2a5591 100644 --- a/mysql-test/t/events_2.test +++ b/mysql-test/t/events_2.test @@ -3,6 +3,8 @@ # Can't test with embedded server that doesn't support grants -- source include/not_embedded.inc +set sql_mode=""; + --disable_warnings drop database if exists events_test; --enable_warnings diff --git a/mysql-test/t/events_bugs.test b/mysql-test/t/events_bugs.test index 1e93917b08e..c0157a7727e 100644 --- a/mysql-test/t/events_bugs.test +++ b/mysql-test/t/events_bugs.test @@ -8,6 +8,7 @@ # Bug#41925 Warning 1366 Incorrect string value: ... for column processlist.info # # Please set $ +SET SQL_MODE=""; let $fixed_bug41925= 0; # # Dear maintainer of this test. Please do NOT remove the next big comment. @@ -1319,5 +1320,4 @@ DROP DATABASE events_test; SET GLOBAL event_scheduler= 'ON'; --source include/running_event_scheduler.inc SET @@global.concurrent_insert= @concurrent_insert; - # THIS MUST BE THE LAST LINE in this file. diff --git a/mysql-test/t/events_trans.test b/mysql-test/t/events_trans.test index 6d829379fea..eea24f19577 100644 --- a/mysql-test/t/events_trans.test +++ b/mysql-test/t/events_trans.test @@ -4,6 +4,8 @@ -- source include/have_innodb.inc -- source include/not_embedded.inc +set sql_mode=""; + --disable_warnings drop database if exists events_test; drop database if exists mysqltest_no_such_database; diff --git a/mysql-test/t/events_trans_notembedded.test b/mysql-test/t/events_trans_notembedded.test index 0353d183386..3cf823bf713 100644 --- a/mysql-test/t/events_trans_notembedded.test +++ b/mysql-test/t/events_trans_notembedded.test @@ -13,6 +13,7 @@ use events_test; # # Privilege checks # +create user mysqltest_user1@localhost; grant create, insert, select, delete on mysqltest_db2.* to mysqltest_user1@localhost; create database mysqltest_db2; diff --git a/mysql-test/t/features.test b/mysql-test/t/features.test index f2ac5a5bba6..225ab40b361 100644 --- a/mysql-test/t/features.test +++ b/mysql-test/t/features.test @@ -6,6 +6,8 @@ drop table if exists t1; --enable_warnings +set sql_mode=""; + flush status; show status like "feature%"; diff --git a/mysql-test/t/fix_priv_tables.test b/mysql-test/t/fix_priv_tables.test index f68c8b518c8..293d3915a05 100644 --- a/mysql-test/t/fix_priv_tables.test +++ b/mysql-test/t/fix_priv_tables.test @@ -22,6 +22,8 @@ if (!$MYSQL_FIX_PRIVILEGE_TABLES) drop table if exists t1,t1aa,t2aa; --enable_warnings +set sql_mode=""; + # # Bug #20589 Missing some table level privileges after upgrade # diff --git a/mysql-test/t/flush-innodb-notembedded.test b/mysql-test/t/flush-innodb-notembedded.test index d08a0647ff5..15bfeb53475 100644 --- a/mysql-test/t/flush-innodb-notembedded.test +++ b/mysql-test/t/flush-innodb-notembedded.test @@ -1,6 +1,8 @@ --source include/have_innodb.inc --source include/not_embedded.inc +set sql_mode=""; + --echo # Test 7: Check privileges required. --echo # diff --git a/mysql-test/t/flush_read_lock.test b/mysql-test/t/flush_read_lock.test index e8ec07392b5..7ba80ea38ac 100644 --- a/mysql-test/t/flush_read_lock.test +++ b/mysql-test/t/flush_read_lock.test @@ -13,6 +13,8 @@ # Save the initial number of concurrent sessions. --source include/count_sessions.inc +set global sql_mode=""; +set local sql_mode=""; --echo # FTWRL takes two global metadata locks -- a global shared --echo # metadata lock and the commit blocker lock. --echo # The first lock prevents DDL from taking place. @@ -2161,6 +2163,7 @@ disconnect con1; disconnect con2; disconnect con3; +set global sql_mode=default; # Check that all connections opened by test cases in this file are really # gone so execution of other tests won't be affected by their presence. --source include/wait_until_count_sessions.inc diff --git a/mysql-test/t/func_compress.test b/mysql-test/t/func_compress.test index fc3d2697426..2a06769b2ef 100644 --- a/mysql-test/t/func_compress.test +++ b/mysql-test/t/func_compress.test @@ -5,6 +5,10 @@ # Note that this test gives error in the gzip library when running under # valgrind, but these warnings can be ignored +set global max_allowed_packet=1048576; +connect (conn1,localhost,root,,); +connection conn1; + select @test_compress_string:='string for test compress function aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa '; select length(@test_compress_string); @@ -142,6 +146,9 @@ DROP TABLE t1; # SELECT UNCOMPRESS(CAST(0 AS BINARY(5))); +disconnect conn1; +connection default; +set global max_allowed_packet=default; --echo # --echo # End of 5.5 tests --echo # diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test index 2998742dbcc..b48f4599074 100644 --- a/mysql-test/t/func_math.test +++ b/mysql-test/t/func_math.test @@ -136,9 +136,11 @@ DROP TABLE t1; # # InnoDB is required to reproduce the fault, but it is okay if we default to # MyISAM when testing. +set sql_mode=""; --disable_warnings create table t1 (a varchar(90), ts datetime not null, index (a)) engine=innodb default charset=utf8; --enable_warnings +set sql_mode=default; insert into t1 values ('http://www.foo.com/', now()); select a from t1 where a='http://www.foo.com/' order by abs(timediff(ts, 0)); drop table t1; diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test index ef6472a3848..364266d7f6f 100644 --- a/mysql-test/t/func_misc.test +++ b/mysql-test/t/func_misc.test @@ -379,7 +379,7 @@ CREATE TABLE t1 (a char(2) not null ); INSERT INTO t1 VALUES (4),(7),(1); set @optimizer_switch_save= @@optimizer_switch; set optimizer_switch='materialization=off'; -CREATE TABLE tv (e char(2) not null ) engine=mysql; +CREATE TABLE tv (e char(2) not null ); INSERT INTO tv VALUES (1); CREATE ALGORITHM=MERGE VIEW v_merge AS SELECT * FROM tv; CREATE ALGORITHM=MERGE VIEW vm AS SELECT * FROM tv; diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 95b742d3545..726397bc2a7 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -6,6 +6,10 @@ drop table if exists t1,t2; --enable_warnings +set global max_allowed_packet=1048576; +connect (conn1,localhost,root,,); +connection conn1; + let $mysqld_datadir= `select @@datadir`; set names latin1; @@ -1562,7 +1566,7 @@ round( ) ); ---connection default +--connection conn1 SET @@global.max_allowed_packet:= @tmp_max; --disconnect newconn # @@ -1739,6 +1743,9 @@ EXECUTE stmt; SET NAMES latin2; EXECUTE stmt; +disconnect conn1; +connection default; +set global max_allowed_packet=default; --echo # --echo # End of 5.6 tests diff --git a/mysql-test/t/func_weight_string.test b/mysql-test/t/func_weight_string.test index 6c34ce1e460..cf6524e9753 100644 --- a/mysql-test/t/func_weight_string.test +++ b/mysql-test/t/func_weight_string.test @@ -2,6 +2,11 @@ drop table if exists t1; --enable_warnings + +set global max_allowed_packet=1048576; +connect (conn1,localhost,root,,); +connection conn1; + set names latin1; # @@ -111,3 +116,6 @@ drop table t1; SELECT HEX(WEIGHT_STRING('ab' AS CHAR(1000000000000000000))); SELECT HEX(WEIGHT_STRING('ab' AS BINARY(1000000000000000000))); +disconnect conn1; +connection default; +set global max_allowed_packet=default; diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index b1580383f22..1d828cd8693 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -6,6 +6,8 @@ # Save the initial number of concurrent sessions --source include/count_sessions.inc +set GLOBAL sql_mode=""; +set LOCAL sql_mode=""; SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators; SET GLOBAL log_bin_trust_function_creators = 1; @@ -2208,9 +2210,6 @@ disconnect con1; DROP USER untrusted@localhost; DROP DATABASE secret; -# Wait till we reached the initial number of concurrent sessions ---source include/wait_until_count_sessions.inc - --echo # --echo # BUG#11759114 - '51401: GRANT TREATS NONEXISTENT FUNCTIONS/PRIVILEGES --echo # DIFFERENTLY'. @@ -2233,3 +2232,7 @@ grant select on mysqltest_db1.t1 to mysqltest_u1; show grants for mysqltest_u1; drop database mysqltest_db1; drop user mysqltest_u1; + +set GLOBAL sql_mode=default; +# Wait till we reached the initial number of concurrent sessions +--source include/wait_until_count_sessions.inc diff --git a/mysql-test/t/grant2.test b/mysql-test/t/grant2.test index 8590dccd1d1..a40fd2afb18 100644 --- a/mysql-test/t/grant2.test +++ b/mysql-test/t/grant2.test @@ -5,6 +5,8 @@ --source include/count_sessions.inc +set GLOBAL sql_mode=""; +set LOCAL sql_mode=""; SET NAMES binary; # @@ -1029,5 +1031,6 @@ DROP USER mysqltest_u4@localhost; DROP USER mysqltest_u5@localhost; +set GLOBAL sql_mode=default; # Wait till we reached the initial number of concurrent sessions --source include/wait_until_count_sessions.inc diff --git a/mysql-test/t/grant3.test b/mysql-test/t/grant3.test index d24b2de17eb..27f565916f7 100644 --- a/mysql-test/t/grant3.test +++ b/mysql-test/t/grant3.test @@ -4,6 +4,8 @@ # Save the initial number of concurrent sessions --source include/count_sessions.inc +set global sql_mode=""; +set local sql_mode=""; # Test of GRANT commands @@ -204,6 +206,7 @@ connection default; DROP USER 'user2'@'%'; DROP DATABASE temp; +set global sql_mode=default; --echo End of 5.0 tests # Wait till we reached the initial number of concurrent sessions diff --git a/mysql-test/t/grant4.test b/mysql-test/t/grant4.test index 36c44fe997a..a3578c9b85a 100644 --- a/mysql-test/t/grant4.test +++ b/mysql-test/t/grant4.test @@ -4,6 +4,8 @@ --disable_warnings drop database if exists mysqltest_db1; --enable_warnings +set GLOBAL sql_mode=""; +set LOCAL sql_mode=""; create database mysqltest_db1; use mysqltest_db1; create table t_column_priv_only (a int, b int); @@ -232,3 +234,6 @@ create user foo2 identified via mysql_native_password using '2222222222222222'; create user foo3 identified via mysql_old_password using '00'; --error ER_PASSWD_LENGTH create user foo4 identified via mysql_old_password using '11111111111111111111111111111111111111111'; + + +set GLOBAL sql_mode=default; diff --git a/mysql-test/t/grant_4332.test b/mysql-test/t/grant_4332.test index d3c3b2d5652..41e0b822f98 100644 --- a/mysql-test/t/grant_4332.test +++ b/mysql-test/t/grant_4332.test @@ -6,6 +6,8 @@ # --source include/not_embedded.inc +set GLOBAL sql_mode=""; +set LOCAL sql_mode=""; alter table mysql.user modify User char(16) binary not null default ''; alter table mysql.db modify User char(16) binary not null default ''; @@ -40,3 +42,4 @@ flush privileges; select user(); --disable_metadata +set GLOBAL sql_mode=default; diff --git a/mysql-test/t/grant_explain_non_select.test b/mysql-test/t/grant_explain_non_select.test index d59a8f3d8ce..701586be325 100644 --- a/mysql-test/t/grant_explain_non_select.test +++ b/mysql-test/t/grant_explain_non_select.test @@ -8,6 +8,9 @@ # Save the initial number of concurrent sessions --source include/count_sessions.inc +set GLOBAL sql_mode=""; +set LOCAL sql_mode=""; + CREATE DATABASE privtest_db; CREATE TABLE privtest_db.t1 (a INT); @@ -254,5 +257,7 @@ DROP USER 'privtest'@localhost; USE test; DROP DATABASE privtest_db; +set GLOBAL sql_mode=default; +set LOCAL sql_mode=default; # Wait till we reached the initial number of concurrent sessions --source include/wait_until_count_sessions.inc diff --git a/mysql-test/t/grant_lowercase.test b/mysql-test/t/grant_lowercase.test index 4b27b4c674d..e31a72b890e 100644 --- a/mysql-test/t/grant_lowercase.test +++ b/mysql-test/t/grant_lowercase.test @@ -4,7 +4,7 @@ # # http://seclists.org/fulldisclosure/2012/Dec/4 # - +set sql_mode=""; # in acl_get(), check_grant_db(), mysql_grant() grant file on *.* to user1@localhost with grant option; grant select on `a%`.* to user1@localhost with grant option; @@ -28,4 +28,3 @@ delete from mysql.db where db like '=>%'; alter table mysql.host modify Db char(64) default ""; alter table mysql.db modify Db char(64) default "", modify User char(80) default ""; flush privileges; - diff --git a/mysql-test/t/help.test b/mysql-test/t/help.test index 71821e46771..43e61136e05 100644 --- a/mysql-test/t/help.test +++ b/mysql-test/t/help.test @@ -63,12 +63,14 @@ help 'impossible_function_1'; help 'impossible_category_1'; ############## +set sql_mode=""; --disable_warnings alter table mysql.help_relation engine=innodb; alter table mysql.help_keyword engine=innodb; alter table mysql.help_topic engine=innodb; alter table mysql.help_category engine=innodb; --enable_warnings +set sql_mode=default; ############## help 'function_of_my_dream'; diff --git a/mysql-test/t/host_cache_size_functionality.test b/mysql-test/t/host_cache_size_functionality.test index 1696c2fcb97..5a7376cc5eb 100644 --- a/mysql-test/t/host_cache_size_functionality.test +++ b/mysql-test/t/host_cache_size_functionality.test @@ -35,7 +35,7 @@ SELECT COUNT(@@GLOBAL.Host_Cache_Size); --echo 1 Expected #set @Default_host_cache_size=(select if(if(@@global.max_connections<500,128+@@global.max_connections,128+@@global.max_connections+floor((@@global.max_connections-500)/20))>2000,2000,if(@@global.max_connections<500,128+@@global.max_connections,128+@@global.max_connections+floor((@@global.max_connections-500)/20)))); -set @Default_host_cache_size=128; +set @Default_host_cache_size=279; select @@global.Host_Cache_Size=@Default_host_cache_size; --echo 1 Expected diff --git a/mysql-test/t/implicit_commit.test b/mysql-test/t/implicit_commit.test index 59f8dc3a44c..bcc43865395 100644 --- a/mysql-test/t/implicit_commit.test +++ b/mysql-test/t/implicit_commit.test @@ -2,6 +2,8 @@ source include/have_innodb.inc; source include/not_embedded.inc; source include/have_profiling.inc; +SET SQL_MODE=""; + SET GLOBAL EVENT_SCHEDULER = OFF; SET BINLOG_FORMAT = STATEMENT; diff --git a/mysql-test/t/index_intersect.test b/mysql-test/t/index_intersect.test index 001c698029e..19918c03479 100644 --- a/mysql-test/t/index_intersect.test +++ b/mysql-test/t/index_intersect.test @@ -428,7 +428,7 @@ CREATE TABLE t1 ( f5 int, PRIMARY KEY (f1), KEY (f4) -) ENGINE=InnoDB; +); INSERT INTO t1 VALUES (5,'H',1), (9,'g',0), (527,'i',0), (528,'y',1), (529,'S',6), diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test index cd98bf3aa5c..f1e78441852 100644 --- a/mysql-test/t/information_schema.test +++ b/mysql-test/t/information_schema.test @@ -14,6 +14,8 @@ # Save the initial number of concurrent sessions --source include/count_sessions.inc +set global sql_mode=""; +set local sql_mode=""; # Test for information_schema.schemata & # show databases @@ -1907,3 +1909,4 @@ disconnect con1; # Wait till all disconnects are completed --source include/wait_until_count_sessions.inc +set global sql_mode=default; diff --git a/mysql-test/t/information_schema_db.test b/mysql-test/t/information_schema_db.test index 5b730db47cd..70ad9b5b920 100644 --- a/mysql-test/t/information_schema_db.test +++ b/mysql-test/t/information_schema_db.test @@ -7,6 +7,9 @@ -- source include/testdb_only.inc +set local sql_mode=""; +set global sql_mode=""; + --disable_warnings drop table if exists t1,t2; drop view if exists v1,v2; @@ -250,3 +253,5 @@ connection user1; disconnect user1; --source include/wait_until_disconnected.inc connection default; + +set global sql_mode=default; diff --git a/mysql-test/t/information_schema_routines.test b/mysql-test/t/information_schema_routines.test index c578176a85d..190410c2b82 100644 --- a/mysql-test/t/information_schema_routines.test +++ b/mysql-test/t/information_schema_routines.test @@ -54,6 +54,8 @@ # the routine; otherwise NULL), # DEFINER (shows the user who created the routine). ################################################################################ +set sql_mode=""; +set sql_mode=""; -- echo # ========== routines.1 ========== USE INFORMATION_SCHEMA; --replace_result ENGINE=MyISAM "" ENGINE=MARIA "" ENGINE=Aria "" " PAGE_CHECKSUM=1" "" " PAGE_CHECKSUM=0" "" diff --git a/mysql-test/t/insert_notembedded.test b/mysql-test/t/insert_notembedded.test index 4e5fe6f6755..713eaf5db40 100644 --- a/mysql-test/t/insert_notembedded.test +++ b/mysql-test/t/insert_notembedded.test @@ -1,5 +1,8 @@ -- source include/not_embedded.inc +set local sql_mode=""; +set global sql_mode=""; + --disable_warnings drop table if exists t1; --enable_warnings @@ -188,3 +191,6 @@ disconnect select; unlock tables; drop table t1; set low_priority_updates=default; + +set local sql_mode=default; +set global sql_mode=default; diff --git a/mysql-test/t/kill.test b/mysql-test/t/kill.test index b762900f1ec..aaf931a2e7f 100644 --- a/mysql-test/t/kill.test +++ b/mysql-test/t/kill.test @@ -10,6 +10,8 @@ -- source include/not_embedded.inc -- source include/have_debug_sync.inc -- source include/not_threadpool.inc +set local sql_mode=""; +set global sql_mode=""; --disable_warnings SET DEBUG_SYNC = 'RESET'; @@ -675,3 +677,5 @@ DROP USER u1@localhost; SET DEBUG_SYNC = 'RESET'; DROP FUNCTION MY_KILL; + +set global sql_mode=default; diff --git a/mysql-test/t/lock_multi.test b/mysql-test/t/lock_multi.test index 753b6bd6379..efd0fe5d630 100644 --- a/mysql-test/t/lock_multi.test +++ b/mysql-test/t/lock_multi.test @@ -324,9 +324,11 @@ DROP DATABASE mysqltest_1; # connection locker; # Disable warnings to allow test to run also without InnoDB +set sql_mode=""; --disable_warnings create table t1 (f1 int(12) unsigned not null auto_increment, primary key(f1)) engine=innodb; --enable_warnings +set sql_mode=default; lock tables t1 write; connection writer; send diff --git a/mysql-test/t/log_tables.test b/mysql-test/t/log_tables.test index 28f6e6dd829..a4158ba6a24 100644 --- a/mysql-test/t/log_tables.test +++ b/mysql-test/t/log_tables.test @@ -6,6 +6,7 @@ # check that CSV engine was compiled in --source include/have_csv.inc +SET SQL_MODE=""; SET @old_general_log_state = @@global.general_log; SET @old_log_output= @@global.log_output; SET @old_slow_query_log= @@global.slow_query_log; diff --git a/mysql-test/t/lowercase_fs_off.test b/mysql-test/t/lowercase_fs_off.test index 1be0351f9bc..cb5cd711c7f 100644 --- a/mysql-test/t/lowercase_fs_off.test +++ b/mysql-test/t/lowercase_fs_off.test @@ -5,6 +5,8 @@ -- source include/have_case_sensitive_file_system.inc -- source include/not_embedded.inc +set GLOBAL sql_mode=""; +set LOCAL sql_mode=""; connect (master,localhost,root,,); connection master; create database d1; @@ -102,3 +104,5 @@ CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET new.a= 1; RENAME TABLE t1 TO T1; ALTER TABLE T1 RENAME t1; DROP TABLE t1; + +set GLOBAL sql_mode=default; diff --git a/mysql-test/t/lowercase_table_grant.test b/mysql-test/t/lowercase_table_grant.test index 7449231fca5..2f98f570e29 100644 --- a/mysql-test/t/lowercase_table_grant.test +++ b/mysql-test/t/lowercase_table_grant.test @@ -3,6 +3,7 @@ # Test of grants when lower_case_table_names is on use mysql; +set sql_mode=""; # mixed-case database name for testing create database MYSQLtest; diff --git a/mysql-test/t/lowercase_table_qcache.test b/mysql-test/t/lowercase_table_qcache.test index e63ad3b2c16..ab05755bec1 100644 --- a/mysql-test/t/lowercase_table_qcache.test +++ b/mysql-test/t/lowercase_table_qcache.test @@ -3,6 +3,8 @@ # Test of query cache with --lower-case-table-names # set GLOBAL query_cache_size=1355776; +set GLOBAL query_cache_type=ON; +set LOCAL query_cache_type=ON; --disable_warnings drop database if exists MySQLtesT; @@ -26,6 +28,7 @@ select * from MySQL.db; enable_result_log; show status like "Qcache_queries_in_cache"; -set GLOBAL query_cache_size=0; +set GLOBAL query_cache_size=default; +set GLOBAL query_cache_type=default; # End of 4.1 tests diff --git a/mysql-test/t/max_statement_time.test b/mysql-test/t/max_statement_time.test index a25a97e1db3..0882daff139 100644 --- a/mysql-test/t/max_statement_time.test +++ b/mysql-test/t/max_statement_time.test @@ -79,6 +79,7 @@ DROP TABLE t1; --echo # MAX_STATEMENT_TIME account resource --echo +set statement sql_mode="" for GRANT USAGE ON *.* TO user1@localhost WITH MAX_STATEMENT_TIME 1.005; --echo # con1 diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test index 2697e3b9a5f..5bfe22697dd 100644 --- a/mysql-test/t/merge.test +++ b/mysql-test/t/merge.test @@ -1895,13 +1895,14 @@ DROP TABLE t1; --disable_warnings drop table if exists t_parent; --enable_warnings -set @save_table_definition_cache=@@global.table_definition_cache; +set @save_table_open_cache=@@global.table_open_cache; --echo # ---echo # Set @@global.table_definition_cache to minimum +--echo # Set @@global.table_open_cache to minimum --echo # -set @@global.table_definition_cache=400; +set @@global.table_open_cache=400; +select @@table_open_cache; set @a=null; -let $1 = 400; +let $1 = `select @@table_open_cache;`; --echo # --echo # Create 400 merge children --echo # @@ -1935,7 +1936,7 @@ deallocate prepare stmt; --echo # --echo # Cleanup --echo # -let $1 = 400; +let $1 = `select @@table_open_cache;`; --disable_query_log while ($1) { @@ -1944,7 +1945,7 @@ while ($1) } --enable_query_log drop table t_parent; -set @@global.table_definition_cache=@save_table_definition_cache; +set @@global.table_open_cache=@save_table_open_cache; # # WL#4144 - Lock MERGE engine children diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test index c013938416e..8c620ed2ce4 100644 --- a/mysql-test/t/multi_update.test +++ b/mysql-test/t/multi_update.test @@ -378,6 +378,7 @@ create database mysqltest; create table mysqltest.t1 (a int, b int, primary key (a)); create table mysqltest.t2 (a int, b int, primary key (a)); create table mysqltest.t3 (a int, b int, primary key (a)); +create user mysqltest_1@localhost; grant select on mysqltest.* to mysqltest_1@localhost; grant update on mysqltest.t1 to mysqltest_1@localhost; connect (user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK); diff --git a/mysql-test/t/mysql.test b/mysql-test/t/mysql.test index c328ab19ffd..f1813dd0ca4 100644 --- a/mysql-test/t/mysql.test +++ b/mysql-test/t/mysql.test @@ -4,6 +4,8 @@ # # Testing the MySQL command line client(mysql) # +set GLOBAL sql_mode=""; +set LOCAL sql_mode=""; --disable_warnings drop table if exists t1,t2,t3; @@ -632,5 +634,6 @@ EOF --exec $MYSQL --default-character-set=utf8 < $MYSQLTEST_VARDIR/tmp/mdev-6572.sql 2>&1 --remove_file $MYSQLTEST_VARDIR/tmp/mdev-6572.sql +set GLOBAL sql_mode=default; --echo --echo End of tests diff --git a/mysql-test/t/mysql_comments.test b/mysql-test/t/mysql_comments.test index 1f997aeb1ab..7b00f17e259 100644 --- a/mysql-test/t/mysql_comments.test +++ b/mysql-test/t/mysql_comments.test @@ -10,6 +10,8 @@ # # ######################################################################## +set global sql_mode=""; + # # Bug #11230: Keeping comments when storing stored procedures # @@ -34,4 +36,6 @@ drop trigger if exists t1_bi; --echo "Pass 2 : --enable-comments" --exec $MYSQL --enable-comments test 2>&1 < "./t/mysql_comments.sql" + +set global sql_mode=default; --echo End of 5.0 tests diff --git a/mysql-test/t/mysql_upgrade.test b/mysql-test/t/mysql_upgrade.test index a24ba0de2d9..552bb12ec74 100644 --- a/mysql-test/t/mysql_upgrade.test +++ b/mysql-test/t/mysql_upgrade.test @@ -2,6 +2,8 @@ -- source include/have_working_dns.inc -- source include/have_innodb.inc +set sql_mode=""; + # # Basic test that we can run mysql_upgrde and that it finds the # expected binaries it uses. @@ -158,4 +160,5 @@ SELECT grantor FROM mysql.tables_priv WHERE db = 'mysql' AND table_name = 'user' DROP USER very_long_user_name_number_1, very_long_user_name_number_2, even_longer_user_name_number_3_to_test_the_grantor_and_definer_field_length@localhost; DROP PROCEDURE test.pr; +set sql_mode=default; --echo End of tests diff --git a/mysql-test/t/mysqlbinlog-innodb.test b/mysql-test/t/mysqlbinlog-innodb.test index 49702e8db38..c8bf8095705 100644 --- a/mysql-test/t/mysqlbinlog-innodb.test +++ b/mysql-test/t/mysqlbinlog-innodb.test @@ -1,7 +1,6 @@ -- source include/have_binlog_format_statement.inc -- source include/have_log_bin.inc -- source include/have_innodb.inc - # # MBug#702303: Spurious `use` statements in output from mysqlbinlog --rewrite-db="a->b" # diff --git a/mysql-test/t/openssl_1.test b/mysql-test/t/openssl_1.test index e36f106a5be..8c81bdc9bbb 100644 --- a/mysql-test/t/openssl_1.test +++ b/mysql-test/t/openssl_1.test @@ -6,6 +6,8 @@ # Save the initial number of concurrent sessions --source include/count_sessions.inc +set local sql_mode=""; +set global sql_mode=""; --disable_warnings drop table if exists t1; @@ -263,6 +265,7 @@ disconnect con1; connection default; DROP USER bug42158@localhost; +set global sql_mode=default; --echo End of 5.1 tests # Wait till we reached the initial number of concurrent sessions diff --git a/mysql-test/t/openssl_6975.test b/mysql-test/t/openssl_6975.test index bc6397c5c28..88fe17d0621 100644 --- a/mysql-test/t/openssl_6975.test +++ b/mysql-test/t/openssl_6975.test @@ -7,7 +7,9 @@ source include/have_ssl_communication.inc; # this is OpenSSL test. +create user ssl_sslv3@localhost; grant select on test.* to ssl_sslv3@localhost require cipher "RC4-SHA"; +create user ssl_tls12@localhost; grant select on test.* to ssl_tls12@localhost require cipher "AES128-SHA256"; let $mysql=$MYSQL --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1; diff --git a/mysql-test/t/partition_grant.test b/mysql-test/t/partition_grant.test index cf944e507fd..a5df218bb10 100644 --- a/mysql-test/t/partition_grant.test +++ b/mysql-test/t/partition_grant.test @@ -21,6 +21,7 @@ insert into t1 values (1),(2); # cleanup possible grants for mysqltest_1 left by previous tests # and ensure consistent results of SHOW GRANTS command below. --disable_warnings +create user mysqltest_1@localhost; grant usage on *.* to mysqltest_1@localhost; revoke all privileges on *.* from mysqltest_1@localhost; --enable_warnings diff --git a/mysql-test/t/partition_hash.test b/mysql-test/t/partition_hash.test index 5b9aa5707b9..c8f473a0477 100644 --- a/mysql-test/t/partition_hash.test +++ b/mysql-test/t/partition_hash.test @@ -135,12 +135,14 @@ drop table t1; # # Disable warnings to allow this test case to run without # the Blackhole storage engine. +set sql_mode=""; --disable_warnings CREATE TABLE t1 (s1 int) ENGINE=BLACKHOLE PARTITION BY HASH (s1); --enable_warnings --error 0,ER_BINLOG_LOGGING_IMPOSSIBLE INSERT INTO t1 VALUES (0); DROP TABLE t1; +set sql_mode=default; # # BUG 18423 Hash partitioning can lose rows in some queries diff --git a/mysql-test/t/partition_innodb.test b/mysql-test/t/partition_innodb.test index 2d90764da0d..b982ab8d2e8 100644 --- a/mysql-test/t/partition_innodb.test +++ b/mysql-test/t/partition_innodb.test @@ -478,6 +478,7 @@ drop table t1; # # Bug 20397: Partitions: Crash when using non-existing engine # +SET SQL_MODE=""; create table t1 (a int) engine = x partition by key (a); @@ -492,6 +493,7 @@ partition by list (a) alter table t1 engine = x; show create table t1; drop table t1; +SET SQL_MODE=default; # BUG#26117: index_merge sort-union over partitioned table crashes diff --git a/mysql-test/t/plugin.test b/mysql-test/t/plugin.test index ec7117bb832..68c4d5afd64 100644 --- a/mysql-test/t/plugin.test +++ b/mysql-test/t/plugin.test @@ -1,8 +1,8 @@ --source include/not_windows_embedded.inc --source include/have_example_plugin.inc +--error ER_UNKNOWN_STORAGE_ENGINE CREATE TABLE t1(a int) ENGINE=EXAMPLE; -DROP TABLE t1; INSTALL PLUGIN example SONAME 'ha_example'; --replace_regex /\.dll/.so/ diff --git a/mysql-test/t/plugin_auth.test b/mysql-test/t/plugin_auth.test index 5e620654e0a..c5d96e0d612 100644 --- a/mysql-test/t/plugin_auth.test +++ b/mysql-test/t/plugin_auth.test @@ -3,6 +3,9 @@ --source include/mysql_upgrade_preparation.inc --source include/have_innodb.inc +SET GLOBAL SQL_MODE=""; +SET LOCAL SQL_MODE=""; + query_vertical SELECT PLUGIN_STATUS, PLUGIN_TYPE, PLUGIN_DESCRIPTION FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME='test_plugin_server'; @@ -60,7 +63,7 @@ disconnect plug_con_rightp; --echo ## test no_auto_create_user sql mode with plugin users SET @@sql_mode=no_auto_create_user; GRANT INSERT ON TEST.* TO grant_user IDENTIFIED WITH 'test_plugin_server'; -SET @@sql_mode=default; +SET @@sql_mode=""; DROP USER grant_user; --echo ## test utf-8 user name @@ -580,4 +583,5 @@ disconnect bug12818542_con2; DROP USER bug12818542@localhost; DROP USER bug12818542_dest@localhost; +SET GLOBAL SQL_MODE=default; --echo End of 5.5 tests diff --git a/mysql-test/t/plugin_auth_qa.test b/mysql-test/t/plugin_auth_qa.test index 3a3921510e0..fce72a66702 100644 --- a/mysql-test/t/plugin_auth_qa.test +++ b/mysql-test/t/plugin_auth_qa.test @@ -3,6 +3,8 @@ --source include/have_plugin_auth.inc --source include/not_embedded.inc +set sql_mode=""; + CREATE DATABASE test_user_db; --sorted_result @@ -332,5 +334,6 @@ DROP USER grant_user,plug_dest; set @@sql_mode= @save_sql_mode; # DROP DATABASE test_user_db; + --exit diff --git a/mysql-test/t/plugin_not_embedded.test b/mysql-test/t/plugin_not_embedded.test index 3e3bd6e86ca..3b4129b6b6b 100644 --- a/mysql-test/t/plugin_not_embedded.test +++ b/mysql-test/t/plugin_not_embedded.test @@ -5,6 +5,7 @@ --echo # Bug#51770: UNINSTALL PLUGIN requires no privileges --echo # +CREATE USER bug51770@localhost; GRANT INSERT ON mysql.plugin TO bug51770@localhost; connect(con1,localhost,bug51770,,); --replace_regex /\.dll/.so/ @@ -29,4 +30,3 @@ let $path = `select CONCAT_WS('/', '..', '$HA_EXAMPLE_SO')`; --replace_regex /\.dll/.so/ --error ER_UDF_NO_PATHS eval INSTALL PLUGIN example SONAME '$path'; - diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index 84c9874260a..96dd88f5eb6 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -1,5 +1,6 @@ -- source include/not_embedded.inc -- source include/have_log_bin.inc + call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.'); # # SQL Syntax for Prepared Statements test diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test index 387dcd205bd..a97b0b1c815 100644 --- a/mysql-test/t/query_cache.test +++ b/mysql-test/t/query_cache.test @@ -4,7 +4,16 @@ # # Tests with query cache # +SET GLOBAL query_cache_type= Off; +SET LOCAL query_cache_type= Off; +SET LOCAL query_cache_type= 0; +--error ER_QUERY_CACHE_IS_GLOBALY_DISABLED +SET LOCAL query_cache_type= on; +--error ER_QUERY_CACHE_IS_GLOBALY_DISABLED +SET LOCAL query_cache_type= 1; set GLOBAL query_cache_size=1355776; +SET GLOBAL query_cache_type= ON; +SET LOCAL query_cache_type= ON; # Reset query cache variables. @@ -1204,9 +1213,8 @@ set global query_cache_size=102400; set global query_cache_size=0; set global query_cache_type=0; show status like 'Qcache_free_blocks'; - ---error ER_QUERY_CACHE_DISABLED set global query_cache_size=102400; +show status like 'Qcache_free_blocks'; set global query_cache_type=on; set session query_cache_type=on; @@ -1260,6 +1268,8 @@ set GLOBAL query_cache_limit=default; set GLOBAL query_cache_min_res_unit=default; set GLOBAL query_cache_size=default; set local query_cache_type=default; +set GLOBAL query_cache_type=on; +set local query_cache_type=on; # # Bug#33756 - query cache with concurrent_insert=0 appears broken diff --git a/mysql-test/t/query_cache_debug.test b/mysql-test/t/query_cache_debug.test index 854af85f3fb..5eba778cf9e 100644 --- a/mysql-test/t/query_cache_debug.test +++ b/mysql-test/t/query_cache_debug.test @@ -3,6 +3,7 @@ --source include/have_debug_sync.inc --source include/long_test.inc +set global query_cache_type= ON; # # Bug #30887 Server crashes on SET GLOBAL query_cache_size=0 # diff --git a/mysql-test/t/query_cache_merge.test b/mysql-test/t/query_cache_merge.test index 189de8e4092..3046c4ecbfe 100644 --- a/mysql-test/t/query_cache_merge.test +++ b/mysql-test/t/query_cache_merge.test @@ -1,5 +1,8 @@ # Test query cache with many tables +SET GLOBAL query_cache_type=ON; +SET LOCAL query_cache_type=ON; + --source include/have_query_cache.inc let $LIMIT=`SHOW VARIABLES LIKE 'open_files_limit'`; let $MIN_LIMIT=600; @@ -102,7 +105,8 @@ while ($c) dec $c; } -SET @@global.query_cache_size = 0; +SET @@global.query_cache_size = default; SET @@global.table_definition_cache = @save_table_definition_cache; +SET GLOBAL query_cache_type=default; --echo End of 5.1 tests diff --git a/mysql-test/t/query_cache_notembedded-master.opt b/mysql-test/t/query_cache_notembedded-master.opt new file mode 100644 index 00000000000..871d6965726 --- /dev/null +++ b/mysql-test/t/query_cache_notembedded-master.opt @@ -0,0 +1 @@ +--query-cache-size=1355776 diff --git a/mysql-test/t/query_cache_notembedded.test b/mysql-test/t/query_cache_notembedded.test index edb6db43516..dff6c2a139b 100644 --- a/mysql-test/t/query_cache_notembedded.test +++ b/mysql-test/t/query_cache_notembedded.test @@ -8,7 +8,12 @@ # # Tests with query cache # -set GLOBAL query_cache_size=1355776; +set @sql_mode_save=@@global.sql_mode; +set @query_cache_type_save=@@global.query_cache_type; +set @query_cache_size_save=@@global.query_cache_size; + +set GLOBAL sql_mode=""; +set LOCAL sql_mode=""; # Reset query cache variables. @@ -270,7 +275,8 @@ DROP DATABASE bug30269; disconnect bug30269; DROP USER 'bug30269'@'localhost'; -set GLOBAL query_cache_type=default; +set GLOBAL query_cache_type=ON; +set LOCAL query_cache_type=ON; set GLOBAL query_cache_limit=default; set GLOBAL query_cache_min_res_unit=default; set GLOBAL query_cache_size=default; @@ -324,3 +330,7 @@ delimiter ;| # Wait till we reached the initial number of concurrent sessions --source include/wait_until_count_sessions.inc +SET GLOBAL query_cache_size=@query_cache_size_save; +SET GLOBAL query_cache_type=@query_cache_type_save; +set GLOBAL sql_mode=@sql_mode_save; + diff --git a/mysql-test/t/query_cache_with_views.test b/mysql-test/t/query_cache_with_views.test index 97e37c53aa3..9b03d0e99d0 100644 --- a/mysql-test/t/query_cache_with_views.test +++ b/mysql-test/t/query_cache_with_views.test @@ -6,7 +6,8 @@ drop table if exists t1,t2,v1,v2,v3; drop view if exists t1,t2,v1,v2,v3; --enable_warnings - +set GLOBAL query_cache_type=ON; +set LOCAL query_cache_type=ON; set GLOBAL query_cache_size=1355776; flush status; create table t1 (a int, b int); @@ -145,3 +146,4 @@ SET AUTOCOMMIT=DEFAULT; # Reset default environment. set GLOBAL query_cache_size=default; +set GLOBAL query_cache_type=default; diff --git a/mysql-test/t/read_only.test b/mysql-test/t/read_only.test index d0f397697d5..3e5d4fc8ce1 100644 --- a/mysql-test/t/read_only.test +++ b/mysql-test/t/read_only.test @@ -3,7 +3,6 @@ # should work with embedded server after mysqltest is fixed --source include/not_embedded.inc - set @start_read_only= @@global.read_only; # Save the initial number of concurrent sessions @@ -16,6 +15,7 @@ DROP TABLE IF EXISTS t1,t2,t3; # READ_ONLY does nothing to SUPER users # so we use a non-SUPER one: +create user test@localhost; grant CREATE, SELECT, DROP on *.* to test@localhost; --echo connect (con1,localhost,test,,test); @@ -278,6 +278,7 @@ delete from mysql.tables_priv where User like 'mysqltest_%'; delete from mysql.columns_priv where User like 'mysqltest_%'; flush privileges; +create user `mysqltest_u1`@`%`; grant all on mysqltest_db2.* to `mysqltest_u1`@`%`; create database mysqltest_db1; grant all on mysqltest_db1.* to `mysqltest_u1`@`%`; @@ -364,4 +365,3 @@ DROP TABLE t1; # Wait till all disconnects are completed --source include/wait_until_count_sessions.inc - diff --git a/mysql-test/t/read_only_innodb.test b/mysql-test/t/read_only_innodb.test index de237fecbb6..f404ba17579 100644 --- a/mysql-test/t/read_only_innodb.test +++ b/mysql-test/t/read_only_innodb.test @@ -13,6 +13,7 @@ DROP TABLE IF EXISTS table_11733 ; # READ_ONLY does nothing to SUPER users # so we use a non-SUPER one: +create user test@localhost; grant CREATE, SELECT, DROP on *.* to test@localhost; connect (con1,localhost,test,,test); @@ -47,6 +48,7 @@ disconnect con1; # Bug #35732: read-only blocks SELECT statements in InnoDB # # Test 1: read only mode +create user test@localhost; GRANT CREATE, SELECT, DROP ON *.* TO test@localhost; connect(con1, localhost, test, , test); @@ -251,3 +253,4 @@ connection default; SET GLOBAL READ_ONLY = OFF; DROP USER bug33669@localhost; DROP DATABASE db1; + diff --git a/mysql-test/t/selectivity.test b/mysql-test/t/selectivity.test index c46ff69295f..92e38604a30 100644 --- a/mysql-test/t/selectivity.test +++ b/mysql-test/t/selectivity.test @@ -848,6 +848,7 @@ set optimizer_use_condition_selectivity=1; explain extended select * from t1, t2, t1 as t3 where t1.b=t2.c and t2.d=t3.a and t3.b<5 and t1.a < 2000; +--sorted_result select * from t1, t2, t1 as t3 where t1.b=t2.c and t2.d=t3.a and t3.b<5 and t1.a < 2000; @@ -855,6 +856,7 @@ set optimizer_use_condition_selectivity=3; explain extended select * from t1, t2, t1 as t3 where t1.b=t2.c and t2.d=t3.a and t3.b<5 and t1.a < 2000; +--sorted_result select * from t1, t2, t1 as t3 where t1.b=t2.c and t2.d=t3.a and t3.b<5 and t1.a < 2000; @@ -946,11 +948,11 @@ drop table t0,t1,t2; --echo # Bug mdev-7316: a conjunct in WHERE with selectivity == 0 --echo # -CREATE TABLE t1 (a varchar(16), b int, PRIMARY KEY(a), KEY(b)) ENGINE=INNODB; +CREATE TABLE t1 (a varchar(16), b int, PRIMARY KEY(a), KEY(b)); INSERT INTO t1 VALUES ('USAChinese',10), ('USAEnglish',20), ('USAFrench',30); -CREATE TABLE t2 (i int) ENGINE=INNODB; +CREATE TABLE t2 (i int); INSERT INTO t2 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(1),(2),(3),(4); diff --git a/mysql-test/t/servers.test b/mysql-test/t/servers.test index 37817937ab5..645206c376e 100644 --- a/mysql-test/t/servers.test +++ b/mysql-test/t/servers.test @@ -1,4 +1,5 @@ # Generic tests for servers (do not require FEDERATED) +set sql_mode=""; --echo # --echo # MDEV-4594 - CREATE SERVER crashes embedded @@ -21,5 +22,3 @@ DROP SERVER s1; CREATE SERVER s1 FOREIGN DATA WRAPPER mysql OPTIONS(SOCKET 'bar'); SELECT * FROM mysql.servers; DROP SERVER s1; - - diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test index 8a3d9478946..d7bfb3a973e 100644 --- a/mysql-test/t/show_check.test +++ b/mysql-test/t/show_check.test @@ -322,8 +322,11 @@ create database mysqltest; show create database mysqltest; create table mysqltest.t1(a int); insert into mysqltest.t1 values(1); +create user mysqltest_1@localhost; grant select on `mysqltest`.* to mysqltest_1@localhost; +create user mysqltest_2@localhost; grant usage on `mysqltest`.* to mysqltest_2@localhost; +create user mysqltest_3@localhost; grant drop on `mysqltest`.* to mysqltest_3@localhost; connect (con1,localhost,mysqltest_1,,mysqltest); @@ -990,6 +993,7 @@ create database mysqltest; show create database mysqltest; create table mysqltest.t1(a int); insert into mysqltest.t1 values(1); +create user mysqltest_4@localhost; grant select on `mysqltest`.`t1` to mysqltest_4@localhost; connect (con4,localhost,mysqltest_4,,mysqltest); connection con4; diff --git a/mysql-test/t/show_explain.test b/mysql-test/t/show_explain.test index 83c05d93007..6615ff66737 100644 --- a/mysql-test/t/show_explain.test +++ b/mysql-test/t/show_explain.test @@ -753,6 +753,7 @@ drop table t1,t3,t4; --echo # --echo # ---------- SHOW EXPLAIN and permissions ----------------- --echo # +create user test2@localhost; grant ALL on test.* to test2@localhost; # Give the user SUPER privilege so it can set debug_dbug variable. @@ -1201,4 +1202,3 @@ drop table t0,t1,t2; connection default; disconnect con1; set debug_sync='RESET'; - diff --git a/mysql-test/t/single_delete_update.test b/mysql-test/t/single_delete_update.test index e3ee13f891c..ec939641ea3 100644 --- a/mysql-test/t/single_delete_update.test +++ b/mysql-test/t/single_delete_update.test @@ -452,30 +452,3 @@ SELECT * FROM t2 WHERE c = 10 ORDER BY a DESC, b DESC; DROP TABLE t1, t2; - ---echo # ---echo # Bug #53742: UPDATEs have no effect after applying patch for bug 36569 ---echo # - ---disable_warnings -CREATE TABLE t1 ( - pk INT NOT NULL AUTO_INCREMENT, - c1_idx CHAR(1) DEFAULT 'y', - c2 INT, - PRIMARY KEY (pk), - INDEX c1_idx (c1_idx) -) ENGINE=InnoDB; ---enable_warnings - -INSERT INTO t1 VALUES (), (), (), (); - -SELECT * FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2; -UPDATE t1 SET c2 = 0 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2; -SELECT * FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2; -SELECT * FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC; - -DELETE FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2; -SELECT * FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC; - -DROP TABLE t1; - diff --git a/mysql-test/t/single_delete_update_innodb.test b/mysql-test/t/single_delete_update_innodb.test new file mode 100644 index 00000000000..7e7817d4dd6 --- /dev/null +++ b/mysql-test/t/single_delete_update_innodb.test @@ -0,0 +1,30 @@ +# +# Single table specific update/delete tests (mysql_update and mysql_delete) +# +--source include/have_innodb.inc + + +--echo # +--echo # Bug #53742: UPDATEs have no effect after applying patch for bug 36569 +--echo # + +CREATE TABLE t1 ( + pk INT NOT NULL AUTO_INCREMENT, + c1_idx CHAR(1) DEFAULT 'y', + c2 INT, + PRIMARY KEY (pk), + INDEX c1_idx (c1_idx) +) ENGINE=InnoDB; + +INSERT INTO t1 VALUES (), (), (), (); + +SELECT * FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2; +UPDATE t1 SET c2 = 0 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2; +SELECT * FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2; +SELECT * FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC; + +DELETE FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2; +SELECT * FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC; + +DROP TABLE t1; + diff --git a/mysql-test/t/skip_name_resolve.test b/mysql-test/t/skip_name_resolve.test index a14f3af5cd6..b0c5118f970 100644 --- a/mysql-test/t/skip_name_resolve.test +++ b/mysql-test/t/skip_name_resolve.test @@ -5,6 +5,7 @@ --source include/count_sessions.inc # Bug#8471 IP address with mask fail when skip-name-resolve is on +CREATE USER mysqltest_1@'127.0.0.1/255.255.255.255'; GRANT ALL ON test.* TO mysqltest_1@'127.0.0.1/255.255.255.255'; SHOW GRANTS FOR mysqltest_1@'127.0.0.1/255.255.255.255'; REVOKE ALL ON test.* FROM mysqltest_1@'127.0.0.1/255.255.255.255'; diff --git a/mysql-test/t/sp-security.test b/mysql-test/t/sp-security.test index 0646e727232..a5df4859d6b 100644 --- a/mysql-test/t/sp-security.test +++ b/mysql-test/t/sp-security.test @@ -7,13 +7,13 @@ # Save the initial number of concurrent sessions --source include/count_sessions.inc - connect (con1root,localhost,root,,); connection con1root; use test; # Create user user1 with no particular access rights +create user user1@localhost; grant usage on *.* to user1@localhost; flush privileges; @@ -57,10 +57,13 @@ call stamp(1); select * from t1; select db(); +create user user1@'%'; grant execute on procedure db1_secret.stamp to user1@'%'; grant execute on function db1_secret.db to user1@'%'; +set sql_mode=''; grant execute on procedure db1_secret.stamp to ''@'%'; grant execute on function db1_secret.db to ''@'%'; +set sql_mode=default; connect (con2user1,localhost,user1,,); connect (con3anon,localhost,anon,,); @@ -175,6 +178,7 @@ insert into t2 values (0); grant usage on db2.* to user1@localhost; grant select on db2.* to user1@localhost; +create user user2@localhost; grant usage on db2.* to user2@localhost; grant select,insert,update,delete,create routine on db2.* to user2@localhost; grant create routine on db2.* to user1@localhost; @@ -263,8 +267,11 @@ flush privileges; # # Test the new security acls # +create user usera@localhost; grant usage on *.* to usera@localhost; +create user userb@localhost; grant usage on *.* to userb@localhost; +create user userc@localhost; grant usage on *.* to userc@localhost; create database sptest; create table t1 ( u varchar(64), i int ); @@ -340,11 +347,13 @@ connection root; --disable_warnings drop function if exists bug_9503; +drop user if exists user1@localhost; --enable_warnings delimiter //; create database mysqltest// use mysqltest// create table t1 (s1 int)// +create user user1@localhost// grant select on t1 to user1@localhost// create function bug_9503 () returns int sql security invoker begin declare v int; select min(s1) into v from t1; return v; end// @@ -420,6 +429,7 @@ begin end// delimiter ;// +create user mysqltest_1@localhost; grant usage on *.* to mysqltest_1@localhost; connect (n1,localhost,mysqltest_1,,information_schema,$MASTER_MYPORT,$MASTER_MYSOCK); @@ -1047,4 +1057,3 @@ grant execute on procedure sp1 to current_user() identified by 'barfoo'; show grants; drop procedure sp1; set password=''; - diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 3a4ddee1de2..9e6b919ea19 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -14,7 +14,6 @@ # Tests that require --with-geometry go into sp_gis.test # Tests that require multibyte character sets, which are not always available, # go into separate files (e.g. sp-ucs2.test) - use test; # Test tables diff --git a/mysql-test/t/sp_notembedded.test b/mysql-test/t/sp_notembedded.test index 2a24ab3d005..d7aaaa4340f 100644 --- a/mysql-test/t/sp_notembedded.test +++ b/mysql-test/t/sp_notembedded.test @@ -219,6 +219,7 @@ delimiter ;| drop procedure if exists bug15298_1; drop procedure if exists bug15298_2; --enable_warnings +create user 'mysqltest_1'@'localhost'; grant all privileges on test.* to 'mysqltest_1'@'localhost'; create procedure 15298_1 () sql security definer show grants for current_user; create procedure 15298_2 () sql security definer show grants; @@ -486,6 +487,5 @@ drop user foo1@localhost; # set @@global.concurrent_insert= @old_concurrent_insert; - # Wait till all disconnects are completed --source include/wait_until_count_sessions.inc diff --git a/mysql-test/t/sp_trans.test b/mysql-test/t/sp_trans.test index 39ac086071b..a9759b99269 100644 --- a/mysql-test/t/sp_trans.test +++ b/mysql-test/t/sp_trans.test @@ -5,6 +5,8 @@ -- source include/have_log_bin.inc -- source include/have_innodb.inc +set SQL_MODE=""; + disable_query_log; call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); enable_query_log; diff --git a/mysql-test/t/stack-crash.test b/mysql-test/t/stack-crash.test index d5bdccc132d..e4feb95a332 100644 --- a/mysql-test/t/stack-crash.test +++ b/mysql-test/t/stack-crash.test @@ -32,7 +32,7 @@ CREATE TABLE t1 ( `sspo_lu_uid` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`sspo_id`), KEY `post_uid` (`sspo_uid`,`sspo_cr_date`) -) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8; +) AUTO_INCREMENT=30 DEFAULT CHARSET=utf8; INSERT INTO t1 VALUES (1,2,'P','test1','',0,'','',NULL,'','','','','A','2013-09-30 00:19:32',2,'2013-09-30 00:19:32',2),(2,2,'P','bbb','',0,'','',NULL,'','','','','A','2013-10-02 15:06:35',2,'2013-10-02 15:06:35',2); CREATE TABLE `t2` ( @@ -48,7 +48,7 @@ CREATE TABLE `t2` ( `spoo_lu_uid` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`spoo_id`), KEY `object_option_main_idx` (`spoo_user_type_id`,`spoo_uid`,`spoo_option_id`,`spoo_value`(255)) -) ENGINE=InnoDB AUTO_INCREMENT=107 DEFAULT CHARSET=utf8; +) AUTO_INCREMENT=107 DEFAULT CHARSET=utf8; INSERT INTO `t2` VALUES (19,1,2,6,'Dortmund','A','2013-09-26 01:36:51',2,'2013-09-26 01:36:51',2),(20,1,2,8,'49','A','2013-09-26 01:36:51',2,'2013-09-26 01:36:51',2); SELECT Count(*) diff --git a/mysql-test/t/status.test b/mysql-test/t/status.test index 9395323d32b..32b903c0265 100644 --- a/mysql-test/t/status.test +++ b/mysql-test/t/status.test @@ -281,6 +281,7 @@ create database db37908; --enable_warnings create table db37908.t1(f1 int); insert into db37908.t1 values(1); +create user mysqltest_1@localhost; grant usage,execute on test.* to mysqltest_1@localhost; delimiter |; create procedure proc37908() begin select 1; end | diff --git a/mysql-test/t/subselect_sj.test b/mysql-test/t/subselect_sj.test index c989cb22558..c2b93c919dd 100644 --- a/mysql-test/t/subselect_sj.test +++ b/mysql-test/t/subselect_sj.test @@ -2524,7 +2524,7 @@ CREATE TABLE t1 ( PRIMARY KEY (pk), KEY col_int_key (col_int_key), KEY col_varchar_key (col_varchar_key, col_int_key) -) ENGINE=InnoDB; +); INSERT INTO t1 VALUES (10,8,'x','x'), diff --git a/mysql-test/t/table_elim.test b/mysql-test/t/table_elim.test index 24f48206013..52857f9169f 100644 --- a/mysql-test/t/table_elim.test +++ b/mysql-test/t/table_elim.test @@ -616,7 +616,7 @@ SET optimizer_switch=@save_optimizer_switch; --echo # (just a testcase) CREATE TABLE t1 ( PostID int(10) unsigned NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) DEFAULT CHARSET=utf8; INSERT INTO t1 (PostID) VALUES (1), (2); @@ -625,7 +625,7 @@ CREATE TABLE t2 ( EntityID int(10) unsigned NOT NULL, UserID int(10) unsigned NOT NULL, UNIQUE KEY EntityID (EntityID,UserID) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) DEFAULT CHARSET=utf8; INSERT INTO t2 (EntityID, UserID) VALUES (1, 30), (2, 30); diff --git a/mysql-test/t/timezone_grant.test b/mysql-test/t/timezone_grant.test index 8013f2b04ce..a6dd6be695e 100644 --- a/mysql-test/t/timezone_grant.test +++ b/mysql-test/t/timezone_grant.test @@ -24,6 +24,7 @@ flush privileges; create table t1 (a int, b datetime); create table t2 (c int, d datetime); +create user mysqltest_1@localhost; grant all privileges on test.* to mysqltest_1@localhost; connect (tzuser, localhost, mysqltest_1,,); connection tzuser; @@ -103,6 +104,7 @@ drop table t1, t2; # Let us rely on that previous tests done proper cleanups create table t1 (a int, b datetime); insert into t1 values (1, 20010101000000), (2, 20020101000000); +create user mysqltest_1@localhost; grant all privileges on test.* to mysqltest_1@localhost; connect (tzuser3, localhost, mysqltest_1,,); create view v1 as select a, convert_tz(b, 'UTC', 'Europe/Moscow') as lb from t1; diff --git a/mysql-test/t/trigger-compat.test b/mysql-test/t/trigger-compat.test index 8b360d16b98..c627d1a6040 100644 --- a/mysql-test/t/trigger-compat.test +++ b/mysql-test/t/trigger-compat.test @@ -19,7 +19,6 @@ # # Prepare environment. # - DELETE FROM mysql.user WHERE User LIKE 'mysqltest_%'; DELETE FROM mysql.db WHERE User LIKE 'mysqltest_%'; DELETE FROM mysql.tables_priv WHERE User LIKE 'mysqltest_%'; diff --git a/mysql-test/t/trigger_notembedded.test b/mysql-test/t/trigger_notembedded.test index b4ce183e114..f0c565be41f 100644 --- a/mysql-test/t/trigger_notembedded.test +++ b/mysql-test/t/trigger_notembedded.test @@ -28,7 +28,6 @@ # # Prepare environment. # - DELETE FROM mysql.user WHERE User LIKE 'mysqltest_%'; DELETE FROM mysql.db WHERE User LIKE 'mysqltest_%'; DELETE FROM mysql.tables_priv WHERE User LIKE 'mysqltest_%'; @@ -1019,6 +1018,7 @@ DROP DATABASE IF EXISTS mysqltest_db1; CREATE DATABASE mysqltest_db1; USE mysqltest_db1; +CREATE USER mysqltest_u1@localhost; GRANT ALL ON mysqltest_db1.* TO mysqltest_u1@localhost; --connect(con1,localhost,mysqltest_u1,,mysqltest_db1) diff --git a/mysql-test/t/user_limits.test b/mysql-test/t/user_limits.test index 7c249f61686..ebb4fd4fb88 100644 --- a/mysql-test/t/user_limits.test +++ b/mysql-test/t/user_limits.test @@ -26,6 +26,7 @@ flush privileges; --disable_ps_protocol # Test of MAX_QUERIES_PER_HOUR limit +create user mysqltest_1@localhost; grant usage on *.* to mysqltest_1@localhost with max_queries_per_hour 2; # This ensures that counters are reset and makes test scheduling independent flush user_resources; @@ -46,6 +47,7 @@ disconnect mqph; disconnect mqph2; # Test of MAX_UPDATES_PER_HOUR limit +create user mysqltest_1@localhost; grant usage on *.* to mysqltest_1@localhost with max_updates_per_hour 2; flush user_resources; connect (muph, localhost, mysqltest_1,,); @@ -70,6 +72,7 @@ disconnect muph; disconnect muph2; # Test of MAX_CONNECTIONS_PER_HOUR limit +create user mysqltest_1@localhost; grant usage on *.* to mysqltest_1@localhost with max_connections_per_hour 2; flush user_resources; connect (mcph1, localhost, mysqltest_1,,); @@ -97,6 +100,7 @@ drop user mysqltest_1@localhost; # Test of MAX_USER_CONNECTIONS limit # We need this to reset internal mqh_used variable flush privileges; +create user mysqltest_1@localhost; grant usage on *.* to mysqltest_1@localhost with max_user_connections 2; flush user_resources; connect (muc1, localhost, mysqltest_1,,); @@ -150,6 +154,7 @@ set session max_user_connections= 2; set global max_user_connections= 2; select @@session.max_user_connections, @@global.max_user_connections; # Let us check that global limit works +create user mysqltest_1@localhost; grant usage on *.* to mysqltest_1@localhost; flush user_resources; connect (muca1, localhost, mysqltest_1,,); diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index 4c7c74f8032..8f29528ac25 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -1467,9 +1467,11 @@ drop function if exists t1_max; drop function if exists t1_min; --enable_warnings +set sql_mode=""; --disable_warnings create table t1 (a int) engine=innodb; --enable_warnings +set sql_mode=default; insert into t1(a) values (0), (1); create function t1_max() returns int return (select max(a) from t1); create function t1_min() returns int return (select min(a) from t1); diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index 8c2a8ac8dc2..26faae545d8 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -2083,18 +2083,16 @@ drop table t1; # Bug#12941 # ---disable_warnings create table t1 ( r_object_id char(16) NOT NULL, group_name varchar(32) NOT NULL -) engine = InnoDB; +); create table t2 ( r_object_id char(16) NOT NULL, i_position int(11) NOT NULL, users_names varchar(32) default NULL -) Engine = InnoDB; ---enable_warnings +); create view v1 as select r_object_id, group_name from t1; create view v2 as select r_object_id, i_position, users_names from t2; @@ -2806,11 +2804,12 @@ DROP VIEW IF EXISTS v1; # Bug#21261 Wrong access rights was required for an insert to a view # +set GLOBAL sql_mode=""; +set LOCAL sql_mode=""; CREATE DATABASE bug21261DB; USE bug21261DB; connect (root,localhost,root,,bug21261DB); connection root; - CREATE TABLE t1 (x INT); CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT x FROM t1; GRANT INSERT, UPDATE ON v1 TO 'user21261'@'localhost'; @@ -2840,6 +2839,8 @@ USE test; disconnect root; disconnect user21261; +set GLOBAL sql_mode=default; +set LOCAL sql_mode=default; # # Bug#15950 NOW() optimized away in VIEWs diff --git a/mysql-test/t/view_grant.test b/mysql-test/t/view_grant.test index 8907c726ae3..6d0cd8e5c28 100644 --- a/mysql-test/t/view_grant.test +++ b/mysql-test/t/view_grant.test @@ -11,6 +11,7 @@ drop view if exists v1,v2,v3; # simple test of grants +create user test@localhost; grant create view on test.* to test@localhost; show grants for test@localhost; revoke create view on test.* from test@localhost; @@ -29,6 +30,7 @@ create database mysqltest; create table mysqltest.t1 (a int, b int); create table mysqltest.t2 (a int, b int); +create user mysqltest_1@localhost; grant select on mysqltest.t1 to mysqltest_1@localhost; grant create view,select on test.* to mysqltest_1@localhost; @@ -90,7 +92,7 @@ select d from mysqltest.v1; connection root; revoke all privileges on mysqltest.v1 from mysqltest_1@localhost; -delete from mysql.user where user='mysqltest_1'; +drop user mysqltest_1@localhost; drop database mysqltest; # TEMPORARY TABLE algorithm @@ -100,6 +102,7 @@ create database mysqltest; create table mysqltest.t1 (a int, b int); create algorithm=temptable view mysqltest.v1 (c,d) as select a+1,b+1 from mysqltest.t1; +create user mysqltest_1@localhost; grant select (c) on mysqltest.v1 to mysqltest_1@localhost; connection user1; @@ -110,7 +113,7 @@ select d from mysqltest.v1; connection root; revoke all privileges on mysqltest.v1 from mysqltest_1@localhost; -delete from mysql.user where user='mysqltest_1'; +drop user mysqltest_1@localhost; drop database mysqltest; # @@ -129,6 +132,7 @@ create view mysqltest.v3 (c,d) as select a+1,b+1 from mysqltest.t2; create algorithm=temptable view mysqltest.v4 (c,d) as select a+1,b+1 from mysqltest.t2; # v5: SHOW VIEW, but no SELECT create view mysqltest.v5 (c,d) as select a+1,b+1 from mysqltest.t1; +create user mysqltest_1@localhost; grant select on mysqltest.v1 to mysqltest_1@localhost; grant select on mysqltest.v2 to mysqltest_1@localhost; grant select on mysqltest.v3 to mysqltest_1@localhost; @@ -225,7 +229,7 @@ show create view mysqltest.v4; connection root; revoke all privileges on mysqltest.* from mysqltest_1@localhost; -delete from mysql.user where user='mysqltest_1'; +drop user mysqltest_1@localhost; drop database mysqltest; # @@ -244,6 +248,7 @@ create view mysqltest.v1 (a,c) as select a, b+1 from mysqltest.t1; create view mysqltest.v2 (a,c) as select a, b from mysqltest.t1; create view mysqltest.v3 (a,c) as select a, b+1 from mysqltest.t1; +create user mysqltest_1@localhost; grant update (a) on mysqltest.v2 to mysqltest_1@localhost; grant update on mysqltest.v1 to mysqltest_1@localhost; grant select on mysqltest.* to mysqltest_1@localhost; @@ -274,6 +279,7 @@ update v3 set a=a+c; use test; connection root; REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost; +drop user mysqltest_1@localhost; drop database mysqltest; # @@ -291,6 +297,7 @@ insert into mysqltest.t2 values (3), (4), (5), (6); create view mysqltest.v1 (a,c) as select a, b+1 from mysqltest.t1; create view mysqltest.v2 (a,c) as select a, b+1 from mysqltest.t1; +create user mysqltest_1@localhost; grant delete on mysqltest.v1 to mysqltest_1@localhost; grant select on mysqltest.* to mysqltest_1@localhost; @@ -310,6 +317,7 @@ delete from v2 where c < 4; use test; connection root; REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost; +drop user mysqltest_1@localhost; drop database mysqltest; # @@ -327,6 +335,7 @@ insert into mysqltest.t2 values (3,4); create view mysqltest.v1 (a,c) as select a, b from mysqltest.t1; create view mysqltest.v2 (a,c) as select a, b from mysqltest.t1; +create user mysqltest_1@localhost; grant insert on mysqltest.v1 to mysqltest_1@localhost; grant select on mysqltest.* to mysqltest_1@localhost; @@ -346,6 +355,7 @@ insert into v2 select x,y from t2; use test; connection root; REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost; +drop user mysqltest_1@localhost; drop database mysqltest; # @@ -359,6 +369,7 @@ create database mysqltest; create table mysqltest.t1 (a int, b int); create table mysqltest.t2 (a int, b int); +create user mysqltest_1@localhost; grant update on mysqltest.t1 to mysqltest_1@localhost; grant update(b) on mysqltest.t2 to mysqltest_1@localhost; grant create view,update on test.* to mysqltest_1@localhost; @@ -407,6 +418,7 @@ create view v4 as select b+1 from mysqltest.t2; connection root; REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost; +drop user mysqltest_1@localhost; drop database mysqltest; drop view v1,v2,v4; @@ -418,6 +430,7 @@ connection root; create database mysqltest; --enable_warnings create table mysqltest.t1 (a int); +create user mysqltest_1@localhost; grant all privileges on mysqltest.* to mysqltest_1@localhost; connection user1; @@ -427,6 +440,7 @@ use test; connection root; revoke all privileges on mysqltest.* from mysqltest_1@localhost; +drop user mysqltest_1@localhost; drop database mysqltest; # @@ -439,6 +453,7 @@ create database mysqltest; create table mysqltest.t1 (a int, b int); +create user mysqltest_1@localhost; grant select on mysqltest.t1 to mysqltest_1@localhost; grant create view,select on test.* to mysqltest_1@localhost; @@ -455,6 +470,7 @@ select * from v1; grant select on mysqltest.t1 to mysqltest_1@localhost; select * from v1; REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost; +drop user mysqltest_1@localhost; drop view v1; drop database mysqltest; @@ -482,6 +498,7 @@ create algorithm=MERGE view v2 as select f2() from t1; create algorithm=TEMPTABLE SQL SECURITY INVOKER view v3 as select f2() from t1; create algorithm=MERGE SQL SECURITY INVOKER view v4 as select f2() from t1; create SQL SECURITY INVOKER view v5 as select * from v4; +create user mysqltest_1@localhost; grant select on v1 to mysqltest_1@localhost; grant select on v2 to mysqltest_1@localhost; grant select on v3 to mysqltest_1@localhost; @@ -506,6 +523,7 @@ drop function f2; drop table t1, t2; use test; REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost; +drop user mysqltest_1@localhost; drop database mysqltest; # @@ -529,6 +547,7 @@ delimiter //; create function f2 () returns int begin declare v int; select s1 from t2 into v; return v; end// delimiter ;// +create user mysqltest_1@localhost; grant select on t1 to mysqltest_1@localhost; grant execute on function f2 to mysqltest_1@localhost; grant create view on mysqltest.* to mysqltest_1@localhost; @@ -558,6 +577,7 @@ drop function f2; drop table t1, t2; use test; REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost; +drop user mysqltest_1@localhost; drop database mysqltest; # @@ -572,6 +592,7 @@ use mysqltest; create table t1 (a int); create table v1 (a int); insert into t1 values (1); +create user mysqltest_1@localhost; grant select on t1 to mysqltest_1@localhost; grant select on v1 to mysqltest_1@localhost; grant create view on mysqltest.* to mysqltest_1@localhost; @@ -601,6 +622,7 @@ select * from v5; drop table t1; use test; REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost; +drop user mysqltest_1@localhost; drop database mysqltest; @@ -617,6 +639,7 @@ create algorithm=MERGE view v2 as select *, a as b from t1; create algorithm=TEMPTABLE SQL SECURITY INVOKER view v3 as select *, a as b from t1; create algorithm=MERGE SQL SECURITY INVOKER view v4 as select *, a as b from t1; create SQL SECURITY INVOKER view v5 as select * from v4; +create user mysqltest_1@localhost; grant select on v1 to mysqltest_1@localhost; grant select on v2 to mysqltest_1@localhost; grant select on v3 to mysqltest_1@localhost; @@ -640,6 +663,7 @@ drop view v1, v2, v3, v4, v5; drop table t1; use test; REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost; +drop user mysqltest_1@localhost; drop database mysqltest; # @@ -657,6 +681,7 @@ delete from mysql.user where user=''; flush privileges; # Create the test user +create user 'test14256'@'%'; grant all on test.* to 'test14256'@'%'; connect (test14256,localhost,test14256,,test); @@ -702,6 +727,7 @@ use mysqltest; CREATE TABLE t1 (i INT); CREATE VIEW v1 AS SELECT * FROM t1; SHOW CREATE VIEW v1; +create user mysqltest_1@localhost; GRANT SELECT, LOCK TABLES ON mysqltest.* TO mysqltest_1@localhost; connection user1; @@ -1162,6 +1188,7 @@ INSERT INTO mysqltest1.t2 VALUES (21), (22), (23), (24); INSERT INTO mysqltest1.t3 VALUES (31), (32), (33), (34); INSERT INTO mysqltest1.t4 VALUES (41), (42), (43), (44); +CREATE USER mysqltest_u1@localhost; GRANT SELECT ON mysqltest1.t1 TO mysqltest_u1@localhost; GRANT INSERT ON mysqltest1.t2 TO mysqltest_u1@localhost; GRANT SELECT, UPDATE ON mysqltest1.t3 TO mysqltest_u1@localhost; @@ -1237,6 +1264,7 @@ USE db1; CREATE TABLE t1(f1 INT, f2 INT); CREATE VIEW v1 AS SELECT f1, f2 FROM t1; +CREATE USER foo; GRANT SELECT (f1) ON t1 TO foo; GRANT SELECT (f1) ON v1 TO foo; diff --git a/mysql-test/t/warnings_engine_disabled.test b/mysql-test/t/warnings_engine_disabled.test index 11b22135128..46c686aa6d6 100644 --- a/mysql-test/t/warnings_engine_disabled.test +++ b/mysql-test/t/warnings_engine_disabled.test @@ -12,9 +12,11 @@ if (!`SELECT count(*) FROM information_schema.engines WHERE # Test for handler type, will select MyISAM and print a warning # about that - since InnoDB is disabled # +set sql_mode=""; create table t1 (id int) engine=InnoDB; alter table t1 engine=InnoDB; drop table t1; +set sql_mode=default; # # Bug#29263 disabled storage engines omitted in SHOW ENGINES diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 2265c6607b1..6d35f53a1d9 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -4328,6 +4328,27 @@ static int init_common_variables() } #endif /* HAVE_SOLARIS_LARGE_PAGES */ + + /* Fix host_cache_size. */ + if (IS_SYSVAR_AUTOSIZE(&host_cache_size)) + { + if (max_connections <= 628 - 128) + SYSVAR_AUTOSIZE(host_cache_size, 128 + max_connections); + else if (max_connections <= ((ulong)(2000 - 628)) * 20 + 500) + SYSVAR_AUTOSIZE(host_cache_size, 628 + ((max_connections - 500) / 20)); + else + SYSVAR_AUTOSIZE(host_cache_size, 2000); + } + + /* Fix back_log (back_log == 0 added for MySQL compatibility) */ + if (back_log == 0 || IS_SYSVAR_AUTOSIZE(&back_log)) + { + if ((900 - 50) * 5 >= max_connections) + SYSVAR_AUTOSIZE(back_log, (50 + max_connections / 5)); + else + SYSVAR_AUTOSIZE(back_log, 900); + } + /* connections and databases needs lots of files */ { uint files, wanted_files, max_open_files; @@ -4873,9 +4894,16 @@ static int init_server_components() unireg_abort(1); query_cache_set_min_res_unit(query_cache_min_res_unit); + query_cache_result_size_limit(query_cache_limit); + /* if we set size of QC non zero in config then probably we want it ON */ + if (query_cache_size != 0 && + global_system_variables.query_cache_type == 0 && + !IS_SYSVAR_AUTOSIZE(&query_cache_size)) + { + global_system_variables.query_cache_type= 1; + } query_cache_init(); query_cache_resize(query_cache_size); - query_cache_result_size_limit(query_cache_limit); my_rnd_init(&sql_rand,(ulong) server_start_time,(ulong) server_start_time/2); setup_fpu(); init_thr_lock(); @@ -5552,6 +5580,12 @@ int mysqld_main(int argc, char **argv) int ho_error __attribute__((unused))= handle_early_options(); + /* fix tdc_size */ + if (IS_SYSVAR_AUTOSIZE(&tdc_size)) + { + SYSVAR_AUTOSIZE(tdc_size, MY_MIN(400 + tdc_size / 2, 2000)); + } + #ifdef WITH_PERFSCHEMA_STORAGE_ENGINE if (ho_error == 0) { diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 2dd8976d51e..03505dec0cf 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -1295,14 +1295,6 @@ ulong Query_cache::resize(ulong query_cache_size_arg) query_cache_size_arg)); DBUG_ASSERT(initialized); - if (global_system_variables.query_cache_type == 0) - { - DBUG_ASSERT(query_cache_size_arg == 0); - if (query_cache_size_arg != 0) - my_error(ER_QUERY_CACHE_IS_DISABLED, MYF(0)); - DBUG_RETURN(0); - } - lock_and_suspend(); /* @@ -1340,7 +1332,7 @@ ulong Query_cache::resize(ulong query_cache_size_arg) m_cache_status is internal query cache switch so switching it on/off will not be reflected on global_system_variables.query_cache_type */ - if (new_query_cache_size) + if (new_query_cache_size && global_system_variables.query_cache_type != 0) { DBUG_EXECUTE("check_querycache",check_integrity(1);); m_cache_status= OK; // size > 0 => enable cache diff --git a/sql/sql_const.h b/sql/sql_const.h index 18a74d8579e..c8bb442376e 100644 --- a/sql/sql_const.h +++ b/sql/sql_const.h @@ -111,7 +111,7 @@ #define MAX_FIELDS_BEFORE_HASH 32 #define USER_VARS_HASH_SIZE 16 #define TABLE_OPEN_CACHE_MIN 400 -#define TABLE_OPEN_CACHE_DEFAULT 400 +#define TABLE_OPEN_CACHE_DEFAULT 2000 #define TABLE_DEF_CACHE_DEFAULT 400 /** We must have room for at least 400 table definitions in the table diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 387fe1b7ef7..70dfc10e29d 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -370,10 +370,10 @@ static Sys_var_mybool Sys_automatic_sp_privileges( static Sys_var_ulong Sys_back_log( "back_log", "The number of outstanding connection requests " - "MySQL can have. This comes into play when the main MySQL thread " + "MariaDB can have. This comes into play when the main MySQL thread " "gets very many connection requests in a very short time", - READ_ONLY GLOBAL_VAR(back_log), CMD_LINE(REQUIRED_ARG), - VALID_RANGE(1, 65535), DEFAULT(150), BLOCK_SIZE(1)); + AUTO_SET READ_ONLY GLOBAL_VAR(back_log), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(0, 65535), DEFAULT(150), BLOCK_SIZE(1)); static Sys_var_charptr Sys_basedir( "basedir", "Path to installation directory. All paths are " @@ -1035,7 +1035,7 @@ static Sys_var_ulonglong Sys_join_buffer_size( "join_buffer_size", "The size of the buffer that is used for joins", SESSION_VAR(join_buff_size), CMD_LINE(REQUIRED_ARG), - VALID_RANGE(128, SIZE_T_MAX), DEFAULT(128*1024), BLOCK_SIZE(128)); + VALID_RANGE(128, SIZE_T_MAX), DEFAULT(256*1024), BLOCK_SIZE(128)); static Sys_var_keycache Sys_key_buffer_size( "key_buffer_size", "The size of the buffer used for " @@ -1286,7 +1286,7 @@ static Sys_var_ulong Sys_max_allowed_packet( "max_allowed_packet", "Max packet length to send to or receive from the server", SESSION_VAR(max_allowed_packet), CMD_LINE(REQUIRED_ARG), - VALID_RANGE(1024, 1024*1024*1024), DEFAULT(1024*1024), + VALID_RANGE(1024, 1024*1024*1024), DEFAULT(4*1024*1024), BLOCK_SIZE(1024), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_max_allowed_packet)); @@ -2691,17 +2691,6 @@ static Sys_var_enum Sys_thread_handling( ); #ifdef HAVE_QUERY_CACHE -static bool check_query_cache_size(sys_var *self, THD *thd, set_var *var) -{ - if (global_system_variables.query_cache_type == 0 && - var->value && var->value->val_int() != 0) - { - my_error(ER_QUERY_CACHE_DISABLED, MYF(0)); - return true; - } - - return false; -} static bool fix_query_cache_size(sys_var *self, THD *thd, enum_var_type type) { ulong new_cache_size= query_cache.resize(query_cache_size); @@ -2715,8 +2704,10 @@ static bool fix_query_cache_size(sys_var *self, THD *thd, enum_var_type type) query_cache_size, new_cache_size); query_cache_size= new_cache_size; + return false; } + static bool fix_query_cache_limit(sys_var *self, THD *thd, enum_var_type type) { query_cache.result_size_limit(query_cache_limit); @@ -2726,8 +2717,8 @@ static Sys_var_ulonglong Sys_query_cache_size( "query_cache_size", "The memory allocated to store results from old queries", GLOBAL_VAR(query_cache_size), CMD_LINE(REQUIRED_ARG), - VALID_RANGE(0, ULONG_MAX), DEFAULT(0), BLOCK_SIZE(1024), - NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_query_cache_size), + VALID_RANGE(0, ULONG_MAX), DEFAULT(1024*1024), BLOCK_SIZE(1024), + NO_MUTEX_GUARD, NOT_IN_BINLOG, NULL, ON_UPDATE(fix_query_cache_size)); static Sys_var_ulong Sys_query_cache_limit( @@ -2753,6 +2744,7 @@ static Sys_var_ulong Sys_query_cache_min_res_unit( ON_UPDATE(fix_qcache_min_res_unit)); static const char *query_cache_type_names[]= { "OFF", "ON", "DEMAND", 0 }; + static bool check_query_cache_type(sys_var *self, THD *thd, set_var *var) { if (query_cache.is_disable_in_progress()) @@ -2760,16 +2752,22 @@ static bool check_query_cache_type(sys_var *self, THD *thd, set_var *var) my_error(ER_QUERY_CACHE_IS_DISABLED, MYF(0)); return true; } - if (var->type != OPT_GLOBAL && - global_system_variables.query_cache_type == 0 && - var->value->val_int() != 0) + + if (var->type != OPT_GLOBAL && global_system_variables.query_cache_type == 0) { - my_error(ER_QUERY_CACHE_IS_GLOBALY_DISABLED, MYF(0)); - return true; + if (var->value) + { + if (var->save_result.ulonglong_value != 0) + { + my_error(ER_QUERY_CACHE_IS_GLOBALY_DISABLED, MYF(0)); + return true; + } + } } - return false; } + + static bool fix_query_cache_type(sys_var *self, THD *thd, enum_var_type type) { if (type != OPT_GLOBAL) @@ -2793,7 +2791,7 @@ static Sys_var_enum Sys_query_cache_type( "except SELECT SQL_NO_CACHE ... queries. DEMAND = Cache only " "SELECT SQL_CACHE ... queries", NO_SET_STMT SESSION_VAR(query_cache_type), CMD_LINE(REQUIRED_ARG), - query_cache_type_names, DEFAULT(1), NO_MUTEX_GUARD, NOT_IN_BINLOG, + query_cache_type_names, DEFAULT(0), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_query_cache_type), ON_UPDATE(fix_query_cache_type)); @@ -2809,7 +2807,7 @@ static Sys_var_mybool Sys_secure_auth( "Disallow authentication for accounts that have old (pre-4.1) " "passwords", GLOBAL_VAR(opt_secure_auth), CMD_LINE(OPT_ARG), - DEFAULT(FALSE)); + DEFAULT(TRUE)); static Sys_var_charptr Sys_secure_file_priv( "secure_file_priv", @@ -3062,7 +3060,10 @@ static Sys_var_set Sys_sql_mode( "sql_mode", "Sets the sql mode", SESSION_VAR(sql_mode), CMD_LINE(REQUIRED_ARG), - sql_mode_names, DEFAULT(0), NO_MUTEX_GUARD, NOT_IN_BINLOG, + sql_mode_names, + DEFAULT(MODE_NO_ENGINE_SUBSTITUTION | + MODE_NO_AUTO_CREATE_USER), + NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_sql_mode), ON_UPDATE(fix_sql_mode)); static const char *old_mode_names[]= @@ -4507,16 +4508,16 @@ static Sys_var_ulonglong Sys_relay_log_space_limit( static Sys_var_uint Sys_sync_relaylog_period( "sync_relay_log", "Synchronously flush relay log to disk after " - "every #th event. Use 0 (default) to disable synchronous flushing", + "every #th event. Use 0 to disable synchronous flushing", GLOBAL_VAR(sync_relaylog_period), CMD_LINE(REQUIRED_ARG), - VALID_RANGE(0, UINT_MAX), DEFAULT(0), BLOCK_SIZE(1)); + VALID_RANGE(0, UINT_MAX), DEFAULT(10000), BLOCK_SIZE(1)); static Sys_var_uint Sys_sync_relayloginfo_period( "sync_relay_log_info", "Synchronously flush relay log info " - "to disk after every #th transaction. Use 0 (default) to disable " + "to disk after every #th transaction. Use 0 to disable " "synchronous flushing", GLOBAL_VAR(sync_relayloginfo_period), CMD_LINE(REQUIRED_ARG), - VALID_RANGE(0, UINT_MAX), DEFAULT(0), BLOCK_SIZE(1)); + VALID_RANGE(0, UINT_MAX), DEFAULT(10000), BLOCK_SIZE(1)); #endif static Sys_var_uint Sys_sync_binlog_period( @@ -4527,9 +4528,9 @@ static Sys_var_uint Sys_sync_binlog_period( static Sys_var_uint Sys_sync_masterinfo_period( "sync_master_info", "Synchronously flush master info to disk " - "after every #th event. Use 0 (default) to disable synchronous flushing", + "after every #th event. Use 0 to disable synchronous flushing", GLOBAL_VAR(sync_masterinfo_period), CMD_LINE(REQUIRED_ARG), - VALID_RANGE(0, UINT_MAX), DEFAULT(0), BLOCK_SIZE(1)); + VALID_RANGE(0, UINT_MAX), DEFAULT(10000), BLOCK_SIZE(1)); #ifdef HAVE_REPLICATION static Sys_var_ulong Sys_slave_trans_retries( @@ -4929,7 +4930,7 @@ static bool fix_host_cache_size(sys_var *, THD *, enum_var_type) static Sys_var_ulong Sys_host_cache_size( "host_cache_size", "How many host names should be cached to avoid resolving.", - GLOBAL_VAR(host_cache_size), + AUTO_SET GLOBAL_VAR(host_cache_size), CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 65536), DEFAULT(HOST_CACHE_SIZE), BLOCK_SIZE(1), diff --git a/storage/connect/mysql-test/connect/r/grant.result b/storage/connect/mysql-test/connect/r/grant.result index 9a0a549fd1f..eedeeacaa5b 100644 --- a/storage/connect/mysql-test/connect/r/grant.result +++ b/storage/connect/mysql-test/connect/r/grant.result @@ -1,3 +1,4 @@ +set sql_mode=""; # # Testing FILE privilege # @@ -537,3 +538,4 @@ DROP USER user@localhost; # # End of grant.inc # +set sql_mode=default; diff --git a/storage/connect/mysql-test/connect/r/ini_grant.result b/storage/connect/mysql-test/connect/r/ini_grant.result index 190114254b0..68330278183 100644 --- a/storage/connect/mysql-test/connect/r/ini_grant.result +++ b/storage/connect/mysql-test/connect/r/ini_grant.result @@ -1,8 +1,10 @@ # # Checking FILE privileges # +set sql_mode=""; GRANT ALL PRIVILEGES ON *.* TO user@localhost; REVOKE FILE ON *.* FROM user@localhost; +set sql_mode=default; SELECT user(); user() user@localhost diff --git a/storage/connect/mysql-test/connect/r/mysql_grant.result b/storage/connect/mysql-test/connect/r/mysql_grant.result index 554e6f47ba1..5f630834392 100644 --- a/storage/connect/mysql-test/connect/r/mysql_grant.result +++ b/storage/connect/mysql-test/connect/r/mysql_grant.result @@ -1,8 +1,10 @@ # # Testing FILE privilege # +set sql_mode=""; GRANT ALL PRIVILEGES ON *.* TO user@localhost; REVOKE FILE ON *.* FROM user@localhost; +set sql_mode=default; SELECT user(); user() user@localhost diff --git a/storage/connect/mysql-test/connect/t/grant.test b/storage/connect/mysql-test/connect/t/grant.test index 31a596ce078..738f156d8a4 100644 --- a/storage/connect/mysql-test/connect/t/grant.test +++ b/storage/connect/mysql-test/connect/t/grant.test @@ -1,4 +1,5 @@ -- source include/not_embedded.inc +set sql_mode=""; let $MYSQLD_DATADIR= `select @@datadir`; @@ -92,4 +93,4 @@ let $TABLE_OPTIONS=TABLE_TYPE=VEC MAX_ROWS=100; let $FILE_EXT=VEC; --source grant.inc - +set sql_mode=default; diff --git a/storage/connect/mysql-test/connect/t/ini_grant.test b/storage/connect/mysql-test/connect/t/ini_grant.test index ebc7a80b8f7..b0ddcb57979 100644 --- a/storage/connect/mysql-test/connect/t/ini_grant.test +++ b/storage/connect/mysql-test/connect/t/ini_grant.test @@ -5,8 +5,10 @@ let $MYSQLD_DATADIR= `select @@datadir`; --echo # --echo # Checking FILE privileges --echo # +set sql_mode=""; GRANT ALL PRIVILEGES ON *.* TO user@localhost; REVOKE FILE ON *.* FROM user@localhost; +set sql_mode=default; --connect(user,localhost,user,,) --connection user SELECT user(); diff --git a/storage/connect/mysql-test/connect/t/mysql_grant.test b/storage/connect/mysql-test/connect/t/mysql_grant.test index 05337efb3f2..7d3d05cb8fd 100644 --- a/storage/connect/mysql-test/connect/t/mysql_grant.test +++ b/storage/connect/mysql-test/connect/t/mysql_grant.test @@ -19,8 +19,10 @@ DROP TABLE t1; --echo # --echo # Testing FILE privilege --echo # +set sql_mode=""; GRANT ALL PRIVILEGES ON *.* TO user@localhost; REVOKE FILE ON *.* FROM user@localhost; +set sql_mode=default; --connect(user,localhost,user,,) --connection user SELECT user(); diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 51e549d9d1b..98f42ff8c26 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -2277,6 +2277,11 @@ static void test_ps_query_cache() "(2, 'hh', 'hh'), (1, 'ii', 'ii'), (2, 'ii', 'ii')"); myquery(rc); + rc= mysql_query(lmysql, "set global query_cache_type=ON"); + myquery(rc); + rc= mysql_query(lmysql, "set local query_cache_type=ON"); + myquery(rc); + for (iteration= TEST_QCACHE_ON; iteration <= TEST_QCACHE_ON_OFF; iteration++) { @@ -2426,7 +2431,9 @@ static void test_ps_query_cache() if (lmysql != mysql) mysql_close(lmysql); - rc= mysql_query(mysql, "set global query_cache_size=0"); + rc= mysql_query(mysql, "set global query_cache_size=default"); + myquery(rc); + rc= mysql_query(mysql, "set global query_cache_type=default"); myquery(rc); } @@ -13167,6 +13174,10 @@ static void test_open_cursor_prepared_statement_query_cache() return; } + rc= mysql_query(mysql, "set global query_cache_type=ON"); + myquery(rc); + rc= mysql_query(mysql, "set local query_cache_type=ON"); + myquery(rc); rc= mysql_query(mysql, "set global query_cache_size=1000000"); myquery(rc); @@ -13189,7 +13200,9 @@ static void test_open_cursor_prepared_statement_query_cache() check_execute(stmt, rc); mysql_stmt_close(stmt); - rc= mysql_query(mysql, "set global query_cache_size=1000000"); + rc= mysql_query(mysql, "set global query_cache_type=default"); + myquery(rc); + rc= mysql_query(mysql, "set global query_cache_size=default"); myquery(rc); } @@ -17959,6 +17972,8 @@ static void test_bug36326() myquery(rc); rc= mysql_query(mysql, "SET GLOBAL query_cache_type = 1"); myquery(rc); + rc= mysql_query(mysql, "SET LOCAL query_cache_type = 1"); + myquery(rc); rc= mysql_query(mysql, "SET GLOBAL query_cache_size = 1048576"); myquery(rc); DIE_UNLESS(!(mysql->server_status & SERVER_STATUS_IN_TRANS)); @@ -17982,7 +17997,8 @@ static void test_bug36326() DIE_UNLESS(rc == 1); rc= mysql_query(mysql, "DROP TABLE t1"); myquery(rc); - rc= mysql_query(mysql, "SET GLOBAL query_cache_size = 0"); + rc= mysql_query(mysql, "SET GLOBAL query_cache_size = default"); + rc= mysql_query(mysql, "SET GLOBAL query_cache_type = default"); myquery(rc); DBUG_VOID_RETURN; |