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
5b09d7a5
Commit
5b09d7a5
authored
May 07, 2006
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG#16798: Merge into 5.0: s/used_tables()/!const_item()/, added comment about its effects.
parent
c2377412
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
sql/sql_select.cc
sql/sql_select.cc
+14
-2
No files found.
sql/sql_select.cc
View file @
5b09d7a5
...
...
@@ -2377,7 +2377,19 @@ merge_key_fields(KEY_FIELD *start,KEY_FIELD *new_fields,KEY_FIELD *end,
{
if
(
old
->
field
==
new_fields
->
field
)
{
if
(
new_fields
->
val
->
used_tables
())
/*
NOTE: below const_item() call really works as "!used_tables()", i.e.
it can return FALSE where it is feasible to make it return TRUE.
The cause is as follows: Some of the tables are already known to be
const tables (the detection code is in make_join_statistics(),
above the update_ref_and_keys() call), but we didn't propagate
information about this: TABLE::const_table is not set to TRUE, and
Item::update_used_tables() hasn't been called for each item.
The result of this is that we're missing some 'ref' accesses.
TODO: OptimizerTeam: Fix this
*/
if
(
!
new_fields
->
val
->
const_item
())
{
/*
If the value matches, we can use the key reference.
...
...
@@ -2407,7 +2419,7 @@ merge_key_fields(KEY_FIELD *start,KEY_FIELD *new_fields,KEY_FIELD *end,
new_fields
->
null_rejecting
);
}
else
if
(
old
->
eq_func
&&
new_fields
->
eq_func
&&
((
!
old
->
val
->
used_tables
()
&&
old
->
val
->
is_null
())
||
((
old
->
val
->
const_item
()
&&
old
->
val
->
is_null
())
||
new_fields
->
val
->
is_null
()))
{
/* field = expression OR field IS NULL */
...
...
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