You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: mysql-test/r/information_schema2.result
+12-12Lines changed: 12 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -6,15 +6,15 @@ select variable_name from information_schema.session_variables where variable_na
6
6
(select variable_name from information_schema.session_variables where variable_name = 'basedir');
7
7
variable_name
8
8
BASEDIR
9
-
create table t1 (a char);
10
-
insert t1 values ('a'),('t'),('z');
11
-
flush status;
12
-
select a, exists (select 1 from information_schema.columns where table_schema=concat('tes',a)) from t1;
13
-
a exists (select 1 from information_schema.columns where table_schema=concat('tes',a))
14
-
a 0
15
-
t 1
16
-
z 0
17
-
show status like 'created_tmp_tables';
18
-
Variable_name Value
19
-
Created_tmp_tables 38
20
-
drop table t1;
9
+
create table t1 (x int);
10
+
create table t2 (x int);
11
+
create table t3 (x int);
12
+
create table t4 AS select table_name from information_schema.TABLES where table_schema = database() and table_type = 'BASE TABLE' ;
13
+
delete from t4 where table_name not in (select table_name from information_schema.TABLES where table_schema = database() and table_type = 'BASE TABLE');
Copy file name to clipboardExpand all lines: mysql-test/t/information_schema2.test
+8-11Lines changed: 8 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -8,15 +8,12 @@ select variable_name from information_schema.session_variables where variable_na
8
8
(select variable_name from information_schema.session_variables where variable_name = 'basedir');
9
9
10
10
#
11
-
# information_schema tables inside subqueries, they should not be re-populated
12
-
# (i_s.columns needs to scan i_s itself, creating a tmp table for every i_s
13
-
# table. if it's re-populated, it'll do that multiple times)
11
+
# MDEV-8796 Delete with sub query with information_schema.TABLES deletes too many rows
14
12
#
15
-
create table t1 (a char);
16
-
insert t1 values ('a'),('t'),('z');
17
-
flush status;
18
-
select a, exists (select 1 from information_schema.columns where table_schema=concat('tes',a)) from t1;
19
-
# fix the result in ps-protocol
20
-
--replace_result 39 38
21
-
show status like 'created_tmp_tables';
22
-
drop table t1;
13
+
create table t1 (x int);
14
+
create table t2 (x int);
15
+
create table t3 (x int);
16
+
create table t4 AS select table_name from information_schema.TABLES where table_schema = database() and table_type = 'BASE TABLE' ;
17
+
delete from t4 where table_name not in (select table_name from information_schema.TABLES where table_schema = database() and table_type = 'BASE TABLE');
0 commit comments