Comment 2 for bug 1385352

Revision history for this message
George Ormond Lorch III (gl-az) wrote : Re: SET STATEMENT does not work after SET GLOBAL and affects the global value

I just hit this trying to fix some myrocks tests, consider the following mtr case which fails on termination as the ending global sql_mode is not the same as the starting global sql_mode

1 --source include/have_innodb.inc
  2
  3 --let $engine=innodb
  4
  5 SET @ORIG_VALUE = @@INNODB_ADAPTIVE_FLUSHING;
  6 SET GLOBAL INNODB_ADAPTIVE_FLUSHING = 0;
  7
  8 #
  9 # Fixed point columns with indexes
 10 #
 11
 12 eval CREATE TABLE t1 (
 13 d1 DECIMAL(10,2) PRIMARY KEY,
 14 d2 DECIMAL(60,10),
 15 n1 NUMERIC,
 16 n2 NUMERIC(65,4)
 17 ) ENGINE=$engine;
 18
 19 SHOW INDEX IN t1;
 20
 21 SET STATEMENT sql_mode=NO_ENGINE_SUBSTITUTION FOR
 22 INSERT IGNORE INTO t1 (d1,d2,n1,n2) VALUES
 23 (10.22,60.12345,123456,14.3456),
 24 (10.0,60.12345,123456,14),
 25 (11.14,15,123456,13),
 26 (100,100,1,2),
 27 (0,0,0,0),
 28 (4540424564.23,3343303441.0,12,13),
 29 (15,17,23,100000);
 30
 31 DROP TABLE t1;
 32
 33 SET GLOBAL INNODB_ADAPTIVE_FLUSHING = @ORIG_VALUE;