summaryrefslogtreecommitdiff
path: root/mysys/charset.c
diff options
context:
space:
mode:
authorunknown <bar@mysql.com>2004-11-22 11:58:40 +0400
committerunknown <bar@mysql.com>2004-11-22 11:58:40 +0400
commit6d6b38c27fcac1da19a11fa07a5f02c2c22635fe (patch)
tree31ad3a81538d6c1313dce3f959bcd8df3a3a2998 /mysys/charset.c
parent5a7198f54d1a11ac7ef70a55c6a9b9044147df54 (diff)
downloadmariadb-git-6d6b38c27fcac1da19a11fa07a5f02c2c22635fe.tar.gz
Bug #6737: REGEXP gives wrong result with case sensitive collation:
- A new flag MY_CS_CSSORT was introduced for case sensitivity. - Item_func_regexp doesn't substiture ICASE not only for binary collations but for case sensitive collations as well.
Diffstat (limited to 'mysys/charset.c')
-rw-r--r--mysys/charset.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/mysys/charset.c b/mysys/charset.c
index 1388fc40c6d..cb2379f8723 100644
--- a/mysys/charset.c
+++ b/mysys/charset.c
@@ -228,6 +228,7 @@ static int add_collation(CHARSET_INFO *cs)
}
else
{
+ uchar *sort_order= all_charsets[cs->number]->sort_order;
simple_cs_init_functions(all_charsets[cs->number]);
new->mbminlen= 1;
new->mbmaxlen= 1;
@@ -236,6 +237,16 @@ static int add_collation(CHARSET_INFO *cs)
all_charsets[cs->number]->state |= MY_CS_LOADED;
}
all_charsets[cs->number]->state|= MY_CS_AVAILABLE;
+
+ /*
+ Check if case sensitive sort order: A < a < B.
+ We need MY_CS_FLAG for regex library, and for
+ case sensitivity flag for 5.0 client protocol,
+ to support isCaseSensitive() method in JDBC driver
+ */
+ if (sort_order && sort_order['A'] < sort_order['a'] &&
+ sort_order['a'] < sort_order['B'])
+ all_charsets[cs->number]->state|= MY_CS_CSSORT;
}
}
else