summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.h
diff options
context:
space:
mode:
authorunknown <bar@mysql.com/bar.myoffice.izhnet.ru>2007-10-05 12:15:11 +0500
committerunknown <bar@mysql.com/bar.myoffice.izhnet.ru>2007-10-05 12:15:11 +0500
commit64b19133820078a555e73ed1ff429984e82d1041 (patch)
treea8f229ad3a0b54c8e87866f471532633a263af0e /sql/item_cmpfunc.h
parent4e331363cf9603cfd46c18d272985695b486911f (diff)
downloadmariadb-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 'sql/item_cmpfunc.h')
-rw-r--r--sql/item_cmpfunc.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index 8410c66b034..11851e9a4e4 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -1313,6 +1313,10 @@ class Item_func_regex :public Item_bool_func
bool regex_is_const;
String prev_regexp;
DTCollation cmp_collation;
+ CHARSET_INFO *regex_lib_charset;
+ int regex_lib_flags;
+ String conv;
+ bool regcomp(bool send_error);
public:
Item_func_regex(Item *a,Item *b) :Item_bool_func(a,b),
regex_compiled(0),regex_is_const(0) {}