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
3fc77434
Commit
3fc77434
authored
Nov 24, 2013
by
Igor Babaev
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
11eb7333
998ed514
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
sql/sql_select.cc
sql/sql_select.cc
+28
-0
No files found.
sql/sql_select.cc
View file @
3fc77434
...
@@ -3618,6 +3618,21 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list,
...
@@ -3618,6 +3618,21 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list,
conds
=
new
Item_int
((
longlong
)
0
,
1
);
conds
=
new
Item_int
((
longlong
)
0
,
1
);
}
}
join
->
conds
=
conds
;
join
->
conds
=
conds
;
join
->
cond_equal
=
NULL
;
if
(
conds
)
{
if
(
conds
->
type
()
==
Item
::
COND_ITEM
&&
((
Item_cond
*
)
conds
)
->
functype
()
==
Item_func
::
COND_AND_FUNC
)
join
->
cond_equal
=
(
&
((
Item_cond_and
*
)
conds
)
->
cond_equal
);
else
if
(
conds
->
type
()
==
Item
::
FUNC_ITEM
&&
((
Item_func
*
)
conds
)
->
functype
()
==
Item_func
::
MULT_EQUAL_FUNC
)
{
if
(
!
join
->
cond_equal
)
join
->
cond_equal
=
new
COND_EQUAL
;
join
->
cond_equal
->
current_level
.
empty
();
join
->
cond_equal
->
current_level
.
push_back
((
Item_equal
*
)
conds
);
}
}
}
}
/* Calc how many (possible) matched records in each table */
/* Calc how many (possible) matched records in each table */
...
@@ -3732,6 +3747,19 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list,
...
@@ -3732,6 +3747,19 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list,
if
(
join
->
const_tables
!=
join
->
table_count
)
if
(
join
->
const_tables
!=
join
->
table_count
)
optimize_keyuse
(
join
,
keyuse_array
);
optimize_keyuse
(
join
,
keyuse_array
);
DBUG_ASSERT
(
!
join
->
conds
||
!
join
->
cond_equal
||
!
join
->
cond_equal
->
current_level
.
elements
||
(
join
->
conds
->
type
()
==
Item
::
COND_ITEM
&&
((
Item_cond
*
)
(
join
->
conds
))
->
functype
()
==
Item_func
::
COND_AND_FUNC
&&
join
->
cond_equal
==
&
((
Item_cond_and
*
)
(
join
->
conds
))
->
cond_equal
)
||
(
join
->
conds
->
type
()
==
Item
::
FUNC_ITEM
&&
((
Item_func
*
)
(
join
->
conds
))
->
functype
()
==
Item_func
::
MULT_EQUAL_FUNC
&&
join
->
cond_equal
->
current_level
.
elements
==
1
&&
join
->
cond_equal
->
current_level
.
head
()
==
join
->
conds
));
if
(
optimize_semijoin_nests
(
join
,
all_table_map
))
if
(
optimize_semijoin_nests
(
join
,
all_table_map
))
DBUG_RETURN
(
TRUE
);
/* purecov: inspected */
DBUG_RETURN
(
TRUE
);
/* purecov: inspected */
...
...
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