Commit 45562df1 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.6
parent f0ef60f2
......@@ -19,9 +19,11 @@ SET @@global.slow_query_log = ON;
create table t1 (a int);
INSERT INTO t1 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
--disable_cursor_protocol
--disable_ps2_protocol
select * from t1 where a<3;
--enable_ps2_protocol
--enable_cursor_protocol
drop table t1;
let SLOW_LOG_FILE= `select @@slow_query_log_file`;
......
#
# simple test of all group functions
#
if (`SELECT $PS_PROTOCOL != 0`)
if (`SELECT $PS_PROTOCOL + $CURSOR_PROTOCOL > 0`)
{
--skip Test temporarily disabled for ps-protocol
--skip Test temporarily disabled for ps-protocol and cursor-protocol
}
set @sav_dpi= @@div_precision_increment;
......
......@@ -313,7 +313,9 @@ connection default;
set debug_sync='now WAIT_FOR go0';
set debug_sync='found_killee SIGNAL go1 WAIT_FOR go2';
evalp kill $id;
--disable_cursor_protocol
select variable_value into @threads_cached from information_schema.global_status where variable_name='threads_cached';
--enable_cursor_protocol
set debug_sync='now SIGNAL go3';
if (`select @@thread_handling != 'pool-of-threads'`) {
# cannot check that a thread was added to thread pool on windows, but the test works there w/o the wait
......
......@@ -152,6 +152,7 @@ DROP USER test2@localhost;
--echo # MYSQL 8
--echo #
--disable_cursor_protocol
--enable_prepare_warnings
SELECT 1 FROM DUAL LIMIT 1 INTO @var FOR UPDATE;
SELECT 1 FROM DUAL LIMIT 1 FOR UPDATE INTO @var;
......@@ -163,3 +164,4 @@ SELECT 1 FROM DUAL LIMIT 1 INTO @var FOR UPDATE INTO @var;
SELECT 1 UNION SELECT 1 FOR UPDATE INTO @var;
SELECT 1 UNION SELECT 1 INTO @var FOR UPDATE;
--disable_prepare_warnings
--enable_cursor_protocol
......@@ -44,6 +44,7 @@ show fields from mysql.slow_log;
#
# Check flush command
#
--disable_cursor_protocol
--disable_ps2_protocol
flush slow logs;
......@@ -121,6 +122,7 @@ show session status like 'Slow_queries';
drop table t;
--enable_ps2_protocol
--enable_cursor_protocol
--echo #
--echo # End of 10.3 tests
......@@ -144,6 +146,7 @@ CREATE TABLE `tab_MDEV_30820` (
PRIMARY KEY (`id`)
);
--disable_cursor_protocol
--disable_ps2_protocol
--disable_view_protocol
......@@ -188,7 +191,7 @@ drop function get_zero;
--enable_view_protocol
--enable_ps2_protocol
--enable_view_protocol
--enable_cursor_protocol
--echo # End of 10.4 tests
......
......@@ -30,9 +30,11 @@ SET SESSION log_slow_verbosity='innodb,query_plan';
--let log_file=$log_slow_prefix-verbosity_1
--source include/log_slow_start.inc
--disable_cursor_protocol
--disable_ps2_protocol
SELECT sum(a+b) FROM t1;
--enable_ps2_protocol
--enable_cursor_protocol
UPDATE t1 set b=b+1 where a=1 or a=999;
--source include/log_slow_stop.inc
......@@ -51,9 +53,11 @@ SET SESSION log_slow_verbosity='innodb,query_plan';
--let log_file=$log_slow_prefix-verbosity_2
--source include/log_slow_start.inc
--disable_cursor_protocol
--disable_ps2_protocol
SELECT 1;
--enable_ps2_protocol
--enable_cursor_protocol
--source include/log_slow_stop.inc
--let log_slow_verbosity_expected_matches= 2
......
......@@ -16,6 +16,7 @@ connect (con2,localhost,root,,);
#
# Bug #27638: slow logging to CSV table inserts bad query_time and lock_time values
#
--disable_cursor_protocol
--disable_ps2_protocol
connection con1;
set session long_query_time=10;
......@@ -38,5 +39,5 @@ connection default;
disconnect con1;
disconnect con2;
--enable_ps2_protocol
--enable_cursor_protocol
set @@global.log_output = @log_output.saved;
......@@ -1042,6 +1042,7 @@ unlock tables;
--echo #
--echo # MDEV-33267 User with minimal permissions can intentionally corrupt mysql.slow_log table
--echo #
--disable_cursor_protocol
truncate mysql.slow_log;
set global log_output= 'TABLE';
create user u@localhost;
......@@ -1057,6 +1058,7 @@ select 'after evil-doing', sleep(0.2);
select distinct sql_text from mysql.slow_log where sql_text like '%evil%';
set global log_output=default;
drop user u@localhost;
--enable_cursor_protocol
SET @@global.log_output= @old_log_output;
SET @@global.slow_query_log= @old_slow_query_log;
......
......@@ -75,7 +75,9 @@ let $restart_parameters=--ssl-key=$ssl_key --ssl-cert=$ssl_cert;
--source include/restart_mysqld.inc
connect ssl_con,localhost,root,,,,,SSL;
--disable_cursor_protocol
SELECT VARIABLE_VALUE INTO @ssl_not_after FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='Ssl_server_not_after';
--enable_cursor_protocol
let $ssl_not_after=`SELECT @ssl_not_after`;
remove_file $ssl_cert;
......
if (`SELECT $PS_PROTOCOL != 0`)
if (`SELECT $PS_PROTOCOL + $CURSOR_PROTOCOL > 0`)
{
--skip Test temporarily disabled for ps-protocol
--skip Test temporarily disabled for ps-protocol and cursor-protocol
}
#
# These tests are designed to cause an internal parser stack overflow,
......
--source include/have_innodb.inc
if (`SELECT $PS_PROTOCOL != 0`)
if (`SELECT $PS_PROTOCOL + $CURSOR_PROTOCOL > 0`)
{
--skip Need regular protocol but ps-protocol was specified
--skip Need regular protocol but ps-protocol and cursor-protocol were specified
}
SET @save_storage_engine= @@default_storage_engine;
......
--source include/not_embedded.inc
--source include/have_innodb.inc
if (`SELECT $PS_PROTOCOL != 0`)
if (`SELECT $PS_PROTOCOL + $CURSOR_PROTOCOL > 0`)
{
--skip Need regular protocol but ps-protocol was specified
--skip Test temporarily disabled for ps-protocol and cursor-protocol
}
SET @save_storage_engine= @@default_storage_engine;
......
......@@ -1863,7 +1863,9 @@ create table t1 (a text);
insert into t1 values ('{"a":"foo"}');
flush status;
SHOW STATUS LIKE 'Qcache_inserts';
--disable_cursor_protocol
select * from t1, json_table(t1.a, '$' columns (f varchar(20) path '$.a')) as jt;
--enable_cursor_protocol
SHOW STATUS LIKE 'Qcache_inserts';
drop table t1;
......
......@@ -976,6 +976,7 @@ SET STATEMENT keycache1.key_buffer_size=1024 FOR SELECT 1;
#
# MDEV-6940: SET STATEMENT executed after SET GLOBAL does not work
#
--disable_cursor_protocol
--disable_ps2_protocol
--disable_view_protocol
set @save_general_log=@@global.general_log;
......@@ -1040,6 +1041,7 @@ select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_ti
--echo #---
--enable_view_protocol
--enable_ps2_protocol
--enable_cursor_protocol
#
# log_slow_verbosity is impossible to check because results are not written
# in TABLE mode
......
......@@ -19,9 +19,9 @@
# Tests that require multibyte character sets, which are not always available,
# go into separate files (e.g. sp-ucs2.test)
if (`SELECT $PS_PROTOCOL != 0`)
if (`SELECT $PS_PROTOCOL + $CURSOR_PROTOCOL > 0`)
{
--skip Need regular protocol but ps-protocol was specified
--skip Need regular protocol but ps-protocol and cursor-protocol were specified
}
--source include/default_charset.inc
......
......@@ -248,7 +248,7 @@ my @opt_skip_test_list;
our $opt_ssl_supported;
our $opt_ps_protocol;
my $opt_sp_protocol;
my $opt_cursor_protocol;
our $opt_cursor_protocol;
my $opt_view_protocol;
my $opt_non_blocking_api;
......
......@@ -18,7 +18,7 @@ sub skip_combinations {
$skip{'include/platform.combinations'} = [ 'aix', 'win' ];
}
if ( $::opt_ps_protocol ) {
if ( $::opt_ps_protocol || $::opt_cursor_protocol) {
$skip{'include/protocol.combinations'} = [ 'nm' ];
} else {
$skip{'include/protocol.combinations'} = [ 'ps' ];
......
......@@ -10,7 +10,10 @@
#
############################################################################
--disable_ps_protocol
if (`SELECT $PS_PROTOCOL + $CURSOR_PROTOCOL > 0`)
{
--skip Test temporarily disabled for ps-protocol and cursor-protocol
}
--source include/default_charset.inc
set sql_mode="";
......@@ -29733,4 +29736,3 @@ DROP TABLE IF EXISTS res_t1;
let $message= . +++ END OF SCRIPT +++;
--source include/show_msg80.inc
# ==============================================================================
--enable_ps_protocol
......@@ -1082,7 +1082,10 @@ SELECT JSON_ARRAY_APPEND
--echo # Bug#21373874 ASSERTION `PARENT' FAILED
--echo # ----------------------------------------------------------------------
#Enable after fix MDEV-31554
--disable_cursor_protocol
select json_array_append('{"a":1}', '$[0]', 100);
--enable_cursor_protocol
select json_array_append('3', '$[0]', 100);
select json_array_append('3', '$[0][0][0][0]', 100);
......@@ -1093,7 +1096,10 @@ select json_array_append('3', '$[0][0][0][0]', 100);
# NULLs
select json_insert(NULL, '$.b', json_compact(1));
select json_insert('[1,2,3]', NULL, json_compact(1));
#Enable after fix MDEV-31554
--disable_cursor_protocol
select json_insert('[1,2,3]', '$[3]', NULL);
--enable_cursor_protocol
# wrong # args
--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
......@@ -1224,7 +1230,10 @@ SELECT JSON_INSERT
# NULLs
select json_array_insert(NULL, '$.b[1]', 1);
select json_array_insert('[1,2,3]', NULL, 1);
#Enable after fix MDEV-31554
--disable_cursor_protocol
select json_array_insert('[1,2,3]', '$[3]', NULL);
--enable_cursor_protocol
# wrong # args
--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
......@@ -1242,6 +1251,8 @@ select json_array_insert('true', '$.a', 1);
--echo error ER_INVALID_JSON_PATH_ARRAY_CELL
select json_array_insert('true', '$.a[1].b', 1);
#Enable after fix MDEV-31554
--disable_cursor_protocol
# nop if there is no array at the path's parent
select json_array_insert( 'true', '$[0]', false );
select json_array_insert( 'true', '$[1]', false );
......@@ -1267,6 +1278,7 @@ select json_array_insert( '[1, 2, 3, 4]', '$[2]', false );
select json_array_insert( '[1, 2, 3, 4]', '$[3]', false );
select json_array_insert( '[1, 2, 3, 4]', '$[4]', false );
select json_array_insert( '[1, 2, 3, 4]', '$[5]', false );
--enable_cursor_protocol
select json_array_insert( '{ "a": [1, 2, 3, 4] }', '$.a[0]', false );
select json_array_insert( '{ "a": [1, 2, 3, 4] }', '$.a[1]', false );
......@@ -1292,7 +1304,10 @@ select json_insert('[]', '$**[1]', 6);
select json_insert('[]', '$[*][1]', 6);
# multiple paths,
#Enable after fix MDEV-31554
--disable_cursor_protocol
select json_array_insert( '[ 1, 2, 3 ]', '$[1]', true, '$[1]', false );
--enable_cursor_protocol
select json_array_insert( '[ 1, 2, 3 ]', '$[1]',
json_compact( '[ "a", "b", "c", "d" ]'), '$[1][2]', false );
......
if (`SELECT $PS_PROTOCOL != 0`)
if (`SELECT $PS_PROTOCOL + $CURSOR_PROTOCOL > 0`)
{
--skip Need regular protocol but ps-protocol was specified
--skip Need regular protocol but ps-protocol and cursor-protocol were specified
}
source include/have_binlog_format_mixed_or_row.inc;
......
......@@ -4,9 +4,9 @@
# Purpose: To test that event effects are replicated. #
##################################################################
if (`SELECT $PS_PROTOCOL != 0`)
if (`SELECT $PS_PROTOCOL + $CURSOR_PROTOCOL > 0`)
{
--skip Need regular protocol but ps-protocol was specified
--skip Need regular protocol but ps-protocol and cursor-protocol were specified
}
--source include/master-slave.inc
......
if (`SELECT $PS_PROTOCOL != 0`)
if (`SELECT $PS_PROTOCOL + $CURSOR_PROTOCOL > 0`)
{
--skip Test temporarily disabled for ps-protocol
--skip Test temporarily disabled for ps-protocol and cursor-protocol
}
--source include/no_valgrind_without_big.inc
--let $rpl_topology=1->2
......
......@@ -25,6 +25,11 @@
# Note that due to the sleep() command the insert is written to the binary
# log in row format.
if (`SELECT $CURSOR_PROTOCOL != 0`)
{
--skip Test requires: cursor-protocol disabled
}
source include/have_binlog_format_statement.inc;
source include/master-slave.inc;
......
......@@ -5,6 +5,11 @@ SET @global_log_output = @@global.log_output;
# Begin the functionality testing for slow_query_log #
###############################################################################
if (`SELECT $CURSOR_PROTOCOL != 0`)
{
--skip Test temporarily disabled for cursor-protocol
}
SET @@session.long_query_time=1;
SET @@global.log_output = 'TABLE';
......
if (`SELECT $PS_PROTOCOL != 0`)
if (`SELECT $PS_PROTOCOL + $CURSOR_PROTOCOL > 0`)
{
--skip Test temporarily disabled for ps-protocol
--skip Test temporarily disabled for ps-protocol and cursor-protocol
}
--source include/have_innodb.inc
--source include/default_optimizer_switch.inc
......
if (`SELECT $PS_PROTOCOL != 0`)
if (`SELECT $PS_PROTOCOL + $CURSOR_PROTOCOL > 0`)
{
--skip Need regular protocol but ps-protocol was specified
--skip Need regular protocol but ps-protocol and cursor-protocol were specified
}
--source suite/versioning/engines.inc
--source suite/versioning/common.inc
......
if (`SELECT $PS_PROTOCOL + $CURSOR_PROTOCOL > 0`)
{
--skip Test temporarily disabled for ps-protocol and cursor-protocol
}
let $prior_set_lwt = `select concat('set @prior_lock_wait_timeout = @@',
'$engine', '_lock_wait_timeout;')`;
let $prior_set_dld = `select concat('set @prior_deadlock_detect = @@',
......
......@@ -4,6 +4,8 @@
# This test inserts 20,000 rows into t1, then selecting one by one from stored procedure.
# If the select does not return any row, it is wrong.
--disable_ps_protocol
--disable_cursor_protocol
CREATE TABLE t1 (
`id1` int unsigned NOT NULL DEFAULT '0',
`id2` int unsigned NOT NULL DEFAULT '0',
......@@ -49,4 +51,5 @@ CALL select_test();
DROP PROCEDURE select_test;
drop table t1;
--enable_cursor_protocol
--enable_ps_protocol
......@@ -95,7 +95,11 @@ let $extra_col_opts = NOT NULL;
set @col_opt_not_nullsave_time_zone=@@time_zone;
set time_zone='UTC';
--disable_cursor_protocol
--disable_ps_protocol
--source type_date_time.inc
--enable_ps_protocol
--enable_cursor_protocol
SET TIMESTAMP=UNIX_TIMESTAMP('2013-12-12 12:12:12');
......@@ -122,9 +126,13 @@ SET TIMESTAMP=UNIX_TIMESTAMP('2013-12-12 12:12:12');
--let $col_default = '2012'
--source col_not_null.inc
--disable_cursor_protocol
--disable_ps_protocol
--let $col_type = YEAR(2)
--let $col_default = '12'
--source col_not_null.inc
--enable_ps_protocol
--enable_cursor_protocol
set time_zone= @col_opt_not_nullsave_time_zone;
......@@ -156,8 +164,10 @@ set time_zone= @col_opt_not_nullsave_time_zone;
--echo # Floating point columns (FLOAT, DOUBLE)
--echo ########################
--disable_ps_protocol
--source type_float.inc
--enable_ps_protocol
--let $col_type = FLOAT
--let $col_default = 1.1
--source col_not_null.inc
......
......@@ -91,7 +91,11 @@ let $extra_col_opts = NULL;
set @col_opt_nullsave_time_zone=@@time_zone;
set time_zone='UTC';
--disable_cursor_protocol
--disable_ps_protocol
--source type_date_time.inc
--enable_ps_protocol
--enable_cursor_protocol
--let $col_type = DATE
--let $col_default = '2012-12-21'
......@@ -113,9 +117,13 @@ set time_zone='UTC';
--let $col_default = '2012'
--source col_null.inc
--disable_cursor_protocol
--disable_ps_protocol
--let $col_type = YEAR(2)
--let $col_default = '12'
--source col_null.inc
--enable_ps_protocol
--enable_cursor_protocol
set time_zone=@col_opt_nullsave_time_zone;
......@@ -146,8 +154,10 @@ set time_zone=@col_opt_nullsave_time_zone;
--echo # Floating point columns (FLOAT, DOUBLE)
--echo ########################
--disable_ps_protocol
--source type_float.inc
--enable_ps_protocol
--let $col_type = FLOAT
--let $col_default = 1.1
--source col_null.inc
......
let $engine=rocksdb;
if (`SELECT $CURSOR_PROTOCOL != 0`)
{
--skip Test temporarily disabled for cursor-protocol
}
--source include/deadlock_stats.inc
......@@ -8,6 +8,7 @@ DROP TABLE IF EXISTS t1;
--enable_warnings
set @save_time_zone=@@time_zone;
set time_zone='UTC';
--disable_cursor_protocol
eval CREATE TABLE t1 (
d DATE $extra_col_opts,
dt DATETIME $extra_col_opts,
......@@ -18,6 +19,7 @@ eval CREATE TABLE t1 (
y2 YEAR(2) $extra_col_opts,
pk DATETIME PRIMARY KEY
) ENGINE=rocksdb;
--enable_cursor_protocol
SHOW COLUMNS IN t1;
......
......@@ -71,7 +71,6 @@ SELECT
CONCAT('', MAX(d10_10)),
CONCAT('', MAX(d53)),
CONCAT('', MAX(d53_10)) FROM t1;
--enable_cursor_protocol
# Invalid values
......@@ -119,6 +118,7 @@ eval ALTER TABLE t1 ADD COLUMN n66_6 DECIMAL(256,1) $extra_col_opts;
# Error occurs on MySQL but not on MariaDB:
# --error ER_TOO_BIG_SCALE
eval ALTER TABLE t1 ADD COLUMN n66_66 DECIMAL(40,35) $extra_col_opts;
--enable_cursor_protocol
DROP TABLE t1;
--source include/have_rocksdb.inc
--source include/have_debug_sync.inc
if (`SELECT $CURSOR_PROTOCOL != 0`)
{
--skip Test temporarily disabled for cursor-protocol
}
# For GitHub issue#167 -- Unique key check doesn't work
connect (con1, localhost, root,,);
......
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