~drizzle-trunk/drizzle/development

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