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
a85f6533
Commit
a85f6533
authored
May 27, 2016
by
Sergei Petrunia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-8989: ORDER BY optimizer ignores equality propagation
Post-fix: add comments, remove dead-code.
parent
99cd5a96
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
17 deletions
+13
-17
sql/sql_select.cc
sql/sql_select.cc
+13
-17
No files found.
sql/sql_select.cc
View file @
a85f6533
...
...
@@ -12342,30 +12342,26 @@ remove_const(JOIN *join,ORDER *first_order, COND *cond,
Item *item= order->item[0];
/*
We are using Context_identity below. This means only do
substitution when equality means
/*
TODO: equality substitution in the context of ORDER BY is
sometimes allowed when it is not allowed in the general case.
We make the below call for its side effect: it will locate the
multiple equality the item belongs to and set item->item_equal
accordingly.
*/
Item *res= item->propagate_equal_fields(join->thd,
Value_source::
Context_identity(),
join->cond_equal);
if (res != item)
{
/* Substituted to a constant */
can_subst_to_first_table= true;
}
else
Item_equal *item_eq;
if ((item_eq= res->get_item_equal()))
{
Item_equal *item_eq= item->get_item_equal();
if (item_eq)
Item *first= item_eq->get_first(NO_PARTICULAR_TAB, NULL);
if (first->const_item() || first->used_tables() ==
first_table_bit)
{
Item *first= item_eq->get_first(NO_PARTICULAR_TAB, NULL);
if (first->const_item() || first->used_tables() ==
first_table_bit)
{
can_subst_to_first_table= true;
}
can_subst_to_first_table= true;
}
}
}
...
...
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