Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
* remove dead code
* simplify the check for table->s->next_number_index
* misc
  • Loading branch information
vuvova committed May 5, 2024
1 parent 947eeaa commit 4f5dea4
Show file tree
Hide file tree
Showing 21 changed files with 683 additions and 135 deletions.
7 changes: 7 additions & 0 deletions mysql-test/main/information_schema2.result
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#
# MDEV-4029 SELECT on information_schema using a subquery locks up the information_schema table due to incorrect mutexes handling
#
select variable_name from information_schema.session_status where variable_name =
(select variable_name from information_schema.session_status where variable_name = 'uptime');
variable_name
Expand All @@ -6,6 +9,9 @@ select variable_name from information_schema.session_variables where variable_na
(select variable_name from information_schema.session_variables where variable_name = 'basedir');
variable_name
BASEDIR
#
# MDEV-8796 Delete with sub query with information_schema.TABLES deletes too many rows
#
create table t1 (x int);
create table t2 (x int);
create table t3 (x int);
Expand All @@ -18,3 +24,4 @@ t2
t3
t4
drop table t1, t2, t3, t4;
# End of 5.5 tests
14 changes: 8 additions & 6 deletions mysql-test/main/information_schema2.test
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@

#
# MDEV-4029 SELECT on information_schema using a subquery locks up the information_schema table due to incorrect mutexes handling
#
--echo #
--echo # MDEV-4029 SELECT on information_schema using a subquery locks up the information_schema table due to incorrect mutexes handling
--echo #
select variable_name from information_schema.session_status where variable_name =
(select variable_name from information_schema.session_status where variable_name = 'uptime');
select variable_name from information_schema.session_variables where variable_name =
(select variable_name from information_schema.session_variables where variable_name = 'basedir');

#
# MDEV-8796 Delete with sub query with information_schema.TABLES deletes too many rows
#
--echo #
--echo # MDEV-8796 Delete with sub query with information_schema.TABLES deletes too many rows
--echo #
create table t1 (x int);
create table t2 (x int);
create table t3 (x int);
create table t4 AS select table_name from information_schema.TABLES where table_schema = database() and table_type = 'BASE TABLE' ;
delete from t4 where table_name not in (select table_name from information_schema.TABLES where table_schema = database() and table_type = 'BASE TABLE');
select * from t4 order by table_name;
drop table t1, t2, t3, t4;

--echo # End of 5.5 tests
6 changes: 3 additions & 3 deletions mysql-test/main/innodb_ext_key,off.rdiff
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
where l_shipdate='1992-07-01' and l_orderkey between 1 and 1000
@@ -220,12 +220,12 @@
5959 3
show status like 'handler_read_next';
show /*a*/ status like 'handler_read_next';
Variable_name Value
-Handler_read_next 3
+Handler_read_next 9
Expand All @@ -177,7 +177,7 @@
select max(l_orderkey) from lineitem
where l_partkey between 1 and 10 group by l_partkey;
@@ -243,9 +243,9 @@
show status like 'handler_read%';
show /*b*/ status like 'handler_read%';
Variable_name Value
Handler_read_first 0
-Handler_read_key 21
Expand All @@ -199,7 +199,7 @@
select max(l_orderkey) from lineitem
where l_suppkey in (1,4) group by l_suppkey;
@@ -265,9 +265,9 @@
show status like 'handler_read%';
show /*c*/ status like 'handler_read%';
Variable_name Value
Handler_read_first 0
-Handler_read_key 6
Expand Down
28 changes: 14 additions & 14 deletions mysql-test/main/innodb_ext_key.result
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ flush status;
select count(*) from lineitem where l_orderkey=130 and l_shipdate='1992-07-01';
count(*)
1
show status like 'handler_read%';
show /*1*/ status like 'handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 1
Expand All @@ -35,7 +35,7 @@ select count(*) from lineitem use index(primary)
where l_orderkey=130 and l_linenumber=2 and l_shipdate='1992-07-01';
count(*)
1
show status like 'handler_read%';
show /*2*/ status like 'handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 1
Expand All @@ -56,7 +56,7 @@ select count(*) from lineitem
where l_shipdate='1992-07-01' and l_orderkey between 1 and 1000;
count(*)
1
show status like 'handler_read%';
show /*3*/ status like 'handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 1
Expand All @@ -79,7 +79,7 @@ l_orderkey l_linenumber
1088 3
1217 1
1221 3
show status like 'handler_read%';
show /*4*/ status like 'handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 1
Expand All @@ -98,7 +98,7 @@ flush status;
select min(l_orderkey) from lineitem where l_shipdate='1992-07-01';
min(l_orderkey)
130
show status like 'handler_read%';
show /*5*/ status like 'handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 1
Expand All @@ -119,7 +119,7 @@ select min(l_orderkey) from lineitem
where l_shipdate='1992-07-01' and l_orderkey between 1001 and 2000;
min(l_orderkey)
1088
show status like 'handler_read%';
show /*6*/ status like 'handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 1
Expand All @@ -140,7 +140,7 @@ select max(l_linenumber) from lineitem
where l_shipdate='1992-07-01' and l_orderkey=130;
max(l_linenumber)
2
show status like 'handler_read%';
show /*7*/ status like 'handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 1
Expand All @@ -166,7 +166,7 @@ or l_receiptdate='1992-07-01' and l_orderkey=5603;
l_orderkey l_linenumber
130 2
5603 2
show status like 'handler_read%';
show /*8*/ status like 'handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 2
Expand All @@ -193,7 +193,7 @@ l_orderkey l_linenumber
130 2
5603 2
5959 3
show status like 'handler_read%';
show /*9*/ status like 'handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 2
Expand All @@ -218,7 +218,7 @@ l_orderkey l_linenumber
130 2
5603 2
5959 3
show status like 'handler_read_next';
show /*a*/ status like 'handler_read_next';
Variable_name Value
Handler_read_next 3
explain
Expand All @@ -240,7 +240,7 @@ max(l_orderkey)
5894
5859
5632
show status like 'handler_read%';
show /*b*/ status like 'handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 21
Expand All @@ -262,7 +262,7 @@ where l_suppkey in (1,4) group by l_suppkey;
max(l_orderkey)
5988
5984
show status like 'handler_read%';
show /*c*/ status like 'handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 6
Expand Down Expand Up @@ -292,7 +292,7 @@ where p_retailprice > 1100 and o_orderdate='1997-01-01'
and o_orderkey=l_orderkey and p_partkey=l_partkey;
o_orderkey p_partkey
5895 200
show status like 'handler_read%';
show /*d*/ status like 'handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 3
Expand Down Expand Up @@ -457,7 +457,7 @@ select * from t1, t2 where t2.a=t1.a and t2.b < 2;
a pk a b
0 0 0 0
1 1 1 1
show status like 'handler_read%';
show /*e*/ status like 'handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 10
Expand Down
28 changes: 14 additions & 14 deletions mysql-test/main/innodb_ext_key.test
Original file line number Diff line number Diff line change
Expand Up @@ -34,53 +34,53 @@ explain
select count(*) from lineitem where l_orderkey=130 and l_shipdate='1992-07-01';
flush status;
select count(*) from lineitem where l_orderkey=130 and l_shipdate='1992-07-01';
show status like 'handler_read%';
show /*1*/ status like 'handler_read%';

explain
select count(*) from lineitem use index(primary)
where l_orderkey=130 and l_linenumber=2 and l_shipdate='1992-07-01';
flush status;
select count(*) from lineitem use index(primary)
where l_orderkey=130 and l_linenumber=2 and l_shipdate='1992-07-01';
show status like 'handler_read%';
show /*2*/ status like 'handler_read%';

explain
select count(*) from lineitem
where l_shipdate='1992-07-01' and l_orderkey between 1 and 1000;
flush status;
select count(*) from lineitem
where l_shipdate='1992-07-01' and l_orderkey between 1 and 1000;
show status like 'handler_read%';
show /*3*/ status like 'handler_read%';

explain
select l_orderkey, l_linenumber from lineitem
where l_shipdate='1992-07-01' and l_orderkey between 1001 and 2000;
flush status;
select l_orderkey, l_linenumber from lineitem
where l_shipdate='1992-07-01' and l_orderkey between 1001 and 2000;
show status like 'handler_read%';
show /*4*/ status like 'handler_read%';

explain
select min(l_orderkey) from lineitem where l_shipdate='1992-07-01';
flush status;
select min(l_orderkey) from lineitem where l_shipdate='1992-07-01';
show status like 'handler_read%';
show /*5*/ status like 'handler_read%';

explain
select min(l_orderkey) from lineitem
where l_shipdate='1992-07-01' and l_orderkey between 1001 and 2000;
flush status;
select min(l_orderkey) from lineitem
where l_shipdate='1992-07-01' and l_orderkey between 1001 and 2000;
show status like 'handler_read%';
show /*6*/ status like 'handler_read%';

explain
select max(l_linenumber) from lineitem
where l_shipdate='1992-07-01' and l_orderkey=130;
flush status;
select max(l_linenumber) from lineitem
where l_shipdate='1992-07-01' and l_orderkey=130;
show status like 'handler_read%';
show /*7*/ status like 'handler_read%';

explain
select l_orderkey, l_linenumber
Expand All @@ -92,7 +92,7 @@ select l_orderkey, l_linenumber
from lineitem use index (i_l_shipdate, i_l_receiptdate)
where l_shipdate='1992-07-01' and l_orderkey=130
or l_receiptdate='1992-07-01' and l_orderkey=5603;
show status like 'handler_read%';
show /*8*/ status like 'handler_read%';

--replace_column 7 #
explain
Expand All @@ -105,7 +105,7 @@ select l_orderkey, l_linenumber
from lineitem use index (i_l_shipdate, i_l_receiptdate)
where l_shipdate='1992-07-01' and l_orderkey between 1 and 1000
or l_receiptdate='1992-07-01' and l_orderkey between 5001 and 6000;
show status like 'handler_read%';
show /*9*/ status like 'handler_read%';

--replace_column 7 # 9 # 10 Using
explain
Expand All @@ -116,7 +116,7 @@ flush status;
select l_orderkey, l_linenumber from lineitem
where l_shipdate='1992-07-01' and l_orderkey between 1 and 1000
or l_receiptdate='1992-07-01' and l_orderkey between 5001 and 6000;
show status like 'handler_read_next';
show /*a*/ status like 'handler_read_next';

--replace_column 9 #
explain
Expand All @@ -125,7 +125,7 @@ select max(l_orderkey) from lineitem
flush status;
select max(l_orderkey) from lineitem
where l_partkey between 1 and 10 group by l_partkey;
show status like 'handler_read%';
show /*b*/ status like 'handler_read%';

--replace_column 9 #
explain
Expand All @@ -134,7 +134,7 @@ select max(l_orderkey) from lineitem
flush status;
select max(l_orderkey) from lineitem
where l_suppkey in (1,4) group by l_suppkey;
show status like 'handler_read%';
show /*c*/ status like 'handler_read%';

create index i_p_retailprice on part(p_retailprice);

Expand All @@ -151,7 +151,7 @@ select o_orderkey, p_partkey
lineitem use index (i_l_partkey), orders
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%';
show /*d*/ status like 'handler_read%';
--enable_ps2_protocol

--echo #
Expand Down Expand Up @@ -327,7 +327,7 @@ 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%';
show /*e*/ status like 'handler_read%';
--enable_ps2_protocol

drop table t1,t2;
Expand Down
2 changes: 0 additions & 2 deletions mysql-test/main/long_unique_bugs.test
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,6 @@ start transaction;
alter table tmp alter column a set default 8;
unlock tables;
drop table t2;
--source include/have_innodb.inc

--echo #
--echo # MDEV-22218 InnoDB: Failing assertion: node->pcur->rel_pos == BTR_PCUR_ON upon LOAD DATA with NO_BACKSLASH_ESCAPES in SQL_MODE and unique blob in table
Expand Down Expand Up @@ -642,7 +641,6 @@ insert into t1 values (0);
check table t1 extended;
drop table t1;


--echo #
--echo # MDEV-32837 long unique does not work like unique key when using replace
--echo #
Expand Down
2 changes: 0 additions & 2 deletions mysql-test/main/myisam.result
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
call mtr.add_suppression("Can't find record in '.*'");
call mtr.add_suppression("Table 't1' is marked as crashed and should be repaired");
drop table if exists t1,t2,t3;
SET SQL_WARNINGS=1;
CREATE TABLE t1 (
STRING_DATA char(255) default NULL,
KEY string_data (STRING_DATA)
Expand Down
6 changes: 0 additions & 6 deletions mysql-test/main/myisam.test
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@
call mtr.add_suppression("Can't find record in '.*'");
call mtr.add_suppression("Table 't1' is marked as crashed and should be repaired");

# Initialise
--disable_warnings
drop table if exists t1,t2,t3;
--enable_warnings
SET SQL_WARNINGS=1;

#
# Test problem with CHECK TABLE;
#
Expand Down
6 changes: 0 additions & 6 deletions mysql-test/main/trigger.result
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
drop table if exists t1, t2, t3, t4;
drop view if exists v1;
drop database if exists mysqltest;
drop function if exists f1;
drop function if exists f2;
drop procedure if exists p1;
connect addconroot1, localhost, root,,;
connect addconroot2, localhost, root,,;
connect addconwithoutdb, localhost, root,,*NO-ONE*;
Expand Down
9 changes: 0 additions & 9 deletions mysql-test/main/trigger.test
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,6 @@
# Basic triggers test
#

--disable_warnings
drop table if exists t1, t2, t3, t4;
drop view if exists v1;
drop database if exists mysqltest;
drop function if exists f1;
drop function if exists f2;
drop procedure if exists p1;
--enable_warnings

# Create additional connections used through test
connect (addconroot1, localhost, root,,);
connect (addconroot2, localhost, root,,);
Expand Down
303 changes: 302 additions & 1 deletion mysql-test/suite/galera/r/galera_load_data.result

Large diffs are not rendered by default.

304 changes: 302 additions & 2 deletions mysql-test/suite/galera/t/galera_load_data.test

Large diffs are not rendered by default.

0 comments on commit 4f5dea4

Please sign in to comment.