summaryrefslogtreecommitdiff
path: root/mysql-test/r
diff options
context:
space:
mode:
authoristruewing@stella.local <>2008-02-14 21:00:10 +0100
committeristruewing@stella.local <>2008-02-14 21:00:10 +0100
commit108013f6a7efbed23cfeef35fbe0097a0a276d93 (patch)
treecad04d67f05b9f0d50fbb42937abc56539e93e24 /mysql-test/r
parent75495093b0e829cad62063ed1cfee64671420513 (diff)
parente053763bef02793ab7dd97b37dc83a247ad4ab05 (diff)
downloadmariadb-git-108013f6a7efbed23cfeef35fbe0097a0a276d93.tar.gz
Merge stella.local:/home2/mydev/mysql-5.1-ateam
into stella.local:/home2/mydev/mysql-5.1-axmrg
Diffstat (limited to 'mysql-test/r')
-rw-r--r--mysql-test/r/bdb_notembedded.result35
-rw-r--r--mysql-test/r/binlog_unsafe.result13
-rw-r--r--mysql-test/r/create.result46
-rw-r--r--mysql-test/r/events_bugs.result13
-rw-r--r--mysql-test/r/grant.result23
-rw-r--r--mysql-test/r/have_local_infile.require2
-rw-r--r--mysql-test/r/information_schema.result17
-rw-r--r--mysql-test/r/lock_multi.result10
-rw-r--r--mysql-test/r/merge-big.result51
-rw-r--r--mysql-test/r/multi_update.result4
-rw-r--r--mysql-test/r/mysqlbinlog.result133
-rw-r--r--mysql-test/r/mysqlbinlog2.result342
-rw-r--r--mysql-test/r/ps.result16
-rw-r--r--mysql-test/r/ps_ddl.result3304
-rw-r--r--mysql-test/r/show_check.result5
-rw-r--r--mysql-test/r/sp-error.result11
-rw-r--r--mysql-test/r/sp.result16
-rw-r--r--mysql-test/r/sp_trans_log.result1
-rw-r--r--mysql-test/r/strict_autoinc_4bdb.result28
-rw-r--r--mysql-test/r/system_mysql_db.result4
-rw-r--r--mysql-test/r/user_var-binlog.result6
21 files changed, 2784 insertions, 1296 deletions
diff --git a/mysql-test/r/bdb_notembedded.result b/mysql-test/r/bdb_notembedded.result
deleted file mode 100644
index 14cb5fad915..00000000000
--- a/mysql-test/r/bdb_notembedded.result
+++ /dev/null
@@ -1,35 +0,0 @@
-set autocommit=1;
-reset master;
-create table bug16206 (a int);
-insert into bug16206 values(1);
-start transaction;
-insert into bug16206 values(2);
-commit;
-show binlog events;
-Log_name Pos Event_type Server_id End_log_pos Info
-f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4
-f n Query 1 n use `test`; create table bug16206 (a int)
-f n Query 1 n use `test`; insert into bug16206 values(1)
-f n Query 1 n use `test`; insert into bug16206 values(2)
-drop table bug16206;
-reset master;
-create table bug16206 (a int) engine= bdb;
-insert into bug16206 values(0);
-insert into bug16206 values(1);
-start transaction;
-insert into bug16206 values(2);
-commit;
-insert into bug16206 values(3);
-show binlog events;
-Log_name Pos Event_type Server_id End_log_pos Info
-f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4
-f n Query 1 n use `test`; create table bug16206 (a int) engine= bdb
-f n Query 1 n use `test`; insert into bug16206 values(0)
-f n Query 1 n use `test`; insert into bug16206 values(1)
-f n Query 1 n use `test`; BEGIN
-f n Query 1 n use `test`; insert into bug16206 values(2)
-f n Query 1 n use `test`; COMMIT
-f n Query 1 n use `test`; insert into bug16206 values(3)
-drop table bug16206;
-set autocommit=0;
-End of 5.0 tests
diff --git a/mysql-test/r/binlog_unsafe.result b/mysql-test/r/binlog_unsafe.result
deleted file mode 100644
index 47284ed8bc3..00000000000
--- a/mysql-test/r/binlog_unsafe.result
+++ /dev/null
@@ -1,13 +0,0 @@
-SET BINLOG_FORMAT=STATEMENT;
-CREATE TABLE t1 (a CHAR(40));
-CREATE TABLE t2 (a INT AUTO_INCREMENT PRIMARY KEY);
-CREATE TABLE t3 (b INT AUTO_INCREMENT PRIMARY KEY);
-CREATE VIEW v1(a,b) AS SELECT a,b FROM t2,t3;
-INSERT INTO t1 SELECT UUID();
-Warnings:
-Warning 1592 Statement is not safe to log in statement format.
-SHOW WARNINGS;
-Level Warning
-Code 1592
-Message Statement is not safe to log in statement format.
-DROP TABLE t1,t2,t3;
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index 0613c9ba488..4bdcca81b74 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -1743,4 +1743,50 @@ t1 CREATE TABLE `t1` (
`MAXLEN` bigint(3) NOT NULL DEFAULT '0'
) ENGINE=MEMORY DEFAULT CHARSET=utf8
drop table t1;
+
+# --
+# -- Bug#21380: DEFAULT definition not always transfered by CREATE
+# -- TABLE/SELECT to the new table.
+# --
+
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+
+CREATE TABLE t1(
+c1 INT DEFAULT 12 COMMENT 'column1',
+c2 INT NULL COMMENT 'column2',
+c3 INT NOT NULL COMMENT 'column3',
+c4 VARCHAR(255) CHARACTER SET utf8 NOT NULL DEFAULT 'a',
+c5 VARCHAR(255) COLLATE utf8_unicode_ci NULL DEFAULT 'b',
+c6 VARCHAR(255))
+COLLATE latin1_bin;
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) DEFAULT '12' COMMENT 'column1',
+ `c2` int(11) DEFAULT NULL COMMENT 'column2',
+ `c3` int(11) NOT NULL COMMENT 'column3',
+ `c4` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT 'a',
+ `c5` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT 'b',
+ `c6` varchar(255) COLLATE latin1_bin DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin
+
+CREATE TABLE t2 AS SELECT * FROM t1;
+
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `c1` int(11) DEFAULT '12' COMMENT 'column1',
+ `c2` int(11) DEFAULT NULL COMMENT 'column2',
+ `c3` int(11) NOT NULL COMMENT 'column3',
+ `c4` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT 'a',
+ `c5` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT 'b',
+ `c6` varchar(255) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+DROP TABLE t2;
+
+# -- End of test case for Bug#21380.
+
End of 5.1 tests
diff --git a/mysql-test/r/events_bugs.result b/mysql-test/r/events_bugs.result
index b91e7e88d64..814cf42d16c 100644
--- a/mysql-test/r/events_bugs.result
+++ b/mysql-test/r/events_bugs.result
@@ -722,4 +722,17 @@ DROP USER mysqltest_u1@localhost;
#
#####################################################################
+drop procedure if exists p;
+set @old_mode= @@sql_mode;
+set @@sql_mode= pow(2,32)-1;
+create event e1 on schedule every 1 day do select 1;
+select @@sql_mode;
+@@sql_mode
+REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,?,ONLY_FULL_GROUP_BY,NO_UNSIGNED_SUBTRACTION,NO_DIR_IN_CREATE,POSTGRESQL,ORACLE,MSSQL,DB2,MAXDB,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,MYSQL323,MYSQL40,ANSI,NO_AUTO_VALUE_ON_ZERO,NO_BACKSLASH_ESCAPES,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ALLOW_INVALID_DATES,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,HIGH_NOT_PRECEDENCE,NO_ENGINE_SUBSTITUTION,PAD_CHAR_TO_FULL_LENGTH
+set @@sql_mode= @old_mode;
+select replace(@full_mode, '?', 'NOT_USED') into @full_mode;
+select replace(@full_mode, 'ALLOW_INVALID_DATES', 'INVALID_DATES') into @full_mode;
+select name from mysql.event where name = 'p' and sql_mode = @full_mode;
+name
+drop event e1;
DROP DATABASE events_test;
diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result
index 0df3ac6de8a..c157e1d4706 100644
--- a/mysql-test/r/grant.result
+++ b/mysql-test/r/grant.result
@@ -1218,6 +1218,28 @@ DROP USER mysqltest_1@localhost;
DROP DATABASE db27878;
use test;
DROP TABLE t1;
+drop table if exists test;
+Warnings:
+Note 1051 Unknown table 'test'
+drop function if exists test_function;
+Warnings:
+Note 1305 FUNCTION test_function does not exist
+drop view if exists v1;
+Warnings:
+Note 1051 Unknown table 'test.v1'
+create table test (col1 varchar(30));
+create function test_function() returns varchar(30)
+begin
+declare tmp varchar(30);
+select col1 from test limit 1 into tmp;
+return '1';
+end|
+create view v1 as select test.* from test where test.col1=test_function();
+grant update (col1) on v1 to 'greg'@'localhost';
+drop user 'greg'@'localhost';
+drop view v1;
+drop table test;
+drop function test_function;
End of 5.0 tests
set names utf8;
grant select on test.* to юзер_юзер@localhost;
@@ -1282,5 +1304,6 @@ CALL mysqltest1.test();
1
DROP DATABASE mysqltest1;
RENAME TABLE mysql.procs_gone TO mysql.procs_priv;
+DROP USER mysqltest_1@localhost;
FLUSH PRIVILEGES;
End of 5.1 tests
diff --git a/mysql-test/r/have_local_infile.require b/mysql-test/r/have_local_infile.require
new file mode 100644
index 00000000000..124540f7b77
--- /dev/null
+++ b/mysql-test/r/have_local_infile.require
@@ -0,0 +1,2 @@
+Variable_name Value
+local_infile ON
diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result
index ddc0e189cd2..708d8ab027d 100644
--- a/mysql-test/r/information_schema.result
+++ b/mysql-test/r/information_schema.result
@@ -588,7 +588,7 @@ proc body longblob
proc definer char(77)
proc created timestamp
proc modified timestamp
-proc sql_mode set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE')
+proc sql_mode set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH')
proc comment char(64)
proc character_set_client char(32)
proc collation_connection char(32)
@@ -1623,4 +1623,19 @@ Db Name Definer Time zone Type Execute at Interval value Interval field Starts E
show events where Db= 'information_schema';
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
use test;
+#
+# Bug#34166: Server crash in SHOW OPEN TABLES and prelocking
+#
+drop table if exists t1;
+drop function if exists f1;
+create table t1 (a int);
+create function f1() returns int
+begin
+insert into t1 (a) values (1);
+return 0;
+end|
+show open tables where f1()=0;
+show open tables where f1()=0;
+drop table t1;
+drop function f1;
End of 5.1 tests.
diff --git a/mysql-test/r/lock_multi.result b/mysql-test/r/lock_multi.result
index 9c4f1b17dcc..cd05fc1473f 100644
--- a/mysql-test/r/lock_multi.result
+++ b/mysql-test/r/lock_multi.result
@@ -143,4 +143,14 @@ connection: default
flush tables;
unlock tables;
drop table t1;
+drop table if exists t1,t2;
+create table t1 (a int);
+flush status;
+lock tables t1 read;
+insert into t1 values(1);;
+unlock tables;
+drop table t1;
+select @tlwa < @tlwb;
+@tlwa < @tlwb
+1
End of 5.1 tests
diff --git a/mysql-test/r/merge-big.result b/mysql-test/r/merge-big.result
index 82fedc1df73..e34ebbd9578 100644
--- a/mysql-test/r/merge-big.result
+++ b/mysql-test/r/merge-big.result
@@ -24,54 +24,3 @@ UNLOCK TABLES;
SET SESSION debug="-d,sleep_open_and_lock_after_open";
# connection default
DROP TABLE t1;
-#
-# Extra tests for Bug#26379 - Combination of FLUSH TABLE and
-# REPAIR TABLE corrupts a MERGE table
-#
-CREATE TABLE t1 (c1 INT);
-CREATE TABLE t2 (c1 INT);
-CREATE TABLE t3 (c1 INT);
-INSERT INTO t1 VALUES (1);
-INSERT INTO t2 VALUES (2);
-INSERT INTO t3 VALUES (3);
-#
-# CREATE ... SELECT
-# try to access parent from another thread.
-#
-# connection con1
-SET SESSION debug="+d,sleep_create_select_before_lock";
-CREATE TABLE t4 (c1 INT) ENGINE=MRG_MYISAM UNION=(t1,t2)
-INSERT_METHOD=FIRST SELECT * FROM t3;
-# connection default
-# Now try to access the parent.
-# If 3 is in table, SELECT had to wait.
-SELECT * FROM t4 ORDER BY c1;
-c1
-1
-2
-3
-# connection con1
-SET SESSION debug="-d,sleep_create_select_before_lock";
-# connection default
-# Cleanup for next test.
-DROP TABLE t4;
-DELETE FROM t1 WHERE c1 != 1;
-#
-# CREATE ... SELECT
-# try to access child from another thread.
-#
-# connection con1
-SET SESSION debug="+d,sleep_create_select_before_lock";
-CREATE TABLE t4 (c1 INT) ENGINE=MRG_MYISAM UNION=(t1,t2)
-INSERT_METHOD=FIRST SELECT * FROM t3;
-# connection default
-# Now try to access a child.
-# If 3 is in table, SELECT had to wait.
-SELECT * FROM t1 ORDER BY c1;
-c1
-1
-3
-# connection con1
-SET SESSION debug="-d,sleep_create_select_before_lock";
-# connection default
-DROP TABLE t1, t2, t3, t4;
diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result
index 0bc01e95d2d..d96927deed5 100644
--- a/mysql-test/r/multi_update.result
+++ b/mysql-test/r/multi_update.result
@@ -627,7 +627,7 @@ a b
4 4
show master status /* there must be the UPDATE query event */;
File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 268
+master-bin.000001 336
delete from t1;
delete from t2;
insert into t1 values (1,2),(3,4),(4,4);
@@ -637,7 +637,7 @@ UPDATE t2,t1 SET t2.a=t2.b where t2.a=t1.a;
ERROR 23000: Duplicate entry '4' for key 'PRIMARY'
show master status /* there must be the UPDATE query event */;
File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 283
+master-bin.000001 351
drop table t1, t2;
set @@session.binlog_format= @sav_binlog_format;
drop table if exists t1, t2, t3;
diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result
index e6485720c49..4ffcb7cdeeb 100644
--- a/mysql-test/r/mysqlbinlog.result
+++ b/mysql-test/r/mysqlbinlog.result
@@ -23,24 +23,33 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-drop table if exists t1,t2,t3,t4,t5,t03,t04/*!*/;
+drop table if exists t1,t2,t3,t4,t5,t03,t04
+/*!*/;
SET TIMESTAMP=1000000000/*!*/;
-create table t1 (word varchar(20))/*!*/;
+create table t1 (word varchar(20))
+/*!*/;
SET TIMESTAMP=1000000000/*!*/;
-create table t2 (id int auto_increment not null primary key)/*!*/;
+create table t2 (id int auto_increment not null primary key)
+/*!*/;
SET TIMESTAMP=1000000000/*!*/;
-insert into t1 values ("abirvalg")/*!*/;
+insert into t1 values ("abirvalg")
+/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1000000000/*!*/;
-insert into t2 values ()/*!*/;
+insert into t2 values ()
+/*!*/;
SET TIMESTAMP=1000000000/*!*/;
-load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-1-0' INTO table t1/*!*/;
+load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
+/*!*/;
SET TIMESTAMP=1000000000/*!*/;
-load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-2-0' INTO table t1/*!*/;
+load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
+/*!*/;
SET TIMESTAMP=1000000000/*!*/;
-load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-3-0' INTO table t1/*!*/;
+load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
+/*!*/;
SET TIMESTAMP=1000000000/*!*/;
-load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-4-0' INTO table t1/*!*/;
+load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -56,7 +65,8 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-insert into t1 values ("Alas")/*!*/;
+insert into t1 values ("Alas")
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -83,7 +93,8 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-insert into t1 values ("Alas")/*!*/;
+insert into t1 values ("Alas")
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -100,24 +111,33 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-drop table if exists t1,t2,t3,t4,t5,t03,t04/*!*/;
+drop table if exists t1,t2,t3,t4,t5,t03,t04
+/*!*/;
SET TIMESTAMP=1000000000/*!*/;
-create table t1 (word varchar(20))/*!*/;
+create table t1 (word varchar(20))
+/*!*/;
SET TIMESTAMP=1000000000/*!*/;
-create table t2 (id int auto_increment not null primary key)/*!*/;
+create table t2 (id int auto_increment not null primary key)
+/*!*/;
SET TIMESTAMP=1000000000/*!*/;
-insert into t1 values ("abirvalg")/*!*/;
+insert into t1 values ("abirvalg")
+/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1000000000/*!*/;
-insert into t2 values ()/*!*/;
+insert into t2 values ()
+/*!*/;
SET TIMESTAMP=1000000000/*!*/;
-load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-1-2' INTO table t1/*!*/;
+load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
+/*!*/;
SET TIMESTAMP=1000000000/*!*/;
-load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-2-2' INTO table t1/*!*/;
+load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
+/*!*/;
SET TIMESTAMP=1000000000/*!*/;
-load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-3-2' INTO table t1/*!*/;
+load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
+/*!*/;
SET TIMESTAMP=1000000000/*!*/;
-load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-4-2' INTO table t1/*!*/;
+load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -133,7 +153,8 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-insert into t1 values ("Alas")/*!*/;
+insert into t1 values ("Alas")
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -160,7 +181,8 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-insert into t1 values ("Alas")/*!*/;
+insert into t1 values ("Alas")
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -173,9 +195,11 @@ DELIMITER /*!*/;
ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1108844556/*!*/;
-BEGIN/*!*/;
+BEGIN
+/*!*/;
SET TIMESTAMP=1108844555/*!*/;
-insert t1 values (1)/*!*/;
+insert t1 values (1)
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -185,9 +209,11 @@ ROLLBACK /* added by mysqlbinlog */;
DELIMITER /*!*/;
use test/*!*/;
SET TIMESTAMP=1108844556/*!*/;
-BEGIN/*!*/;
+BEGIN
+/*!*/;
SET TIMESTAMP=1108844555/*!*/;
-insert t1 values (1)/*!*/;
+insert t1 values (1)
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -246,7 +272,8 @@ SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.
CREATE DEFINER=`root`@`localhost` procedure p1()
begin
select 1;
-end/*!*/;
+end
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -288,27 +315,36 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-create table t1 (a varchar(64) character set utf8)/*!*/;
+create table t1 (a varchar(64) character set utf8)
+/*!*/;
SET TIMESTAMP=1000000000/*!*/;
-load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-6-0' INTO table t1/*!*/;
+load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
+/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.collation_database=7/*!*/;
-load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-7-0' INTO table t1/*!*/;
+load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
+/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
-load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-8-0' INTO table t1/*!*/;
+load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
+/*!*/;
SET TIMESTAMP=1000000000/*!*/;
-load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-9-0' INTO table t1/*!*/;
+load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
+/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.collation_database=7/*!*/;
-load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-a-0' INTO table t1/*!*/;
+load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-a-0' INTO table t1
+/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
-load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-b-0' INTO table t1/*!*/;
+load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-b-0' INTO table t1
+/*!*/;
SET TIMESTAMP=1000000000/*!*/;
-load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-c-0' INTO table t1 character set koi8r/*!*/;
+load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-c-0' INTO table t1 character set koi8r
+/*!*/;
SET TIMESTAMP=1000000000/*!*/;
-drop table t1/*!*/;
+drop table t1
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -352,4 +388,29 @@ a b
1 root@localhost
DROP DATABASE mysqltest1;
DROP USER untrusted@localhost;
+BUG#32580: mysqlbinlog cannot read binlog event with user variables
+USE test;
+SET BINLOG_FORMAT = STATEMENT;
+FLUSH LOGS;
+CREATE TABLE t1 (a_real FLOAT, an_int INT, a_decimal DECIMAL(5,2), a_string CHAR(32));
+SET @a_real = rand(20) * 1000;
+SET @an_int = 1000;
+SET @a_decimal = CAST(rand(19) * 999 AS DECIMAL(5,2));
+SET @a_string = 'Just a test';
+INSERT INTO t1 VALUES (@a_real, @an_int, @a_decimal, @a_string);
+FLUSH LOGS;
+SELECT * FROM t1;
+a_real 158.883
+an_int 1000
+a_decimal 907.79
+a_string Just a test
+DROP TABLE t1;
+>> mysqlbinlog var/log/master-bin.000019 > var/tmp/bug32580.sql
+>> mysql test < var/tmp/bug32580.sql
+SELECT * FROM t1;
+a_real 158.883
+an_int 1000
+a_decimal 907.79
+a_string Just a test
+DROP TABLE t1;
End of 5.1 tests
diff --git a/mysql-test/r/mysqlbinlog2.result b/mysql-test/r/mysqlbinlog2.result
index 5347787d829..0c9ba34fc61 100644
--- a/mysql-test/r/mysqlbinlog2.result
+++ b/mysql-test/r/mysqlbinlog2.result
@@ -29,42 +29,48 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-create table t1 (a int auto_increment not null primary key, b char(3))/*!*/;
+create table t1 (a int auto_increment not null primary key, b char(3))
+/*!*/;
# at {pos}
#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Intvar
SET INSERT_ID=1/*!*/;
# at {pos}
#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Query thread_id={integer} exec_time={integer} error_code=0
SET TIMESTAMP=1579609942/*!*/;
-insert into t1 values(null, "a")/*!*/;
+insert into t1 values(null, "a")
+/*!*/;
# at {pos}
#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Intvar
SET INSERT_ID=2/*!*/;
# at {pos}
#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Query thread_id={integer} exec_time={integer} error_code=0
SET TIMESTAMP=1579609942/*!*/;
-insert into t1 values(null, "b")/*!*/;
+insert into t1 values(null, "b")
+/*!*/;
# at {pos}
#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Intvar
SET INSERT_ID=3/*!*/;
# at {pos}
#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Query thread_id={integer} exec_time={integer} error_code=0
SET TIMESTAMP=1579609944/*!*/;
-insert into t1 values(null, "c")/*!*/;
+insert into t1 values(null, "c")
+/*!*/;
# at {pos}
#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Intvar
SET INSERT_ID=4/*!*/;
# at {pos}
#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Query thread_id={integer} exec_time={integer} error_code=0
SET TIMESTAMP=1579609946/*!*/;
-insert into t1 values(null, "d")/*!*/;
+insert into t1 values(null, "d")
+/*!*/;
# at {pos}
#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Intvar
SET INSERT_ID=5/*!*/;
# at {pos}
#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Query thread_id={integer} exec_time={integer} error_code=0
SET TIMESTAMP=1579609946/*!*/;
-insert into t1 values(null, "e")/*!*/;
+insert into t1 values(null, "e")
+/*!*/;
# at {pos}
#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Rotate to master-bin.000002 pos: {pos}
DELIMITER ;
@@ -84,19 +90,24 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-insert into t1 values(null, "a")/*!*/;
+insert into t1 values(null, "a")
+/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/;
-insert into t1 values(null, "b")/*!*/;
+insert into t1 values(null, "b")
+/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1579609944/*!*/;
-insert into t1 values(null, "c")/*!*/;
+insert into t1 values(null, "c")
+/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1579609946/*!*/;
-insert into t1 values(null, "d")/*!*/;
+insert into t1 values(null, "d")
+/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/;
-insert into t1 values(null, "e")/*!*/;
+insert into t1 values(null, "e")
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -106,6 +117,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
+ROLLBACK/*!*/;
SET INSERT_ID=4/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609946/*!*/;
@@ -113,10 +125,12 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-insert into t1 values(null, "d")/*!*/;
+insert into t1 values(null, "d")
+/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/;
-insert into t1 values(null, "e")/*!*/;
+insert into t1 values(null, "e")
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -133,16 +147,20 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-create table t1 (a int auto_increment not null primary key, b char(3))/*!*/;
+create table t1 (a int auto_increment not null primary key, b char(3))
+/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1579609942/*!*/;
-insert into t1 values(null, "a")/*!*/;
+insert into t1 values(null, "a")
+/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/;
-insert into t1 values(null, "b")/*!*/;
+insert into t1 values(null, "b")
+/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1579609944/*!*/;
-insert into t1 values(null, "c")/*!*/;
+insert into t1 values(null, "c")
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -152,6 +170,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
+ROLLBACK/*!*/;
SET INSERT_ID=4/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609946/*!*/;
@@ -159,7 +178,8 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-insert into t1 values(null, "d")/*!*/;
+insert into t1 values(null, "d")
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -177,13 +197,16 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-insert into t1 values(null, "c")/*!*/;
+insert into t1 values(null, "c")
+/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1579609946/*!*/;
-insert into t1 values(null, "d")/*!*/;
+insert into t1 values(null, "d")
+/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/;
-insert into t1 values(null, "e")/*!*/;
+insert into t1 values(null, "e")
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -200,13 +223,16 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-create table t1 (a int auto_increment not null primary key, b char(3))/*!*/;
+create table t1 (a int auto_increment not null primary key, b char(3))
+/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1579609942/*!*/;
-insert into t1 values(null, "a")/*!*/;
+insert into t1 values(null, "a")
+/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/;
-insert into t1 values(null, "b")/*!*/;
+insert into t1 values(null, "b")
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -224,22 +250,28 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-create table t1 (a int auto_increment not null primary key, b char(3))/*!*/;
+create table t1 (a int auto_increment not null primary key, b char(3))
+/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1579609942/*!*/;
-insert into t1 values(null, "a")/*!*/;
+insert into t1 values(null, "a")
+/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/;
-insert into t1 values(null, "b")/*!*/;
+insert into t1 values(null, "b")
+/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1579609944/*!*/;
-insert into t1 values(null, "c")/*!*/;
+insert into t1 values(null, "c")
+/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1579609946/*!*/;
-insert into t1 values(null, "d")/*!*/;
+insert into t1 values(null, "d")
+/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/;
-insert into t1 values(null, "e")/*!*/;
+insert into t1 values(null, "e")
+/*!*/;
DELIMITER ;
DELIMITER /*!*/;
SET INSERT_ID=6/*!*/;
@@ -249,7 +281,8 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-insert into t1 values(null, "f")/*!*/;
+insert into t1 values(null, "f")
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -267,19 +300,24 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-insert into t1 values(null, "a")/*!*/;
+insert into t1 values(null, "a")
+/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/;
-insert into t1 values(null, "b")/*!*/;
+insert into t1 values(null, "b")
+/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1579609944/*!*/;
-insert into t1 values(null, "c")/*!*/;
+insert into t1 values(null, "c")
+/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1579609946/*!*/;
-insert into t1 values(null, "d")/*!*/;
+insert into t1 values(null, "d")
+/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/;
-insert into t1 values(null, "e")/*!*/;
+insert into t1 values(null, "e")
+/*!*/;
DELIMITER ;
DELIMITER /*!*/;
SET INSERT_ID=6/*!*/;
@@ -289,7 +327,8 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-insert into t1 values(null, "f")/*!*/;
+insert into t1 values(null, "f")
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -299,6 +338,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
+ROLLBACK/*!*/;
SET INSERT_ID=4/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609946/*!*/;
@@ -306,10 +346,12 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-insert into t1 values(null, "d")/*!*/;
+insert into t1 values(null, "d")
+/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/;
-insert into t1 values(null, "e")/*!*/;
+insert into t1 values(null, "e")
+/*!*/;
DELIMITER ;
DELIMITER /*!*/;
SET INSERT_ID=6/*!*/;
@@ -319,7 +361,8 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-insert into t1 values(null, "f")/*!*/;
+insert into t1 values(null, "f")
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -336,22 +379,28 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-create table t1 (a int auto_increment not null primary key, b char(3))/*!*/;
+create table t1 (a int auto_increment not null primary key, b char(3))
+/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1579609942/*!*/;
-insert into t1 values(null, "a")/*!*/;
+insert into t1 values(null, "a")
+/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/;
-insert into t1 values(null, "b")/*!*/;
+insert into t1 values(null, "b")
+/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1579609944/*!*/;
-insert into t1 values(null, "c")/*!*/;
+insert into t1 values(null, "c")
+/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1579609946/*!*/;
-insert into t1 values(null, "d")/*!*/;
+insert into t1 values(null, "d")
+/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/;
-insert into t1 values(null, "e")/*!*/;
+insert into t1 values(null, "e")
+/*!*/;
DELIMITER ;
DELIMITER /*!*/;
SET INSERT_ID=6/*!*/;
@@ -372,13 +421,16 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-insert into t1 values(null, "c")/*!*/;
+insert into t1 values(null, "c")
+/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1579609946/*!*/;
-insert into t1 values(null, "d")/*!*/;
+insert into t1 values(null, "d")
+/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/;
-insert into t1 values(null, "e")/*!*/;
+insert into t1 values(null, "e")
+/*!*/;
DELIMITER ;
DELIMITER /*!*/;
SET INSERT_ID=6/*!*/;
@@ -388,7 +440,8 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-insert into t1 values(null, "f")/*!*/;
+insert into t1 values(null, "f")
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -405,13 +458,16 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-create table t1 (a int auto_increment not null primary key, b char(3))/*!*/;
+create table t1 (a int auto_increment not null primary key, b char(3))
+/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1579609942/*!*/;
-insert into t1 values(null, "a")/*!*/;
+insert into t1 values(null, "a")
+/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/;
-insert into t1 values(null, "b")/*!*/;
+insert into t1 values(null, "b")
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -428,22 +484,28 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-create table t1 (a int auto_increment not null primary key, b char(3))/*!*/;
+create table t1 (a int auto_increment not null primary key, b char(3))
+/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1579609942/*!*/;
-insert into t1 values(null, "a")/*!*/;
+insert into t1 values(null, "a")
+/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/;
-insert into t1 values(null, "b")/*!*/;
+insert into t1 values(null, "b")
+/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1579609944/*!*/;
-insert into t1 values(null, "c")/*!*/;
+insert into t1 values(null, "c")
+/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1579609946/*!*/;
-insert into t1 values(null, "d")/*!*/;
+insert into t1 values(null, "d")
+/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/;
-insert into t1 values(null, "e")/*!*/;
+insert into t1 values(null, "e")
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -461,19 +523,24 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-insert into t1 values(null, "a")/*!*/;
+insert into t1 values(null, "a")
+/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/;
-insert into t1 values(null, "b")/*!*/;
+insert into t1 values(null, "b")
+/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1579609944/*!*/;
-insert into t1 values(null, "c")/*!*/;
+insert into t1 values(null, "c")
+/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1579609946/*!*/;
-insert into t1 values(null, "d")/*!*/;
+insert into t1 values(null, "d")
+/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/;
-insert into t1 values(null, "e")/*!*/;
+insert into t1 values(null, "e")
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -490,10 +557,12 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-insert into t1 values(null, "d")/*!*/;
+insert into t1 values(null, "d")
+/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/;
-insert into t1 values(null, "e")/*!*/;
+insert into t1 values(null, "e")
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -510,16 +579,20 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-create table t1 (a int auto_increment not null primary key, b char(3))/*!*/;
+create table t1 (a int auto_increment not null primary key, b char(3))
+/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1579609942/*!*/;
-insert into t1 values(null, "a")/*!*/;
+insert into t1 values(null, "a")
+/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/;
-insert into t1 values(null, "b")/*!*/;
+insert into t1 values(null, "b")
+/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1579609944/*!*/;
-insert into t1 values(null, "c")/*!*/;
+insert into t1 values(null, "c")
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -536,7 +609,8 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-insert into t1 values(null, "d")/*!*/;
+insert into t1 values(null, "d")
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -554,13 +628,16 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-insert into t1 values(null, "c")/*!*/;
+insert into t1 values(null, "c")
+/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1579609946/*!*/;
-insert into t1 values(null, "d")/*!*/;
+insert into t1 values(null, "d")
+/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/;
-insert into t1 values(null, "e")/*!*/;
+insert into t1 values(null, "e")
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -577,13 +654,16 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-create table t1 (a int auto_increment not null primary key, b char(3))/*!*/;
+create table t1 (a int auto_increment not null primary key, b char(3))
+/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1579609942/*!*/;
-insert into t1 values(null, "a")/*!*/;
+insert into t1 values(null, "a")
+/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/;
-insert into t1 values(null, "b")/*!*/;
+insert into t1 values(null, "b")
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -600,22 +680,28 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-create table t1 (a int auto_increment not null primary key, b char(3))/*!*/;
+create table t1 (a int auto_increment not null primary key, b char(3))
+/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1579609942/*!*/;
-insert into t1 values(null, "a")/*!*/;
+insert into t1 values(null, "a")
+/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/;
-insert into t1 values(null, "b")/*!*/;
+insert into t1 values(null, "b")
+/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1579609944/*!*/;
-insert into t1 values(null, "c")/*!*/;
+insert into t1 values(null, "c")
+/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1579609946/*!*/;
-insert into t1 values(null, "d")/*!*/;
+insert into t1 values(null, "d")
+/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/;
-insert into t1 values(null, "e")/*!*/;
+insert into t1 values(null, "e")
+/*!*/;
DELIMITER ;
DELIMITER /*!*/;
SET INSERT_ID=6/*!*/;
@@ -625,7 +711,8 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-insert into t1 values(null, "f")/*!*/;
+insert into t1 values(null, "f")
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -643,19 +730,24 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-insert into t1 values(null, "a")/*!*/;
+insert into t1 values(null, "a")
+/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/;
-insert into t1 values(null, "b")/*!*/;
+insert into t1 values(null, "b")
+/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1579609944/*!*/;
-insert into t1 values(null, "c")/*!*/;
+insert into t1 values(null, "c")
+/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1579609946/*!*/;
-insert into t1 values(null, "d")/*!*/;
+insert into t1 values(null, "d")
+/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/;
-insert into t1 values(null, "e")/*!*/;
+insert into t1 values(null, "e")
+/*!*/;
DELIMITER ;
DELIMITER /*!*/;
SET INSERT_ID=6/*!*/;
@@ -665,7 +757,8 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-insert into t1 values(null, "f")/*!*/;
+insert into t1 values(null, "f")
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -682,10 +775,12 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-insert into t1 values(null, "d")/*!*/;
+insert into t1 values(null, "d")
+/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/;
-insert into t1 values(null, "e")/*!*/;
+insert into t1 values(null, "e")
+/*!*/;
DELIMITER ;
DELIMITER /*!*/;
SET INSERT_ID=6/*!*/;
@@ -695,7 +790,8 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-insert into t1 values(null, "f")/*!*/;
+insert into t1 values(null, "f")
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -712,22 +808,28 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-create table t1 (a int auto_increment not null primary key, b char(3))/*!*/;
+create table t1 (a int auto_increment not null primary key, b char(3))
+/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1579609942/*!*/;
-insert into t1 values(null, "a")/*!*/;
+insert into t1 values(null, "a")
+/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/;
-insert into t1 values(null, "b")/*!*/;
+insert into t1 values(null, "b")
+/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1579609944/*!*/;
-insert into t1 values(null, "c")/*!*/;
+insert into t1 values(null, "c")
+/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1579609946/*!*/;
-insert into t1 values(null, "d")/*!*/;
+insert into t1 values(null, "d")
+/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/;
-insert into t1 values(null, "e")/*!*/;
+insert into t1 values(null, "e")
+/*!*/;
DELIMITER ;
DELIMITER /*!*/;
SET INSERT_ID=6/*!*/;
@@ -748,13 +850,16 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-insert into t1 values(null, "c")/*!*/;
+insert into t1 values(null, "c")
+/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1579609946/*!*/;
-insert into t1 values(null, "d")/*!*/;
+insert into t1 values(null, "d")
+/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/;
-insert into t1 values(null, "e")/*!*/;
+insert into t1 values(null, "e")
+/*!*/;
DELIMITER ;
DELIMITER /*!*/;
SET INSERT_ID=6/*!*/;
@@ -764,7 +869,8 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-insert into t1 values(null, "f")/*!*/;
+insert into t1 values(null, "f")
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -781,13 +887,16 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-create table t1 (a int auto_increment not null primary key, b char(3))/*!*/;
+create table t1 (a int auto_increment not null primary key, b char(3))
+/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1579609942/*!*/;
-insert into t1 values(null, "a")/*!*/;
+insert into t1 values(null, "a")
+/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/;
-insert into t1 values(null, "b")/*!*/;
+insert into t1 values(null, "b")
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -804,25 +913,32 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-create table t1 (a int auto_increment not null primary key, b char(3))/*!*/;
+create table t1 (a int auto_increment not null primary key, b char(3))
+/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1579609942/*!*/;
-insert into t1 values(null, "a")/*!*/;
+insert into t1 values(null, "a")
+/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/;
-insert into t1 values(null, "b")/*!*/;
+insert into t1 values(null, "b")
+/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1579609944/*!*/;
-insert into t1 values(null, "c")/*!*/;
+insert into t1 values(null, "c")
+/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1579609946/*!*/;
-insert into t1 values(null, "d")/*!*/;
+insert into t1 values(null, "d")
+/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/;
-insert into t1 values(null, "e")/*!*/;
+insert into t1 values(null, "e")
+/*!*/;
SET INSERT_ID=6/*!*/;
SET TIMESTAMP=1579609943/*!*/;
-insert into t1 values(null, "f")/*!*/;
+insert into t1 values(null, "f")
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result
index a6b07bfc127..75d3f79f4b0 100644
--- a/mysql-test/r/ps.result
+++ b/mysql-test/r/ps.result
@@ -1717,6 +1717,22 @@ t1 CREATE TABLE `t1` (
`?` decimal(2,1) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
+drop table if exists t1;
+create table t1 (a bigint unsigned, b bigint(20) unsigned);
+prepare stmt from "insert into t1 values (?,?)";
+set @a= 9999999999999999;
+set @b= 14632475938453979136;
+insert into t1 values (@a, @b);
+select * from t1 where a = @a and b = @b;
+a b
+9999999999999999 14632475938453979136
+execute stmt using @a, @b;
+select * from t1 where a = @a and b = @b;
+a b
+9999999999999999 14632475938453979136
+9999999999999999 14632475938453979136
+deallocate prepare stmt;
+drop table t1;
End of 5.0 tests.
create procedure proc_1() reset query cache;
call proc_1();
diff --git a/mysql-test/r/ps_ddl.result b/mysql-test/r/ps_ddl.result
index 0987e765265..531d29d219e 100644
--- a/mysql-test/r/ps_ddl.result
+++ b/mysql-test/r/ps_ddl.result
@@ -1,10 +1,11 @@
+SELECT VARIABLE_VALUE from
+INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE'
+into @base_count ;
+set @expected = 0;
=====================================================================
Testing 1: NOTHING -> TABLE transitions
=====================================================================
drop table if exists t1;
-SELECT VARIABLE_VALUE from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE'
-into @base_count ;
prepare stmt from 'select * from t1';
ERROR 42S02: Table 'test.t1' doesn't exist
=====================================================================
@@ -17,92 +18,144 @@ Testing 3: NOTHING -> VIEW transitions
Testing 4: TABLE -> NOTHING transitions
=====================================================================
drop table if exists t4;
-SELECT VARIABLE_VALUE from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE'
-into @base_count ;
create table t4(a int);
prepare stmt from 'select * from t4';
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop table t4;
execute stmt;
ERROR 42S02: Table 'test.t4' doesn't exist
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
ERROR 42S02: Table 'test.t4' doesn't exist
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
=====================================================================
Testing 5: TABLE -> TABLE (DDL) transitions
=====================================================================
drop table if exists t5;
-SELECT VARIABLE_VALUE from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE'
-into @base_count ;
create table t5(a int);
-prepare stmt from 'select * from t5';
+prepare stmt from 'select a from t5';
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
alter table t5 add column (b int);
+set @expected = @expected + 1;
execute stmt;
-a b
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+a
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
-a b
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+a
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop table t5;
=====================================================================
Testing 6: TABLE -> TABLE (TRIGGER) transitions
=====================================================================
drop table if exists t6;
-SELECT VARIABLE_VALUE from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE'
-into @base_count ;
create table t6(a int);
prepare stmt from 'insert into t6(a) value (?)';
set @val=1;
execute stmt using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
set @val=2;
execute stmt using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
create trigger t6_bi before insert on t6 for each row
begin
set @message= "t6_bi";
@@ -110,20 +163,33 @@ end
$$
set @message="none";
set @val=3;
+set @expected = @expected + 1;
execute stmt using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
select @message;
@message
t6_bi
set @val=4;
execute stmt using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
select @message;
@message
t6_bi
@@ -131,20 +197,32 @@ prepare stmt from 'insert into t6(a) value (?)';
set @message="none";
set @val=5;
execute stmt using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
select @message;
@message
t6_bi
set @message="none";
set @val=6;
execute stmt using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
select @message;
@message
t6_bi
@@ -155,21 +233,34 @@ end
$$
set @message="none";
set @val=7;
+set @expected = @expected + 1;
execute stmt using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
select @message;
@message
t6_bi
set @message="none";
set @val=8;
execute stmt using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
select @message;
@message
t6_bi
@@ -177,20 +268,32 @@ prepare stmt from 'insert into t6(a) value (?)';
set @message="none";
set @val=9;
execute stmt using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
select @message;
@message
t6_bi
set @message="none";
set @val=10;
execute stmt using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
select @message;
@message
t6_bi
@@ -202,20 +305,33 @@ end
$$
set @message="none";
set @val=11;
+set @expected = @expected + 1;
execute stmt using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-2
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
select @message;
@message
t6_bi (2)
set @val=12;
execute stmt using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-2
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
select @message;
@message
t6_bi (2)
@@ -223,20 +339,32 @@ prepare stmt from 'insert into t6(a) value (?)';
set @message="none";
set @val=13;
execute stmt using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-2
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
select @message;
@message
t6_bi (2)
set @message="none";
set @val=14;
execute stmt using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-2
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
select @message;
@message
t6_bi (2)
@@ -248,21 +376,34 @@ end
$$
set @message="none";
set @val=15;
+set @expected = @expected + 1;
execute stmt using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-2
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
select @message;
@message
t6_bi (2)
set @message="none";
set @val=16;
execute stmt using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-2
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
select @message;
@message
t6_bi (2)
@@ -270,40 +411,65 @@ prepare stmt from 'insert into t6(a) value (?)';
set @message="none";
set @val=17;
execute stmt using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-2
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
select @message;
@message
t6_bi (2)
set @message="none";
set @val=18;
execute stmt using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-2
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
select @message;
@message
t6_bi (2)
drop trigger t6_bi;
set @message="none";
set @val=19;
+set @expected = @expected + 1;
execute stmt using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-2
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
select @message;
@message
none
set @val=20;
execute stmt using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-2
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
select @message;
@message
none
@@ -311,38 +477,63 @@ prepare stmt from 'insert into t6(a) value (?)';
set @message="none";
set @val=21;
execute stmt using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-2
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
select @message;
@message
none
set @val=22;
execute stmt using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-2
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
select @message;
@message
none
drop trigger t6_bd;
set @val=23;
+set @expected = @expected + 1;
execute stmt using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-2
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
select @message;
@message
none
set @val=24;
execute stmt using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-2
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
select @message;
@message
none
@@ -386,9 +577,6 @@ drop table if exists t7_audit;
drop procedure if exists audit_proc;
drop function if exists audit_func;
drop view if exists audit_view;
-SELECT VARIABLE_VALUE from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE'
-into @base_count ;
create table t7_proc(a int);
create table t7_func(a int);
create table t7_view(a int);
@@ -414,155 +602,294 @@ for each row set NEW.reason="trigger v1";
prepare stmt_proc from 'insert into t7_proc(a) value (?)';
set @val=101;
execute stmt_proc using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
set @val=102;
execute stmt_proc using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop procedure audit_proc;
create procedure audit_proc(a int)
insert into t7_audit values (NULL, a, "proc v2");
set @val=103;
+set @expected = @expected + 1;
execute stmt_proc using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
set @val=104;
execute stmt_proc using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
prepare stmt_func from 'insert into t7_func(a) value (?)';
set @val=201;
execute stmt_func using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
set @val=202;
execute stmt_func using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop function audit_func;
create function audit_func() returns varchar(50)
return "func v2";
set @val=203;
+set @expected = @expected + 1;
execute stmt_func using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
set @val=204;
execute stmt_func using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
prepare stmt_view from 'insert into t7_view(a) value (?)';
set @val=301;
execute stmt_view using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
set @val=302;
execute stmt_view using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop view audit_view;
create view audit_view as select "view v2" as reason from dual;
set @val=303;
+set @expected = @expected + 1;
execute stmt_view using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
set @val=304;
execute stmt_view using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
prepare stmt_table from 'insert into t7_table(a) value (?)';
set @val=401;
execute stmt_table using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
set @val=402;
execute stmt_table using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
alter table t7_dependent_table add column comments varchar(100) default NULL;
set @val=403;
+set @expected = @expected + 1;
execute stmt_table using @val;
ERROR 21S01: Column count doesn't match value count at row 1
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-2
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
set @val=404;
+set @expected = @expected + 1;
execute stmt_table using @val;
ERROR 21S01: Column count doesn't match value count at row 1
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-2
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
alter table t7_dependent_table drop column comments;
set @val=405;
+set @expected = @expected + 1;
execute stmt_table using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-3
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
set @val=406;
execute stmt_table using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-3
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
prepare stmt_table_trigger from 'insert into t7_table(a) value (?)';
set @val=501;
execute stmt_table_trigger using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-3
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
set @val=502;
execute stmt_table_trigger using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-3
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop trigger t7_table_trigger_bi;
create trigger t7_table_trigger_bi before insert on t7_dependent_table
for each row set NEW.reason="trigger v2";
set @val=503;
+set @expected = @expected + 1;
execute stmt_table_trigger using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-4
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
set @val=504;
execute stmt_table_trigger using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-4
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
select * from t7_audit order by new_a;
old_a new_a reason
NULL 101 proc v1
@@ -601,150 +928,237 @@ drop view audit_view;
Testing 8: TABLE -> TEMPORARY TABLE transitions
=====================================================================
drop table if exists t8;
-SELECT VARIABLE_VALUE from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE'
-into @base_count ;
create table t8(a int);
prepare stmt from 'select * from t8';
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop table t8;
create temporary table t8(a int);
+set @expected = @expected + 1;
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop table t8;
=====================================================================
Testing 9: TABLE -> VIEW transitions
=====================================================================
drop table if exists t9;
drop table if exists t9_b;
-SELECT VARIABLE_VALUE from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE'
-into @base_count ;
create table t9(a int);
create table t9_b(a int);
prepare stmt from 'select * from t9';
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop table t9;
create view t9 as select * from t9_b;
+set @expected = @expected + 1;
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop view t9;
drop table t9_b;
=====================================================================
Testing 10: TEMPORARY TABLE -> NOTHING transitions
=====================================================================
drop temporary table if exists t10;
-SELECT VARIABLE_VALUE from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE'
-into @base_count ;
create temporary table t10(a int);
prepare stmt from 'select * from t10';
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop temporary table t10;
execute stmt;
ERROR 42S02: Table 'test.t10' doesn't exist
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
ERROR 42S02: Table 'test.t10' doesn't exist
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
=====================================================================
Testing 11: TEMPORARY TABLE -> TABLE transitions
=====================================================================
drop table if exists t11;
drop temporary table if exists t11;
-SELECT VARIABLE_VALUE from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE'
-into @base_count ;
create table t11(a int);
insert into t11(a) value (1);
create temporary table t11(a int);
prepare stmt from 'select * from t11';
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop temporary table t11;
+set @expected = @expected + 1;
execute stmt;
a
1
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
a
1
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
select * from t11;
a
1
@@ -753,37 +1167,59 @@ drop table t11;
Testing 12: TEMPORARY TABLE -> TEMPORARY TABLE (DDL) transitions
=====================================================================
drop temporary table if exists t12;
-SELECT VARIABLE_VALUE from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE'
-into @base_count ;
create temporary table t12(a int);
-prepare stmt from 'select * from t12';
+prepare stmt from 'select a from t12';
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop temporary table t12;
create temporary table t12(a int, b int);
+set @expected = @expected + 1;
execute stmt;
-a b
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+a
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
-a b
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+a
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
select * from t12;
a b
drop table t12;
@@ -792,38 +1228,60 @@ Testing 13: TEMPORARY TABLE -> VIEW transitions
=====================================================================
drop temporary table if exists t13;
drop table if exists t13_b;
-SELECT VARIABLE_VALUE from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE'
-into @base_count ;
create temporary table t13(a int);
create table t13_b(a int);
prepare stmt from 'select * from t13';
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop temporary table t13;
create view t13 as select * from t13_b;
+set @expected = @expected + 1;
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop view t13;
drop table t13_b;
=====================================================================
@@ -831,75 +1289,120 @@ Testing 14: VIEW -> NOTHING transitions
=====================================================================
drop view if exists t14;
drop table if exists t14_b;
-SELECT VARIABLE_VALUE from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE'
-into @base_count ;
create table t14_b(a int);
create view t14 as select * from t14_b;
prepare stmt from 'select * from t14';
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop view t14;
+set @expected = @expected + 1;
execute stmt;
ERROR 42S02: Table 'test.t14' doesn't exist
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
+set @expected = @expected + 1;
execute stmt;
ERROR 42S02: Table 'test.t14' doesn't exist
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop table t14_b;
=====================================================================
Testing 15: VIEW -> TABLE transitions
=====================================================================
drop view if exists t15;
drop table if exists t15_b;
-SELECT VARIABLE_VALUE from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE'
-into @base_count ;
create table t15_b(a int);
create view t15 as select * from t15_b;
prepare stmt from 'select * from t15';
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop view t15;
create table t15(a int);
+set @expected = @expected + 1;
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop table t15_b;
drop table t15;
=====================================================================
@@ -907,38 +1410,60 @@ Testing 16: VIEW -> TEMPORARY TABLE transitions
=====================================================================
drop view if exists t16;
drop table if exists t16_b;
-SELECT VARIABLE_VALUE from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE'
-into @base_count ;
create table t16_b(a int);
create view t16 as select * from t16_b;
prepare stmt from 'select * from t16';
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop view t16;
create temporary table t16(a int);
+set @expected = @expected + 1;
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop table t16_b;
drop temporary table t16;
=====================================================================
@@ -946,9 +1471,6 @@ Testing 17: VIEW -> VIEW (DDL) transitions
=====================================================================
drop view if exists t17;
drop table if exists t17_b;
-SELECT VARIABLE_VALUE from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE'
-into @base_count ;
create table t17_b(a int);
insert into t17_b values (10), (20), (30);
create view t17 as select a, 2*a as b, 3*a as c from t17_b;
@@ -963,44 +1485,69 @@ a b c
10 20 30
20 40 60
30 60 90
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
a b c
10 20 30
20 40 60
30 60 90
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop view t17;
-create view t17 as select a, 2*a as b, 10*a as c from t17_b;
+create view t17 as select a, 2*a as b, 5*a as c from t17_b;
select * from t17;
a b c
-10 20 100
-20 40 200
-30 60 300
+10 20 50
+20 40 100
+30 60 150
+set @expected = @expected + 1;
execute stmt;
a b c
-10 20 100
-20 40 200
-30 60 300
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+10 20 50
+20 40 100
+30 60 150
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
a b c
-10 20 100
-20 40 200
-30 60 300
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+10 20 50
+20 40 100
+30 60 150
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop table t17_b;
drop view t17;
=====================================================================
@@ -1013,9 +1560,6 @@ drop view if exists t18_view;
drop view if exists t18_table;
drop function if exists view_func;
drop view if exists view_view;
-SELECT VARIABLE_VALUE from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE'
-into @base_count ;
create table t18(a int);
insert into t18 values (1), (2), (3);
create function view_func(x int) returns int
@@ -1031,117 +1575,192 @@ a b
1 2
2 3
3 4
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt_func;
a b
1 2
2 3
3 4
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop function view_func;
create function view_func(x int) returns int
return x*x;
+set @expected = @expected + 1;
execute stmt_func;
a b
1 1
2 4
3 9
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt_func;
a b
1 1
2 4
3 9
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
prepare stmt_view from 'select * from t18_view';
execute stmt_view;
a b
1 view v1
2 view v1
3 view v1
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt_view;
a b
1 view v1
2 view v1
3 view v1
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop view view_view;
create view view_view as select "view v2" as reason from dual;
+set @expected = @expected + 1;
execute stmt_view;
a b
1 view v2
2 view v2
3 view v2
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt_view;
a b
1 view v2
2 view v2
3 view v2
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
prepare stmt_table from 'select * from t18_table';
execute stmt_table;
a
1
2
3
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt_table;
a
1
2
3
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
alter table t18 add column comments varchar(50) default NULL;
+set @expected = @expected + 1;
execute stmt_table;
a
1
2
3
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-2
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt_table;
a
1
2
3
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-2
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop table t18;
drop table t18_dependent_table;
drop view t18_func;
@@ -1153,9 +1772,6 @@ drop view view_view;
Testing 19: Special tables (INFORMATION_SCHEMA)
=====================================================================
drop procedure if exists proc_19;
-SELECT VARIABLE_VALUE from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE'
-into @base_count ;
prepare stmt from
'select ROUTINE_SCHEMA, ROUTINE_NAME, ROUTINE_TYPE
from INFORMATION_SCHEMA.ROUTINES where
@@ -1164,115 +1780,178 @@ create procedure proc_19() select "hi there";
execute stmt;
ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE
test proc_19 PROCEDURE
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE
test proc_19 PROCEDURE
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop procedure proc_19;
create procedure proc_19() select "hi there, again";
execute stmt;
ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE
test proc_19 PROCEDURE
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE
test proc_19 PROCEDURE
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop procedure proc_19;
=====================================================================
Testing 20: Special tables (log tables)
=====================================================================
-SELECT VARIABLE_VALUE from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE'
-into @base_count ;
prepare stmt from
'select * from mysql.general_log where argument=\'IMPOSSIBLE QUERY STRING\'';
execute stmt;
event_time user_host thread_id server_id command_type argument
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
event_time user_host thread_id server_id command_type argument
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
event_time user_host thread_id server_id command_type argument
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
event_time user_host thread_id server_id command_type argument
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
=====================================================================
Testing 21: Special tables (system tables)
=====================================================================
drop procedure if exists proc_21;
-SELECT VARIABLE_VALUE from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE'
-into @base_count ;
prepare stmt from
'select type, db, name from mysql.proc where name=\'proc_21\'';
create procedure proc_21() select "hi there";
execute stmt;
type db name
PROCEDURE test proc_21
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
type db name
PROCEDURE test proc_21
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop procedure proc_21;
create procedure proc_21() select "hi there, again";
execute stmt;
type db name
PROCEDURE test proc_21
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
type db name
PROCEDURE test proc_21
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop procedure proc_21;
=====================================================================
Testing 22: Special tables (views temp tables)
=====================================================================
drop table if exists t22_b;
drop view if exists t22;
-SELECT VARIABLE_VALUE from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE'
-into @base_count ;
create table t22_b(a int);
create algorithm=temptable view t22 as select a*a as a2 from t22_b;
show create view t22;
@@ -1285,19 +1964,31 @@ a2
1
4
9
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
a2
1
4
9
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
insert into t22_b values (4), (5), (6);
execute stmt;
a2
@@ -1307,10 +1998,16 @@ a2
16
25
36
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
a2
1
@@ -1319,10 +2016,16 @@ a2
16
25
36
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop table t22_b;
drop view t22;
=====================================================================
@@ -1330,9 +2033,6 @@ Testing 23: Special tables (internal join tables)
=====================================================================
drop table if exists t23_a;
drop table if exists t23_b;
-SELECT VARIABLE_VALUE from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE'
-into @base_count ;
create table t23_a(a int);
create table t23_b(b int);
prepare stmt from 'select * from t23_a join t23_b';
@@ -1349,10 +2049,16 @@ a b
1 30
2 30
3 30
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
a b
1 10
@@ -1364,10 +2070,16 @@ a b
1 30
2 30
3 30
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
insert into t23_a values (4);
insert into t23_b values (40);
execute stmt;
@@ -1388,10 +2100,16 @@ a b
2 40
3 40
4 40
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
a b
1 10
@@ -1410,45 +2128,72 @@ a b
2 40
3 40
4 40
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop table t23_a;
drop table t23_b;
=====================================================================
Testing 24: Special statements
=====================================================================
drop table if exists t24_alter;
-SELECT VARIABLE_VALUE from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE'
-into @base_count ;
create table t24_alter(a int);
prepare stmt from 'alter table t24_alter add column b int';
execute stmt;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop table t24_alter;
create table t24_alter(a1 int, a2 int);
execute stmt;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
alter table t24_alter drop column b;
execute stmt;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
alter table t24_alter drop column b;
execute stmt;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop table t24_alter;
drop table if exists t24_repair;
create table t24_repair(a int);
@@ -1457,36 +2202,60 @@ prepare stmt from 'repair table t24_repair';
execute stmt;
Table Op Msg_type Msg_text
test.t24_repair repair status OK
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop table t24_repair;
create table t24_repair(a1 int, a2 int);
insert into t24_repair values (1, 10), (2, 20), (3, 30);
execute stmt;
Table Op Msg_type Msg_text
test.t24_repair repair status OK
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
alter table t24_repair add column b varchar(50) default NULL;
execute stmt;
Table Op Msg_type Msg_text
test.t24_repair repair status OK
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
alter table t24_repair drop column b;
execute stmt;
Table Op Msg_type Msg_text
test.t24_repair repair status OK
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop table t24_repair;
drop table if exists t24_analyze;
create table t24_analyze(a int);
@@ -1495,36 +2264,60 @@ prepare stmt from 'analyze table t24_analyze';
execute stmt;
Table Op Msg_type Msg_text
test.t24_analyze analyze status OK
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop table t24_analyze;
create table t24_analyze(a1 int, a2 int);
insert into t24_analyze values (1, 10), (2, 20), (3, 30);
execute stmt;
Table Op Msg_type Msg_text
test.t24_analyze analyze status OK
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
alter table t24_analyze add column b varchar(50) default NULL;
execute stmt;
Table Op Msg_type Msg_text
test.t24_analyze analyze status OK
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
alter table t24_analyze drop column b;
execute stmt;
Table Op Msg_type Msg_text
test.t24_analyze analyze status OK
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop table t24_analyze;
drop table if exists t24_optimize;
create table t24_optimize(a int);
@@ -1533,176 +2326,308 @@ prepare stmt from 'optimize table t24_optimize';
execute stmt;
Table Op Msg_type Msg_text
test.t24_optimize optimize status OK
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop table t24_optimize;
create table t24_optimize(a1 int, a2 int);
insert into t24_optimize values (1, 10), (2, 20), (3, 30);
execute stmt;
Table Op Msg_type Msg_text
test.t24_optimize optimize status OK
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
alter table t24_optimize add column b varchar(50) default NULL;
execute stmt;
Table Op Msg_type Msg_text
test.t24_optimize optimize status OK
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
alter table t24_optimize drop column b;
execute stmt;
Table Op Msg_type Msg_text
test.t24_optimize optimize status OK
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop table t24_optimize;
drop procedure if exists changing_proc;
prepare stmt from 'show create procedure changing_proc';
execute stmt;
ERROR 42000: PROCEDURE changing_proc does not exist
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
ERROR 42000: PROCEDURE changing_proc does not exist
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
create procedure changing_proc() begin end;
execute stmt;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
changing_proc CREATE DEFINER=`root`@`localhost` PROCEDURE `changing_proc`()
begin end latin1 latin1_swedish_ci latin1_swedish_ci
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
changing_proc CREATE DEFINER=`root`@`localhost` PROCEDURE `changing_proc`()
begin end latin1 latin1_swedish_ci latin1_swedish_ci
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop procedure changing_proc;
create procedure changing_proc(x int, y int) begin end;
execute stmt;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
changing_proc CREATE DEFINER=`root`@`localhost` PROCEDURE `changing_proc`(x int, y int)
begin end latin1 latin1_swedish_ci latin1_swedish_ci
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
changing_proc CREATE DEFINER=`root`@`localhost` PROCEDURE `changing_proc`(x int, y int)
begin end latin1 latin1_swedish_ci latin1_swedish_ci
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop procedure changing_proc;
execute stmt;
ERROR 42000: PROCEDURE changing_proc does not exist
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
ERROR 42000: PROCEDURE changing_proc does not exist
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop function if exists changing_func;
prepare stmt from 'show create function changing_func';
execute stmt;
ERROR 42000: FUNCTION changing_func does not exist
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
ERROR 42000: FUNCTION changing_func does not exist
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
create function changing_func() returns int return 0;
execute stmt;
Function sql_mode Create Function character_set_client collation_connection Database Collation
changing_func CREATE DEFINER=`root`@`localhost` FUNCTION `changing_func`() RETURNS int(11)
return 0 latin1 latin1_swedish_ci latin1_swedish_ci
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
Function sql_mode Create Function character_set_client collation_connection Database Collation
changing_func CREATE DEFINER=`root`@`localhost` FUNCTION `changing_func`() RETURNS int(11)
return 0 latin1 latin1_swedish_ci latin1_swedish_ci
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop function changing_func;
create function changing_func(x int, y int) returns int return x+y;
execute stmt;
Function sql_mode Create Function character_set_client collation_connection Database Collation
changing_func CREATE DEFINER=`root`@`localhost` FUNCTION `changing_func`(x int, y int) RETURNS int(11)
return x+y latin1 latin1_swedish_ci latin1_swedish_ci
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
Function sql_mode Create Function character_set_client collation_connection Database Collation
changing_func CREATE DEFINER=`root`@`localhost` FUNCTION `changing_func`(x int, y int) RETURNS int(11)
return x+y latin1 latin1_swedish_ci latin1_swedish_ci
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop function changing_func;
execute stmt;
ERROR 42000: FUNCTION changing_func does not exist
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
ERROR 42000: FUNCTION changing_func does not exist
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop table if exists t24_trigger;
create table t24_trigger(a int);
prepare stmt from 'show create trigger t24_bi;';
execute stmt;
ERROR HY000: Trigger does not exist
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
ERROR HY000: Trigger does not exist
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
create trigger t24_bi before insert on t24_trigger for each row
begin
set @message= "t24_bi";
@@ -1714,239 +2639,427 @@ t24_bi CREATE DEFINER=`root`@`localhost` trigger t24_bi before insert on t24_tr
begin
set @message= "t24_bi";
end latin1 latin1_swedish_ci latin1_swedish_ci
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
t24_bi CREATE DEFINER=`root`@`localhost` trigger t24_bi before insert on t24_trigger for each row
begin
set @message= "t24_bi";
end latin1 latin1_swedish_ci latin1_swedish_ci
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop trigger t24_bi;
create trigger t24_bi before insert on t24_trigger for each row
begin
set @message= "t24_bi (2)";
end
$$
+set @expected = @expected + 1;
execute stmt;
Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
t24_bi CREATE DEFINER=`root`@`localhost` trigger t24_bi before insert on t24_trigger for each row
begin
set @message= "t24_bi (2)";
end latin1 latin1_swedish_ci latin1_swedish_ci
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
t24_bi CREATE DEFINER=`root`@`localhost` trigger t24_bi before insert on t24_trigger for each row
begin
set @message= "t24_bi (2)";
end latin1 latin1_swedish_ci latin1_swedish_ci
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop trigger t24_bi;
execute stmt;
ERROR HY000: Trigger does not exist
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
ERROR HY000: Trigger does not exist
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop table t24_trigger;
=====================================================================
Testing 25: Testing the strength of TABLE_SHARE version
=====================================================================
drop table if exists t25_num_col;
-SELECT VARIABLE_VALUE from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE'
-into @base_count ;
create table t25_num_col(a int);
-prepare stmt from 'select * from t25_num_col';
+prepare stmt from 'select a from t25_num_col';
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
alter table t25_num_col add column b varchar(50) default NULL;
+set @expected = @expected + 1;
execute stmt;
-a b
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+a
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
-a b
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+a
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop table t25_num_col;
drop table if exists t25_col_name;
create table t25_col_name(a int);
prepare stmt from 'select * from t25_col_name';
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
alter table t25_col_name change a b int;
-execute stmt;
-b
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-2
-execute stmt;
-b
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-2
+set @expected = @expected + 1;
+execute stmt;
+ERROR HY000: Prepared statement result set has changed, rebind needed
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
+set @expected = @expected + 1;
+execute stmt;
+ERROR HY000: Prepared statement result set has changed, rebind needed
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop table t25_col_name;
drop table if exists t25_col_type;
create table t25_col_type(a int);
prepare stmt from 'select * from t25_col_type';
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-2
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-2
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
alter table t25_col_type change a a varchar(10);
-execute stmt;
-a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-3
-execute stmt;
-a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-3
+set @expected = @expected + 1;
+execute stmt;
+ERROR HY000: Prepared statement result set has changed, rebind needed
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
+set @expected = @expected + 1;
+execute stmt;
+ERROR HY000: Prepared statement result set has changed, rebind needed
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop table t25_col_type;
drop table if exists t25_col_type_length;
create table t25_col_type_length(a varchar(10));
prepare stmt from 'select * from t25_col_type_length';
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-3
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-3
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
alter table t25_col_type_length change a a varchar(20);
-execute stmt;
-a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-4
-execute stmt;
-a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-4
+set @expected = @expected + 1;
+execute stmt;
+ERROR HY000: Prepared statement result set has changed, rebind needed
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
+set @expected = @expected + 1;
+execute stmt;
+ERROR HY000: Prepared statement result set has changed, rebind needed
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop table t25_col_type_length;
drop table if exists t25_col_null;
create table t25_col_null(a varchar(10));
prepare stmt from 'select * from t25_col_null';
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-4
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-4
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
alter table t25_col_null change a a varchar(10) NOT NULL;
-execute stmt;
-a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-5
-execute stmt;
-a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-5
+set @expected = @expected + 1;
+execute stmt;
+ERROR HY000: Prepared statement result set has changed, rebind needed
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
+set @expected = @expected + 1;
+execute stmt;
+ERROR HY000: Prepared statement result set has changed, rebind needed
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop table t25_col_null;
drop table if exists t25_col_default;
create table t25_col_default(a int, b int DEFAULT 10);
prepare stmt from 'insert into t25_col_default(a) values (?)';
set @val=1;
execute stmt using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-5
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
set @val=2;
execute stmt using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-5
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
alter table t25_col_default change b b int DEFAULT 20;
set @val=3;
+set @expected = @expected + 1;
execute stmt using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-5
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
set @val=4;
execute stmt using @val;
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-5
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
select * from t25_col_default;
a b
1 10
@@ -1959,29 +3072,54 @@ create table t25_index(a varchar(10));
prepare stmt from 'select * from t25_index';
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-5
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-5
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
create index i1 on t25_index(a);
+set @expected = @expected + 1;
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-6
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-6
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop table t25_index;
drop table if exists t25_index_unique;
create table t25_index_unique(a varchar(10), b varchar(10));
@@ -1996,16 +3134,28 @@ t25_index_unique CREATE TABLE `t25_index_unique` (
prepare stmt from 'select * from t25_index_unique';
execute stmt;
a b
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-6
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
a b
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-6
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
alter table t25_index_unique drop index i1;
create unique index i1 on t25_index_unique(a, b);
show create table t25_index_unique;
@@ -2015,18 +3165,31 @@ t25_index_unique CREATE TABLE `t25_index_unique` (
`b` varchar(10) DEFAULT NULL,
UNIQUE KEY `i1` (`a`,`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
+set @expected = @expected + 1;
execute stmt;
a b
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-7
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
a b
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-7
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop table t25_index_unique;
=====================================================================
Testing reported bugs
@@ -2035,9 +3198,6 @@ drop table if exists table_12093;
drop function if exists func_12093;
drop function if exists func_12093_unrelated;
drop procedure if exists proc_12093;
-SELECT VARIABLE_VALUE from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE'
-into @base_count ;
create table table_12093(a int);
create function func_12093()
returns int
@@ -2055,88 +3215,137 @@ prepare stmt_sp from 'call proc_12093(func_12093())';
execute stmt_sf;
func_12093()
0
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt_sp;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop function func_12093_unrelated;
drop procedure proc_12093_unrelated;
execute stmt_sf;
func_12093()
0
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt_sp;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt_sf;
func_12093()
0
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt_sp;
a
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
deallocate prepare stmt_sf;
deallocate prepare stmt_sp;
drop table table_12093;
drop function func_12093;
drop procedure proc_12093;
drop function if exists func_21294;
-SELECT VARIABLE_VALUE from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE'
-into @base_count ;
create function func_21294() returns int return 10;
prepare stmt from "select func_21294()";
execute stmt;
func_21294()
10
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop function func_21294;
create function func_21294() returns int return 10;
execute stmt;
func_21294()
10
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop function func_21294;
create function func_21294() returns int return 20;
+set @expected = @expected + 1;
execute stmt;
func_21294()
20
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
deallocate prepare stmt;
drop function func_21294;
drop table if exists t_27420_100;
drop table if exists t_27420_101;
drop view if exists v_27420;
-SELECT VARIABLE_VALUE from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE'
-into @base_count ;
create table t_27420_100(a int);
insert into t_27420_100 values (1), (2);
create table t_27420_101(a int);
@@ -2149,35 +3358,52 @@ execute stmt;
X Y
1 1
2 2
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop view v_27420;
create table v_27420(X int, Y int);
+set @expected = @expected + 1;
execute stmt;
X Y
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop table v_27420;
create table v_27420 (a int, b int, filler char(200));
-execute stmt;
-a b filler
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-2
+set @expected = @expected + 1;
+execute stmt;
+ERROR HY000: Prepared statement result set has changed, rebind needed
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
deallocate prepare stmt;
drop table t_27420_100;
drop table t_27420_101;
drop table v_27420;
drop table if exists t_27430_1;
drop table if exists t_27430_2;
-SELECT VARIABLE_VALUE from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE'
-into @base_count ;
create table t_27430_1 (a int not null, oref int not null, key(a));
insert into t_27430_1 values
(1, 1),
@@ -2199,20 +3425,32 @@ oref a Z
2 2 0
3 1234 0
4 1234 0
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
oref a Z
1 1 1
2 2 0
3 1234 0
4 1234 0
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop table t_27430_1, t_27430_2;
create table t_27430_1 (a int, oref int, key(a));
insert into t_27430_1 values
@@ -2227,35 +3465,38 @@ insert into t_27430_2 values
(2,2),
(NULL, 3),
(NULL, 4);
-execute stmt;
-oref a Z
-1 1 1
-2 2 0
-3 NULL NULL
-4 NULL 0
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
-execute stmt;
-oref a Z
-1 1 1
-2 2 0
-3 NULL NULL
-4 NULL 0
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+set @expected = @expected + 1;
+execute stmt;
+ERROR HY000: Prepared statement result set has changed, rebind needed
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
+set @expected = @expected + 1;
+execute stmt;
+ERROR HY000: Prepared statement result set has changed, rebind needed
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
deallocate prepare stmt;
drop table t_27430_1;
drop table t_27430_2;
drop table if exists t_27690_1;
drop view if exists v_27690_1;
drop table if exists v_27690_2;
-SELECT VARIABLE_VALUE from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE'
-into @base_count ;
create table t_27690_1 (a int, b int);
insert into t_27690_1 values (1,1),(2,2);
create table v_27690_1 as select * from t_27690_1;
@@ -2267,34 +3508,59 @@ a b a b
2 2 1 1
1 1 2 2
2 2 2 2
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
a b a b
1 1 1 1
2 2 1 1
1 1 2 2
2 2 2 2
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
drop table v_27690_1;
execute stmt;
ERROR 42S02: Table 'test.v_27690_1' doesn't exist
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
ERROR 42S02: Table 'test.v_27690_1' doesn't exist
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-0
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
create view v_27690_1 as select A.a, A.b from t_27690_1 A, t_27690_1 B;
+set @expected = @expected + 1;
execute stmt;
a b a b
1 1 1 1
@@ -2305,10 +3571,16 @@ a b a b
2 2 2 2
1 1 2 2
2 2 2 2
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
execute stmt;
a b a b
1 1 1 1
@@ -2319,10 +3591,16 @@ a b a b
2 2 2 2
1 1 2 2
2 2 2 2
-SELECT VARIABLE_VALUE - @base_count AS REPREPARED from
-INFORMATION_SCHEMA.SESSION_STATUS where variable_name='COM_STMT_REPREPARE' ;
-REPREPARED
-1
+SELECT CASE (VARIABLE_VALUE - @base_count - @expected)
+WHEN 0 THEN "PASSED"
+ ELSE "FAILED"
+ END
+AS `CHECK`,
+(VARIABLE_VALUE - @base_count - @expected) AS `OFFSET`
+ from INFORMATION_SCHEMA.SESSION_STATUS
+where variable_name='COM_STMT_REPREPARE' ;
+CHECK OFFSET
+PASSED 0
deallocate prepare stmt;
drop table t_27690_1;
drop view v_27690_1;
diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result
index ff32d2a1512..c5fcb833933 100644
--- a/mysql-test/r/show_check.result
+++ b/mysql-test/r/show_check.result
@@ -1427,4 +1427,9 @@ DROP FUNCTION f1;
DROP TABLE t1;
DROP EVENT ev1;
SHOW TABLE TYPES;
+CREATE USER test_u@localhost;
+GRANT PROCESS ON *.* TO test_u@localhost;
+SHOW ENGINE MYISAM MUTEX;
+SHOW ENGINE MYISAM STATUS;
+DROP USER test_u@localhost;
End of 5.1 tests
diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result
index c33c378340e..bc2ab13fe5f 100644
--- a/mysql-test/r/sp-error.result
+++ b/mysql-test/r/sp-error.result
@@ -1627,3 +1627,14 @@ end loop label1;
end loop;
end|
ERROR 42000: End-label label1 without match
+drop procedure if exists p1;
+create procedure p1()
+begin
+create table t1 (a int) type=MyISAM;
+drop table t1;
+end|
+Warnings:
+Warning 1287 The syntax 'TYPE=storage_engine' is deprecated and will be removed in MySQL 5.2. Please use 'ENGINE=storage_engine' instead
+call p1();
+call p1();
+drop procedure p1;
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index 50ece83b258..a68be67a8e0 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -6963,6 +6963,22 @@ END latin1 latin1_swedish_ci latin1_swedish_ci
DROP FUNCTION f1;
+drop procedure if exists p;
+set @old_mode= @@sql_mode;
+set @@sql_mode= pow(2,32)-1;
+select @@sql_mode into @full_mode;
+create procedure p() begin end;
+call p();
+select @@sql_mode;
+@@sql_mode
+REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,?,ONLY_FULL_GROUP_BY,NO_UNSIGNED_SUBTRACTION,NO_DIR_IN_CREATE,POSTGRESQL,ORACLE,MSSQL,DB2,MAXDB,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,MYSQL323,MYSQL40,ANSI,NO_AUTO_VALUE_ON_ZERO,NO_BACKSLASH_ESCAPES,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ALLOW_INVALID_DATES,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,HIGH_NOT_PRECEDENCE,NO_ENGINE_SUBSTITUTION,PAD_CHAR_TO_FULL_LENGTH
+set @@sql_mode= @old_mode;
+select replace(@full_mode, '?', 'NOT_USED') into @full_mode;
+select replace(@full_mode, 'ALLOW_INVALID_DATES', 'INVALID_DATES') into @full_mode;
+select name from mysql.proc where name = 'p' and sql_mode = @full_mode;
+name
+p
+drop procedure p;
# ------------------------------------------------------------------
# -- End of 5.1 tests
# ------------------------------------------------------------------
diff --git a/mysql-test/r/sp_trans_log.result b/mysql-test/r/sp_trans_log.result
index a835b06858b..7a6173b89e2 100644
--- a/mysql-test/r/sp_trans_log.result
+++ b/mysql-test/r/sp_trans_log.result
@@ -16,6 +16,7 @@ insert into t2 values (bug23333(),1)|
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
show binlog events from 106 /* with fixes for #23333 will show there is the query */|
Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query 1 # #
master-bin.000001 # Table_map 1 # #
master-bin.000001 # Table_map 1 # #
master-bin.000001 # Write_rows 1 # #
diff --git a/mysql-test/r/strict_autoinc_4bdb.result b/mysql-test/r/strict_autoinc_4bdb.result
deleted file mode 100644
index 2e8980e435b..00000000000
--- a/mysql-test/r/strict_autoinc_4bdb.result
+++ /dev/null
@@ -1,28 +0,0 @@
-drop table if exists t1;
-set @org_mode=@@sql_mode;
-create table t1
-(
-`a` tinyint(4) NOT NULL auto_increment,
-primary key (`a`)
-) engine = 'BDB' ;
-set @@sql_mode='strict_all_tables';
-insert into t1 values(1000);
-ERROR 22003: Out of range value for column 'a' at row 1
-select count(*) from t1;
-count(*)
-0
-set auto_increment_increment=1000;
-set auto_increment_offset=700;
-insert into t1 values(null);
-ERROR 22003: Out of range value for column 'a' at row 1
-select count(*) from t1;
-count(*)
-0
-set @@sql_mode=@org_mode;
-insert into t1 values(null);
-Warnings:
-Warning 1264 Out of range value for column 'a' at row 1
-select * from t1;
-a
-127
-drop table t1;
diff --git a/mysql-test/r/system_mysql_db.result b/mysql-test/r/system_mysql_db.result
index d1aff0fa657..171b53ebf09 100644
--- a/mysql-test/r/system_mysql_db.result
+++ b/mysql-test/r/system_mysql_db.result
@@ -201,7 +201,7 @@ proc CREATE TABLE `proc` (
`definer` char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
- `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE') NOT NULL DEFAULT '',
+ `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') NOT NULL DEFAULT '',
`comment` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
`character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
@@ -226,7 +226,7 @@ event CREATE TABLE `event` (
`ends` datetime DEFAULT NULL,
`status` enum('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL DEFAULT 'ENABLED',
`on_completion` enum('DROP','PRESERVE') NOT NULL DEFAULT 'DROP',
- `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE') NOT NULL DEFAULT '',
+ `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') NOT NULL DEFAULT '',
`comment` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
`originator` int(10) NOT NULL,
`time_zone` char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM',
diff --git a/mysql-test/r/user_var-binlog.result b/mysql-test/r/user_var-binlog.result
index b76b399c9e2..44fcfc0c478 100644
--- a/mysql-test/r/user_var-binlog.result
+++ b/mysql-test/r/user_var-binlog.result
@@ -25,11 +25,13 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-INSERT INTO t1 VALUES(@`a b`)/*!*/;
+INSERT INTO t1 VALUES(@`a b`)
+/*!*/;
SET @`var1`:=_latin1 0x273B616161 COLLATE `latin1_swedish_ci`/*!*/;
SET @`var2`:=_binary 0x61 COLLATE `binary`/*!*/;
SET TIMESTAMP=10000/*!*/;
-insert into t1 values (@var1),(@var2)/*!*/;
+insert into t1 values (@var1),(@var2)
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;