summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <timour@mysql.com>2005-08-23 20:03:32 +0300
committerunknown <timour@mysql.com>2005-08-23 20:03:32 +0300
commitb4e830c3e33cc229fef3e037bf44dbfc5109d731 (patch)
tree46744e00bac05aa35b9e21e99a91640bc5d6e39d /sql
parent142f65834b73e99cce98d9c537c22584bdd81033 (diff)
downloadmariadb-git-b4e830c3e33cc229fef3e037bf44dbfc5109d731.tar.gz
Fix for BUG#6276.
mysql-test/r/select.result: Test for BUG#6276. mysql-test/t/select.test: Test for BUG#6276. sql/sql_base.cc: Add a true ON condition for outer joins without common columns.
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_base.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 763fbc6c336..a7f5fa3ce03 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -3851,6 +3851,11 @@ store_top_level_join_columns(THD *thd, TABLE_LIST *table_ref,
*/
table_ref_1->natural_join= table_ref_2->natural_join= NULL;
+ /* Add a TRUE condition to outer joins that have no common columns. */
+ if (table_ref_2->outer_join &&
+ !table_ref_1->on_expr && !table_ref_2->on_expr)
+ table_ref_2->on_expr= new Item_int((longlong) 1,1); /* Always true. */
+
/* Change this table reference to become a leaf for name resolution. */
if (left_neighbor)
{