summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index e3347aebd5d..d8504cf5fd6 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -2387,7 +2387,13 @@ TABLE_LIST *add_table_to_list(Table_ident *table, LEX_STRING *alias,
void add_join_on(TABLE_LIST *b,Item *expr)
{
- b->on_expr=expr;
+ if (!b->on_expr)
+ b->on_expr=expr;
+ else
+ {
+ // This only happens if you have both a right and left join
+ b->on_expr=new Item_cond_and(b->on_expr,expr);
+ }
}