Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
938fb67b
Commit
938fb67b
authored
Jun 07, 2004
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug #3928 regexp [[:>:]] and UTF-8
parent
5cc410bb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
7 deletions
+51
-7
mysql-test/r/ctype_utf8.result
mysql-test/r/ctype_utf8.result
+22
-0
mysql-test/t/ctype_utf8.test
mysql-test/t/ctype_utf8.test
+16
-0
strings/ctype-utf8.c
strings/ctype-utf8.c
+13
-7
No files found.
mysql-test/r/ctype_utf8.result
View file @
938fb67b
...
...
@@ -218,3 +218,25 @@ b
select * from t1 where a = 'b' and a != 'b';
a
drop table t1;
set names utf8;
select 'вася' rlike '[[:<:]]вася[[:>:]]';
'вася' rlike '[[:<:]]вася[[:>:]]'
1
select 'вася ' rlike '[[:<:]]вася[[:>:]]';
'вася ' rlike '[[:<:]]вася[[:>:]]'
1
select ' вася' rlike '[[:<:]]вася[[:>:]]';
' вася' rlike '[[:<:]]вася[[:>:]]'
1
select ' вася ' rlike '[[:<:]]вася[[:>:]]';
' вася ' rlike '[[:<:]]вася[[:>:]]'
1
select 'васяz' rlike '[[:<:]]вася[[:>:]]';
'васяz' rlike '[[:<:]]вася[[:>:]]'
0
select 'zвася' rlike '[[:<:]]вася[[:>:]]';
'zвася' rlike '[[:<:]]вася[[:>:]]'
0
select 'zвасяz' rlike '[[:<:]]вася[[:>:]]';
'zвасяz' rlike '[[:<:]]вася[[:>:]]'
0
mysql-test/t/ctype_utf8.test
View file @
938fb67b
...
...
@@ -141,3 +141,19 @@ select * from t1 where a = 'b';
select
*
from
t1
where
a
=
'b'
and
a
=
'b'
;
select
*
from
t1
where
a
=
'b'
and
a
!=
'b'
;
drop
table
t1
;
#
# Bug #3928 regexp [[:>:]] and UTF-8
#
set
names
utf8
;
# This should return TRUE
select
'вася'
rlike
'[[:<:]]вася[[:>:]]'
;
select
'вася '
rlike
'[[:<:]]вася[[:>:]]'
;
select
' вася'
rlike
'[[:<:]]вася[[:>:]]'
;
select
' вася '
rlike
'[[:<:]]вася[[:>:]]'
;
# This should return FALSE
select
'васяz'
rlike
'[[:<:]]вася[[:>:]]'
;
select
'zвася'
rlike
'[[:<:]]вася[[:>:]]'
;
select
'zвасяz'
rlike
'[[:<:]]вася[[:>:]]'
;
strings/ctype-utf8.c
View file @
938fb67b
...
...
@@ -1524,8 +1524,12 @@ MY_UNICASE_INFO *uni_plane[256]={
#ifdef HAVE_CHARSET_utf8
/* These arrays are taken from usa7 implementation */
/*
We consider bytes with code more than 127 as a letter.
This garantees that word boundaries work fine with regular
expressions. Note, there is no need to mark byte 255 as a
letter, it is illegal byte in UTF8.
*/
static
uchar
ctype_utf8
[]
=
{
0
,
32
,
32
,
32
,
32
,
32
,
32
,
32
,
32
,
32
,
40
,
40
,
40
,
40
,
40
,
32
,
32
,
...
...
@@ -1536,16 +1540,18 @@ static uchar ctype_utf8[] = {
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
16
,
16
,
16
,
16
,
16
,
16
,
130
,
130
,
130
,
130
,
130
,
130
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
16
,
16
,
16
,
16
,
32
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
0
};
/* The below are taken from usa7 implementation */
static
uchar
to_lower_utf8
[]
=
{
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
,
17
,
18
,
19
,
20
,
21
,
22
,
23
,
24
,
25
,
26
,
27
,
28
,
29
,
30
,
31
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment