summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.h
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mnogosearch.org>2013-10-08 18:25:17 +0400
committerAlexander Barkov <bar@mnogosearch.org>2013-10-08 18:25:17 +0400
commit1bcd2bebc69163c541baa548f1204ccd1b830d25 (patch)
treed3ee75906d99188903b87662730d415ded4a1b0e /sql/item_cmpfunc.h
parent43c09c15ff6d07e70d3fb12f7eea47dd85ecd992 (diff)
downloadmariadb-git-1bcd2bebc69163c541baa548f1204ccd1b830d25.tar.gz
MDEV-4425 Regexp enhancements
Do not pass PCRE_UCP flag for binary data. This makes bytes 0x80..FF not to belong to generic character classes \d (digit) and \w (word character). SELECT 0xFF RLIKE '\\w'; -> 0 Note, this change does not affect non-binary data, which is still examined with the PCRE_UCP flag by default.
Diffstat (limited to 'sql/item_cmpfunc.h')
-rw-r--r--sql/item_cmpfunc.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index e8574a573e7..2d89b8d65db 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -1511,8 +1511,9 @@ public:
{}
void init(CHARSET_INFO *data_charset, int extra_flags, uint nsubpatterns)
{
- m_library_flags= PCRE_UCP | extra_flags |
- (data_charset != &my_charset_bin ? PCRE_UTF8 : 0) |
+ m_library_flags= extra_flags |
+ (data_charset != &my_charset_bin ?
+ (PCRE_UTF8 | PCRE_UCP) : 0) |
((data_charset->state &
(MY_CS_BINSORT | MY_CS_CSSORT)) ? 0 : PCRE_CASELESS);