~drizzle-trunk/drizzle/development

1976.7.1 by Brian Aker
Added compatible REGEX for Drizzle to MySQL's syntax.
1
CREATE table t1 (xxx char(128));
2
INSERT into t1 (xxx) values('this is a test of some long text to see what happens');
3
SELECT * from t1 where xxx regexp('is a test of some long text to');
4
xxx
5
EXPLAIN EXTENDED SELECT * FROM t1 WHERE xxx REGEXP('is a test of some long text to');
6
id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
7
1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	1	100.00	Using where
8
Warnings:
9
Note	1003	select `test`.`t1`.`xxx` AS `xxx` from `test`.`t1` where regex(`test`.`t1`.`xxx`,'is a test of some long text to')
10
SELECT * from t1 where xxx regexp('is a test of some long text to ');
11
xxx
12
SELECT * from t1 where xxx regexp('is a test of some long text to s');
13
xxx
14
SELECT * from t1 where xxx regexp('is a test of some long text to se');
15
xxx
16
DROP table t1;
17
CREATE table t1 (xxx char(128));
18
INSERT into t1 (xxx) values('this is some text: to test - out.reg exp (22/45)');
19
SELECT * from t1 where xxx REGEXP '^this is some text: to test - out\\.regexp [[(][0-9]+[/\\][0-9]+[])][ ]*$';
20
xxx
21
DROP table t1;
22
SELECT 1 REGEXP NULL;
23
1 REGEXP NULL
1994.1.1 by Andrew Hutchings
Fix REGEXP which was using the match against value for the regex as well
24
NULL
1976.7.1 by Brian Aker
Added compatible REGEX for Drizzle to MySQL's syntax.
25
SELECT '' REGEXP BINARY NULL;
26
'' REGEXP BINARY NULL
27
NULL
28
SELECT NULL REGEXP BINARY NULL;
29
NULL REGEXP BINARY NULL
30
NULL
31
SELECT 'A' REGEXP BINARY NULL;
32
'A' REGEXP BINARY NULL
1994.1.1 by Andrew Hutchings
Fix REGEXP which was using the match against value for the regex as well
33
NULL
1976.7.1 by Brian Aker
Added compatible REGEX for Drizzle to MySQL's syntax.
34
SELECT "ABC" REGEXP BINARY NULL;
35
"ABC" REGEXP BINARY NULL
1994.1.1 by Andrew Hutchings
Fix REGEXP which was using the match against value for the regex as well
36
NULL
1976.7.1 by Brian Aker
Added compatible REGEX for Drizzle to MySQL's syntax.
37
CREATE TABLE t1(a INT, b CHAR(4));
38
INSERT INTO t1 VALUES (1, '6.1'), (1, '7.0'), (1, '8.0');
39
SET @stmt1="SELECT a FROM t1 WHERE a=1 AND '7.0' REGEXP b LIMIT 1";
40
EXECUTE @stmt1;
41
a
1994.1.1 by Andrew Hutchings
Fix REGEXP which was using the match against value for the regex as well
42
EXECUTE @stmt1;
43
a
44
EXECUTE @stmt1;
45
a
46
EXECUTE @stmt1;
47
a
1976.7.1 by Brian Aker
Added compatible REGEX for Drizzle to MySQL's syntax.
48
DROP TABLE t1;