~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/string_functions/tests/t/regex.test

  • Committer: Brian Aker
  • Date: 2010-12-07 21:33:25 UTC
  • mto: This revision was merged to the branch mainline in revision 1987.
  • Revision ID: brian@tangent.org-20101207213325-u6vbc107dpe0c7ld
Added compatible REGEX for Drizzle to MySQL's syntax.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Test REGEX function
 
2
CREATE table t1 (xxx char(128));
 
3
INSERT into t1 (xxx) values('this is a test of some long text to see what happens');
 
4
SELECT * from t1 where xxx regexp('is a test of some long text to');
 
5
EXPLAIN EXTENDED SELECT * FROM t1 WHERE xxx REGEXP('is a test of some long text to');
 
6
SELECT * from t1 where xxx regexp('is a test of some long text to ');
 
7
SELECT * from t1 where xxx regexp('is a test of some long text to s');
 
8
SELECT * from t1 where xxx regexp('is a test of some long text to se');
 
9
DROP table t1;
 
10
 
 
11
CREATE table t1 (xxx char(128));
 
12
INSERT into t1 (xxx) values('this is some text: to test - out.reg exp (22/45)');
 
13
SELECT * from t1 where xxx REGEXP '^this is some text: to test - out\\.regexp [[(][0-9]+[/\\][0-9]+[])][ ]*$';
 
14
DROP table t1;
 
15
 
 
16
SELECT 1 REGEXP NULL;
 
17
 
 
18
SELECT '' REGEXP BINARY NULL;
 
19
SELECT NULL REGEXP BINARY NULL;
 
20
SELECT 'A' REGEXP BINARY NULL;
 
21
SELECT "ABC" REGEXP BINARY NULL;
 
22
 
 
23
CREATE TABLE t1(a INT, b CHAR(4));
 
24
INSERT INTO t1 VALUES (1, '6.1'), (1, '7.0'), (1, '8.0');
 
25
SET @stmt1="SELECT a FROM t1 WHERE a=1 AND '7.0' REGEXP b LIMIT 1";
 
26
EXECUTE @stmt1;
 
27
EXECUTE @stmt1;
 
28
EXECUTE @stmt1;
 
29
EXECUTE @stmt1;
 
30
DROP TABLE t1;
 
31