summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2002-11-11 15:57:35 +0200
committerunknown <monty@mashka.mysql.fi>2002-11-11 15:57:35 +0200
commit3165440cdec9d1270a2101973cb75e67e334dc5c (patch)
treeaf6d24e40719efd42eef9d7580ef497455ddd45d /sql/sql_parse.cc
parent1b6548d54d6d649c068a73c8550e75ddb26bfd00 (diff)
downloadmariadb-git-3165440cdec9d1270a2101973cb75e67e334dc5c.tar.gz
Fixed that NULL and 0 returns 0 instead of NULL
This is coded to not cause a speed impact on top level AND expressions where we don't care if an AND expression returns 0 or NULL mysql-test/r/bdb.result: Fix results after serges last patch mysql-test/r/innodb.result: Fix results after serges last patch mysql-test/r/null.result: Update for new AND handling of NULL scripts/mysqld_safe.sh: Fix 'isroot' test to work even if user is not root sql/item.h: Fixed that NULL and 0 returns 0 instead of NULL sql/item_cmpfunc.cc: Fixed that NULL and 0 returns 0 instead of NULL sql/item_cmpfunc.h: Fixed that NULL and 0 returns 0 instead of NULL sql/sql_base.cc: Fixed that NULL and 0 returns 0 instead of NULL sql/sql_parse.cc: Fixed that NULL and 0 returns 0 instead of NULL sql/sql_select.cc: Fixed that NULL and 0 returns 0 instead of NULL sql/sql_yacc.yy: Fixed that NULL and 0 returns 0 instead of NULL
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 086a0a561a0..eb2d2ace467 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -3324,12 +3324,16 @@ static bool create_total_list(THD *thd, LEX *lex, TABLE_LIST **result)
void add_join_on(TABLE_LIST *b,Item *expr)
{
- if (!b->on_expr)
- b->on_expr=expr;
- else
+ if (expr)
{
- // This only happens if you have both a right and left join
- b->on_expr=new Item_cond_and(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);
+ }
+ b->on_expr->top_level_item();
}
}