summaryrefslogtreecommitdiff
path: root/mysql-test/r/bool.result
diff options
context:
space:
mode:
authorsalle@geopard.(none) <>2002-11-18 13:41:07 +0200
committersalle@geopard.(none) <>2002-11-18 13:41:07 +0200
commita1a88ab92bde55ede514ee77e8a4124c328c805f (patch)
treec590c34db96365436e8bfc11d9d205303ccfaaf8 /mysql-test/r/bool.result
parent74f229fd612469630f5920f63222c8718fb33fce (diff)
downloadmariadb-git-a1a88ab92bde55ede514ee77e8a4124c328c805f.tar.gz
Added tests for boolean operators in select part
Redo of changeset I commited, but failed to push
Diffstat (limited to 'mysql-test/r/bool.result')
-rw-r--r--mysql-test/r/bool.result26
1 files changed, 26 insertions, 0 deletions
diff --git a/mysql-test/r/bool.result b/mysql-test/r/bool.result
index dc170ee5150..cb82c6baa0f 100644
--- a/mysql-test/r/bool.result
+++ b/mysql-test/r/bool.result
@@ -46,3 +46,29 @@ SELECT @a, @b;
@a @b
0 6
DROP TABLE t1;
+drop table if exists t;
+create table t(a int, b int);
+insert into t values(null, null), (0, null), (1, null), (null, 0), (null, 1), (0, 0), (0, 1), (1, 0), (1, 1);
+select ifnull(A, 'N') as A, ifnull(B, 'N') as B, ifnull(not A, 'N') as nA, ifnull(not B, 'N') as nB, ifnull(A and B, 'N') as AB, ifnull(not (A and B), 'N') as `n(AB)`, ifnull((not A or not B), 'N') as nAonB, ifnull(A or B, 'N') as AoB, ifnull(not(A or B), 'N') as `n(AoB)`, ifnull(not A and not B, 'N') as nAnB from t;
+A B nA nB AB n(AB) nAonB AoB n(AoB) nAnB
+N N N N N N N N N N
+0 N 1 N 0 1 1 N N N
+1 N 0 N N N N 1 0 0
+N 0 N 1 0 1 1 N N N
+N 1 N 0 N N N 1 0 0
+0 0 1 1 0 1 1 0 1 1
+0 1 1 0 0 1 1 1 0 0
+1 0 0 1 0 1 1 1 0 0
+1 1 0 0 1 0 0 1 0 0
+select ifnull(A=1, 'N') as A, ifnull(B=1, 'N') as B, ifnull(not (A=1), 'N') as nA, ifnull(not (B=1), 'N') as nB, ifnull((A=1) and (B=1), 'N') as AB, ifnull(not ((A=1) and (B=1)), 'N') as `n(AB)`, ifnull((not (A=1) or not (B=1)), 'N') as nAonB, ifnull((A=1) or (B=1), 'N') as AoB, ifnull(not((A=1) or (B=1)), 'N') as `n(AoB)`, ifnull(not (A=1) and not (B=1), 'N') as nAnB from t;
+A B nA nB AB n(AB) nAonB AoB n(AoB) nAnB
+N N N N N N N N N N
+0 N 1 N 0 1 1 N N N
+1 N 0 N N N N 1 0 0
+N 0 N 1 0 1 1 N N N
+N 1 N 0 N N N 1 0 0
+0 0 1 1 0 1 1 0 1 1
+0 1 1 0 0 1 1 1 0 0
+1 0 0 1 0 1 1 1 0 0
+1 1 0 0 1 0 0 1 0 0
+drop table t;