Merge branch '10.4' into 10.5

This commit is contained in:
Oleksandr Byelkin 2023-07-27 13:12:30 +02:00
commit f291c3df2c
423 changed files with 1551 additions and 152 deletions

View file

@ -117,7 +117,7 @@ static my_bool opt_compress= 0, silent= 0, verbose= 0;
static my_bool debug_info_flag= 0, debug_check_flag= 0;
static my_bool tty_password= 0;
static my_bool opt_mark_progress= 0;
static my_bool ps_protocol= 0, ps_protocol_enabled= 0;
static my_bool ps_protocol= 0, ps_protocol_enabled= 0, ps2_protocol_enabled= 0;
static my_bool sp_protocol= 0, sp_protocol_enabled= 0;
static my_bool view_protocol= 0, view_protocol_enabled= 0;
static my_bool service_connection_enabled= 1;
@ -158,6 +158,7 @@ static struct property prop_list[] = {
{ &display_session_track_info, 0, 1, 1, "$ENABLED_STATE_CHANGE_INFO" },
{ &display_metadata, 0, 0, 0, "$ENABLED_METADATA" },
{ &ps_protocol_enabled, 0, 0, 0, "$ENABLED_PS_PROTOCOL" },
{ &ps2_protocol_enabled, 0, 0, 0, "$ENABLED_PS2_PROTOCOL" },
{ &view_protocol_enabled, 0, 0, 0, "$ENABLED_VIEW_PROTOCOL"},
{ &service_connection_enabled, 0, 1, 0, "$ENABLED_SERVICE_CONNECTION"},
{ &disable_query_log, 0, 0, 1, "$ENABLED_QUERY_LOG" },
@ -174,6 +175,7 @@ enum enum_prop {
P_SESSION_TRACK,
P_META,
P_PS,
P_PS2,
P_VIEW,
P_CONN,
P_QUERY,
@ -264,6 +266,7 @@ static size_t suite_dir_len, overlay_dir_len;
/* Precompiled re's */
static regex_t ps_re; /* the query can be run using PS protocol */
static regex_t ps2_re; /* the query can be run using PS protocol with second execution*/
static regex_t sp_re; /* the query can be run as a SP */
static regex_t view_re; /* the query can be run as a view*/
@ -382,6 +385,7 @@ enum enum_commands {
Q_LOWERCASE,
Q_START_TIMER, Q_END_TIMER,
Q_CHARACTER_SET, Q_DISABLE_PS_PROTOCOL, Q_ENABLE_PS_PROTOCOL,
Q_DISABLE_PS2_PROTOCOL, Q_ENABLE_PS2_PROTOCOL,
Q_DISABLE_VIEW_PROTOCOL, Q_ENABLE_VIEW_PROTOCOL,
Q_DISABLE_SERVICE_CONNECTION, Q_ENABLE_SERVICE_CONNECTION,
Q_ENABLE_NON_BLOCKING_API, Q_DISABLE_NON_BLOCKING_API,
@ -475,6 +479,8 @@ const char *command_names[]=
"character_set",
"disable_ps_protocol",
"enable_ps_protocol",
"disable_ps2_protocol",
"enable_ps2_protocol",
"disable_view_protocol",
"enable_view_protocol",
"disable_service_connection",
@ -8399,6 +8405,19 @@ void run_query_stmt(struct st_connection *cn, struct st_command *command,
}
#endif
/*
Execute the query first time if second execution enable
*/
if(ps2_protocol_enabled && match_re(&ps2_re, query))
{
if (do_stmt_execute(cn))
{
handle_error(command, mysql_stmt_errno(stmt),
mysql_stmt_error(stmt), mysql_stmt_sqlstate(stmt), ds);
goto end;
}
}
/*
Execute the query
*/
@ -9353,6 +9372,13 @@ void init_re(void)
"[[:space:]]*UNINSTALL[[:space:]]+|"
"[[:space:]]*UPDATE[[:space:]]"
")";
/*
Filter for queries that can be run for second
execution of prepare statement
*/
const char *ps2_re_str =
"^("
"[[:space:]]*SELECT[[:space:]])";
/*
Filter for queries that can be run using the
@ -9368,6 +9394,7 @@ void init_re(void)
"[[:space:]]*SELECT[[:space:]])";
init_re_comp(&ps_re, ps_re_str);
init_re_comp(&ps2_re, ps2_re_str);
init_re_comp(&sp_re, sp_re_str);
init_re_comp(&view_re, view_re_str);
}
@ -9404,6 +9431,7 @@ int match_re(regex_t *re, char *str)
void free_re(void)
{
regfree(&ps_re);
regfree(&ps2_re);
regfree(&sp_re);
regfree(&view_re);
}
@ -9755,6 +9783,9 @@ int main(int argc, char **argv)
if (cursor_protocol)
ps_protocol= 1;
/* Enable second execution of SELECT for ps-protocol
if ps-protocol is used */
ps2_protocol_enabled= ps_protocol;
ps_protocol_enabled= ps_protocol;
sp_protocol_enabled= sp_protocol;
view_protocol_enabled= view_protocol;
@ -10182,6 +10213,12 @@ int main(int argc, char **argv)
case Q_ENABLE_PS_PROTOCOL:
set_property(command, P_PS, ps_protocol);
break;
case Q_DISABLE_PS2_PROTOCOL:
set_property(command, P_PS2, 0);
break;
case Q_ENABLE_PS2_PROTOCOL:
set_property(command, P_PS2, ps_protocol);
break;
case Q_DISABLE_VIEW_PROTOCOL:
set_property(command, P_VIEW, 0);
/* Close only util connections */

View file

@ -233,6 +233,8 @@ SET(CPACK_RPM_shared_POST_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/
SET(CPACK_RPM_shared_POST_UNINSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/shared-post.sh)
SET(CPACK_RPM_compat_POST_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/shared-post.sh)
SET(CPACK_RPM_compat_POST_UNINSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/shared-post.sh)
SET(CPACK_RPM_cracklib-password-check_POST_INSTALL_SCRIPT_FILE
${CMAKE_SOURCE_DIR}/plugin/cracklib_password_check/support-files/rpm/mariadb-plugin-cracklib-password-check-postin.sh)
MACRO(ALTERNATIVE_NAME real alt)
IF(${ARGC} GREATER 2)

View file

@ -1,4 +1,6 @@
--disable_ps2_protocol
--connection slave
SET @saved_slave_type_conversions = @@slave_type_conversions;
@ -257,4 +259,4 @@ SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
DROP TABLE t1,t2;
--sync_slave_with_master
--enable_ps2_protocol

View file

@ -6,6 +6,7 @@
## - $engine_type should be set
##
--disable_ps2_protocol
set sql_mode=no_engine_substitution;
eval set default_storage_engine = $engine_type;
set autocommit=1;
@ -787,3 +788,4 @@ call p_verify_status_increment(2, 0, 2, 0);
drop table t1, t2, t3;
drop procedure p_verify_status_increment;
drop function f1;
--enable_ps2_protocol

View file

@ -463,6 +463,7 @@ select * from t1;
show create table t1;
drop table t1;
--disable_ps2_protocol
# Ensure that row_count() value is reset after drop table.
select 1;
select hex(concat(row_count()));
@ -474,6 +475,7 @@ select hex(concat(found_rows()));
create table t1 as select concat(found_rows()) as c1;
show create table t1;
drop table t1;
--enable_ps2_protocol
create table t1 as select concat(uuid_short()) as c1;
show create table t1;

View file

@ -165,9 +165,11 @@ while ($_dt_tables)
# Now that we have the comma-separated list of columns, we can write
# the table to a file.
--disable_ps2_protocol
--let $_dt_outfile= `SELECT @@datadir`
--let $_dt_outfile= $_dt_outfile/diff_table-$_dt_connection-$_dt_database-$_dt_table
eval SELECT * INTO OUTFILE '$_dt_outfile' FROM $_dt_database.$_dt_table ORDER BY `$_dt_column_list`;
--enable_ps2_protocol
# Compare files.
if ($_dt_prev_outfile)

View file

@ -26,6 +26,7 @@
--echo # query: $query
--echo # select: $select
--echo #
--disable_ps2_protocol
--disable_view_protocol
if ($select) {
--disable_query_log
@ -160,3 +161,4 @@ SHOW STATUS WHERE (Variable_name LIKE 'Sort%' OR
--echo
--enable_view_protocol
--enable_ps2_protocol

View file

@ -824,6 +824,7 @@ eval CREATE TABLE t2 (
i $datetime DEFAULT $current_timestamp ON UPDATE $current_timestamp NOT NULL
);
--disable_ps2_protocol
SELECT 1 INTO OUTFILE 't3.dat' FROM dual;
SELECT NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
@ -831,6 +832,7 @@ INTO OUTFILE 't4.dat'
FROM dual;
SELECT 1, 2 INTO OUTFILE 't5.dat' FROM dual;
--enable_ps2_protocol
--echo # Mon Aug 1 15:11:19 2011 UTC
SET TIMESTAMP = 1312211479.918273;
@ -929,9 +931,11 @@ remove_file $MYSQLD_DATADIR/test/t5.dat;
--echo # Mon Aug 1 15:11:19 2011 UTC
SET TIMESTAMP = 1312211479.089786;
--disable_ps2_protocol
SELECT 1 INTO OUTFILE "file1.dat" FROM dual;
SELECT NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
INTO OUTFILE "file2.dat" FROM dual;
--enable_ps2_protocol
--echo # Too short row

View file

@ -54,6 +54,8 @@ set GLOBAL query_cache_type=ON;
set LOCAL query_cache_type=ON;
set GLOBAL query_cache_size=1355776;
--disable_ps2_protocol
reset query cache;
flush status;
connect (root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
@ -171,6 +173,8 @@ show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
show status like "Qcache_not_cached";
--enable_ps2_protocol
# Cleanup
connection root;

View file

@ -876,6 +876,7 @@ SET optimizer_switch=@save_optimizer_switch;
DROP TABLE t1,t2;
--disable_ps2_protocol
--echo # check "Handler_pushed" status varuiables
CREATE TABLE t1 (
c1 CHAR(1),
@ -897,6 +898,7 @@ SELECT * FROM t1 WHERE (c2='3' or c2='4') and c2 % 2 = 0 ;
show status like "Handler_icp%";
DROP TABLE t1;
--enable_ps2_protocol
#
# MDEV-308 lp:1008516 - Failing assertion: templ->mysql_col_len == len

View file

@ -14,6 +14,7 @@
# old name was innodb_cache.test
# main code went into include/query_cache.inc
#
--disable_ps2_protocol
--disable_view_protocol
SET global query_cache_type=ON;
SET local query_cache_type=ON;
@ -192,3 +193,4 @@ drop table t2;
SET global query_cache_type=default;
--enable_view_protocol
--enable_ps2_protocol

View file

@ -44,13 +44,14 @@ flush status;
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
--disable_ps2_protocol
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
--enable_ps2_protocol
drop table t1;
@ -79,12 +80,14 @@ flush status;
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
--disable_ps2_protocol
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
--enable_ps2_protocol
drop table t1;
@ -114,6 +117,7 @@ INSERT INTO t1 VALUES (1, now(), 0);
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
--disable_ps2_protocol
BEGIN;
UPDATE `t1` SET `cool` = 1 WHERE `id` = 1;
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
@ -126,6 +130,7 @@ SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
--enable_ps2_protocol
drop table t1;

View file

@ -23,6 +23,8 @@
set GLOBAL query_cache_type=ON;
set LOCAL query_cache_type=ON;
--disable_ps2_protocol
connect (con1,localhost,root,,test,$MASTER_MYPORT,);
connection default;
@ -252,6 +254,7 @@ set @a=10;
execute stmt1 using @a;
show status like 'Qcache_hits';
--enable_ps2_protocol
drop table t1;
disconnect con1;

View file

@ -1 +1,3 @@
--disable_ps2_protocol
eval select "Outfile OK" into outfile "$MYSQLTEST_VARDIR/tmp/outfile.test";
--enable_ps2_protocol

View file

@ -34,8 +34,10 @@ SET sql_mode=DEFAULT;
--eval CREATE TABLE t1 (a $type DEFAULT $defval, b $type DEFAULT $defval)
--eval INSERT INTO t1 VALUES (DEFAULT,DEFAULT);
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--disable_ps2_protocol
--eval SELECT a INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/mdev-7824.txt' FROM t1
DELETE FROM t1;
--enable_ps2_protocol
SET sql_mode=TRADITIONAL;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--error ER_INVALID_DEFAULT_VALUE_FOR_FIELD

View file

@ -46,7 +46,9 @@ if (`SELECT LENGTH(@@secure_file_priv) > 0`)
--let $_wvtf_suffix= `SELECT UUID()`
--let $_wvtf_tmp_file= $MYSQLTEST_VARDIR/_wvtf_$_wvtf_suffix
--disable_ps2_protocol
--eval SELECT '$write_var' INTO DUMPFILE '$_wvtf_tmp_file'
--enable_ps2_protocol
--copy_file $_wvtf_tmp_file $write_to_file
--remove_file $_wvtf_tmp_file
}

View file

@ -19,7 +19,9 @@ 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_ps2_protocol
select * from t1 where a<3;
--enable_ps2_protocol
drop table t1;
let SLOW_LOG_FILE= `select @@slow_query_log_file`;

View file

@ -11,7 +11,9 @@ set default_storage_engine=innodb;
#
create table t1 (pk int auto_increment primary key, f varchar(20));
insert t1 (f) values ('a'), ('b'), ('c'), ('d');
--disable_ps2_protocol
select null, f into outfile 'load.data' from t1 limit 1;
--enable_ps2_protocol
load data infile 'load.data' into table t1;
insert t1 (f) values ('<===');
select * from t1;

View file

@ -45,7 +45,9 @@ remove_file $MYSQLTEST_VARDIR/tmp/bootstrap_error.sql;
--echo #
--disable_query_log
create table t1 select 2 as a, concat(repeat('MySQL', @@max_allowed_packet/10), ';') as b;
--disable_ps2_protocol
eval select * into outfile '$MYSQLTEST_VARDIR/tmp/long_query.sql' from t1;
--enable_ps2_protocol
--enable_query_log
--source include/kill_mysqld.inc
--error 1

View file

@ -6,6 +6,7 @@
--echo # Bug #39022: Mysql randomly crashing in lock_sec_rec_cons_read_sees
--echo #
--disable_ps2_protocol
call mtr.add_suppression("Deadlock found when trying to get lock; try restarting transaction");
CREATE TABLE t1(a TINYINT NOT NULL,b TINYINT,PRIMARY KEY(b)) ENGINE=innodb;
@ -56,3 +57,4 @@ disconnect thread1;
connection default;
DROP TABLE t1,t2;
--enable_ps2_protocol

View file

@ -402,9 +402,11 @@ SET @@GLOBAL.max_allowed_packet=2048;
# reconnect to make the new max packet size take effect
--connect (newconn, localhost, root,,)
--disable_ps2_protocol
SELECT CONVERT('a', BINARY(2049));
SELECT CONVERT('a', CHAR(2049));
SELECT length(CONVERT(repeat('a',2048), CHAR(2049)));
--enable_ps2_protocol
connection default;
disconnect newconn;

View file

@ -172,7 +172,10 @@ insert t1 (b) values (1);
insert t1 (b) values (10);
select * from t1 where a is null;
set sql_auto_is_null=1;
#Enable after fix MDEV-31307
--disable_ps2_protocol
select * from t1 where a is null;
--enable_ps2_protocol
--error ER_CONSTRAINT_FAILED
insert t1 (b) values (1);
drop table t1;

View file

@ -8,6 +8,8 @@ eval CREATE TABLE t1(a $typec);
ALTER TABLE t1 ADD KEY(a(10));
SHOW CREATE TABLE t1;
--disable_ps2_protocol
--echo # Make sure column was actually compressed
INSERT INTO t1 VALUES(REPEAT('a', 1000));
SELECT LEFT(a, 10), LENGTH(a) FROM t1;
@ -94,6 +96,8 @@ SELECT * FROM t1 ORDER BY a;
SELECT a+1 FROM t1 ORDER BY 1;
SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME IN('Column_compressions', 'Column_decompressions');
--enable_ps2_protocol
DROP TABLE t1;
--echo #

View file

@ -48,6 +48,7 @@ select count(distinct n1), count(distinct n2) from t1;
select count(distinct n2), n1 from t1 group by n1;
drop table t1;
--disable_ps2_protocol
# test the conversion from tree to MyISAM
create table t1 (n int default NULL);
let $1=5000;
@ -82,5 +83,6 @@ flush status;
select count(distinct s) from t1;
show status like 'Created_tmp_disk_tables';
drop table t1;
--enable_ps2_protocol
# End of 4.1 tests

View file

@ -77,7 +77,9 @@ select hex(convert(_big5 0xC84041 using ucs2));
set names big5;
create table t1 (a blob);
insert into t1 values (0xEE00);
--disable_ps2_protocol
select * into outfile 'test/t1.txt' from t1;
--enable_ps2_protocol
delete from t1;
let $MYSQLD_DATADIR= `select @@datadir`;
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR

View file

@ -75,7 +75,9 @@ DROP TABLE t1;
--echo # Problem # 1 (original report): wrong parsing of ucs2 data
SET character_set_connection=ucs2;
--disable_ps2_protocol
SELECT '00' UNION SELECT '10' INTO OUTFILE 'tmpp.txt';
--enable_ps2_protocol
CREATE TABLE t1(a INT);
LOAD DATA INFILE 'tmpp.txt' INTO TABLE t1 CHARACTER SET ucs2
(@b) SET a=REVERSE(@b);
@ -86,9 +88,10 @@ DROP TABLE t1;
let $MYSQLD_DATADIR= `select @@datadir`;
remove_file $MYSQLD_DATADIR/test/tmpp.txt;
--disable_ps2_protocol
--echo # Problem # 2 : if you write and read ucs2 data to a file they're lost
SELECT '00' UNION SELECT '10' INTO OUTFILE 'tmpp2.txt' CHARACTER SET ucs2;
--enable_ps2_protocol
CREATE TABLE t1(a INT);
LOAD DATA INFILE 'tmpp2.txt' INTO TABLE t1 CHARACTER SET ucs2
(@b) SET a=REVERSE(@b);

View file

@ -19,7 +19,9 @@ create table t1 (sal int(10),id int(10));
INSERT INTO t1 (sal,id) VALUES (5000,1);
INSERT INTO t1 (sal,id) VALUES (2000,1);
INSERT INTO t1 (sal,id) VALUES (1000,1);
--disable_ps2_protocol
select f1(sal) from t1 where id>= 1;
--enable_ps2_protocol
select * from t2;
drop table t2;
drop function f1;
@ -96,9 +98,12 @@ end|
delimiter ;|
#Check after fix MDEV-31281
--disable_ps2_protocol
select f1(10);
select f1(sal) from t1;
select f1(sal) from t1 where 1=0;
--enable_ps2_protocol
drop function f1;
delimiter |;

View file

@ -3,6 +3,8 @@
--source include/default_optimizer_switch.inc
--disable_ps2_protocol
flush status;
show status like "%custom_aggregate%";
create table t2 (sal int(10));
@ -73,6 +75,8 @@ with agg_sum as (
select * from agg_sum;
show status like "%custom_aggregate%";
--enable_ps2_protocol
drop table t2,t1,t3;
drop function f1;
drop function f2;

View file

@ -381,6 +381,7 @@ DROP TABLE IF EXISTS t1;
--enable_warnings
#
# Test.
--disable_ps2_protocol
CREATE TABLE t1 (c1 INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1);
SELECT GET_LOCK('mysqltest_lock', 100);
@ -417,6 +418,7 @@ disconnect con1;
disconnect con2;
connection default;
DROP TABLE t1;
--enable_ps2_protocol
#
# Cleanup after test case.

View file

@ -451,6 +451,7 @@ DELETE t1 FROM db1.t1, db2.t1;
# Test multiple-table cross database deletes
--disable_ps2_protocol
DELETE t1 FROM db1.t2 AS t1, db2.t2 AS t2 WHERE t2.a = 1 AND t1.a = t2.a;
SELECT ROW_COUNT();
CALL count_rows();
@ -462,6 +463,7 @@ DROP DATABASE db1;
DROP DATABASE db2;
DROP PROCEDURE count_rows;
DROP TABLE t1, t2;
--enable_ps2_protocol
--echo #
--echo # Bug#46958: Assertion in Diagnostics_area::set_ok_status, trigger,

View file

@ -897,11 +897,14 @@ select distinct t1.id, tt.id, tt.data
(select t1.id, 'yes' as data from t1) as tt
on t1.id = tt.id;
#Check after fix MDEV-31277
--disable_ps2_protocol
select distinct t1.id, tt.id, tt.data
from t1
left join
(select t1.id, 'yes' as data from t1 where id > 1) as tt
on t1.id = tt.id;
--enable_ps2_protocol
drop table t1;

View file

@ -1895,9 +1895,9 @@ DELIMITER ;$$
CALL p1('a');
DROP PROCEDURE p1;
--disable_ps2_protocol
SELECT a FROM (SELECT "aa" a) t WHERE REGEXP_INSTR(t.a, (SELECT MAX('aa') FROM DUAL LIMIT 1));
--enable_ps2_protocol
DELIMITER $$;
CREATE OR REPLACE FUNCTION f1(a VARCHAR(10), b VARCHAR(10)) RETURNS INT

View file

@ -42,6 +42,7 @@ explain extended
select * from (select * from t1 where f1 in (2,3)) tt join
(select * from t1 where f1 in (1,2)) aa on tt.f1=aa.f1;
--disable_ps2_protocol
flush status;
explain extended
select * from (select * from t1 where f1 in (2,3)) tt where f11=2;
@ -49,6 +50,7 @@ show status like 'Handler_read%';
flush status;
select * from (select * from t1 where f1 in (2,3)) tt where f11=2;
show status like 'Handler_read%';
--enable_ps2_protocol
--echo for merged views
create view v1 as select * from t1;
@ -69,6 +71,7 @@ explain extended
select * from v3 join v4 on f1=f2;
select * from v3 join v4 on f1=f2;
--disable_ps2_protocol
flush status;
explain extended select * from v4 where f2 in (1,3);
show status like 'Handler_read%';
@ -91,6 +94,7 @@ show status like 'Handler_read%';
flush status;
select * from t1 join (select * from t2 group by f2) tt on f1=f2;
show status like 'Handler_read%';
--enable_ps2_protocol
--echo for materialized views
drop view v1,v2,v3;
@ -106,6 +110,7 @@ explain extended select * from t1 join v2 on f1=f2;
select * from t1 join v2 on f1=f2;
explain extended
select * from t1,v3 as v31,v3 where t1.f1=v31.f1 and t1.f1=v3.f1;
--disable_ps2_protocol
flush status;
select * from t1,v3 as v31,v3 where t1.f1=v31.f1 and t1.f1=v3.f1;
show status like 'Handler_read%';
@ -116,6 +121,7 @@ show status like 'Handler_read%';
flush status;
select * from t1 join v2 on f1=f2;
show status like 'Handler_read%';
--enable_ps2_protocol
explain extended select * from v1 join v4 on f1=f2;
explain format=json select * from v1 join v4 on f1=f2;
@ -159,6 +165,7 @@ join
(select * from (select * from t1 where f1 < 7 group by f1) tt where f1 > 2) z
on x.f1 = z.f1;
--disable_ps2_protocol
flush status;
select * from
(select * from (select * from t1 where f1 < 7 group by f1) tt where f1 > 2) x
@ -167,6 +174,7 @@ join
on x.f1 = z.f1;
show status like 'Handler_read%';
flush status;
--enable_ps2_protocol
--echo merged in merged derived join merged in merged derived
explain extended select * from

View file

@ -494,14 +494,18 @@ DROP TABLE IF EXISTS t2;
CREATE TABLE t2 (fruit_id INT NOT NULL, fruit_name varchar(20)
default NULL);
--disable_ps2_protocol
SELECT DISTINCT fruit_id, fruit_name INTO OUTFILE
'../../tmp/data1.tmp' FROM t1 WHERE fruit_name = 'APPLE';
--enable_ps2_protocol
LOAD DATA INFILE '../../tmp/data1.tmp' INTO TABLE t2;
--error 0,1
--remove_file $MYSQLTEST_VARDIR/tmp/data1.tmp
--disable_ps2_protocol
SELECT DISTINCT @v19:= fruit_id, @v20:= fruit_name INTO OUTFILE
'../../tmp/data2.tmp' FROM t1 WHERE fruit_name = 'APPLE';
--enable_ps2_protocol
LOAD DATA INFILE '../../tmp/data2.tmp' INTO TABLE t2;
--remove_file $MYSQLTEST_VARDIR/tmp/data2.tmp

View file

@ -7,9 +7,11 @@ drop table if exists t1;
--enable_warnings
create table t1 (nr int(5) not null auto_increment,b blob,str char(10), primary key (nr));
--disable_ps2_protocol
select count(*) from t1;
select * from t1;
select * from t1 limit 0;
--enable_ps2_protocol
show status like "Empty_queries";
drop table t1;
@ -17,8 +19,10 @@ drop table t1;
# Accessing a non existing table should not increase Empty_queries
#
--disable_ps2_protocol
--error 1146
select * from t2;
--enable_ps2_protocol
show status like "Empty_queries";
--echo # End of 4.1 tests

View file

@ -80,10 +80,12 @@ SET optimizer_switch='outer_join_with_cache=off';
SET SESSION debug_dbug= '+d,only_one_Unique_may_be_created';
--disable_ps2_protocol
--replace_column 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x
EXPLAIN
SELECT * FROM t1 LEFT JOIN t2 ON ( t2.a < 10 OR t2.b < 10 );
SELECT * FROM t1 LEFT JOIN t2 ON ( t2.a < 10 OR t2.b < 10 );
--enable_ps2_protocol
SET debug_dbug= @saved_dbug;

View file

@ -94,8 +94,10 @@ end|
delimiter ;|
flush status;
--disable_ps2_protocol
--error 1062
select f1(), f2();
--enable_ps2_protocol
show status like 'Com_insert';
select * from t1;
select * from t2;

View file

@ -38,6 +38,7 @@ select "no-op query";
let $count = query_get_value($show_count_statement, Value, 1);
let $opt = query_get_value($show_opt_statement, Value, 1);
--disable_ps2_protocol
--disable_query_log
eval select $count - $base_count into @cluster_lookups;
eval select $opt - $base_opt into @cluster_lookups_avoided;
@ -662,6 +663,8 @@ eval set @cluster_lookups_avoided = $opt - $base_opt;
select @cluster_lookups;
select @cluster_lookups_avoided;
--enable_ps2_protocol
DROP TABLE t1;
--echo #

View file

@ -8,6 +8,8 @@ drop table if exists t1;
set sql_mode="";
--disable_ps2_protocol
flush status;
show status like "feature%";
@ -114,7 +116,7 @@ select updatexml('<div><div><span>1</span><span>2</span></div></div>',
'/','<tr><td>1</td><td>2</td></tr>') as upd1;
--replace_result 4 2
show status like "feature_xml";
--enable_ps2_protocol
--echo #
--echo # Feature delayed_keys

View file

@ -61,6 +61,7 @@ select grp,group_concat(c order by c) from t1 group by grp;
# Test warnings
--disable_ps2_protocol
set group_concat_max_len = 4;
select grp,group_concat(c) from t1 group by grp;
show warnings;
@ -72,6 +73,7 @@ set group_concat_max_len = 1024;
select group_concat(sum(c)) from t1 group by grp;
--error 1054
select grp,group_concat(c order by 2) from t1 group by grp;
--enable_ps2_protocol
drop table t1;
@ -237,10 +239,12 @@ select group_concat(distinct b) from t1 group by a;
select group_concat(b order by b) from t1 group by a;
select group_concat(distinct b order by b) from t1 group by a;
set local group_concat_max_len=4;
--disable_ps2_protocol
select group_concat(b) from t1 group by a;
select group_concat(distinct b) from t1 group by a;
select group_concat(b order by b) from t1 group by a;
select group_concat(distinct b order by b) from t1 group by a;
--enable_ps2_protocol
#
# long blobs
@ -256,10 +260,12 @@ select group_concat(distinct b) from t1 group by a;
select group_concat(b order by b) from t1 group by a;
select group_concat(distinct b order by b) from t1 group by a;
set local group_concat_max_len=400;
--disable_ps2_protocol
select group_concat(b) from t1 group by a;
select group_concat(distinct b) from t1 group by a;
select group_concat(b order by b) from t1 group by a;
select group_concat(distinct b order by b) from t1 group by a;
--enable_ps2_protocol
drop table t1;
@ -517,10 +523,12 @@ CREATE TABLE t1( a VARCHAR( 10 ), b INT );
INSERT INTO t1 VALUES ( repeat( 'a', 10 ), 1),
( repeat( 'b', 10 ), 2);
SET group_concat_max_len = 20;
--disable_ps2_protocol
SELECT GROUP_CONCAT( a ) FROM t1;
SELECT GROUP_CONCAT( DISTINCT a ) FROM t1;
SELECT GROUP_CONCAT( a ORDER BY b ) FROM t1;
SELECT GROUP_CONCAT( DISTINCT a ORDER BY b ) FROM t1;
SELECT GROUP_CONCAT( DISTINCT a ORDER BY b ) FROM t1;
--enable_ps2_protocol
SET group_concat_max_len = DEFAULT;
DROP TABLE t1;
# Bug #23856:GROUP_CONCAT and ORDER BY: junk from previous rows for query on I_S
@ -787,7 +795,9 @@ INSERT INTO t1 VALUES ('555555', 5);
SET group_concat_max_len = 5;
SET @old_sql_mode = @@sql_mode, @@sql_mode = 'traditional';
--disable_ps2_protocol
SELECT GROUP_CONCAT(a), b FROM t1 GROUP BY b LIMIT 3;
--enable_ps2_protocol
--error ER_CUT_VALUE_GROUP_CONCAT
INSERT INTO t2 SELECT GROUP_CONCAT(a), b FROM t1 GROUP BY b;
UPDATE t1 SET a = '11111' WHERE b = 1;
@ -864,6 +874,7 @@ CREATE TABLE t2 SELECT GROUP_CONCAT(UPPER(f1) ORDER BY f2) FROM t1;
SHOW CREATE TABLE t2;
DROP TABLE t2;
--disable_ps2_protocol
SET group_concat_max_len= 1024;
SELECT LENGTH(GROUP_CONCAT(f1 ORDER BY f2)) FROM t1;
@ -873,6 +884,7 @@ SELECT LENGTH(GROUP_CONCAT(f1 ORDER BY f2)) FROM t1 GROUP BY f2;
INSERT INTO t1 VALUES (REPEAT('a', 499999), 3), (REPEAT('b', 500000), 4);
SELECT LENGTH(GROUP_CONCAT(f1 ORDER BY f2)) FROM t1 GROUP BY f2;
--enable_ps2_protocol
DROP TABLE t1;
SET group_concat_max_len= DEFAULT;
@ -882,8 +894,10 @@ SET group_concat_max_len= DEFAULT;
#
set session group_concat_max_len=1024;
set max_session_mem_used=16*1024*1024; # 8M..32M
--disable_ps2_protocol
SELECT GROUP_CONCAT(concat(seq/1.1), concat(seq/1.1), concat(seq/1.1), concat(seq/1.1), concat(seq/1.1), concat(seq/1.1), concat(seq/1.1), concat(seq/1.1) ORDER BY 2,1,3,4,6,5,8,7) AS c
FROM seq_1_to_200000;
--enable_ps2_protocol
set max_session_mem_used=default;
set session group_concat_max_len=default;

View file

@ -1017,8 +1017,11 @@ DROP TABLE t1;
set group_concat_max_len=64;
create table t1 (a varchar(254));
insert into t1 values (concat('x64-', repeat('a', 60)));
insert into t1 values (concat('x64-', repeat('b', 60))); insert into t1 values (concat('x64-', repeat('c', 60)));
select json_arrayagg(a) from t1;
insert into t1 values (concat('x64-', repeat('b', 60)));
insert into t1 values (concat('x64-', repeat('c', 60)));
--disable_ps2_protocol
select json_arrayagg(a) from t1;
--enable_ps2_protocol
drop table t1;
SET group_concat_max_len= default;

View file

@ -223,12 +223,15 @@ drop table t1;
#
# Item_func_like::fix_fields, ESCAPE, const_item()
#
#Enable after fix MDEV-31282
--disable_ps2_protocol
create table t1(f1 int);
insert into t1 values(1);
--error ER_WRONG_ARGUMENTS
update (select 1 like 2 escape (1 in (select 1 from t1))) x, t1 as d set d.f1 = 1;
select * from (select 1 like 2 escape (1 in (select 1 from t1))) x;
drop table t1;
--enable_ps2_protocol
#
# Item_func_like::walk

View file

@ -31,7 +31,9 @@ explain extended select log10(100),log10(18),log10(-4),log10(0),log10(NULL);
select pow(10,log10(10)),power(2,4);
explain extended select pow(10,log10(10)),power(2,4);
set @@rand_seed1=10000000,@@rand_seed2=1000000;
--disable_ps2_protocol
select rand(999999),rand();
--enable_ps2_protocol
explain extended select rand(999999),rand();
select pi(),format(sin(pi()/2),6),format(cos(pi()/2),6),format(abs(tan(pi())),6),format(cot(1),6),format(asin(1),6),format(acos(0),6),format(atan(1),6);
explain extended select pi(),format(sin(pi()/2),6),format(cos(pi()/2),6),format(abs(tan(pi())),6),format(cot(1),6),format(asin(1),6),format(acos(0),6),format(atan(1),6);

View file

@ -54,6 +54,7 @@ drop table t1;
# Bug#16501: IS_USED_LOCK does not appear to work
#
--disable_ps2_protocol
CREATE TABLE t1 (conn CHAR(7), connection_id INT);
INSERT INTO t1 VALUES ('default', CONNECTION_ID());
@ -85,6 +86,7 @@ disconnect con1;
connection default;
DROP TABLE t1;
--enable_ps2_protocol
#
# Bug #21531: EXPORT_SET() doesn't accept args with coercible character sets
@ -148,15 +150,19 @@ select avg(a) from table_26093;
select benchmark(100, (select avg(a) from table_26093));
set @invoked := 0;
--disable_ps2_protocol
select benchmark(100, (select avg(func_26093_a(a)) from table_26093));
--enable_ps2_protocol
# Returns only 10, since intermediate results are cached.
select @invoked;
set @invoked := 0;
--disable_ps2_protocol
#enable after fix MDEV-27871
--disable_view_protocol
select benchmark(100, (select avg(func_26093_b(a, rand())) from table_26093));
--enable_view_protocol
--enable_ps2_protocol
# Returns 1000, due to rand() preventing caching.
select @invoked;
@ -631,6 +637,7 @@ DROP TABLE t1;
--echo # GET_LOCK, RELEASE_LOCK, IS_USED_LOCK functions test
--echo #
--disable_ps2_protocol
--disable_service_connection
--echo # IS_USED_LOCK, IS_FREE_LOCK: the lock is not acquired
@ -794,6 +801,7 @@ select is_free_lock(repeat('a', 193));
select release_lock(repeat('a', 193));
--enable_service_connection
--enable_ps2_protocol
--echo
--echo # --
@ -1224,8 +1232,10 @@ DROP TABLE t1;
--echo # MDEV-20517 Assertion `!is_expensive()' failed in Item::value_depends_on_sql_mode_const_item
--echo #
--disable_ps2_protocol
SELECT ( 1 LIKE GET_LOCK( 'foo', 0 ) ) - 2;
SELECT RELEASE_LOCK('foo');
--enable_ps2_protocol
--echo #
--echo # End of 10.2 tests
@ -1300,6 +1310,7 @@ DROP TABLE t1;
--echo # MDEV-10569 Add RELEASE_ALL_LOCKS SQL-function
--echo #
--disable_view_protocol
--disable_ps2_protocol
--echo # Test function without any locks
SELECT RELEASE_ALL_LOCKS();
@ -1354,4 +1365,5 @@ SELECT RELEASE_ALL_LOCKS();
SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA
FROM information_schema.metadata_lock_info WHERE thread_id>0 ORDER BY TABLE_SCHEMA;
--enable_ps2_protocol
--enable_view_protocol

View file

@ -90,12 +90,16 @@ delimiter ;//
--echo
--echo # One f1_simple_insert execution per row, no NOT NULL violation
--disable_ps2_protocol
SELECT f1_simple_insert(1);
--enable_ps2_protocol
SELECT * FROM t1_not_null ORDER BY f1,f2;
ROLLBACK;
SELECT * FROM t1_not_null;
#
--disable_ps2_protocol
SELECT f1_simple_insert(1) FROM t1_select;
--enable_ps2_protocol
SELECT * FROM t1_not_null ORDER BY f1,f2;
ROLLBACK;
SELECT * FROM t1_not_null;
@ -219,7 +223,9 @@ eval $f1_insert_select;
--echo # - t1_not_null gets a row inserted
--echo # is covered by the manual.
# Non strict sqlmode + INSERT SELECT --> NULL adjusted to default
--disable_ps2_protocol
SELECT f1_insert_select(2);
--enable_ps2_protocol
SELECT * FROM t1_not_null ORDER BY f1,f2;
ROLLBACK;
SELECT * FROM t1_not_null ORDER BY f1,f2;
@ -295,7 +301,9 @@ eval $f1_insert_with_two_rows;
--echo # - t1_not_null gets a row inserted
--echo # is covered by the manual.
# Non strict sqlmode + multiple-row INSERT --> NULL adjusted to default
--disable_ps2_protocol
SELECT f1_insert_with_two_rows();
--enable_ps2_protocol
SELECT * FROM t1_not_null ORDER BY f1,f2;
ROLLBACK;
SELECT * FROM t1_not_null ORDER BY f1,f2;

View file

@ -1539,7 +1539,9 @@ SELECT CONVERT(('' IN (REVERSE(CAST(('') AS DECIMAL)), '')), CHAR(3));
--echo #
CREATE TABLE t1 ( a TEXT );
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--disable_ps2_protocol
--eval SELECT 'aaaaaaaaaaaaaa' INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/bug58165.txt';
--enable_ps2_protocol
SELECT insert( substring_index( 'a', 'a', 'b' ), 1, 0, 'x' );
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/bug58165.txt' INTO TABLE t1;

View file

@ -2282,9 +2282,11 @@ delimiter ;//
SET @sav_slow_query_log= @@session.slow_query_log;
--disable_ps2_protocol
# @@slow_query_log ON check
SET @@session.slow_query_log= ON;
SELECT current_timestamp(6),fn_sleep_before_now() INTO @ts_cur, @ts_func;
--enable_ps2_protocol
SELECT a FROM t_ts LIMIT 1 into @ts_func;
SELECT a FROM t_trig LIMIT 1 into @ts_trig;
@ -2296,9 +2298,11 @@ if (!`SELECT @ts_cur = @ts_func and @ts_func = @ts_trig`)
DELETE FROM t_ts;
DELETE FROM t_trig;
--disable_ps2_protocol
# @@slow_query_log OFF check
SET @@session.slow_query_log= OFF;
SELECT current_timestamp(6),fn_sleep_before_now() INTO @ts_cur, @func_ts;
--enable_ps2_protocol
SELECT a FROM t_ts LIMIT 1 into @ts_func;
SELECT a FROM t_trig LIMIT 1 into @ts_trig;
if (!`SELECT @ts_cur = @ts_func and @ts_func = @ts_trig`)
@ -2350,9 +2354,11 @@ SELECT
--echo # MDEV-14032 SEC_TO_TIME executes side effect two times
--echo #
--disable_ps2_protocol
SET @a=10000000;
SELECT SEC_TO_TIME(@a:=@a+1);
SELECT @a;
--enable_ps2_protocol
CREATE TABLE t1 (a TEXT);
DELIMITER $$;
@ -2363,7 +2369,9 @@ BEGIN
END;
$$
DELIMITER ;$$
--disable_ps2_protocol
SELECT SEC_TO_TIME(f1());
--enable_ps2_protocol
SELECT * FROM t1;
DROP TABLE t1;
DROP FUNCTION f1;

View file

@ -114,7 +114,9 @@ drop table t1;
--echo # BUG#11898467 - SERVER CRASHES ON SELECT HEX(WEIGHT_STRING(STR AS [CHAR|BINARY](N))) IF N IS BIG
--echo #
SELECT HEX(WEIGHT_STRING('ab' AS CHAR(1000000000000000000)));
--disable_ps2_protocol
SELECT HEX(WEIGHT_STRING('ab' AS BINARY(1000000000000000000)));
--enable_ps2_protocol
disconnect conn1;
connection default;

View file

@ -838,7 +838,9 @@ SHOW CREATE TABLE t1;
--echo #
INSERT INTO t1 VALUES (1), (2), (3);
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--disable_ps2_protocol
--eval SELECT a INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/bug27480.txt' FROM t1
--enable_ps2_protocol
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/bug27480.txt' INTO TABLE t1
--remove_file $MYSQLTEST_VARDIR/tmp/bug27480.txt

View file

@ -284,23 +284,27 @@ drop table t1;
CREATE TABLE t1 (a char(1));
INSERT INTO t1 VALUES ('A'),('B'),('A'),('B'),('A'),('B'),(NULL),('a'),('b'),(NULL),('A'),('B'),(NULL);
flush status;
--disable_ps2_protocol
SELECT a FROM t1 GROUP BY a;
SELECT a,count(*) FROM t1 GROUP BY a;
SELECT a FROM t1 GROUP BY binary a;
SELECT a,count(*) FROM t1 GROUP BY binary a;
SELECT binary a FROM t1 GROUP BY 1;
SELECT binary a,count(*) FROM t1 GROUP BY 1;
--enable_ps2_protocol
--disable_ps_protocol
show status like 'Created%tables';
--enable_ps_protocol
# Do the same tests with on-disk temporary tables
set tmp_memory_table_size=0;
--disable_ps2_protocol
SELECT a FROM t1 GROUP BY a;
SELECT a,count(*) FROM t1 GROUP BY a;
SELECT a FROM t1 GROUP BY binary a;
SELECT a,count(*) FROM t1 GROUP BY binary a;
SELECT binary a FROM t1 GROUP BY 1;
SELECT binary a,count(*) FROM t1 GROUP BY 1;
--enable_ps2_protocol
--disable_ps_protocol
show status like 'Created%tables';
--enable_ps_protocol
@ -1041,9 +1045,11 @@ EXPLAIN SELECT a FROM t1 IGNORE INDEX FOR JOIN (PRIMARY,i2);
EXPLAIN SELECT a FROM t1 IGNORE INDEX FOR GROUP BY (PRIMARY,i2) GROUP BY a;
--echo # Here's a proof it is really doing sorting:
flush status;
--disable_ps2_protocol
--disable_result_log
SELECT a FROM t1 IGNORE INDEX FOR GROUP BY (PRIMARY,i2) GROUP BY a;
--enable_result_log
--enable_ps2_protocol
show status like 'Sort_%';
--echo # Proof ends.
--echo #
@ -1054,9 +1060,11 @@ show status like 'Sort_%';
EXPLAIN SELECT a FROM t1 IGNORE INDEX FOR ORDER BY (PRIMARY,i2) ORDER BY a;
--echo # Here's a proof it is really doing sorting:
flush status;
--disable_ps2_protocol
--disable_result_log
SELECT a FROM t1 IGNORE INDEX FOR ORDER BY (PRIMARY,i2) ORDER BY a;
--enable_result_log
--enable_ps2_protocol
show status like 'Sort_%';
--echo # Proof ends.
--echo #
@ -1409,7 +1417,9 @@ let $query0=SELECT col1 AS field1, col1 AS field2
# Needs to be range to exercise bug
--eval EXPLAIN $query0;
FLUSH STATUS;
--disable_ps2_protocol
--eval $query0;
--enable_ps2_protocol
SHOW SESSION STATUS LIKE 'Sort_scan%';
let $query=SELECT SQL_BIG_RESULT col1 AS field1, col1 AS field2
@ -1418,7 +1428,9 @@ let $query=SELECT SQL_BIG_RESULT col1 AS field1, col1 AS field2
# Needs to be range to exercise bug
--eval EXPLAIN $query
FLUSH STATUS;
--disable_ps2_protocol
--eval $query
--enable_ps2_protocol
SHOW SESSION STATUS LIKE 'Sort_scan%';
CREATE VIEW v1 AS SELECT * FROM t1;
@ -1652,6 +1664,7 @@ DROP TABLE t1, t2;
#the view protocol creates
# an additional util connection and other statistics data
--disable_ps2_protocol
--disable_view_protocol
FLUSH STATUS; # this test case *must* use Aria temp tables
@ -1664,6 +1677,7 @@ DROP TABLE t1;
--echo the value below *must* be 1
show status like 'Created_tmp_disk_tables';
--enable_view_protocol
--enable_ps2_protocol
--echo #
--echo # Bug #1002146: Unneeded filesort if usage of join buffer is not allowed

View file

@ -921,7 +921,7 @@ DROP TABLE t1,t2;
#
# Bug#24156: Loose index scan not used with CREATE TABLE ...SELECT and similar statements
#
--disable_ps2_protocol
CREATE TABLE t1 (a INT, b INT, INDEX (a,b));
INSERT INTO t1 (a, b) VALUES (1,1), (1,2), (1,3), (1,4), (1,5),
(2,2), (2,3), (2,1), (3,1), (4,1), (4,2), (4,3), (4,4), (4,5), (4,6);
@ -979,6 +979,7 @@ DELETE FROM t3 WHERE (SELECT (SELECT MAX(b) FROM t1 GROUP BY a HAVING a < 2) x
SHOW STATUS LIKE 'handler_read__e%';
DROP TABLE t1,t2,t3;
--enable_ps2_protocol
#
# Bug#25602: queries with DISTINCT and SQL_BIG_RESULT hint

View file

@ -9,6 +9,7 @@ DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a INT, INDEX (a));
INSERT INTO t1 VALUES (),(),(),(),(),(),(),(),(),();
--disable_ps2_protocol
FLUSH STATUS;
SELECT a FROM t1 ORDER BY a LIMIT 1;
SHOW STATUS LIKE 'HANDLER_READ%';
@ -24,6 +25,7 @@ SHOW STATUS LIKE 'HANDLER_READ%';
FLUSH STATUS;
SELECT a FROM t1 ORDER BY a DESC LIMIT 3;
SHOW STATUS LIKE 'HANDLER_READ%';
--enable_ps2_protocol
DROP TABLE t1;

View file

@ -892,8 +892,10 @@ CREATE TABLE t1 (t INT, u INT, KEY(t));
INSERT INTO t1 VALUES(10, 10), (11, 11), (12, 12), (12, 13),(14, 15), (15, 16),
(16, 17), (17, 17);
ANALYZE TABLE t1;
--disable_ps2_protocol
SELECT t, next_seq_value() r FROM t1 FORCE INDEX(t)
GROUP BY t HAVING r = 1 ORDER BY t1.u;
--enable_ps2_protocol
DROP TABLE t1;
DROP FUNCTION next_seq_value;

View file

@ -1406,12 +1406,13 @@ set global init_connect="";
#
# Bug#34517 SHOW GLOBAL STATUS does not work properly in embedded server.
#
--disable_ps2_protocol
create table t0 select * from information_schema.global_status where VARIABLE_NAME='COM_SELECT';
SELECT 1;
select a.VARIABLE_VALUE - b.VARIABLE_VALUE from t0 b, information_schema.global_status a
where a.VARIABLE_NAME = b.VARIABLE_NAME;
drop table t0;
--enable_ps2_protocol
#
# Bug#35275 INFORMATION_SCHEMA.TABLES.CREATE_OPTIONS omits KEY_BLOCK_SIZE

View file

@ -1,3 +1,4 @@
--disable_ps2_protocol
#
# MDEV-8633: information_schema.index_statistics doesn't delete item when drop table indexes or drop table;
#
@ -45,3 +46,4 @@ drop table just_a_test;
select * from information_schema.index_statistics where table_schema='test' and table_name='just_a_test';
select * from information_schema.table_statistics where table_schema='test' and table_name='just_a_test';
set global userstat=@save_userstat;
--enable_ps2_protocol

View file

@ -27,6 +27,7 @@ ANALYZE TABLE lineitem PERSISTENT FOR COLUMNS() INDEXES();
--enable_result_log
--enable_query_log
--disable_ps2_protocol
explain
select count(*) from lineitem where l_orderkey=130 and l_shipdate='1992-07-01';
flush status;
@ -149,6 +150,7 @@ select o_orderkey, p_partkey
where p_retailprice > 1100 and o_orderdate='1997-01-01'
and o_orderkey=l_orderkey and p_partkey=l_partkey;
show status like 'handler_read%';
--enable_ps2_protocol
--echo #
--echo # Bug mdev-3851: ref access used instead of expected eq_ref access
@ -317,12 +319,14 @@ select
A.a + 10 * B.a, A.a + 10 * B.a, A.a + 10 * B.a
from t1 A, t1 B;
--disable_ps2_protocol
--replace_column 9 #
explain
select * from t1, t2 where t2.a=t1.a and t2.b < 2;
flush status;
select * from t1, t2 where t2.a=t1.a and t2.b < 2;
show status like 'handler_read%';
--enable_ps2_protocol
drop table t1,t2;

View file

@ -210,6 +210,7 @@ drop table t1;
# (and thus for values returned by mysql_affected_rows())
# for various forms of INSERT
#
--disable_ps2_protocol
create table t1 (id int primary key, data int);
insert into t1 values (1, 1), (2, 2), (3, 3);
select row_count();
@ -227,6 +228,7 @@ select row_count();
insert into t1 values (5, 5) on duplicate key update data= data + 10;
select row_count();
drop table t1;
--enable_ps2_protocol
#
# Bug#25123: ON DUPLICATE KEY clause allows fields not from the insert table
@ -284,8 +286,10 @@ BEGIN
END |
delimiter ;|
--disable_ps2_protocol
SELECT f1();
SELECT f2();
--enable_ps2_protocol
INSERT INTO t1 VALUES (3);
INSERT DELAYED INTO t1 VALUES (4);
@ -592,7 +596,9 @@ CREATE ALGORITHM = MERGE VIEW v1 AS SELECT f1, f2 FROM t1 WHERE f1 = cast('' as
REPLACE INTO v1 SET f2 = 1;
SELECT * from t1;
drop view v1;
--disable_ps2_protocol
SELECT 0,0 INTO OUTFILE 't1.txt';
--enable_ps2_protocol
CREATE ALGORITHM = MERGE VIEW v1 AS SELECT f1, f2 FROM t1 WHERE f1 = 'x' WITH CHECK OPTION;
--error ER_TRUNCATED_WRONG_VALUE
LOAD DATA INFILE 't1.txt' INTO TABLE v1;

View file

@ -251,7 +251,9 @@ DROP TABLE t1;
create or replace table t1 (a int, b int invisible);
insert into t1 values (1),(2);
--disable_ps2_protocol
select * from t1 into outfile 'f';
--enable_ps2_protocol
load data infile 'f' into table t1;
select a,b from t1;
load data infile 'f' into table t1 (a,@v) SET b=@v;
@ -261,7 +263,9 @@ select a,b from t1;
truncate table t1;
insert into t1(a,b) values (1,1),(2,2);
--disable_ps2_protocol
select a,b from t1 into outfile 'a';
--enable_ps2_protocol
load data infile 'a' into table t1(a,b);
select a,b from t1;
load data infile 'a' into table t1 (a,@v) SET b=@v;

View file

@ -659,7 +659,9 @@ create table t3 (a int not null, primary key(a));
insert into t3 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
flush status;
--disable_ps2_protocol
select * from t1, t2, t3 where t3.a=t1.a and t2.a=t1.b;
--enable_ps2_protocol
explain select * from t1, t2, t3 where t3.a=t1.a and t2.a=t1.b;
--echo We expect rnd_next=5, and read_key must be 0 because of short-cutting:
show status like 'Handler_read%';
@ -958,7 +960,9 @@ INSERT INTO t1 VALUES (3,'b'),(4,NULL),(5,'c'),(6,'cc'),(7,'d'),
INSERT INTO t2 VALUES (2,NULL);
ANALYZE TABLE t1,t2;
FLUSH STATUS;
--disable_ps2_protocol
SELECT * FROM t1 JOIN t2 ON t1.v = t2.v WHERE t2.v IS NULL ORDER BY 1;
--enable_ps2_protocol
SHOW STATUS LIKE 'Handler_read_%';
DROP TABLE t1, t2;

View file

@ -1645,6 +1645,7 @@ insert into t2 values (3,1, 'qwerty'),(3,4, 'qwerty');
insert into t2 values (4,1, 'qwerty'),(4,2, 'qwerty'),(4,3, 'qwerty'),
(4,4, 'qwerty');
--disable_ps2_protocol
flush status;
set join_cache_level=5;
select t2.f1, t2.f2, t2.f3 from t1,t2
@ -1678,6 +1679,8 @@ explain select t2.f1, t2.f2, t2.f3 from t1,t2
where t1.f1=t2.f1 and t2.f2 between t1.f1 and t2.f2;
show status like "Handler_icp%";
--enable_ps2_protocol
drop table t1,t2;
set join_cache_level=@save_join_cache_level;
@ -4029,6 +4032,8 @@ insert into t1 values (1), (2);
insert into t2 values (1), (2);
insert into t3 values (2);
--disable_ps2_protocol
explain
select count(*) from t1 straight_join t2
where c1 = c2-0 and c2 <= (select max(c3) from t3 where c3 = 2 and @counter:=@counter+1);
@ -4055,6 +4060,8 @@ where c1 = c2-0 and
select @counter;
--enable_ps2_protocol
drop table t1,t2,t3;
set expensive_subquery_limit=@save_expensive_subquery_limit;

View file

@ -685,9 +685,15 @@ create table t1 (a int, b varchar(20));
create table t2 (a int, c varchar(20));
insert into t1 values (1,"aaaaaaaaaa"),(2,"bbbbbbbbbb");
insert into t2 values (1,"cccccccccc"),(2,"dddddddddd");
#Enable after fix MDEV-31276
--disable_ps2_protocol
select group_concat(t1.b,t2.c) from t1 left join t2 using(a) group by t1.a;
--enable_ps2_protocol
select group_concat(t1.b,t2.c) from t1 inner join t2 using(a) group by t1.a;
#Enable after fix MDEV-31276
--disable_ps2_protocol
select group_concat(t1.b,t2.c) from t1 left join t2 using(a) group by a;
--enable_ps2_protocol
select group_concat(t1.b,t2.c) from t1 inner join t2 using(a) group by a;
drop table t1, t2;
set group_concat_max_len=default;
@ -873,7 +879,8 @@ DROP TABLE t1,t2;
#
# Bug 28188: 'not exists' optimization for outer joins
#
--disable_ps2_protocol
CREATE TABLE t1 (id int PRIMARY KEY, a varchar(8));
CREATE TABLE t2 (id int NOT NULL, b int NOT NULL, INDEX idx(id));
INSERT INTO t1 VALUES
@ -889,7 +896,7 @@ SELECT t1.id, a FROM t1 LEFT JOIN t2 ON t1.id=t2.id WHERE t2.b IS NULL;
show status like 'Handler_read%';
DROP TABLE t1,t2;
--enable_ps2_protocol
#
# Bug 28571: outer join with false on condition over constant tables
#
@ -1369,6 +1376,7 @@ drop table t1,t2,t3,t4;
--echo # Bug#57024: Poor performance when conjunctive condition over the outer
--echo # table is used in the on condition of an outer join
--echo #
--disable_ps2_protocol
--disable_view_protocol
create table t1 (a int);
insert into t1 values (NULL), (NULL), (NULL), (NULL);
@ -1411,6 +1419,7 @@ show status like "handler_read%";
drop table t1,t2,t3;
--enable_view_protocol
--enable_ps2_protocol
--echo #
--echo # Bug#57688 Assertion `!table || (!table->write_set || bitmap_is_set(table->write_set, field
@ -2363,8 +2372,11 @@ create view v1 as select * from t1
left join ( select 'Y' AS Voted, ElectionID from t2 ) AS T
on T.ElectionID = t1.Election
limit 9;
#enable after fix MDEV-31277
--disable_ps2_protocol
# limit X causes merge algorithm select as opposed to temp table
select * from v1;
--enable_ps2_protocol
drop table t1, t2;
drop view v1;
@ -2379,7 +2391,10 @@ create view v10 as select *, 'U' as u from t10 left join (select 'Y' as y, t20.b
create table t30 (c int);
insert into t30 values (1),(3);
create view v20 as select * from t30 left join (select 'X' as x, v10.u, v10.y, v10.b from v10) dt2 on t30.c=dt2.b limit 6;
#check after fix MDEV-31277
--disable_ps2_protocol
select * from v20 limit 9;
--enable_ps2_protocol
drop view v10, v20;
drop table t10, t20, t30;
@ -2392,7 +2407,9 @@ create table t3 (c int);
insert into t3 values (3),(1);
create table t1 (a int);
insert into t1 values (1),(2),(7),(1);
#check after fix MDEV-31277
--disable_ps2_protocol
select * from
(
select * from
@ -2405,6 +2422,7 @@ select * from
on dt1.a=dt2.b
limit 9
) dt;
--enable_ps2_protocol
## Same as dt3 above
create view v3(x,c) as select * from (select 'X' as x, t3.c from t3) dt3;
@ -2418,7 +2436,10 @@ create view v0(y,b,x,c) as select * from v2 left join v3 on v2.b=v3.c;
# Same as above select statement
create view v1 as select 'Z' as z, t1.a, v0.* from t1 left join v0 on t1.a=v0.b limit 9;
#check after fix MDEV-31277
--disable_ps2_protocol
select * from v1;
--enable_ps2_protocol
set statement join_cache_level=0 for
select * from v1;

View file

@ -276,6 +276,7 @@ DROP TABLE t1;
# Test usage of the KEY_CACHE table from information schema
# for a simple key cache
--disable_ps2_protocol
set global key_buffer_size=@save_key_buffer_size;
set global key_cache_block_size=@save_key_cache_block_size;
select @@key_buffer_size;
@ -536,6 +537,7 @@ set global keycache2.key_buffer_size=0;
set global key_buffer_size=@save_key_buffer_size;
set global key_cache_segments=@save_key_cache_segments;
set global key_cache_file_hash_size=@save_key_cache_file_hash_size;
--enable_ps2_protocol
# End of 5.2 tests

View file

@ -489,6 +489,7 @@ WHERE alias3.c IN ( SELECT 1 UNION SELECT 6 )
GROUP BY field1, field2, field3, field4, field5
LIMIT ROWS EXAMINED 120;
--disable_ps2_protocol
FLUSH STATUS;
SELECT a AS field1, alias2.d AS field2, alias2.f AS field3, alias2.e AS field4, b AS field5
FROM t1, t2 AS alias2, t2 AS alias3
@ -506,6 +507,7 @@ GROUP BY field1, field2, field3, field4, field5
LIMIT ROWS EXAMINED 124;
SHOW STATUS LIKE 'Handler_read%';
SHOW STATUS LIKE 'Handler_tmp%';
--enable_ps2_protocol
drop table t1, t2;
@ -550,10 +552,12 @@ INSERT INTO t2 VALUES
(5, 0),(3, 4),(6, 1),
(5, 8),(4, 9),(8, 1);
--disable_ps2_protocol
SELECT (SELECT MAX(c) FROM t1, t2)
FROM t2
WHERE c = (SELECT MAX(b) FROM t2)
LIMIT ROWS EXAMINED 3;
--enable_ps2_protocol
drop table t1, t2;

View file

@ -36,6 +36,7 @@ drop table t1;
#
# Bug #12053 LOAD DATA INFILE ignores NO_AUTO_VALUE_ON_ZERO setting
#
--disable_ps2_protocol
SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
create table t1(id integer not null auto_increment primary key);
insert into t1 values(0);
@ -59,6 +60,7 @@ select * from t1;
remove_file $MYSQLTEST_VARDIR/tmp/t1;
SET @@SQL_MODE=@OLD_SQL_MODE;
drop table t1;
--enable_ps2_protocol
#
# Bug #11203: LOAD DATA does not accept same characters for ESCAPED and
@ -92,7 +94,9 @@ INSERT INTO t1 (c1) VALUES
SELECT * FROM t1;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--disable_ps2_protocol
eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1' FIELDS ENCLOSED BY 'r' FROM t1;
--enable_ps2_protocol
cat_file $MYSQLTEST_VARDIR/tmp/t1;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
@ -183,7 +187,9 @@ create table t1(f1 int);
insert into t1 values(1),(null);
create table t2(f2 int auto_increment primary key);
disable_query_log;
--disable_ps2_protocol
eval select * into outfile '$MYSQLTEST_VARDIR/tmp/t1' from t1;
--enable_ps2_protocol
SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
eval load data infile '$MYSQLTEST_VARDIR/tmp/t1' into table t2;
enable_query_log;
@ -200,16 +206,20 @@ create table t1(f1 int, f2 timestamp not null default current_timestamp);
create table t2(f1 int);
insert into t2 values(1),(2);
disable_query_log;
--disable_ps2_protocol
eval select * into outfile '$MYSQLTEST_VARDIR/tmp/t2' from t2;
--enable_ps2_protocol
eval load data infile '$MYSQLTEST_VARDIR/tmp/t2' ignore into table t1;
enable_query_log;
select f1 from t1 where f2 <> '0000-00-00 00:00:00' order by f1;
remove_file $MYSQLTEST_VARDIR/tmp/t2;
delete from t1;
disable_query_log;
--disable_ps2_protocol
eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t2'
FIELDS TERMINATED BY '' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\r\n'
FROM t2;
--enable_ps2_protocol
eval load data infile '$MYSQLTEST_VARDIR/tmp/t2' ignore into table t1
FIELDS TERMINATED BY '' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\r\n';
enable_query_log;
@ -228,7 +238,9 @@ INSERT INTO t1 (c1, c2, c3, c4) VALUES (10, '1970-02-01 01:02:03', 1.1E-100, 1.1
SELECT * FROM t1;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--disable_ps2_protocol
eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1' FIELDS ENCLOSED BY '-' FROM t1;
--enable_ps2_protocol
cat_file $MYSQLTEST_VARDIR/tmp/t1;
echo EOF;
@ -365,8 +377,10 @@ SET @OLD_SQL_MODE=@@SESSION.SQL_MODE;
SET sql_mode = '';
--disable_ps2_protocol
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--eval SELECT '1 \\\\aa\n' INTO DUMPFILE '$file'
--enable_ps2_protocol
CREATE TABLE t1 (id INT, val1 CHAR(3)) ENGINE=MyISAM;
@ -378,13 +392,17 @@ SELECT * FROM t1;
# show we can write this with OUTFILE, forcing the parameters for now
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--disable_ps2_protocol
--eval SELECT * INTO OUTFILE '$file2' FIELDS ESCAPED BY '' TERMINATED BY ' ' FROM t1
--enable_ps2_protocol
--diff_files $file $file2
--remove_file $file2
# now show the OUTFILE defaults are correct with NO_BACKSLASH_ESCAPES
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--disable_ps2_protocol
--eval SELECT * INTO OUTFILE '$file2' FIELDS TERMINATED BY ' ' FROM t1
--enable_ps2_protocol
--diff_files $file $file2
--remove_file $file2
@ -417,7 +435,9 @@ INSERT INTO t1 (id, val1) VALUES (3, '\tx');
--echo 1.1 NO_BACKSLASH_ESCAPES, use defaults for ESCAPED BY
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--disable_ps2_protocol
--eval SELECT * INTO OUTFILE '$file' FIELDS TERMINATED BY ' ' FROM t1 ORDER BY id
--enable_ps2_protocol
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--eval LOAD DATA INFILE '$file' INTO TABLE t2 FIELDS TERMINATED BY ' '
@ -439,7 +459,9 @@ eval SELECT LOAD_FILE("$file");
--echo 1.2 NO_BACKSLASH_ESCAPES, override defaults for ESCAPED BY
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--disable_ps2_protocol
--eval SELECT * INTO OUTFILE '$file' FIELDS ESCAPED BY '\' TERMINATED BY ' ' FROM t1 ORDER BY id
--enable_ps2_protocol
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--eval LOAD DATA INFILE '$file' INTO TABLE t2 FIELDS ESCAPED BY '\' TERMINATED BY ' '
@ -465,7 +487,9 @@ SET sql_mode = '';
--echo 2.1 !NO_BACKSLASH_ESCAPES, use defaults for ESCAPED BY
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--disable_ps2_protocol
--eval SELECT * INTO OUTFILE '$file' FIELDS TERMINATED BY ' ' FROM t1 ORDER BY id
--enable_ps2_protocol
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--eval LOAD DATA INFILE '$file' INTO TABLE t2 FIELDS TERMINATED BY ' '
@ -493,7 +517,9 @@ SET sql_mode = '';
--echo 2.2 !NO_BACKSLASH_ESCAPES, override defaults for ESCAPED BY
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--disable_ps2_protocol
--eval SELECT * INTO OUTFILE '$file' FIELDS ESCAPED BY '' TERMINATED BY ' ' FROM t1 ORDER BY id
--enable_ps2_protocol
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--eval LOAD DATA INFILE '$file' INTO TABLE t2 FIELDS ESCAPED BY '' TERMINATED BY ' '
@ -544,7 +570,9 @@ INSERT INTO t1 VALUES (1);
SET NAMES latin1;
SET character_set_filesystem=filename;
select @@character_set_filesystem;
--disable_ps2_protocol
SELECT * INTO OUTFILE 't-1' FROM t1;
--enable_ps2_protocol
DELETE FROM t1;
LOAD DATA INFILE 't-1' INTO TABLE t1;
SELECT * FROM t1;
@ -566,7 +594,9 @@ select @@character_set_filesystem;
--echo #
CREATE TABLE t1(col0 LONGBLOB);
--disable_ps2_protocol
SELECT 'test' INTO OUTFILE 't1.txt';
--enable_ps2_protocol
LOAD DATA INFILE 't1.txt' IGNORE INTO TABLE t1 SET col0=col0;
SELECT * FROM t1;
@ -635,7 +665,9 @@ disconnect con1;
--echo #
CREATE TABLE t1(f1 INT);
--disable_ps2_protocol
EVAL SELECT 0xE1BB30 INTO OUTFILE 't1.dat';
--enable_ps2_protocol
--disable_warnings
LOAD DATA INFILE 't1.dat' IGNORE INTO TABLE t1 CHARACTER SET utf8;
--enable_warnings
@ -649,9 +681,11 @@ remove_file $MYSQLD_DATADIR/test/t1.dat;
--echo # WHEN ERROR OCCURS
--echo #
--disable_ps2_protocol
--let $file=$MYSQLTEST_VARDIR/tmp/bug11735141.txt
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--eval SELECT '1\n' INTO DUMPFILE '$file'
--enable_ps2_protocol
create table t1(a point);
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
@ -737,7 +771,9 @@ CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a), UNIQUE(b));
INSERT INTO t1 VALUES (1,1);
CREATE TABLE t2 (c INT);
CREATE VIEW v AS SELECT t1.* FROM t1 JOIN t2;
--disable_ps2_protocol
SELECT a, b INTO OUTFILE '15645.data' FROM t1;
--enable_ps2_protocol
--error ER_WRONG_USAGE
LOAD DATA INFILE '15645.data' IGNORE INTO TABLE v (a,b);
--error ER_WRONG_USAGE

View file

@ -8,6 +8,7 @@ drop DATABASE if exists mysqltest_1;
# Test to see if select will get the lock ahead of low priority update
--disable_ps2_protocol
connect (locker,localhost,root,,);
connect (locker2,localhost,root,,);
connect (reader,localhost,root,,);
@ -87,6 +88,7 @@ select release_lock("mysqltest_lock");
connection writer;
reap;
drop table t1;
--enable_ps2_protocol
#
# Test problem when using locks with multi-updates

View file

@ -44,6 +44,7 @@ show fields from mysql.slow_log;
#
# Check flush command
#
--disable_ps2_protocol
flush slow logs;
@ -115,6 +116,7 @@ select * from t;
show session status like 'Slow_queries';
drop table t;
--enable_ps2_protocol
--echo #
--echo # End of 10.3 tests

View file

@ -16,6 +16,7 @@ connect (con2,localhost,root,,);
#
# Bug #27638: slow logging to CSV table inserts bad query_time and lock_time values
#
--disable_ps2_protocol
connection con1;
set session long_query_time=10;
select get_lock('bug27638', 1);
@ -36,5 +37,6 @@ connection default;
disconnect con1;
disconnect con2;
--enable_ps2_protocol
set @@global.log_output = @log_output.saved;

View file

@ -1051,12 +1051,14 @@ INSERT INTO t1 VALUES (2,2,2);
INSERT INTO t1 VALUES (3,3,3);
INSERT INTO t1 VALUES (4,4,4);
--disable_ps2_protocol
SELECT SQL_NO_CACHE 'Bug#31700 - SCAN',f1,f2,f3,SLEEP(1.1) FROM t1 WHERE f3=4;
SELECT SQL_NO_CACHE 'Bug#31700 - KEY', f1,f2,f3,SLEEP(1.1) FROM t1 WHERE f2=3;
SELECT SQL_NO_CACHE 'Bug#31700 - PK', f1,f2,f3,SLEEP(1.1) FROM t1 WHERE f1=2;
--replace_column 1 TIMESTAMP
SELECT start_time, rows_examined, rows_sent, sql_text FROM mysql.slow_log WHERE sql_text LIKE '%Bug#31700%' ORDER BY start_time;
--enable_ps2_protocol
DROP TABLE t1;

View file

@ -12,7 +12,9 @@ insert into t1 () values
(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),
(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),
(),(),(),();
--disable_ps2_protocol
select * into outfile 'load.data' from t1;
--enable_ps2_protocol
create temporary table tmp (a varchar(1024), b int, c int, d int, e linestring, unique (e));
load data infile 'load.data' into table tmp;
delete from tmp;
@ -224,7 +226,9 @@ drop table t1;
--echo #
CREATE TABLE t1 (data VARCHAR(4), unique(data) using hash) with system versioning;
INSERT INTO t1 VALUES ('A');
--disable_ps2_protocol
SELECT * INTO OUTFILE 'load.data' from t1;
--enable_ps2_protocol
--error ER_DUP_ENTRY
LOAD DATA INFILE 'load.data' INTO TABLE t1;
select * from t1;
@ -238,7 +242,9 @@ DROP TABLE t1;
CREATE TABLE t1 (data VARCHAR(7961)) ENGINE=InnoDB;
INSERT INTO t1 VALUES ('f'), ('o'), ('o');
--disable_ps2_protocol
SELECT * INTO OUTFILE 'load.data' from t1;
--enable_ps2_protocol
ALTER IGNORE TABLE t1 ADD UNIQUE INDEX (data);
SELECT * FROM t1;
@ -472,7 +478,9 @@ drop table t2;
--echo #
create table t1 (pk int primary key, f blob, unique(f)) engine=innodb;
insert t1 values (1, null);
--disable_ps2_protocol
select * into outfile 't1.data' from t1;
--enable_ps2_protocol
load data infile 't1.data' replace into table t1;
select * from t1;
drop table t1;

View file

@ -2023,7 +2023,9 @@ BEGIN
RETURN (SELECT MAX(c1) FROM tm1);
END|
DELIMITER ;|
--disable_ps2_protocol
SELECT f1() FROM (SELECT 1 UNION SELECT 1) c1;
--enable_ps2_protocol
DROP FUNCTION f1;
DROP TABLE tm1, t1, t2;
#

View file

@ -273,6 +273,7 @@ drop table t1;
--echo #
--echo # Test of MRR handler counters
--echo #
--disable_ps2_protocol
flush status;
show status like 'Handler_mrr%';
create table t0 (a int);
@ -321,6 +322,7 @@ show status like 'handler_mrr%';
set join_cache_level= @join_cache_level_save;
set join_buffer_size= @join_buffer_size_save;
--enable_ps2_protocol
drop table t0, t1;

View file

@ -2811,6 +2811,7 @@ drop database d;
--echo # MDEV-21786:
--echo # mysqldump will forget sequence definition details on --no-data dump
--echo #
--disable_ps2_protocol
create database d;
CREATE SEQUENCE d.s1 START WITH 100 INCREMENT BY 10 MINVALUE=100 MAXVALUE=1100 CYCLE;
@ -2861,6 +2862,7 @@ show create sequence d2.s1;
drop sequence d.s1, d.s2, d.s3, d.s4;
drop database d;
drop database d2;
--enable_ps2_protocol
--echo #
--echo # MDEV-20070

View file

@ -29,7 +29,9 @@ SET GLOBAL profiling=on;
create user mysqltest1@localhost;
connect (con1,localhost,mysqltest1,,);
connection con1;
--disable_ps2_protocol
SELECT @a, @b;
--enable_ps2_protocol
--replace_column 2 #
SHOW PROFILES;

View file

@ -1084,6 +1084,7 @@ DROP TABLE t1;
# Testing with side effects
--disable_ps2_protocol
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2),(3);
SET @a=0;
@ -1092,6 +1093,7 @@ SELECT @a;
SET @a=0;
SELECT NULLIF(AVG(a),0), NULLIF(AVG(LAST_VALUE(@a:=@a+1,a)),0) FROM t1;
SELECT @a;
--enable_ps2_protocol
# There should not be cache in here:

View file

@ -233,6 +233,7 @@ SELECT COUNT(*) FROM t3;
EXPLAIN SELECT SQL_CALC_FOUND_ROWS * FROM t1 LEFT JOIN t2 ON t1.a=t2.a
LEFT JOIN t3 ON t2.b=t3.b;
FLUSH STATUS ;
--disable_ps2_protocol
SELECT SQL_CALC_FOUND_ROWS * FROM t1 LEFT JOIN t2 ON t1.a=t2.a
LEFT JOIN t3 ON t2.b=t3.b;
@ -240,6 +241,7 @@ SELECT SQL_CALC_FOUND_ROWS * FROM t1 LEFT JOIN t2 ON t1.a=t2.a
SELECT FOUND_ROWS();
SHOW STATUS LIKE "handler_read%";
--enable_view_protocol
--enable_ps2_protocol
DROP TABLE t1,t2,t3,t4;
# End of 4.1 tests

View file

@ -18,8 +18,11 @@ select {fn length("hello")}, { date "1997-10-20" };
create table t1 (a int not null auto_increment,b int not null,primary key (a,b));
insert into t1 SET A=NULL,B=1;
insert into t1 SET a=null,b=2;
#Enable after fix MDEV-31307
--disable_ps2_protocol
select * from t1 where a is null and b=2;
select * from t1 where a is null;
--enable_ps2_protocol
explain select * from t1 where b is null;
drop table t1;
@ -28,8 +31,11 @@ drop table t1;
#
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY);
INSERT INTO t1 VALUES (NULL);
#Enable after fix MDEV-31307
--disable_ps2_protocol
SELECT sql_no_cache a, last_insert_id() FROM t1 WHERE a IS NULL;
SELECT sql_no_cache a, last_insert_id() FROM t1 WHERE a IS NULL;
--enable_ps2_protocol
SELECT sql_no_cache a, last_insert_id() FROM t1;
DROP TABLE t1;

View file

@ -450,6 +450,7 @@ DROP TABLE t;
--echo # MDEV-14041 Server crashes in String::length on queries with functions and ROLLUP
--echo #
--disable_ps2_protocol
#enable view protocol after fix MDEV-28538
--disable_view_protocol
@ -460,6 +461,7 @@ SELECT HEX( RELEASE_LOCK( 'foo' ) ) AS f FROM t1 GROUP BY f WITH ROLLUP;
DROP TABLE t1;
--enable_view_protocol
--enable_ps2_protocol
CREATE TABLE t1 (i INT);
INSERT INTO t1 VALUES (1),(2);

View file

@ -7417,8 +7417,8 @@ set optimizer_trace='enabled=on';
explain select * from t1 force index (a_b) where a=2 and b=4;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref a_b a_b 10 const,const 1 Using index
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JS
[
{
"range_scan_alternatives":
@ -7446,8 +7446,8 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
explain select * from t1 where a >= 900 and b between 10 and 20;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range a_b a_b 10 NULL 107 Using where; Using index
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JS
[
{
"range_scan_alternatives":
@ -7478,8 +7478,8 @@ insert into t1 select date_add(now(), interval a day), date_add(now(), interval
explain select * from t1 force index(start_date) where start_date >= '2019-02-10' and end_date <'2019-04-01';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range start_date start_date 8 NULL 1000 Using index condition
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JS
[
{
"range_scan_alternatives":
@ -7518,8 +7518,8 @@ insert into t1 select a,a, a,a from ten;
explain select * from t1 force index(a_b_c) where a between 1 and 4 and b < 50;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range a_b_c a_b_c 8 NULL 4 Using index condition
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JS
[
{
"range_scan_alternatives":
@ -7552,8 +7552,8 @@ INSERT INTO t1 VALUES (2, NULL);
EXPLAIN SELECT * FROM t1 WHERE b IN (0xD95B94336A9946A39CF5B58CFE772D8C);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref i_b i_b 17 const 1 Using index condition
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JS
[
{
"range_scan_alternatives":
@ -7581,8 +7581,8 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
EXPLAIN SELECT * FROM t1 WHERE b IS NULL;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref i_b i_b 17 const 1 Using index condition
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JS
[
{
"range_scan_alternatives":
@ -7618,8 +7618,8 @@ set optimizer_trace=1;
EXPLAIN SELECT * FROM t1 WHERE b='ab\n';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref i_b i_b 13 const 1 Using index condition
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JS
[
{
"range_scan_alternatives":
@ -7648,8 +7648,8 @@ ALTER TABLE t1 modify column b BINARY(10) AFTER i;
EXPLAIN SELECT * FROM t1 WHERE b='ab\n';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref i_b i_b 11 const 1 Using index condition
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JS
[
{
"range_scan_alternatives":
@ -7678,8 +7678,8 @@ ALTER TABLE t1 modify column b VARBINARY(10) AFTER i;
EXPLAIN SELECT * FROM t1 WHERE b='ab\n';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref i_b i_b 13 const 1 Using index condition
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JS
[
{
"range_scan_alternatives":
@ -7711,8 +7711,8 @@ INSERT INTO t1 VALUES (2, NULL);
EXPLAIN SELECT * FROM t1 WHERE b='ab\n';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref i_b i_b 11 const 1 Using index condition
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JS
[
{
"range_scan_alternatives":
@ -7747,8 +7747,8 @@ set optimizer_trace=1;
EXPLAIN SELECT * FROM t1 WHERE b= 'ab\n';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref i_b i_b 1003 const 1 Using where
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JS
[
{
"range_scan_alternatives":
@ -7781,8 +7781,8 @@ set optimizer_trace=1;
EXPLAIN SELECT * FROM t1 WHERE b='ab\n';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref i_b i_b 13 const 2 Using index condition
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JS
[
{
"range_scan_alternatives":
@ -7832,8 +7832,8 @@ EXPLAIN
}
}
}
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JS
[
{
"range_scan_alternatives":
@ -7891,8 +7891,8 @@ explain select * from t0 A, one_k B where A.a<5 and B.a<800;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE A ALL NULL NULL NULL NULL 10 Using where
1 SIMPLE B ALL NULL NULL NULL NULL 1000 Using where
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans'))
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JS
[
[
{
@ -7986,8 +7986,8 @@ explain select * from t0 A, one_k B where A.a=B.b and B.a<800;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE A ALL NULL NULL NULL NULL 10 Using where
1 SIMPLE B ref b b 5 test.A.a 1 Using where
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans'))
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JS
[
[
{
@ -8096,8 +8096,8 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref a a 258 const 1 Using where
SELECT * FROM t1 WHERE a= REPEAT('a', 0);
a
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JS
[
{
"range_scan_alternatives":
@ -8158,8 +8158,8 @@ insert into t1 values (1,1),(1,5),(5,1),(5,5);
set optimizer_trace=1;
select * from t1 force index(kp1) where (kp1=2 and kp2 >=4);
kp1 kp2
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.range_scan_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JSON_DETAILED(JSON_EXTRACT(trace, '$**.range_scan_alternatives'))
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.range_scan_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JS
[
[
{
@ -8188,8 +8188,8 @@ EXPLAIN SELECT * FROM t1, t2 WHERE t1.a=t2.a ORDER BY t2.b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL a NULL NULL NULL 10 Using where; Using temporary; Using filesort
1 SIMPLE t2 ref a a 5 test.t1.a 1
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans'))
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JS
[
[
{
@ -8343,8 +8343,8 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 100 0.22 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`a` between 1 and 5 and `test`.`t1`.`b` <= 5
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.selectivity_for_columns')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JSON_DETAILED(JSON_EXTRACT(trace, '$**.selectivity_for_columns'))
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.selectivity_for_columns')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JS
[
[
{
@ -8366,8 +8366,8 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 100 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`a` <> 5
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.selectivity_for_columns')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JSON_DETAILED(JSON_EXTRACT(trace, '$**.selectivity_for_columns'))
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.selectivity_for_columns')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JS
[
[
{
@ -8386,8 +8386,8 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 100 15.62 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`b` >= 10 and `test`.`t1`.`b` < 25
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.selectivity_for_columns')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JSON_DETAILED(JSON_EXTRACT(trace, '$**.selectivity_for_columns'))
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.selectivity_for_columns')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JS
[
[
{
@ -8408,8 +8408,8 @@ SELECT sum(b), row_number() OVER (order by b) FROM t1 WHERE a = 101;
sum(b) row_number() OVER (order by b)
NULL 1
UPDATE t1 SET b=10 WHERE a=1;
SELECT JSON_DETAILED(JSON_EXTRACT(trace, '$**.range_scan_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JSON_DETAILED(JSON_EXTRACT(trace, '$**.range_scan_alternatives'))
SELECT JSON_DETAILED(JSON_EXTRACT(trace, '$**.range_scan_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JS
[
[
{

View file

@ -21,6 +21,7 @@ create view v2 as select * from t1 where t1.a=1 group by t1.b;
set optimizer_trace="enabled=on";
--echo # Mergeable views/derived tables
--disable_ps2_protocol
--disable_view_protocol
select * from v1;
select * from information_schema.OPTIMIZER_TRACE;
@ -31,6 +32,7 @@ select * from information_schema.OPTIMIZER_TRACE;
select * from v2;
select * from information_schema.OPTIMIZER_TRACE;
--enable_view_protocol
--enable_ps2_protocol
drop table t1,t2;
drop view v1,v2;
drop function f1;
@ -403,13 +405,11 @@ create table t1 ( a int, b int, key a_b(a,b));
insert into t1 select a,a from one_k;
set optimizer_trace='enabled=on';
#enable after fix MDEV-27871
--disable_view_protocol
explain select * from t1 force index (a_b) where a=2 and b=4;
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
explain select * from t1 where a >= 900 and b between 10 and 20;
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
drop table t0,t1;
@ -418,7 +418,7 @@ create table t1 (start_date date, end_date date, filler char(100), key(start_dat
insert into t1 select date_add(now(), interval a day), date_add(now(), interval (a+7) day), 'data' from one_k;
--enable_warnings
explain select * from t1 force index(start_date) where start_date >= '2019-02-10' and end_date <'2019-04-01';
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
drop table t1,one_k;
create table ten(a int);
@ -433,7 +433,7 @@ create table t1 (
insert into t1 select a,a, a,a from ten;
explain select * from t1 force index(a_b_c) where a between 1 and 4 and b < 50;
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
drop table ten,t1;
--echo # Ported test from MYSQL for ranges involving Binary column
@ -443,10 +443,10 @@ INSERT INTO t1 VALUES (1, x'D95B94336A9946A39CF5B58CFE772D8C');
INSERT INTO t1 VALUES (2, NULL);
EXPLAIN SELECT * FROM t1 WHERE b IN (0xD95B94336A9946A39CF5B58CFE772D8C);
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
EXPLAIN SELECT * FROM t1 WHERE b IS NULL;
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
drop table t1;
@ -459,22 +459,22 @@ INSERT INTO t1 VALUES (1, 'ab\n');
INSERT INTO t1 VALUES (2, NULL);
set optimizer_trace=1;
EXPLAIN SELECT * FROM t1 WHERE b='ab\n';
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
ALTER TABLE t1 modify column b BINARY(10) AFTER i;
EXPLAIN SELECT * FROM t1 WHERE b='ab\n';
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
ALTER TABLE t1 modify column b VARBINARY(10) AFTER i;
EXPLAIN SELECT * FROM t1 WHERE b='ab\n';
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
drop table t1;
CREATE TABLE t1(i INT PRIMARY KEY, b CHAR(10), INDEX i_b(b));
INSERT INTO t1 VALUES (1, 'ab\n');
INSERT INTO t1 VALUES (2, NULL);
EXPLAIN SELECT * FROM t1 WHERE b='ab\n';
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
drop table t1;
CREATE TABLE t1(i INT PRIMARY KEY, b blob , INDEX i_b(b));
@ -482,7 +482,7 @@ INSERT INTO t1 VALUES (1, 'ab\n');
INSERT INTO t1 VALUES (2, NULL);
set optimizer_trace=1;
EXPLAIN SELECT * FROM t1 WHERE b= 'ab\n';
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
drop table t1;
CREATE TABLE t1(i INT PRIMARY KEY, b VARCHAR(10), INDEX i_b(b));
@ -490,7 +490,7 @@ INSERT INTO t1 VALUES (1, 'ab\n');
INSERT INTO t1 VALUES (2, 'ab\n');
set optimizer_trace=1;
EXPLAIN SELECT * FROM t1 WHERE b='ab\n';
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
drop table t1;
create table t0(a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
@ -501,9 +501,8 @@ create table t1 (start_date date, end_date date, filler char(100), key(start_dat
insert into t1 select date_add(now(), interval a day), date_add(now(), interval (a+7) day), 'data' from one_k;
--enable_warnings
explain format=json select * from t1 force index(start_date) where start_date >= '2019-02-10' and end_date <'2019-04-01';
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
drop table t1, t0, one_k;
--enable_view_protocol
--echo #
--echo # MDEV-19776: Assertion `to_len >= 8' failed in convert_to_printable with optimizer trace enabled
@ -533,18 +532,15 @@ set optimizer_trace=1;
--echo # (cost_for_plan is the same as best_access_path.cost for single-table SELECTs
--echo # but for joins using condition selectivity it is not as trivial. So,
--echo # now we are printing it)
#enable after fix MDEV-27871
--disable_view_protocol
explain select * from t0 A, one_k B where A.a<5 and B.a<800;
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
set join_cache_level=@tmp_jcl;
--echo # This shows post-join selectivity
explain select * from t0 A, one_k B where A.a=B.b and B.a<800;
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
drop table t0, one_k;
--enable_view_protocol
--echo #
--echo # Assertion `to_len >= 8' failed in convert_to_printable
@ -556,9 +552,7 @@ insert into t1 values ('foo'), ('bar');
EXPLAIN SELECT * FROM t1 WHERE a= REPEAT('a', 0);
SELECT * FROM t1 WHERE a= REPEAT('a', 0);
#enable after fix MDEV-27871
--disable_view_protocol
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
--enable_view_protocol
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
DROP TABLE t1;
--echo #
@ -589,9 +583,7 @@ insert into t1 values (1,1),(1,5),(5,1),(5,5);
set optimizer_trace=1;
select * from t1 force index(kp1) where (kp1=2 and kp2 >=4);
#enable after fix MDEV-27871
--disable_view_protocol
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.range_scan_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
--enable_view_protocol
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.range_scan_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
drop table t1;
--echo #
@ -604,12 +596,10 @@ CREATE TABLE t2(a INT, b INT, key(a));
INSERT INTO t2 SELECT seq, seq from seq_1_to_100;
#enable after fix MDEV-27871
--disable_view_protocol
SET OPTIMIZER_TRACE=1;
EXPLAIN SELECT * FROM t1, t2 WHERE t1.a=t2.a ORDER BY t2.b;
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
DROP TABLE t1,t2;
--enable_view_protocol
--echo #
--echo # MDEV-22665: Print ranges in the optimizer trace created for non-indexed columns when
@ -620,15 +610,12 @@ CREATE TABLE t1(a INT, b INT);
INSERT INTO t1 SELECT seq, seq from seq_1_to_100;
SET optimizer_trace=1;
ANALYZE TABLE t1 PERSISTENT FOR ALL;
#enable after fix MDEV-27871
--disable_view_protocol
EXPLAIN EXTENDED SELECT * from t1 WHERE a between 1 and 5 and b <= 5;
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.selectivity_for_columns')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.selectivity_for_columns')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
EXPLAIN EXTENDED SELECT * from t1 WHERE a != 5;
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.selectivity_for_columns')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.selectivity_for_columns')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
EXPLAIN EXTENDED SELECT * from t1 WHERE b >= 10 and b < 25;
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.selectivity_for_columns')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
--enable_view_protocol
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.selectivity_for_columns')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
drop table t1;
--echo #
@ -639,10 +626,7 @@ drop table t1;
CREATE TABLE t1( a INT, b INT, PRIMARY KEY( a ) );
SELECT sum(b), row_number() OVER (order by b) FROM t1 WHERE a = 101;
UPDATE t1 SET b=10 WHERE a=1;
#enable after fix MDEV-27871
--disable_view_protocol
SELECT JSON_DETAILED(JSON_EXTRACT(trace, '$**.range_scan_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
--enable_view_protocol
SELECT JSON_DETAILED(JSON_EXTRACT(trace, '$**.range_scan_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
DROP TABLE t1;
set optimizer_trace='enabled=off';
@ -784,9 +768,13 @@ select * from
from t10 left join t11 on t11.col1=t10.col1
group by grp_id) T on T.grp_id=t1.b;
# Not sure how MDEV-27871 is related but this test uses this reason
# all over the place:
#enable after fix MDEV-27871
# Enable after fix MDEV-31408
# On the first creation of the view from information_schema.optimizer_trace
# everything is fine, but on the second creation of the view is
# from information_schema.optimizer_trace the result of select
# from this view is already returned NULL.
# That's why view-protocol is disabled here
--disable_view_protocol
select json_detailed(json_extract(trace, '$**.check_split_materialized')) as JS

View file

@ -304,8 +304,8 @@ set optimizer_trace='enabled=on';
explain select key1,key2,key3 from t1 where key1=100 and key2=100 and key3=100;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index_merge key1,key2,key3 key1,key2,key3 5,5,5 NULL 2 Using intersect(key1,key2,key3); Using where; Using index
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JS
[
{
"range_scan_alternatives":
@ -398,8 +398,8 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
[]
}
]
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.chosen_range_access_summary')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JSON_DETAILED(JSON_EXTRACT(trace, '$**.chosen_range_access_summary'))
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.chosen_range_access_summary')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JS
[
{
"range_access_plan":
@ -443,8 +443,8 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.chosen_range_access_summary'))
explain select key1,key2,key3,key4 from t1 where key1=100 and key2=100 or key3=100 and key4=100;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index_merge key1,key2,key3,key4 key1,key2,key3,key4 5,5,5,5 NULL 154 Using union(intersect(key1,key2),intersect(key3,key4)); Using where
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JS
[
{
"range_scan_alternatives":
@ -620,8 +620,8 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
]
}
]
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.chosen_range_access_summary')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JSON_DETAILED(JSON_EXTRACT(trace, '$**.chosen_range_access_summary'))
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.chosen_range_access_summary')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JS
[
{
"range_access_plan":

View file

@ -119,17 +119,17 @@ insert into t1 (key1, key2, key3, key4, filler1) values (100, 100, -1, -1, 'key1
insert into t1 (key1, key2, key3, key4, filler1) values (-1, -1, 100, 100, 'key4-key3');
set optimizer_trace='enabled=on';
#check after fix MDEV-27871
# Enable after fix MDEV-31408
--disable_view_protocol
--echo # 3-way ROR-intersection
explain select key1,key2,key3 from t1 where key1=100 and key2=100 and key3=100;
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.chosen_range_access_summary')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.chosen_range_access_summary')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
--echo # ROR-union(ROR-intersection, ROR-range)
explain select key1,key2,key3,key4 from t1 where key1=100 and key2=100 or key3=100 and key4=100;
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.chosen_range_access_summary')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.chosen_range_access_summary')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
--enable_view_protocol
drop table t0,t1;

View file

@ -66,7 +66,9 @@ grant show view on db1.v1 to 'bar'@'%';
--change_user foo
select current_user();
set optimizer_trace="enabled=on";
--disable_ps2_protocol
select * from db1.v1;
--enable_ps2_protocol
select * from information_schema.OPTIMIZER_TRACE;
set optimizer_trace="enabled=off";

View file

@ -20,8 +20,8 @@ EXPLAIN
}
}
}
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives'))
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JS
[
{
"range_scan_alternatives":

View file

@ -6,8 +6,5 @@ insert into t1 values ('a', 'a');
insert into t1 values ('a', 'a');
set optimizer_trace=1;
explain format=json select * from t1 force index(col1) where col1 >='a';
#enable after fix MDEV-27871
--disable_view_protocol
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
--enable_view_protocol
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
drop table t1;

View file

@ -347,6 +347,8 @@ DROP TABLE t1;
--echo # MDEV-14835: conversion to TVC with BIGINT or YEAR values
--echo #
#Enable after fix MDEV-31178
--disable_ps2_protocol
SET @@in_predicate_conversion_threshold= 2;
CREATE TABLE t1 (a BIGINT);
@ -362,6 +364,7 @@ SELECT * FROM t2 WHERE y IN ('2009','2011');
DROP TABLE t1,t2;
SET @@in_predicate_conversion_threshold= default;
--enable_ps2_protocol
--echo #
--echo # MDEV-17222: conversion to TVC with no names for constants

View file

@ -1464,6 +1464,7 @@ SELECT * FROM t1 WHERE f1>10 ORDER BY f2, f0 LIMIT 0;
SELECT * FROM t1 WHERE f1>10 ORDER BY f2, f0 LIMIT 10 OFFSET 10;
SELECT * FROM t1 WHERE f1>10 ORDER BY f2, f0 LIMIT 0 OFFSET 10;
--disable_ps2_protocol
################
## Test with SQL_CALC_FOUND_ROWS
set sort_buffer_size= 32768;
@ -1510,6 +1511,7 @@ SELECT SQL_CALC_FOUND_ROWS * FROM t1 JOIN tmp on t1.f2=tmp.f2
WHERE t1.f2>20
ORDER BY tmp.f1, f0 LIMIT 30 OFFSET 30;
SELECT FOUND_ROWS();
--enable_ps2_protocol
################
## Test views
@ -1534,6 +1536,7 @@ GROUP BY 1 ORDER BY 2,1 LIMIT 0;
################
## Test SP
--disable_ps2_protocol
delimiter |;
CREATE PROCEDURE wl1393_sp_test()
BEGIN
@ -1547,6 +1550,7 @@ END|
CALL wl1393_sp_test()|
DROP PROCEDURE wl1393_sp_test|
delimiter ;|
--enable_ps2_protocol
################
## Test with subqueries
@ -1881,6 +1885,7 @@ insert into t1
analyze table t1;
--enable_result_log
--disable_ps2_protocol
explain
select b, count(*) num_cnt from t1
where a > 9750 group by b order by num_cnt;
@ -1900,6 +1905,7 @@ select b, count(*) num_cnt from t1
where a > 9750 group by b order by num_cnt limit 1;
--enable_result_log
show status like '%Handler_read%';
--enable_ps2_protocol
drop table t0, t1;

View file

@ -112,7 +112,9 @@ set sort_buffer_size=262144*10;
--source include/analyze-format.inc
eval analyze format=json $query;
flush status;
--disable_ps2_protocol
eval $query;
--enable_ps2_protocol
show status like '%sort%';
set sort_buffer_size=default;
@ -124,7 +126,9 @@ set sort_buffer_size=32768;
--source include/analyze-format.inc
eval analyze format=json $query;
flush status;
--disable_ps2_protocol
eval $query;
--enable_ps2_protocol
show status like '%sort%';
set sort_buffer_size=default;
@ -141,12 +145,16 @@ set sort_buffer_size= 2097152;
--source include/analyze-format.inc
eval ANALYZE FORMAT=JSON SELECT id, names, address FROM t3 ORDER BY names, address;
flush status;
--disable_ps2_protocol
evalp SELECT id, names, address INTO OUTFILE '$file1' FROM t3 ORDER BY names, address;
--enable_ps2_protocol
--echo # Sort_merge_passes should be 0
show status like '%sort%';
--disable_ps2_protocol
evalp SELECT id, names, address INTO OUTFILE '$file2' FROM t3 FORCE INDEX(idx) ORDER BY names, address;
--enable_ps2_protocol
diff_files $file1 $file2;
@ -163,7 +171,9 @@ set sort_buffer_size= 1097152;
--source include/analyze-format.inc
eval ANALYZE FORMAT=JSON SELECT id, names, address FROM t3 ORDER BY names, address;
flush status;
--disable_ps2_protocol
evalp SELECT id, names, address INTO OUTFILE '$file1' FROM t3 ORDER BY names, address;
--enable_ps2_protocol
--echo # Sort_merge_passes should be 0
show status like '%sort%';

View file

@ -57,7 +57,9 @@ set sort_buffer_size= 32768;
FLUSH STATUS;
SHOW SESSION STATUS LIKE 'Sort%';
--disable_ps2_protocol
SELECT * FROM t1 ORDER BY f2 LIMIT 100;
--enable_ps2_protocol
SHOW SESSION STATUS LIKE 'Sort%';

View file

@ -8,6 +8,7 @@ enable_query_log;
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
--disable_ps2_protocol
#
# test of into outfile|dumpfile
@ -139,3 +140,4 @@ drop database mysqltest;
# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc
--enable_ps2_protocol

View file

@ -5,6 +5,7 @@ DROP TABLE IF EXISTS t1, t2;
#enable view protocol after fix MDEV-27871
-- source include/no_view_protocol.inc
--disable_ps2_protocol
--echo #
--echo # Bug#31663 FIELDS TERMINATED BY special character
--echo #
@ -291,7 +292,7 @@ let $length= 800;
SELECT LENGTH(a) FROM t2;
DROP TABLE t1, t2;
--enable_ps2_protocol
###########################################################################
--echo # End of 5.1 tests.

View file

@ -474,6 +474,7 @@ INSERT INTO `t2` VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),
EXPLAIN PARTITIONS SELECT c1 FROM t1 WHERE (c1 > 10 AND c1 < 13) OR (c1 > 17 AND c1 < 20);
--disable_ps2_protocol
FLUSH STATUS;
SELECT c1 FROM t1 WHERE (c1 > 10 AND c1 < 13) OR (c1 > 17 AND c1 < 20);
SHOW STATUS LIKE 'Handler_read_%';
@ -484,6 +485,7 @@ FLUSH STATUS;
SELECT c1 FROM t2 WHERE (c1 > 10 AND c1 < 13) OR (c1 > 17 AND c1 < 20);
SHOW STATUS LIKE 'Handler_read_%';
DROP TABLE t1,t2;
--enable_ps2_protocol
# Bug#37329 Range scan on partitioned tables shows higher Handler_read_next
# (marked as duplicate of Bug#35931)
@ -505,6 +507,7 @@ INSERT INTO `t2` VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),
EXPLAIN PARTITIONS SELECT c1 FROM t1 WHERE (c1 > 2 AND c1 < 5);
--disable_ps2_protocol
FLUSH STATUS;
SELECT c1 FROM t1 WHERE (c1 > 2 AND c1 < 5);
SHOW STATUS LIKE 'Handler_read_%';
@ -527,6 +530,7 @@ FLUSH STATUS;
SELECT c1 FROM t2 WHERE (c1 > 12 AND c1 < 15);
SHOW STATUS LIKE 'Handler_read_%';
DROP TABLE t1,t2;
--enable_ps2_protocol
--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
create table t1 (a int) partition by list ((a/3)*10 div 1)

View file

@ -10,6 +10,7 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0;
--echo # Bug#13559657: PARTITION SELECTION DOES NOT WORK WITH VIEWS
--echo #
--disable_view_protocol
--disable_ps2_protocol
CREATE TABLE t1 (a int)
ENGINE = InnoDB
PARTITION BY HASH (a) PARTITIONS 2;
@ -85,7 +86,6 @@ SELECT * FROM v1;
SELECT * FROM t1;
DROP VIEW v1;
DROP TABLE t1;
--enable_service_connection
--echo # Original tests for WL#5217
--echo # Must have InnoDB as engine to get the same statistics results.
@ -101,7 +101,6 @@ eval $get_handler_status_counts;
eval $get_handler_status_counts;
--echo # OK, seems to add number of variables processed before HANDLER_WRITE
--echo # and number of variables + 1 evaluated in the previous call in RND_NEXT
--disable_service_connection
CREATE TABLE t1
(a INT NOT NULL,
b varchar (64),
@ -622,6 +621,7 @@ eval $get_handler_status_counts;
SELECT * FROM t3 PARTITION (pNeg);
DROP TABLE t1, t2, t3;
--enable_ps2_protocol
--enable_view_protocol
--echo # Test from superseeded WL# 2682
# Partition select tests.

View file

@ -968,6 +968,7 @@ ANALYZE TABLE t1,t2;
EXPLAIN SELECT a, MAX(b) FROM t1 WHERE a IN (10,100) GROUP BY a;
EXPLAIN SELECT a, MAX(b) FROM t2 WHERE a IN (10,100) GROUP BY a;
--disable_ps2_protocol
FLUSH status;
SELECT a, MAX(b) FROM t1 WHERE a IN (10, 100) GROUP BY a;
--echo # Should be no more than 4 reads.
@ -977,6 +978,7 @@ FLUSH status;
SELECT a, MAX(b) FROM t2 WHERE a IN (10, 100) GROUP BY a;
--echo # Should be no more than 4 reads.
SHOW status LIKE 'handler_read_key';
--enable_ps2_protocol
--echo #
--echo # MDEV-18501 Partition pruning doesn't work for historical queries

View file

@ -4495,7 +4495,10 @@ select 2 BETWEEN 1 AND 3 IN (SELECT 0 UNION SELECT 1), 2 BETWEEN 1 AND (3 IN (SE
create or replace view v1 as select 2 LIKE 1 ESCAPE 3 IN (SELECT 0 UNION SELECT 1), 2 LIKE 1 ESCAPE (3 IN (SELECT 0 UNION SELECT 1)), (2 LIKE 1 ESCAPE 3) IN (SELECT 0 UNION SELECT 1);
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';
#Enable after fix MDEV-31282
--disable_ps2_protocol
select 2 LIKE 1 ESCAPE 3 IN (SELECT 0 UNION SELECT 1), 2 LIKE 1 ESCAPE (3 IN (SELECT 0 UNION SELECT 1)), (2 LIKE 1 ESCAPE 3) IN (SELECT 0 UNION SELECT 1) union select * from v1;
--enable_ps2_protocol
create or replace view v1 as select 3 BETWEEN 1 AND 2 AND NULL, 3 BETWEEN (1 AND 2) AND NULL, 3 BETWEEN 1 AND (2 AND NULL), (3 BETWEEN 1 AND 2) AND NULL;
Select view_definition from information_schema.views where table_schema='test' and table_name='v1';

View file

@ -56,6 +56,7 @@ insert into t1(b) select b from t2;
select count(*) from t1;
select count(*) from t2;
--disable_ps2_protocol
flush tables; flush status;
show status like "key_read%";
@ -99,6 +100,7 @@ flush tables; flush status;
show status like "key_read%";
load index into cache t3 key (b), t2 key (c) ;
show status like "key_read%";
--enable_ps2_protocol
drop table t1, t2;

View file

@ -1,6 +1,7 @@
--source include/have_profiling.inc
--source include/no_view_protocol.inc
--disable_ps2_protocol
# Verify that the protocol isn't violated if we ask for profiling info
# before profiling has recorded anything.
show profiles;
@ -257,7 +258,7 @@ drop function if exists f1;
#--eval select 1; select 2; select 3;
## two continuations, one starting
#select state from information_schema.profiling where seq=1 order by query_id desc limit 3;
--enable_ps2_protocol
## last thing in the file
set session profiling = OFF;

View file

@ -466,6 +466,7 @@ deallocate prepare stmt;
# Bug#6088 "FOUND_ROWS returns wrong values for prepared statements when
# LIMIT is used"
#
--disable_ps2_protocol
create table t1 (a int);
insert into t1 (a) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
prepare stmt from "select sql_calc_found_rows * from t1 limit 2";
@ -477,6 +478,7 @@ execute stmt;
select found_rows();
deallocate prepare stmt;
drop table t1;
--enable_ps2_protocol
#
# Bug#6047 "permission problem when executing mysql_stmt_execute with derived
@ -558,13 +560,14 @@ drop table t1;
#
# Bug #6089: FOUND_ROWS returns wrong values when no table/view is used
#
--disable_ps2_protocol
prepare stmt from "SELECT SQL_CALC_FOUND_ROWS 'foo' UNION SELECT 'bar' LIMIT 0";
execute stmt;
SELECT FOUND_ROWS();
execute stmt;
SELECT FOUND_ROWS();
deallocate prepare stmt;
--enable_ps2_protocol
#
# Bug#9096 "select doesn't return all matched records if prepared statements
@ -1412,11 +1415,13 @@ DEALLOCATE PREPARE b12651;
# Bug #14956: ROW_COUNT() returns incorrect result after EXECUTE of prepared
# statement
#
--disable_ps2_protocol
create table t1 (id int);
prepare ins_call from "insert into t1 (id) values (1)";
execute ins_call;
select row_count();
drop table t1;
--enable_ps2_protocol
#
# BUG#16474: SP crashed MySQL
@ -3568,8 +3573,10 @@ flush status;
execute st;
show status like '%Handler_read%';
flush status;
--disable_ps2_protocol
select * from t1 use index() where a=3;
show status like '%Handler_read%';
--enable_ps2_protocol
flush status;
execute st;
show status like '%Handler_read%';

View file

@ -203,7 +203,9 @@ END|
DELIMITER ;|
--disable_ps2_protocol
SELECT * FROM t2 WHERE a = @@sort_buffer_size AND p1(@@sort_buffer_size + 1) > a - 1;
--enable_ps2_protocol
DROP TABLE t2;
DROP FUNCTION p1;

View file

@ -3,6 +3,7 @@
-- source include/no_valgrind_without_big.inc
-- source include/no_view_protocol.inc
--disable_ps2_protocol
set @save_query_cache_size=@@query_cache_size;
#
# Tests with query cache
@ -1812,3 +1813,4 @@ set global Query_cache_size=18446744073709547520;
--echo restore defaults
SET GLOBAL query_cache_type= default;
SET GLOBAL query_cache_size=@save_query_cache_size;
--enable_ps2_protocol

View file

@ -38,6 +38,7 @@ while ($1)
# prepare and execute, and we will get a constant validation
# error. See WL#4165 for details.
#
--disable_ps2_protocol
--disable_view_protocol
set @save_table_definition_cache= @@global.table_definition_cache;
set @@global.table_definition_cache=512;
@ -54,6 +55,7 @@ drop table t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t2
SET @@global.query_cache_size=0;
set @@global.table_definition_cache=@save_table_definition_cache;
--enable_view_protocol
--enable_ps2_protocol
# End of 4.1 tests

Some files were not shown because too many files have changed in this diff Show more