Commit dfaada19 authored by Lena Startseva's avatar Lena Startseva

MDEV-31005: Make working cursor-protocol

Updated tests: cases with bugs or which cannot be run
with the cursor-protocol were excluded with
"--disable_cursor_protocol"/"--enable_cursor_protocol"

Fix for v.10.11
parent 150468f5
...@@ -424,6 +424,7 @@ EXPLAIN SELECT * FROM t100,t10000,t10; ...@@ -424,6 +424,7 @@ EXPLAIN SELECT * FROM t100,t10000,t10;
EXPLAIN SELECT * FROM t10000,t10,t100; EXPLAIN SELECT * FROM t10000,t10,t100;
EXPLAIN SELECT * FROM t10000,t100,t10; EXPLAIN SELECT * FROM t10000,t100,t10;
--disable_cursor_protocol
###### ######
## Ordering between T100,T10000 EQ-joined T10 will ## Ordering between T100,T10000 EQ-joined T10 will
## normally be with smallest EQ-table joined first ## normally be with smallest EQ-table joined first
...@@ -492,7 +493,6 @@ WHERE t100.K=t10.I ...@@ -492,7 +493,6 @@ WHERE t100.K=t10.I
AND t10000.K=t10.K; AND t10000.K=t10.K;
--source include/check_qep.inc --source include/check_qep.inc
--echo ##### --echo #####
--echo ## EQ_REF Should be executed before table scan(ALL) --echo ## EQ_REF Should be executed before table scan(ALL)
--echo ## - Independent of #records in table being EQ_REF-joined --echo ## - Independent of #records in table being EQ_REF-joined
...@@ -715,6 +715,7 @@ SELECT COUNT(*) FROM t10,t10000 y,t10000 x ...@@ -715,6 +715,7 @@ SELECT COUNT(*) FROM t10,t10000 y,t10000 x
WHERE x.k=t10.i WHERE x.k=t10.i
AND y.i=x.k; AND y.i=x.k;
--source include/check_qep.inc --source include/check_qep.inc
--enable_cursor_protocol
######## ########
......
...@@ -297,10 +297,12 @@ CREATE FUNCTION test_func5 (s CHAR(20)) RETURNS VARCHAR(30) ...@@ -297,10 +297,12 @@ CREATE FUNCTION test_func5 (s CHAR(20)) RETURNS VARCHAR(30)
--echo # We cannot use the index due to missing condition on SPECIFIC_SCHEMA, --echo # We cannot use the index due to missing condition on SPECIFIC_SCHEMA,
--echo # but we will use SPECIFIC_NAME for filtering records from mysql.proc --echo # but we will use SPECIFIC_NAME for filtering records from mysql.proc
FLUSH STATUS; FLUSH STATUS;
--disable_cursor_protocol
--disable_ps2_protocol --disable_ps2_protocol
query_vertical SELECT * FROM INFORMATION_SCHEMA.PARAMETERS query_vertical SELECT * FROM INFORMATION_SCHEMA.PARAMETERS
WHERE SPECIFIC_NAME = 'test_func5'; WHERE SPECIFIC_NAME = 'test_func5';
--enable_ps2_protocol --enable_ps2_protocol
--enable_cursor_protocol
--replace_result $count_routines count_routines --replace_result $count_routines count_routines
SHOW STATUS LIKE 'handler_read%next'; SHOW STATUS LIKE 'handler_read%next';
...@@ -308,6 +310,7 @@ SHOW STATUS LIKE 'handler_read%next'; ...@@ -308,6 +310,7 @@ SHOW STATUS LIKE 'handler_read%next';
--echo # We cannot use the index due to CONCAT(), and filtering by SPECIFIC_NAME --echo # We cannot use the index due to CONCAT(), and filtering by SPECIFIC_NAME
--echo # does not work either since SPECIFIC_NAME = 'not_existing_proc'. See --echo # does not work either since SPECIFIC_NAME = 'not_existing_proc'. See
--echo # the difference in counters in comparison to the previous test --echo # the difference in counters in comparison to the previous test
--disable_cursor_protocol
--disable_ps2_protocol --disable_ps2_protocol
FLUSH STATUS; FLUSH STATUS;
query_vertical SELECT * FROM INFORMATION_SCHEMA.PARAMETERS query_vertical SELECT * FROM INFORMATION_SCHEMA.PARAMETERS
...@@ -342,6 +345,7 @@ query_vertical SELECT * FROM INFORMATION_SCHEMA.PARAMETERS ...@@ -342,6 +345,7 @@ query_vertical SELECT * FROM INFORMATION_SCHEMA.PARAMETERS
AND SPECIFIC_NAME = 'процедурка'; AND SPECIFIC_NAME = 'процедурка';
SHOW STATUS LIKE 'handler_read%next'; SHOW STATUS LIKE 'handler_read%next';
--enable_ps2_protocol --enable_ps2_protocol
--enable_cursor_protocol
--replace_column 1 # --replace_column 1 #
SELECT COUNT(*) FROM information_schema.PARAMETERS SELECT COUNT(*) FROM information_schema.PARAMETERS
......
...@@ -270,11 +270,13 @@ CREATE FUNCTION test_func5 (s CHAR(20)) RETURNS VARCHAR(30) ...@@ -270,11 +270,13 @@ CREATE FUNCTION test_func5 (s CHAR(20)) RETURNS VARCHAR(30)
--echo # We cannot use the index due to missing condition on SPECIFIC_SCHEMA, --echo # We cannot use the index due to missing condition on SPECIFIC_SCHEMA,
--echo # but we will use ROUTINE_NAME for filtering records from mysql.proc --echo # but we will use ROUTINE_NAME for filtering records from mysql.proc
FLUSH STATUS; FLUSH STATUS;
--disable_cursor_protocol
--disable_ps2_protocol --disable_ps2_protocol
--replace_column 24 <created> 25 <modified> --replace_column 24 <created> 25 <modified>
query_vertical SELECT * FROM INFORMATION_SCHEMA.ROUTINES query_vertical SELECT * FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_NAME = 'test_func5'; WHERE ROUTINE_NAME = 'test_func5';
--enable_ps2_protocol --enable_ps2_protocol
--enable_cursor_protocol
--replace_result $count_routines count_routines --replace_result $count_routines count_routines
SHOW STATUS LIKE 'handler_read%next'; SHOW STATUS LIKE 'handler_read%next';
...@@ -282,6 +284,7 @@ SHOW STATUS LIKE 'handler_read%next'; ...@@ -282,6 +284,7 @@ SHOW STATUS LIKE 'handler_read%next';
--echo # We cannot use the index due to CONCAT(), and filtering by ROUTINE_NAME --echo # We cannot use the index due to CONCAT(), and filtering by ROUTINE_NAME
--echo # does not work either since ROUTINE_NAME = 'not_existing_proc'. See --echo # does not work either since ROUTINE_NAME = 'not_existing_proc'. See
--echo # the difference in counters in comparison to the previous test --echo # the difference in counters in comparison to the previous test
--disable_cursor_protocol
--disable_ps2_protocol --disable_ps2_protocol
FLUSH STATUS; FLUSH STATUS;
query_vertical SELECT * FROM INFORMATION_SCHEMA.ROUTINES query_vertical SELECT * FROM INFORMATION_SCHEMA.ROUTINES
...@@ -320,6 +323,7 @@ query_vertical SELECT * FROM INFORMATION_SCHEMA.ROUTINES ...@@ -320,6 +323,7 @@ query_vertical SELECT * FROM INFORMATION_SCHEMA.ROUTINES
AND ROUTINE_NAME = 'процедурка'; AND ROUTINE_NAME = 'процедурка';
SHOW STATUS LIKE 'handler_read%next'; SHOW STATUS LIKE 'handler_read%next';
--enable_ps2_protocol --enable_ps2_protocol
--enable_cursor_protocol
--echo # --echo #
--echo # Test SHOW PROCEDURE STATUS. It's impossible to use the index here --echo # Test SHOW PROCEDURE STATUS. It's impossible to use the index here
......
...@@ -1187,8 +1187,10 @@ DROP TABLE t; ...@@ -1187,8 +1187,10 @@ DROP TABLE t;
--echo # --echo #
CREATE TABLE t1 (a VARCHAR(8), PRIMARY KEY(a DESC)) ENGINE=InnoDB; CREATE TABLE t1 (a VARCHAR(8), PRIMARY KEY(a DESC)) ENGINE=InnoDB;
ALTER TABLE t1 RENAME COLUMN a TO b, ALGORITHM=INPLACE; ALTER TABLE t1 RENAME COLUMN a TO b, ALGORITHM=INPLACE;
--disable_cursor_protocol
SELECT TABLE_ID INTO @table_id FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME="test/t1"; SELECT TABLE_ID INTO @table_id FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME="test/t1";
SELECT INDEX_ID INTO @index_id FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES WHERE TABLE_ID = @table_id; SELECT INDEX_ID INTO @index_id FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES WHERE TABLE_ID = @table_id;
--enable_cursor_protocol
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_FIELDS WHERE INDEX_ID=@index_id; SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_FIELDS WHERE INDEX_ID=@index_id;
DROP TABLE t1; DROP TABLE t1;
...@@ -1217,8 +1219,10 @@ DROP TABLE t1; ...@@ -1217,8 +1219,10 @@ DROP TABLE t1;
CREATE TABLE t1 (id INT PRIMARY KEY, a CHAR(8), b INT, KEY(a DESC,b)) ENGINE=InnoDB; CREATE TABLE t1 (id INT PRIMARY KEY, a CHAR(8), b INT, KEY(a DESC,b)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1,'foo',10); INSERT INTO t1 VALUES (1,'foo',10);
ALTER TABLE t1 RENAME COLUMN b TO c, ALGORITHM=INPLACE; ALTER TABLE t1 RENAME COLUMN b TO c, ALGORITHM=INPLACE;
--disable_cursor_protocol
SELECT TABLE_ID INTO @table_id FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME="test/t1"; SELECT TABLE_ID INTO @table_id FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME="test/t1";
SELECT INDEX_ID INTO @index_id FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES WHERE TABLE_ID = @table_id ORDER BY INDEX_ID DESC LIMIT 1; SELECT INDEX_ID INTO @index_id FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES WHERE TABLE_ID = @table_id ORDER BY INDEX_ID DESC LIMIT 1;
--enable_cursor_protocol
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_FIELDS WHERE INDEX_ID=@index_id; SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_FIELDS WHERE INDEX_ID=@index_id;
DROP TABLE t1; DROP TABLE t1;
......
...@@ -21,15 +21,19 @@ SET GLOBAL innodb_fast_shutdown = 0; ...@@ -21,15 +21,19 @@ SET GLOBAL innodb_fast_shutdown = 0;
--source include/restart_mysqld.inc --source include/restart_mysqld.inc
let $status=`SHOW ENGINE INNODB STATUS`; let $status=`SHOW ENGINE INNODB STATUS`;
--disable_cursor_protocol
SELECT CAST(variable_value AS INTEGER) INTO @read1 SELECT CAST(variable_value AS INTEGER) INTO @read1
FROM INFORMATION_SCHEMA.GLOBAL_STATUS FROM INFORMATION_SCHEMA.GLOBAL_STATUS
WHERE VARIABLE_NAME='innodb_buffer_pool_read_requests'; WHERE VARIABLE_NAME='innodb_buffer_pool_read_requests';
--enable_cursor_protocol
select * from t1; select * from t1;
--disable_cursor_protocol
SELECT CAST(variable_value AS INTEGER) INTO @read2 SELECT CAST(variable_value AS INTEGER) INTO @read2
FROM INFORMATION_SCHEMA.GLOBAL_STATUS FROM INFORMATION_SCHEMA.GLOBAL_STATUS
WHERE VARIABLE_NAME='innodb_buffer_pool_read_requests'; WHERE VARIABLE_NAME='innodb_buffer_pool_read_requests';
--enable_cursor_protocol
SELECT @read1>0, @read2>@read1; SELECT @read1>0, @read2>@read1;
......
...@@ -560,9 +560,11 @@ DROP TABLE t; ...@@ -560,9 +560,11 @@ DROP TABLE t;
--echo # --echo #
CREATE TABLE t (id INT) ENGINE=InnoDB; CREATE TABLE t (id INT) ENGINE=InnoDB;
--replace_result $MYSQLTEST_VARDIR VARDIR --replace_result $MYSQLTEST_VARDIR VARDIR
--disable_cursor_protocol
--disable_ps2_protocol --disable_ps2_protocol
eval select 1 into outfile "$MYSQLTEST_VARDIR/tmp/t.outfile"; eval select 1 into outfile "$MYSQLTEST_VARDIR/tmp/t.outfile";
--enable_ps2_protocol --enable_ps2_protocol
--enable_cursor_protocol
BEGIN; BEGIN;
--replace_result $MYSQLTEST_VARDIR VARDIR --replace_result $MYSQLTEST_VARDIR VARDIR
eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/t.outfile' INTO TABLE t; eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/t.outfile' INTO TABLE t;
......
...@@ -24,9 +24,11 @@ SET GLOBAL innodb_limit_optimistic_insert_debug=@save_limit; ...@@ -24,9 +24,11 @@ SET GLOBAL innodb_limit_optimistic_insert_debug=@save_limit;
DROP TABLE t1; DROP TABLE t1;
--disable_cursor_protocol
SELECT CAST(VARIABLE_VALUE AS INTEGER) INTO @dirty_prev SELECT CAST(VARIABLE_VALUE AS INTEGER) INTO @dirty_prev
FROM INFORMATION_SCHEMA.GLOBAL_STATUS FROM INFORMATION_SCHEMA.GLOBAL_STATUS
WHERE VARIABLE_NAME='Innodb_buffer_pool_pages_dirty'; WHERE VARIABLE_NAME='Innodb_buffer_pool_pages_dirty';
--enable_cursor_protocol
set debug_dbug="d,trigger_garbage_collection"; set debug_dbug="d,trigger_garbage_collection";
SET GLOBAL innodb_buffer_pool_size=@@innodb_buffer_pool_size; SET GLOBAL innodb_buffer_pool_size=@@innodb_buffer_pool_size;
......
...@@ -21,7 +21,9 @@ select * from information_schema.session_variables where variable_name='innodb_r ...@@ -21,7 +21,9 @@ select * from information_schema.session_variables where variable_name='innodb_r
# #
# show that it's not read-only # show that it's not read-only
# #
--disable_cursor_protocol
select @@innodb_read_io_threads into @n; select @@innodb_read_io_threads into @n;
--enable_cursor_protocol
--disable_warnings --disable_warnings
set global innodb_read_io_threads = 1; set global innodb_read_io_threads = 1;
--enable_warnings --enable_warnings
......
...@@ -21,7 +21,9 @@ select * from information_schema.session_variables where variable_name='innodb_w ...@@ -21,7 +21,9 @@ select * from information_schema.session_variables where variable_name='innodb_w
# #
# show that it's not read-only # show that it's not read-only
# #
--disable_cursor_protocol
select @@innodb_write_io_threads into @n; select @@innodb_write_io_threads into @n;
--enable_cursor_protocol
--disable_warnings --disable_warnings
set global innodb_write_io_threads=1; set global innodb_write_io_threads=1;
--enable_warnings --enable_warnings
......
...@@ -38,8 +38,10 @@ insert into t1 values (1), (2); ...@@ -38,8 +38,10 @@ insert into t1 values (1), (2);
set timestamp=unix_timestamp('2011-11-11 11:11:11.111111'); set timestamp=unix_timestamp('2011-11-11 11:11:11.111111');
delete from t1 where x = 1; delete from t1 where x = 1;
set timestamp=default; set timestamp=default;
--disable_cursor_protocol
select row_start, row_end into @s1, @e1 from t1 for system_time all where x = 1; select row_start, row_end into @s1, @e1 from t1 for system_time all where x = 1;
select row_start, row_end into @s2, @e2 from t1 for system_time all where x = 2; select row_start, row_end into @s2, @e2 from t1 for system_time all where x = 2;
--enable_cursor_protocol
create or replace table t2 ( create or replace table t2 (
x int, x int,
......
...@@ -192,9 +192,11 @@ replace into t3 values (0, '1980-01-01 00:00:00', '1981-01-01 00:00:00'); ...@@ -192,9 +192,11 @@ replace into t3 values (0, '1980-01-01 00:00:00', '1981-01-01 00:00:00');
--echo # LOAD DATA --echo # LOAD DATA
--let DATAFILE= $MYSQLTEST_VARDIR/tmp/test_versioning_t3.data --let DATAFILE= $MYSQLTEST_VARDIR/tmp/test_versioning_t3.data
--replace_result $DATAFILE DATAFILE --replace_result $DATAFILE DATAFILE
--disable_cursor_protocol
--disable_ps2_protocol --disable_ps2_protocol
eval select x, row_start, row_end into outfile '$DATAFILE' from t1 for system_time all; eval select x, row_start, row_end into outfile '$DATAFILE' from t1 for system_time all;
--enable_ps2_protocol --enable_ps2_protocol
--enable_cursor_protocol
create or replace table t2 like t1; create or replace table t2 like t1;
--replace_result $default_engine DEFAULT_ENGINE --replace_result $default_engine DEFAULT_ENGINE
show create table t2; show create table t2;
...@@ -251,9 +253,11 @@ set sql_mode='STRICT_ALL_TABLES'; ...@@ -251,9 +253,11 @@ set sql_mode='STRICT_ALL_TABLES';
create or replace table t1 (a int) with system versioning; create or replace table t1 (a int) with system versioning;
set system_versioning_insert_history= on; set system_versioning_insert_history= on;
insert into t1 (a,row_start,row_end) values (1,'2022-01-01','2023-01-01'),(1,'2022-01-01','2023-01-01'); insert into t1 (a,row_start,row_end) values (1,'2022-01-01','2023-01-01'),(1,'2022-01-01','2023-01-01');
--disable_cursor_protocol
--disable_ps2_protocol --disable_ps2_protocol
select a,row_start,row_end into outfile 'mdev29813.txt' from t1 for system_time all; select a,row_start,row_end into outfile 'mdev29813.txt' from t1 for system_time all;
--enable_ps2_protocol --enable_ps2_protocol
--enable_cursor_protocol
create or replace table t1 (a int primary key) with system versioning; create or replace table t1 (a int primary key) with system versioning;
load data infile 'mdev29813.txt' ignore into table t1 (a,row_start,row_end); load data infile 'mdev29813.txt' ignore into table t1 (a,row_start,row_end);
......
...@@ -2212,9 +2212,11 @@ create or replace table t1 (x int primary key) with system versioning ...@@ -2212,9 +2212,11 @@ create or replace table t1 (x int primary key) with system versioning
partition by system_time interval 1 hour auto; partition by system_time interval 1 hour auto;
insert t1 values (1), (2), (3); insert t1 values (1), (2), (3);
--disable_cursor_protocol
--disable_ps2_protocol --disable_ps2_protocol
select x into outfile 'MDEV-17554.data' from t1; select x into outfile 'MDEV-17554.data' from t1;
--enable_ps2_protocol --enable_ps2_protocol
--enable_cursor_protocol
set timestamp= unix_timestamp('2000-01-01 01:00:00'); set timestamp= unix_timestamp('2000-01-01 01:00:00');
load data infile 'MDEV-17554.data' replace into table t1 (x); load data infile 'MDEV-17554.data' replace into table t1 (x);
......
...@@ -414,9 +414,11 @@ select row_start = '1980-01-01 00:00:00', row_end = '1980-01-01 00:00:01' from t ...@@ -414,9 +414,11 @@ select row_start = '1980-01-01 00:00:00', row_end = '1980-01-01 00:00:01' from t
connection master; connection master;
--let DATAFILE= $MYSQLTEST_VARDIR/tmp/test_versioning_t3.data --let DATAFILE= $MYSQLTEST_VARDIR/tmp/test_versioning_t3.data
--replace_result $DATAFILE DATAFILE --replace_result $DATAFILE DATAFILE
--disable_cursor_protocol
--disable_ps2_protocol --disable_ps2_protocol
eval select x, row_start, row_end into outfile '$DATAFILE' from t1 for system_time all; eval select x, row_start, row_end into outfile '$DATAFILE' from t1 for system_time all;
--enable_ps2_protocol --enable_ps2_protocol
--enable_cursor_protocol
create or replace table t3 like t1; create or replace table t3 like t1;
set @@system_versioning_insert_history= 1; set @@system_versioning_insert_history= 1;
--replace_result $DATAFILE DATAFILE --replace_result $DATAFILE DATAFILE
......
...@@ -24,10 +24,12 @@ DROP TABLE t1; ...@@ -24,10 +24,12 @@ DROP TABLE t1;
CREATE TABLE t1 (a INET4); CREATE TABLE t1 (a INET4);
INSERT INTO t1 VALUES ('0.0.0.1'); INSERT INTO t1 VALUES ('0.0.0.1');
--disable_cursor_protocol
--enable_metadata --enable_metadata
SELECT * FROM t1; SELECT * FROM t1;
SELECT CAST('0.0.0.1' AS INET4) AS a; SELECT CAST('0.0.0.1' AS INET4) AS a;
--disable_metadata --disable_metadata
--enable_cursor_protocol
DROP TABLE t1; DROP TABLE t1;
...@@ -1290,6 +1292,7 @@ DROP TABLE t1; ...@@ -1290,6 +1292,7 @@ DROP TABLE t1;
--echo # --echo #
CREATE TABLE t1 (a INET4); CREATE TABLE t1 (a INET4);
--disable_cursor_protocol
--enable_metadata --enable_metadata
SELECT SELECT
CAST(a AS BINARY(0)), CAST(a AS BINARY(0)),
...@@ -1308,6 +1311,7 @@ SELECT ...@@ -1308,6 +1311,7 @@ SELECT
CAST(a AS BINARY(16777216)) CAST(a AS BINARY(16777216))
FROM t1; FROM t1;
--disable_metadata --disable_metadata
--enable_cursor_protocol
DROP TABLE t1; DROP TABLE t1;
--echo # --echo #
......
...@@ -20,10 +20,12 @@ DROP TABLE t1; ...@@ -20,10 +20,12 @@ DROP TABLE t1;
CREATE TABLE t1 (a UUID); CREATE TABLE t1 (a UUID);
INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001'); INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
--disable_cursor_protocol
--enable_metadata --enable_metadata
SELECT * FROM t1; SELECT * FROM t1;
SELECT CAST('00000000-0000-0000-0000-000000000001' AS UUID) AS a; SELECT CAST('00000000-0000-0000-0000-000000000001' AS UUID) AS a;
--disable_metadata --disable_metadata
--enable_cursor_protocol
DROP TABLE t1; DROP TABLE t1;
...@@ -1587,6 +1589,7 @@ DROP TABLE t1; ...@@ -1587,6 +1589,7 @@ DROP TABLE t1;
--echo # --echo #
CREATE TABLE t1 (a UUID); CREATE TABLE t1 (a UUID);
--disable_cursor_protocol
--enable_metadata --enable_metadata
SELECT SELECT
CAST(a AS BINARY(0)), CAST(a AS BINARY(0)),
...@@ -1605,6 +1608,7 @@ SELECT ...@@ -1605,6 +1608,7 @@ SELECT
CAST(a AS BINARY(16777216)) CAST(a AS BINARY(16777216))
FROM t1; FROM t1;
--disable_metadata --disable_metadata
--enable_cursor_protocol
DROP TABLE t1; DROP TABLE t1;
--echo # --echo #
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment