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
ad66d486
Commit
ad66d486
authored
Sep 05, 2003
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug#926 fix undone - it caused suboptimal execution plan for "range ON, no WHERE" query
Another fix applied
parent
f0879fd9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
sql/sql_select.cc
sql/sql_select.cc
+19
-2
No files found.
sql/sql_select.cc
View file @
ad66d486
...
@@ -146,7 +146,7 @@ static void copy_sum_funcs(Item_sum **func_ptr);
...
@@ -146,7 +146,7 @@ static void copy_sum_funcs(Item_sum **func_ptr);
static
bool
add_ref_to_table_cond
(
THD
*
thd
,
JOIN_TAB
*
join_tab
);
static
bool
add_ref_to_table_cond
(
THD
*
thd
,
JOIN_TAB
*
join_tab
);
static
void
init_sum_functions
(
Item_sum
**
func
);
static
void
init_sum_functions
(
Item_sum
**
func
);
static
bool
update_sum_func
(
Item_sum
**
func
);
static
bool
update_sum_func
(
Item_sum
**
func
);
static
void
select_describe
(
JOIN
*
join
,
bool
need_tmp_table
,
bool
need_order
,
static
void
select_describe
(
JOIN
*
join
,
bool
need_tmp_table
,
bool
need_order
,
bool
distinct
,
const
char
*
message
=
NullS
);
bool
distinct
,
const
char
*
message
=
NullS
);
static
void
describe_info
(
JOIN
*
join
,
const
char
*
info
);
static
void
describe_info
(
JOIN
*
join
,
const
char
*
info
);
...
@@ -2663,13 +2663,30 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
...
@@ -2663,13 +2663,30 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
join
->
thd
->
select_limit
<
join
->
best_positions
[
i
].
records_read
&&
join
->
thd
->
select_limit
<
join
->
best_positions
[
i
].
records_read
&&
!
(
join
->
select_options
&
OPTION_FOUND_ROWS
)))
!
(
join
->
select_options
&
OPTION_FOUND_ROWS
)))
{
{
/* Join with outer join condition */
COND
*
orig_cond
=
sel
->
cond
;
sel
->
cond
=
and_conds
(
sel
->
cond
,
tab
->
on_expr
);
if
(
sel
->
test_quick_select
(
tab
->
keys
,
if
(
sel
->
test_quick_select
(
tab
->
keys
,
used_tables
&
~
current_map
,
used_tables
&
~
current_map
,
(
join
->
select_options
&
(
join
->
select_options
&
OPTION_FOUND_ROWS
?
OPTION_FOUND_ROWS
?
HA_POS_ERROR
:
HA_POS_ERROR
:
join
->
thd
->
select_limit
))
<
0
)
join
->
thd
->
select_limit
))
<
0
)
DBUG_RETURN
(
1
);
// Impossible range
{
/* before reporting "Impossible WHERE" for the whole query
we have to check isn't it only "impossible ON" instead */
sel
->
cond
=
orig_cond
;
if
(
!
tab
->
on_expr
||
sel
->
test_quick_select
(
tab
->
keys
,
used_tables
&
~
current_map
,
(
join
->
select_options
&
OPTION_FOUND_ROWS
?
HA_POS_ERROR
:
join
->
thd
->
select_limit
))
<
0
)
DBUG_RETURN
(
1
);
// Impossible WHERE
}
else
sel
->
cond
=
orig_cond
;
/* Fix for EXPLAIN */
/* Fix for EXPLAIN */
if
(
sel
->
quick
)
if
(
sel
->
quick
)
join
->
best_positions
[
i
].
records_read
=
sel
->
quick
->
records
;
join
->
best_positions
[
i
].
records_read
=
sel
->
quick
->
records
;
...
...
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