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
4a7cacda
Commit
4a7cacda
authored
Jun 25, 2014
by
Sergei Petrunia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-406: ANALYZE $stmt: fix "explain UPDATE view problem".
parent
3da81ab9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
sql/sql_select.cc
sql/sql_select.cc
+20
-0
No files found.
sql/sql_select.cc
View file @
4a7cacda
...
...
@@ -23361,6 +23361,26 @@ void JOIN_TAB::save_explain_data(Explain_table_access *eta, table_map prefix_tab
else
{
TABLE_LIST
*
real_table
=
table
->
pos_in_table_list
;
/*
When multi-table UPDATE/DELETE does updates/deletes to a VIEW, the view
is merged in a certain particular way (grep for DT_MERGE_FOR_INSERT).
As a result, view's underlying tables have $tbl->pos_in_table_list={view}.
We don't want to print view name in EXPLAIN, we want underlying table's
alias (like specified in the view definition).
*/
if
(
real_table
->
merged_for_insert
)
{
TABLE_LIST
*
view_child
=
real_table
->
view
->
select_lex
.
table_list
.
first
;
for
(;
view_child
;
view_child
=
view_child
->
next_local
)
{
if
(
view_child
->
table
==
table
)
{
real_table
=
view_child
;
break
;
}
}
}
eta
->
table_name
.
copy
(
real_table
->
alias
,
strlen
(
real_table
->
alias
),
cs
);
}
...
...
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