summaryrefslogtreecommitdiffstats
path: root/mysql-test/main/func_equal.test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 18:00:34 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 18:00:34 +0000
commit3f619478f796eddbba6e39502fe941b285dd97b1 (patch)
treee2c7b5777f728320e5b5542b6213fd3591ba51e2 /mysql-test/main/func_equal.test
parentInitial commit. (diff)
downloadmariadb-3f619478f796eddbba6e39502fe941b285dd97b1.tar.xz
mariadb-3f619478f796eddbba6e39502fe941b285dd97b1.zip
Adding upstream version 1:10.11.6.upstream/1%10.11.6upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/main/func_equal.test')
-rw-r--r--mysql-test/main/func_equal.test46
1 files changed, 46 insertions, 0 deletions
diff --git a/mysql-test/main/func_equal.test b/mysql-test/main/func_equal.test
new file mode 100644
index 00000000..f17ebb5b
--- /dev/null
+++ b/mysql-test/main/func_equal.test
@@ -0,0 +1,46 @@
+# Initialise
+--disable_warnings
+drop table if exists t1,t2;
+--enable_warnings
+
+#
+# Testing of the <=> operator
+#
+
+#
+# First some simple tests
+#
+
+select 0<=>0,0.0<=>0.0,0E0=0E0,"A"<=>"A",NULL<=>NULL;
+select 1<=>0,0<=>NULL,NULL<=>0;
+select 1.0<=>0.0,0.0<=>NULL,NULL<=>0.0;
+select "A"<=>"B","A"<=>NULL,NULL<=>"A";
+select 0<=>0.0, 0.0<=>0E0, 0E0<=>"0", 10.0<=>1E1, 10<=>10.0, 10<=>1E1;
+select 1.0<=>0E1,10<=>NULL,NULL<=>0.0, NULL<=>0E0;
+
+#
+# Test with tables
+#
+
+create table t1 (id int, value int);
+create table t2 (id int, value int);
+
+insert into t1 values (1,null);
+insert into t2 values (1,null);
+
+select t1.*, t2.*, t1.value<=>t2.value from t1, t2 where t1.id=t2.id and t1.id=1;
+select * from t1 where id <=>id;
+select * from t1 where value <=> value;
+select * from t1 where id <=> value or value<=>id;
+drop table t1,t2;
+
+#
+# Bug #12612: quoted bigint unsigned value and the use of "in" in where clause
+#
+create table t1 (a bigint unsigned);
+insert into t1 values (4828532208463511553);
+select * from t1 where a = '4828532208463511553';
+select * from t1 where a in ('4828532208463511553');
+drop table t1;
+
+--echo #End of 4.1 tests