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
306af7f4
Commit
306af7f4
authored
Mar 29, 2007
by
bar@bar.myoffice.izhnet.ru
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/bar/mysql-5.0.b27079
into mysql.com:/home/bar/mysql-5.1-new-rpl
parents
3099b103
d5c66804
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
7 deletions
+45
-7
mysql-test/r/ctype_uca.result
mysql-test/r/ctype_uca.result
+9
-0
mysql-test/t/ctype_uca.test
mysql-test/t/ctype_uca.test
+10
-0
strings/ctype-uca.c
strings/ctype-uca.c
+26
-7
No files found.
mysql-test/r/ctype_uca.result
View file @
306af7f4
...
@@ -2654,3 +2654,12 @@ ii 2 ii 2 İİ 4
...
@@ -2654,3 +2654,12 @@ ii 2 ii 2 İİ 4
İİ 4 ii 2 İİ 4
İİ 4 ii 2 İİ 4
II 2 ıı 4 II 2
II 2 ıı 4 II 2
DROP TABLE t1;
DROP TABLE t1;
CREATE TABLE t1 (
c1 text character set ucs2 collate ucs2_polish_ci NOT NULL
) ENGINE=MyISAM;
insert into t1 values (''),('a');
SELECT COUNT(*), c1 FROM t1 GROUP BY c1;
COUNT(*) c1
1
1 a
DROP TABLE IF EXISTS t1;
mysql-test/t/ctype_uca.test
View file @
306af7f4
...
@@ -475,3 +475,13 @@ ALTER TABLE t1 MODIFY a VARCHAR(30) character set utf8 collate utf8_turkish_ci;
...
@@ -475,3 +475,13 @@ ALTER TABLE t1 MODIFY a VARCHAR(30) character set utf8 collate utf8_turkish_ci;
SELECT
a
,
length
(
a
)
la
,
@
l
:=
lower
(
a
)
l
,
length
(
@
l
)
ll
,
@
u
:=
upper
(
a
)
u
,
length
(
@
u
)
lu
SELECT
a
,
length
(
a
)
la
,
@
l
:=
lower
(
a
)
l
,
length
(
@
l
)
ll
,
@
u
:=
upper
(
a
)
u
,
length
(
@
u
)
lu
FROM
t1
ORDER
BY
id
;
FROM
t1
ORDER
BY
id
;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
#
# Bug #27079 Crash while grouping empty ucs2 strings
#
CREATE
TABLE
t1
(
c1
text
character
set
ucs2
collate
ucs2_polish_ci
NOT
NULL
)
ENGINE
=
MyISAM
;
insert
into
t1
values
(
''
),(
'a'
);
SELECT
COUNT
(
*
),
c1
FROM
t1
GROUP
BY
c1
;
DROP
TABLE
IF
EXISTS
t1
;
strings/ctype-uca.c
View file @
306af7f4
...
@@ -6744,7 +6744,7 @@ typedef struct my_uca_scanner_handler_st
...
@@ -6744,7 +6744,7 @@ typedef struct my_uca_scanner_handler_st
int
(
*
next
)(
my_uca_scanner
*
scanner
);
int
(
*
next
)(
my_uca_scanner
*
scanner
);
}
my_uca_scanner_handler
;
}
my_uca_scanner_handler
;
static
uint16
nochar
[]
=
{
0
};
static
uint16
nochar
[]
=
{
0
,
0
};
#ifdef HAVE_CHARSET_ucs2
#ifdef HAVE_CHARSET_ucs2
...
@@ -6769,13 +6769,32 @@ static void my_uca_scanner_init_ucs2(my_uca_scanner *scanner,
...
@@ -6769,13 +6769,32 @@ static void my_uca_scanner_init_ucs2(my_uca_scanner *scanner,
CHARSET_INFO
*
cs
__attribute__
((
unused
)),
CHARSET_INFO
*
cs
__attribute__
((
unused
)),
const
uchar
*
str
,
uint
length
)
const
uchar
*
str
,
uint
length
)
{
{
/* Note, no needs to initialize scanner->wbeg */
scanner
->
sbeg
=
str
;
scanner
->
send
=
str
+
length
-
2
;
scanner
->
wbeg
=
nochar
;
scanner
->
wbeg
=
nochar
;
scanner
->
uca_length
=
cs
->
sort_order
;
if
(
length
)
scanner
->
uca_weight
=
cs
->
sort_order_big
;
{
scanner
->
contractions
=
cs
->
contractions
;
scanner
->
sbeg
=
str
;
scanner
->
send
=
str
+
length
-
2
;
scanner
->
uca_length
=
cs
->
sort_order
;
scanner
->
uca_weight
=
cs
->
sort_order_big
;
scanner
->
contractions
=
cs
->
contractions
;
return
;
}
/*
Sometimes this function is called with
str=NULL and length=0, which should be
considered as an empty string.
The above initialization is unsafe for such cases,
because scanner->send is initialized to (NULL-2), which is 0xFFFFFFFE.
Then we fall into an endless loop in my_uca_scanner_next_ucs2().
Do special initialization for the case when length=0.
Initialize scanner->sbeg to an address greater than scanner->send.
Next call of my_uca_scanner_next_ucs2() will correctly return with -1.
*/
scanner
->
sbeg
=
(
uchar
*
)
&
nochar
[
1
];
scanner
->
send
=
(
uchar
*
)
&
nochar
[
0
];
}
}
...
...
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