summaryrefslogtreecommitdiffstats
path: root/mysql-test/main/func_regexp.result
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--mysql-test/main/func_regexp.result52
1 files changed, 49 insertions, 3 deletions
diff --git a/mysql-test/main/func_regexp.result b/mysql-test/main/func_regexp.result
index b883c818..7a9e24f8 100644
--- a/mysql-test/main/func_regexp.result
+++ b/mysql-test/main/func_regexp.result
@@ -110,7 +110,7 @@ R2
R3
deallocate prepare stmt1;
drop table t1;
-End of 4.1 tests
+# End of 4.1 tests
SELECT 1 REGEXP NULL;
1 REGEXP NULL
NULL
@@ -126,7 +126,7 @@ NULL
SELECT "ABC" REGEXP BINARY NULL;
"ABC" REGEXP BINARY NULL
NULL
-End of 5.0 tests
+# End of 5.0 tests
CREATE TABLE t1(a INT, b CHAR(4));
INSERT INTO t1 VALUES (1, '6.1'), (1, '7.0'), (1, '8.0');
PREPARE stmt1 FROM "SELECT a FROM t1 WHERE a=1 AND '7.0' REGEXP b LIMIT 1";
@@ -144,7 +144,7 @@ a
1
DEALLOCATE PREPARE stmt1;
DROP TABLE t1;
-End of 5.1 tests
+# End of 5.1 tests
SELECT ' ' REGEXP '[[:blank:]]';
' ' REGEXP '[[:blank:]]'
1
@@ -163,3 +163,49 @@ SELECT '\t' REGEXP '[[:space:]]';
SELECT REGEXP_INSTR('111222333',2);
REGEXP_INSTR('111222333',2)
4
+# End of 10.3 tests
+#
+# MDEV-33344 REGEXP empty string inconsistent
+#
+create table t1 (x char(5));
+insert t1 values (''), ('x');
+select 'foo' regexp x from t1 order by x asc;
+'foo' regexp x
+1
+0
+select 'foo' regexp x from t1 order by x desc;
+'foo' regexp x
+0
+1
+drop table t1;
+#
+# MDEV-21076 NOT NULL and UNIQUE constraints cause SUM() to yield an incorrect result
+#
+CREATE TABLE t0(c0 INT NOT NULL, c1 CHAR UNIQUE);
+INSERT INTO t0 VALUES (0, 1);
+INSERT INTO t0 VALUES (0, '');
+SELECT (c1 RLIKE c1), (c0 IS NULL) FROM t0;
+(c1 RLIKE c1) (c0 IS NULL)
+1 0
+1 0
+SELECT SUM(a.t) FROM (SELECT (c1 RLIKE c1) = (c0 IS NULL) as t FROM t0) as a;
+SUM(a.t)
+0
+DROP TABLE t0;
+#
+# MDEV-21058 CREATE TABLE with generated column and RLIKE results in sigabrt
+#
+CREATE TABLE t1 (c0 INT);
+INSERT INTO t1 VALUES (1),(2),(3);
+SELECT ('' RLIKE '[') AS c1 FROM t1;
+ERROR 42000: Regex error 'missing terminating ] for character class at offset 1'
+SELECT REGEXP_INSTR('','[') AS c1 FROM t1;
+ERROR 42000: Regex error 'missing terminating ] for character class at offset 1'
+SELECT c0, '' RLIKE NULL AS c1, REGEXP_INSTR('', NULL) AS c2
+FROM t1 ORDER BY c0;
+c0 c1 c2
+1 NULL NULL
+2 NULL NULL
+3 NULL NULL
+DROP TABLE t1;
+# End of 10.5 tests