Commit b94bea25 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 4e5c8a46
......@@ -424,6 +424,7 @@ EXPLAIN SELECT * FROM t100,t10000,t10;
EXPLAIN SELECT * FROM t10000,t10,t100;
EXPLAIN SELECT * FROM t10000,t100,t10;
--disable_cursor_protocol
######
## Ordering between T100,T10000 EQ-joined T10 will
## normally be with smallest EQ-table joined first
......@@ -492,7 +493,6 @@ WHERE t100.K=t10.I
AND t10000.K=t10.K;
--source include/check_qep.inc
#####
## EQ_REF Should be executed before table scan(ALL)
## - Independent of #records in table being EQ_REF-joined
......@@ -715,6 +715,7 @@ SELECT COUNT(*) FROM t10,t10000 y,t10000 x
WHERE x.k=t10.i
AND y.i=x.k;
--source include/check_qep.inc
--enable_cursor_protocol
########
......
......@@ -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 # but we will use SPECIFIC_NAME for filtering records from mysql.proc
FLUSH STATUS;
--disable_cursor_protocol
--disable_ps2_protocol
query_vertical SELECT * FROM INFORMATION_SCHEMA.PARAMETERS
WHERE SPECIFIC_NAME = 'test_func5';
--enable_ps2_protocol
--enable_cursor_protocol
--replace_result $count_routines count_routines
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 # does not work either since SPECIFIC_NAME = 'not_existing_proc'. See
--echo # the difference in counters in comparison to the previous test
--disable_cursor_protocol
--disable_ps2_protocol
FLUSH STATUS;
query_vertical SELECT * FROM INFORMATION_SCHEMA.PARAMETERS
......@@ -342,6 +345,7 @@ query_vertical SELECT * FROM INFORMATION_SCHEMA.PARAMETERS
AND SPECIFIC_NAME = 'процедурка';
SHOW STATUS LIKE 'handler_read%next';
--enable_ps2_protocol
--enable_cursor_protocol
--replace_column 1 #
SELECT COUNT(*) FROM information_schema.PARAMETERS
......
......@@ -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 # but we will use ROUTINE_NAME for filtering records from mysql.proc
FLUSH STATUS;
--disable_cursor_protocol
--disable_ps2_protocol
--replace_column 24 <created> 25 <modified>
query_vertical SELECT * FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_NAME = 'test_func5';
--enable_ps2_protocol
--enable_cursor_protocol
--replace_result $count_routines count_routines
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 # does not work either since ROUTINE_NAME = 'not_existing_proc'. See
--echo # the difference in counters in comparison to the previous test
--disable_cursor_protocol
--disable_ps2_protocol
FLUSH STATUS;
query_vertical SELECT * FROM INFORMATION_SCHEMA.ROUTINES
......@@ -320,6 +323,7 @@ query_vertical SELECT * FROM INFORMATION_SCHEMA.ROUTINES
AND ROUTINE_NAME = 'процедурка';
SHOW STATUS LIKE 'handler_read%next';
--enable_ps2_protocol
--enable_cursor_protocol
--echo #
--echo # Test SHOW PROCEDURE STATUS. It's impossible to use the index here
......
......@@ -1187,8 +1187,10 @@ DROP TABLE t;
--echo #
CREATE TABLE t1 (a VARCHAR(8), PRIMARY KEY(a DESC)) ENGINE=InnoDB;
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 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;
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;
INSERT INTO t1 VALUES (1,'foo',10);
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 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;
DROP TABLE t1;
......
......@@ -21,15 +21,19 @@ SET GLOBAL innodb_fast_shutdown = 0;
--source include/restart_mysqld.inc
let $status=`SHOW ENGINE INNODB STATUS`;
--disable_cursor_protocol
SELECT CAST(variable_value AS INTEGER) INTO @read1
FROM INFORMATION_SCHEMA.GLOBAL_STATUS
WHERE VARIABLE_NAME='innodb_buffer_pool_read_requests';
--enable_cursor_protocol
select * from t1;
--disable_cursor_protocol
SELECT CAST(variable_value AS INTEGER) INTO @read2
FROM INFORMATION_SCHEMA.GLOBAL_STATUS
WHERE VARIABLE_NAME='innodb_buffer_pool_read_requests';
--enable_cursor_protocol
SELECT @read1>0, @read2>@read1;
......
......@@ -560,9 +560,11 @@ DROP TABLE t;
--echo #
CREATE TABLE t (id INT) ENGINE=InnoDB;
--replace_result $MYSQLTEST_VARDIR VARDIR
--disable_cursor_protocol
--disable_ps2_protocol
eval select 1 into outfile "$MYSQLTEST_VARDIR/tmp/t.outfile";
--enable_ps2_protocol
--enable_cursor_protocol
BEGIN;
--replace_result $MYSQLTEST_VARDIR VARDIR
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;
DROP TABLE t1;
--disable_cursor_protocol
SELECT CAST(VARIABLE_VALUE AS INTEGER) INTO @dirty_prev
FROM INFORMATION_SCHEMA.GLOBAL_STATUS
WHERE VARIABLE_NAME='Innodb_buffer_pool_pages_dirty';
--enable_cursor_protocol
set debug_dbug="d,trigger_garbage_collection";
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
#
# show that it's not read-only
#
--disable_cursor_protocol
select @@innodb_read_io_threads into @n;
--enable_cursor_protocol
--disable_warnings
set global innodb_read_io_threads = 1;
--enable_warnings
......
......@@ -21,7 +21,9 @@ select * from information_schema.session_variables where variable_name='innodb_w
#
# show that it's not read-only
#
--disable_cursor_protocol
select @@innodb_write_io_threads into @n;
--enable_cursor_protocol
--disable_warnings
set global innodb_write_io_threads=1;
--enable_warnings
......
......@@ -38,8 +38,10 @@ insert into t1 values (1), (2);
set timestamp=unix_timestamp('2011-11-11 11:11:11.111111');
delete from t1 where x = 1;
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 @s2, @e2 from t1 for system_time all where x = 2;
--enable_cursor_protocol
create or replace table t2 (
x int,
......
......@@ -192,9 +192,11 @@ replace into t3 values (0, '1980-01-01 00:00:00', '1981-01-01 00:00:00');
--echo # LOAD DATA
--let DATAFILE= $MYSQLTEST_VARDIR/tmp/test_versioning_t3.data
--replace_result $DATAFILE DATAFILE
--disable_cursor_protocol
--disable_ps2_protocol
eval select x, row_start, row_end into outfile '$DATAFILE' from t1 for system_time all;
--enable_ps2_protocol
--enable_cursor_protocol
create or replace table t2 like t1;
--replace_result $default_engine DEFAULT_ENGINE
show create table t2;
......@@ -251,9 +253,11 @@ set sql_mode='STRICT_ALL_TABLES';
create or replace table t1 (a int) with system versioning;
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');
--disable_cursor_protocol
--disable_ps2_protocol
select a,row_start,row_end into outfile 'mdev29813.txt' from t1 for system_time all;
--enable_ps2_protocol
--enable_cursor_protocol
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);
......
......@@ -2212,9 +2212,11 @@ create or replace table t1 (x int primary key) with system versioning
partition by system_time interval 1 hour auto;
insert t1 values (1), (2), (3);
--disable_cursor_protocol
--disable_ps2_protocol
select x into outfile 'MDEV-17554.data' from t1;
--enable_ps2_protocol
--enable_cursor_protocol
set timestamp= unix_timestamp('2000-01-01 01:00:00');
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
connection master;
--let DATAFILE= $MYSQLTEST_VARDIR/tmp/test_versioning_t3.data
--replace_result $DATAFILE DATAFILE
--disable_cursor_protocol
--disable_ps2_protocol
eval select x, row_start, row_end into outfile '$DATAFILE' from t1 for system_time all;
--enable_ps2_protocol
--enable_cursor_protocol
create or replace table t3 like t1;
set @@system_versioning_insert_history= 1;
--replace_result $DATAFILE DATAFILE
......
......@@ -24,10 +24,12 @@ DROP TABLE t1;
CREATE TABLE t1 (a INET4);
INSERT INTO t1 VALUES ('0.0.0.1');
--disable_cursor_protocol
--enable_metadata
SELECT * FROM t1;
SELECT CAST('0.0.0.1' AS INET4) AS a;
--disable_metadata
--enable_cursor_protocol
DROP TABLE t1;
......@@ -1290,6 +1292,7 @@ DROP TABLE t1;
--echo #
CREATE TABLE t1 (a INET4);
--disable_cursor_protocol
--enable_metadata
SELECT
CAST(a AS BINARY(0)),
......@@ -1308,6 +1311,7 @@ SELECT
CAST(a AS BINARY(16777216))
FROM t1;
--disable_metadata
--enable_cursor_protocol
DROP TABLE t1;
--echo #
......
......@@ -20,10 +20,12 @@ DROP TABLE t1;
CREATE TABLE t1 (a UUID);
INSERT INTO t1 VALUES ('00000000-0000-0000-0000-000000000001');
--disable_cursor_protocol
--enable_metadata
SELECT * FROM t1;
SELECT CAST('00000000-0000-0000-0000-000000000001' AS UUID) AS a;
--disable_metadata
--enable_cursor_protocol
DROP TABLE t1;
......@@ -1587,6 +1589,7 @@ DROP TABLE t1;
--echo #
CREATE TABLE t1 (a UUID);
--disable_cursor_protocol
--enable_metadata
SELECT
CAST(a AS BINARY(0)),
......@@ -1605,6 +1608,7 @@ SELECT
CAST(a AS BINARY(16777216))
FROM t1;
--disable_metadata
--enable_cursor_protocol
DROP TABLE t1;
--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