summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorunknown <igor@rurik.mysql.com>2004-11-05 22:15:24 -0800
committerunknown <igor@rurik.mysql.com>2004-11-05 22:15:24 -0800
commit9bd7def36943eca0be244a5da30d9a007f8aa935 (patch)
treeeec257d5ff4dfc6aaeb35cd27c5c6df1230d8a01 /sql/sql_select.cc
parentcf9e3745db16df776ca1c7ea4d2c0b1ba998ef68 (diff)
downloadmariadb-git-9bd7def36943eca0be244a5da30d9a007f8aa935.tar.gz
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. sql/sql_select.cc: Fixed the problem of bug report #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. It looks like that no attributes of the built condition are needed, so we don't have to call fix_fields here. mysql-test/t/join_outer.test: Added cases for bugs #6307 and #6460. mysql-test/r/join_outer.result: Added cases for bugs #6307 and #6460.
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index df74a946b5c..0a921ddb235 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -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 &