summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2005-03-13 16:34:40 +0100
committerunknown <serg@serg.mylan>2005-03-13 16:34:40 +0100
commit2427f3695ccd495eb33ce10c3fb3a636823e8850 (patch)
tree254e6f7485d61866406b23139ea1dfecd5af5896
parent7cecea527d5fcfa7c12c55ee3c95347ee8f43b15 (diff)
downloadmariadb-git-2427f3695ccd495eb33ce10c3fb3a636823e8850.tar.gz
correct not_null_tables() for XOR and AND
correct top_level_item for XOR mysql-test/r/join_outer.result: one more test mysql-test/t/join_outer.test: one more test
-rw-r--r--mysql-test/r/join_outer.result6
-rw-r--r--mysql-test/t/join_outer.test1
-rw-r--r--sql/item_cmpfunc.h4
3 files changed, 10 insertions, 1 deletions
diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result
index 7981fc9c733..b035f88da41 100644
--- a/mysql-test/r/join_outer.result
+++ b/mysql-test/r/join_outer.result
@@ -857,4 +857,10 @@ a b a b
1 1 1 2
2 1 2 2
3 1 NULL NULL
+SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.a WHERE not(0+(t1.a=30 and t2.b=1));
+a b a b
+1 1 1 2
+2 1 2 2
+3 1 NULL NULL
+4 2 NULL NULL
DROP TABLE t1,t2;
diff --git a/mysql-test/t/join_outer.test b/mysql-test/t/join_outer.test
index 2ed7086746f..fe9ec1e0963 100644
--- a/mysql-test/t/join_outer.test
+++ b/mysql-test/t/join_outer.test
@@ -610,6 +610,7 @@ SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.a;
SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.a WHERE t1.b=1;
SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.a
WHERE t1.b=1 XOR (NOT ISNULL(t2.a) AND t2.b=1);
+SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.a WHERE not(0+(t1.a=30 and t2.b=1));
DROP TABLE t1,t2;
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index 7c48854850e..37b0674a094 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -966,6 +966,8 @@ public:
enum Functype functype() const { return COND_AND_FUNC; }
longlong val_int();
const char *func_name() const { return "and"; }
+ table_map not_null_tables() const
+ { return abort_on_null ? not_null_tables_cache: and_tables_cache; }
Item* copy_andor_structure(THD *thd)
{
Item_cond_and *item;
@@ -1013,7 +1015,7 @@ public:
enum Type type() const { return FUNC_ITEM; }
longlong val_int();
const char *func_name() const { return "xor"; }
- table_map not_null_tables() const { return and_tables_cache; }
+ void top_level_item() {}
};