diff options
author | unknown <bar@mysql.com/bar.myoffice.izhnet.ru> | 2007-10-05 12:15:11 +0500 |
---|---|---|
committer | unknown <bar@mysql.com/bar.myoffice.izhnet.ru> | 2007-10-05 12:15:11 +0500 |
commit | 64b19133820078a555e73ed1ff429984e82d1041 (patch) | |
tree | a8f229ad3a0b54c8e87866f471532633a263af0e /mysql-test/t/func_regexp.test | |
parent | 4e331363cf9603cfd46c18d272985695b486911f (diff) | |
download | mariadb-git-64b19133820078a555e73ed1ff429984e82d1041.tar.gz |
Bug#31081 server crash in regexp function
Problem: The "regex" library written by Henry Spencer
does not support tricky character sets like UCS2.
Fix: convert tricky character sets to UTF8 before calling
regex functions.
mysql-test/r/ctype_uca.result:
Adding tests
mysql-test/r/ctype_ucs.result:
Adding tests
mysql-test/r/ctype_utf8.result:
Adding tests
mysql-test/r/func_regexp.result:
Adding tests
mysql-test/t/ctype_uca.test:
Adding tests
mysql-test/t/ctype_ucs.test:
Adding tests
mysql-test/t/ctype_utf8.test:
Adding tests
mysql-test/t/func_regexp.test:
Adding tests
sql/item_cmpfunc.cc:
- Adding new method Item_func_regex::regcomp()
to share more code between fix_fields() and val_int()
- Adding conversion from ASCII-incompatible charsets like UCS2
to UTF8, because the "regexp" does not support these charsets
- Additional optimization: calculate flags for regcomp only
once in fix_fields, instead of every regcomp()
sql/item_cmpfunc.h:
Adding prototypes for new members and methods
mysql-test/include/ctype_regex.inc:
New BitKeeper file ``mysql-test/include/ctype_regex.inc''
Moving common regular expression tests into a separate
file and uncluding it into func_regexp and into many ctype_xxx tests.
Diffstat (limited to 'mysql-test/t/func_regexp.test')
-rw-r--r-- | mysql-test/t/func_regexp.test | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/mysql-test/t/func_regexp.test b/mysql-test/t/func_regexp.test index 23070c71fe9..f34830f6100 100644 --- a/mysql-test/t/func_regexp.test +++ b/mysql-test/t/func_regexp.test @@ -6,28 +6,9 @@ drop table if exists t1; --enable_warnings -create table t1 (s1 char(64),s2 char(64)); +set names latin1; +--source include/ctype_regex.inc -insert into t1 values('aaa','aaa'); -insert into t1 values('aaa|qqq','qqq'); -insert into t1 values('gheis','^[^a-dXYZ]+$'); -insert into t1 values('aab','^aa?b'); -insert into t1 values('Baaan','^Ba*n'); -insert into t1 values('aaa','qqq|aaa'); -insert into t1 values('qqq','qqq|aaa'); - -insert into t1 values('bbb','qqq|aaa'); -insert into t1 values('bbb','qqq'); -insert into t1 values('aaa','aba'); - -insert into t1 values(null,'abc'); -insert into t1 values('def',null); -insert into t1 values(null,null); -insert into t1 values('ghi','ghi['); - -select HIGH_PRIORITY s1 regexp s2 from t1; - -drop table t1; # # This test a bug in regexp on Alpha |