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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
d7fd3ffb
Commit
d7fd3ffb
authored
Sep 08, 2014
by
Jan Lindström
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '10.1' of github.com:MariaDB/server into 10.1
parents
d3ceb934
d161546b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
6 deletions
+19
-6
sql/sql_select.cc
sql/sql_select.cc
+9
-5
sql/sql_show.cc
sql/sql_show.cc
+1
-0
sql/sql_show.h
sql/sql_show.h
+9
-1
No files found.
sql/sql_select.cc
View file @
d7fd3ffb
...
...
@@ -23490,16 +23490,19 @@ void JOIN_TAB::save_explain_data(Explain_table_access *eta, table_map prefix_tab
const
char
*
tmp_buff
;
int
f_idx
;
StringBuffer
<
64
>
key_name_buf
;
if
(
is_table_read_plan
->
has_db_lookup_value
())
if
(
is_table_read_plan
->
trivial_show_command
||
is_table_read_plan
->
has_db_lookup_value
())
{
/* The "key" has the name of the column referring to the database */
f_idx
=
table_list
->
schema_table
->
idx_field1
;
tmp_buff
=
table_list
->
schema_table
->
fields_info
[
f_idx
].
field_name
;
key_name_buf
.
append
(
tmp_buff
,
strlen
(
tmp_buff
),
cs
);
}
if
(
is_table_read_plan
->
has_table_lookup_value
())
if
(
is_table_read_plan
->
trivial_show_command
||
is_table_read_plan
->
has_table_lookup_value
())
{
if
(
is_table_read_plan
->
has_db_lookup_value
())
if
(
is_table_read_plan
->
trivial_show_command
||
is_table_read_plan
->
has_db_lookup_value
())
key_name_buf
.
append
(
','
);
f_idx
=
table_list
->
schema_table
->
idx_field2
;
...
...
@@ -23630,8 +23633,9 @@ void JOIN_TAB::save_explain_data(Explain_table_access *eta, table_map prefix_tab
else
eta
->
push_extra
(
ET_OPEN_FULL_TABLE
);
/* psergey-note: the following has a bug.*/
if
(
table_list
->
is_table_read_plan
->
has_db_lookup_value
()
&&
table_list
->
is_table_read_plan
->
has_table_lookup_value
())
if
(
table_list
->
is_table_read_plan
->
trivial_show_command
||
(
table_list
->
is_table_read_plan
->
has_db_lookup_value
()
&&
table_list
->
is_table_read_plan
->
has_table_lookup_value
()))
eta
->
push_extra
(
ET_SCANNED_0_DATABASES
);
else
if
(
table_list
->
is_table_read_plan
->
has_db_lookup_value
()
||
table_list
->
is_table_read_plan
->
has_table_lookup_value
())
...
...
sql/sql_show.cc
View file @
d7fd3ffb
...
...
@@ -8035,6 +8035,7 @@ static bool optimize_for_get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond
if
(
lsel
&&
lsel
->
table_list
.
first
)
{
/* These do not need to have a query plan */
plan
->
trivial_show_command
=
true
;
goto
end
;
}
...
...
sql/sql_show.h
View file @
d7fd3ffb
...
...
@@ -192,9 +192,17 @@ typedef struct st_lookup_field_values
class
IS_table_read_plan
:
public
Sql_alloc
{
public:
IS_table_read_plan
()
:
no_rows
(
false
)
{}
IS_table_read_plan
()
:
no_rows
(
false
)
,
trivial_show_command
(
FALSE
)
{}
bool
no_rows
;
/*
For EXPLAIN only: For SHOW KEYS and SHOW COLUMNS, we know which
db_name.table_name will be read, however for some reason we don't
set the fields in this->lookup_field_vals.
In order to not have JOIN::save_explain_data() walking over uninitialized
data, we set trivial_show_command=true.
*/
bool
trivial_show_command
;
LOOKUP_FIELD_VALUES
lookup_field_vals
;
Item
*
partial_cond
;
...
...
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