mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
join_outer.result, join_outer.test:
Added cases for bugs #6307 and #6460. sql_select.cc: Fixed the problem of bug reports #6307 and #6460. The reported wrong result sets were due to the fact that the added call of the fix_fields method for the built AND condition that joined WHERE and ON conditions broke ON expression, as it removed extra AND levels in the built condition. It looks like that no attributes of the built condition are needed, so we don't have to call fix_fields here.
This commit is contained in:
@ -3507,8 +3507,17 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
|
||||
/* Join with outer join condition */
|
||||
COND *orig_cond=sel->cond;
|
||||
sel->cond= and_conds(sel->cond, tab->on_expr);
|
||||
|
||||
/*
|
||||
We can't call sel->cond->fix_fields,
|
||||
as it will break tab->on_expr if it's AND condition
|
||||
(fix_fields currently removes extra AND/OR levels).
|
||||
Yet attributes of the just built condition are not needed.
|
||||
Thus we call sel->cond->quick_fix_field for safety.
|
||||
*/
|
||||
if (sel->cond && !sel->cond->fixed)
|
||||
sel->cond->fix_fields(join->thd, 0, &sel->cond);
|
||||
sel->cond->quick_fix_field();
|
||||
|
||||
if (sel->test_quick_select(join->thd, tab->keys,
|
||||
used_tables & ~ current_map,
|
||||
(join->select_options &
|
||||
|
Reference in New Issue
Block a user