diff options
author | unknown <monty@mashka.mysql.fi> | 2002-11-11 15:57:35 +0200 |
---|---|---|
committer | unknown <monty@mashka.mysql.fi> | 2002-11-11 15:57:35 +0200 |
commit | 3165440cdec9d1270a2101973cb75e67e334dc5c (patch) | |
tree | af6d24e40719efd42eef9d7580ef497455ddd45d /mysql-test/r | |
parent | 1b6548d54d6d649c068a73c8550e75ddb26bfd00 (diff) | |
download | mariadb-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 'mysql-test/r')
-rw-r--r-- | mysql-test/r/bdb.result | 2 | ||||
-rw-r--r-- | mysql-test/r/bool.result | 48 | ||||
-rw-r--r-- | mysql-test/r/innodb.result | 8 | ||||
-rw-r--r-- | mysql-test/r/null.result | 2 |
4 files changed, 54 insertions, 6 deletions
diff --git a/mysql-test/r/bdb.result b/mysql-test/r/bdb.result index e52878b9759..a815f2f8fab 100644 --- a/mysql-test/r/bdb.result +++ b/mysql-test/r/bdb.result @@ -203,7 +203,7 @@ a 2 check table t1; Table Op Msg_type Msg_text -test.t1 check error The handler for the table doesn't support check/repair +test.t1 check error The handler for the table doesn't support check drop table t1; create table t1 (a int,b varchar(20)) type=bdb; insert into t1 values (1,""), (2,"testing"); diff --git a/mysql-test/r/bool.result b/mysql-test/r/bool.result new file mode 100644 index 00000000000..dc170ee5150 --- /dev/null +++ b/mysql-test/r/bool.result @@ -0,0 +1,48 @@ +DROP TABLE IF EXISTS t1; +SELECT IF(NULL AND 1, 1, 2), IF(1 AND NULL, 1, 2); +IF(NULL AND 1, 1, 2) IF(1 AND NULL, 1, 2) +2 2 +SELECT NULL AND 1, 1 AND NULL, 0 AND NULL, NULL and 0; +NULL AND 1 1 AND NULL 0 AND NULL NULL and 0 +NULL NULL 0 0 +create table t1 (a int); +insert into t1 values (0),(1),(NULL); +SELECT * FROM t1 WHERE IF(a AND 1, 0, 1); +a +0 +NULL +SELECT * FROM t1 WHERE IF(1 AND a, 0, 1); +a +0 +NULL +SELECT * FROM t1 where NOT(a AND 1); +a +0 +SELECT * FROM t1 where NOT(1 AND a); +a +0 +SELECT * FROM t1 where (a AND 1)=0; +a +0 +SELECT * FROM t1 where (1 AND a)=0; +a +0 +SELECT * FROM t1 where (1 AND a)=1; +a +1 +SELECT * FROM t1 where (1 AND a) IS NULL; +a +NULL +SET @a=0, @b=0; +SELECT * FROM t1 WHERE NULL AND (@a:=@a+1); +a +SELECT * FROM t1 WHERE NOT(a>=0 AND NULL AND (@b:=@b+1)); +a +SELECT * FROM t1 WHERE a=2 OR (NULL AND (@a:=@a+1)); +a +SELECT * FROM t1 WHERE NOT(a=2 OR (NULL AND (@b:=@b+1))); +a +SELECT @a, @b; +@a @b +0 6 +DROP TABLE t1; diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 62f5734a217..67c78f34392 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -165,7 +165,7 @@ level id parent_id 1 1007 101 optimize table t1; Table Op Msg_type Msg_text -test.t1 optimize error The handler for the table doesn't support check/repair +test.t1 optimize error The handler for the table doesn't support optimize show keys from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment t1 0 PRIMARY 1 id A 87 NULL NULL BTREE @@ -189,7 +189,7 @@ create table t1 (a int) type=innodb; insert into t1 values (1), (2); optimize table t1; Table Op Msg_type Msg_text -test.t1 optimize error The handler for the table doesn't support check/repair +test.t1 optimize error The handler for the table doesn't support optimize delete from t1 where a = 1; select * from t1; a @@ -208,7 +208,7 @@ create index skr on t1 (a); insert into t1 values (3,""), (4,"testing"); analyze table t1; Table Op Msg_type Msg_text -test.t1 analyze error The handler for the table doesn't support check/repair +test.t1 analyze error The handler for the table doesn't support analyze show keys from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment t1 1 skr 1 a A 3 NULL NULL YES BTREE @@ -724,7 +724,7 @@ world 2 hello 1 optimize table t1; Table Op Msg_type Msg_text -test.t1 optimize error The handler for the table doesn't support check/repair +test.t1 optimize error The handler for the table doesn't support optimize show keys from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment t1 0 PRIMARY 1 a A 2 NULL NULL BTREE diff --git a/mysql-test/r/null.result b/mysql-test/r/null.result index e6e3b7155a3..07724a56025 100644 --- a/mysql-test/r/null.result +++ b/mysql-test/r/null.result @@ -30,7 +30,7 @@ SELECT (NULL OR NULL) IS NULL; 1 select NULL AND 0, 0 and NULL; NULL AND 0 0 and NULL -NULL 0 +0 0 select inet_ntoa(null),inet_aton(null),inet_aton("122.256"),inet_aton("122.226."),inet_aton(""); inet_ntoa(null) inet_aton(null) inet_aton("122.256") inet_aton("122.226.") inet_aton("") NULL NULL NULL NULL NULL |