Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
f07b3463
Commit
f07b3463
authored
Jun 05, 2015
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
do not re-populate I_S tables in subqueries
parent
980bdc3d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
1 deletion
+31
-1
mysql-test/r/information_schema2.result
mysql-test/r/information_schema2.result
+12
-0
mysql-test/t/information_schema2.test
mysql-test/t/information_schema2.test
+13
-0
sql/sql_show.cc
sql/sql_show.cc
+6
-1
No files found.
mysql-test/r/information_schema2.result
View file @
f07b3463
...
...
@@ -6,3 +6,15 @@ 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
create table t1 (a char);
insert t1 values ('a'),('t'),('z');
flush status;
select a, exists (select 1 from information_schema.columns where table_schema=concat('tes',a)) from t1;
a exists (select 1 from information_schema.columns where table_schema=concat('tes',a))
a 0
t 1
z 0
show status like 'created_tmp_tables';
Variable_name Value
Created_tmp_tables 38
drop table t1;
mysql-test/t/information_schema2.test
View file @
f07b3463
...
...
@@ -7,3 +7,16 @@ select variable_name from information_schema.session_status where variable_name
select
variable_name
from
information_schema
.
session_variables
where
variable_name
=
(
select
variable_name
from
information_schema
.
session_variables
where
variable_name
=
'basedir'
);
#
# information_schema tables inside subqueries, they should not be re-populated
# (i_s.columns needs to scan i_s itself, creating a tmp table for every i_s
# table. if it's re-populated, it'll do that multiple times)
#
create
table
t1
(
a
char
);
insert
t1
values
(
'a'
),(
't'
),(
'z'
);
flush
status
;
select
a
,
exists
(
select
1
from
information_schema
.
columns
where
table_schema
=
concat
(
'tes'
,
a
))
from
t1
;
# fix the result in ps-protocol
--
replace_result
39
38
show
status
like
'created_tmp_tables'
;
drop
table
t1
;
sql/sql_show.cc
View file @
f07b3463
...
...
@@ -7720,15 +7720,20 @@ bool get_schema_tables_result(JOIN *join,
TABLE_LIST
*
table_list
=
tab
->
table
->
pos_in_table_list
;
if
(
table_list
->
schema_table
&&
thd
->
fill_information_schema_tables
())
{
#if MYSQL_VERSION_ID > 100105
#error I_S tables only need to be re-populated if make_cond_for_info_schema() will preserve outer fields
bool
is_subselect
=
(
&
lex
->
unit
!=
lex
->
current_select
->
master_unit
()
&&
lex
->
current_select
->
master_unit
()
->
item
);
#else
#define is_subselect false
#endif
/* A value of 0 indicates a dummy implementation */
if
(
table_list
->
schema_table
->
fill_table
==
0
)
continue
;
/* skip I_S optimizations specific to get_all_tables */
if
(
thd
->
lex
->
describe
&&
if
(
lex
->
describe
&&
(
table_list
->
schema_table
->
fill_table
!=
get_all_tables
))
continue
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment