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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
809ea732
Commit
809ea732
authored
Dec 09, 2004
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugs: #7111: server crashes when regexp is used
parent
e539f5bd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
2 deletions
+38
-2
mysql-test/r/ctype_uca.result
mysql-test/r/ctype_uca.result
+11
-0
mysql-test/t/ctype_uca.test
mysql-test/t/ctype_uca.test
+8
-0
regex/regcomp.c
regex/regcomp.c
+19
-2
No files found.
mysql-test/r/ctype_uca.result
View file @
809ea732
...
...
@@ -2375,3 +2375,14 @@ DROP DATABASE d1;
USE test;
SET character_set_server= @safe_character_set_server;
SET collation_server= @safe_collation_server;
create table t1 (a varchar(1)) character set utf8 collate utf8_estonian_ci;
insert into t1 values ('A'),('B'),('C'),('a'),('b'),('c');
select a, a regexp '[a]' from t1 order by binary a;
a a regexp '[a]'
A 1
B 0
C 0
a 1
b 0
c 0
drop table t1;
mysql-test/t/ctype_uca.test
View file @
809ea732
...
...
@@ -444,3 +444,11 @@ DROP TABLE t1;
SET
@
test_character_set
=
'utf8'
;
SET
@
test_collation
=
'utf8_swedish_ci'
;
--
source
include
/
ctype_common
.
inc
#
# Bug 7111 server crashes when regexp is used
#
create
table
t1
(
a
varchar
(
1
))
character
set
utf8
collate
utf8_estonian_ci
;
insert
into
t1
values
(
'A'
),(
'B'
),(
'C'
),(
'a'
),(
'b'
),(
'c'
);
select
a
,
a
regexp
'[a]'
from
t1
order
by
binary
a
;
drop
table
t1
;
regex/regcomp.c
View file @
809ea732
...
...
@@ -860,11 +860,28 @@ othercase(charset,ch)
CHARSET_INFO
*
charset
;
int
ch
;
{
/*
In MySQL some multi-byte character sets
have 'ctype' array but don't have 'to_lower'
and 'to_upper' arrays. In this case we handle
only basic latin letters a..z and A..Z.
If 'to_lower' and 'to_upper' arrays are empty in a character set,
then my_isalpha(cs, ch) should never return TRUE for characters
other than basic latin letters. Otherwise it should be
considered as a mistake in character set definition.
*/
assert
(
my_isalpha
(
charset
,
ch
));
if
(
my_isupper
(
charset
,
ch
))
return
(
my_tolower
(
charset
,
ch
));
{
return
(
charset
->
to_lower
?
my_tolower
(
charset
,
ch
)
:
ch
-
'A'
+
'a'
);
}
else
if
(
my_islower
(
charset
,
ch
))
return
(
my_toupper
(
charset
,
ch
));
{
return
(
charset
->
to_upper
?
my_toupper
(
charset
,
ch
)
:
ch
-
'a'
+
'A'
);
}
else
/* peculiar, but could happen */
return
(
ch
);
}
...
...
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