summaryrefslogtreecommitdiff
path: root/mysql-test/r/bool.result
diff options
context:
space:
mode:
authorunknown <salle@geopard.(none)>2002-11-18 13:41:07 +0200
committerunknown <salle@geopard.(none)>2002-11-18 13:41:07 +0200
commit925cd76bc9f6538c2d7f10a756dde7b5d648d40f (patch)
treec590c34db96365436e8bfc11d9d205303ccfaaf8 /mysql-test/r/bool.result
parent971db765336a86a314726ea2dbe2cb4acac80e79 (diff)
downloadmariadb-git-925cd76bc9f6538c2d7f10a756dde7b5d648d40f.tar.gz
Added tests for boolean operators in select part
Redo of changeset I commited, but failed to push mysql-test/r/bool.result: Added tests for boolean operators in select part mysql-test/t/bool.test: Added tests for boolean operators in select part
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;