SET STATEMENT ... FOR ... changes global variables
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Percona Server moved to https://jira.percona.com/projects/PS | Status tracked in 5.7 | |||||
5.6 |
Invalid
|
Undecided
|
Unassigned | |||
5.7 |
Triaged
|
High
|
Unassigned |
Bug Description
MTR test case:
--source include/
SET STATEMENT sql_mode='' FOR SELECT 1;
SET STATEMENT innodb_
--source include/
fails with error
MTR's internal check of the test case 'main.sql-mode-ps' failed.
This means that the test case does not preserve the state that existed
before the test case was executed. Most likely the test case did not
do a proper clean-up. It could also be caused by the previous test run
by this thread, if the server wasn't restarted.
This is the diff of the states of the servers before and after the
test case was executed:
mysqltest: Logging to '/Users/
mysqltest: Results saved in '/Users/
mysqltest: Connecting to server localhost:13001 (socket /Users/
mysqltest: ... Connected.
mysqltest: Start processing test commands from './include/
mysqltest: ... Done processing test commands.
--- /Users/
+++ /Users/
@@ -353,7 +353,7 @@
INNODB_
INNODB_
INNODB_
-INNODB_TMPDIR
+INNODB_TMPDIR /private/tmp
INNODB_
INNODB_
INNODB_
@@ -603,7 +603,7 @@
SQL_BUFFER_RESULT OFF
SQL_LOG_BIN ON
SQL_LOG_OFF OFF
-SQL_MODE ONLY_FULL_
+SQL_MODE
SQL_NOTES ON
SQL_QUOTE_
SQL_SAFE_UPDATES OFF
mysqltest: Result content mismatch
Using count_sessions/
tags: | added: regression set-statement |
When I modify the test case to be as follows:
--source include/ count_sessions. inc
SET STATEMENT sql_mode='' FOR SELECT 1; tmpdir= '/tmp' FOR SELECT 1; innodb_ tmpdir;
SELECT @@global.sql_mode;
SET STATEMENT innodb_
SELECT @@global.
--source include/ wait_until_ count_sessions. inc
The result file contains:
SET STATEMENT sql_mode='' FOR SELECT 1; CREATE_ USER' is deprecated. It will be removed in a future release.
1
1
Warnings:
Warning 3090 Changing sql mode 'NO_AUTO_
SELECT @@global.sql_mode;
@@global.sql_mode
SET STATEMENT innodb_ tmpdir= '/tmp' FOR SELECT 1; innodb_ tmpdir; innodb_ tmpdir
1
1
SELECT @@global.
@@global.
/private/tmp
The bug is present only in 5.7