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
d8e024ba
Commit
d8e024ba
authored
Jul 05, 2007
by
bar@bar.myoffice.izhnet.ru
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/bar/mysql-work/mysql-5.0-rpl
into mysql.com:/home/bar/mysql-work/mysql-5.1-new-rpl
parents
90f76298
84eb7985
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
14 deletions
+67
-14
mysql-test/extra/binlog_tests/ctype_cp932.test
mysql-test/extra/binlog_tests/ctype_cp932.test
+22
-0
mysql-test/r/binlog_stm_ctype_cp932.result
mysql-test/r/binlog_stm_ctype_cp932.result
+16
-0
strings/ctype-cp932.c
strings/ctype-cp932.c
+11
-3
strings/ctype-utf8.c
strings/ctype-utf8.c
+18
-11
No files found.
mysql-test/extra/binlog_tests/ctype_cp932.test
View file @
d8e024ba
...
...
@@ -403,6 +403,28 @@ SET collation_connection='cp932_japanese_ci';
SET
collation_connection
=
'cp932_bin'
;
--
source
include
/
ctype_filesort
.
inc
#
# Bug#29333 myisam corruption with
# character set cp932 collate cp932_japanese_ci
#
create
table
t2
(
a
char
(
1
));
insert
into
t2
values
(
'0'
),(
'1'
),(
'2'
),(
'3'
),(
'4'
),(
'5'
),(
'6'
),(
'7'
);
insert
into
t2
values
(
'8'
),(
'9'
),(
'A'
),(
'B'
),(
'C'
),(
'D'
),(
'E'
),(
'F'
);
create
table
t1
(
a
varchar
(
2
)
character
set
cp932
)
engine
=
myisam
;
--
disable_warnings
insert
into
t1
select
unhex
(
concat
(
t24
.
a
,
t23
.
a
,
t22
.
a
,
t21
.
a
))
from
t2
t21
,
t2
t22
,
t2
t23
,
t2
t24
;
--
enable_warnings
delete
from
t1
where
a
=
''
;
alter
table
t1
add
key
(
a
);
check
table
t1
;
drop
table
t1
;
drop
table
t2
;
#
# Bug#12547: Inserting long string into varchar causes table crash in cp932
#
...
...
mysql-test/r/binlog_stm_ctype_cp932.result
View file @
d8e024ba
...
...
@@ -11335,6 +11335,22 @@ cp932_bin 6109
cp932_bin 61
cp932_bin 6120
drop table t1;
create table t2 (a char(1));
insert into t2 values ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7');
insert into t2 values ('8'),('9'),('A'),('B'),('C'),('D'),('E'),('F');
create table t1 (
a varchar(2) character set cp932
) engine=myisam;
insert into t1
select unhex(concat(t24.a, t23.a, t22.a, t21.a))
from t2 t21, t2 t22, t2 t23, t2 t24;
delete from t1 where a='';
alter table t1 add key(a);
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
drop table t1;
drop table t2;
create table t1 (col1 varchar(1)) character set cp932;
insert into t1 values ('a');
insert into t1 values ('ab');
...
...
strings/ctype-cp932.c
View file @
d8e024ba
...
...
@@ -250,9 +250,16 @@ static int my_strnncollsp_cp932(CHARSET_INFO *cs __attribute__((unused)),
const
uchar
*
a_end
=
a
+
a_length
;
const
uchar
*
b_end
=
b
+
b_length
;
int
res
=
my_strnncoll_cp932_internal
(
cs
,
&
a
,
a_length
,
&
b
,
b_length
);
#ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE
diff_if_only_endspace_difference
=
0
;
#endif
if
(
!
res
&&
(
a
!=
a_end
||
b
!=
b_end
))
{
int
swap
=
0
;
int
swap
=
1
;
if
(
diff_if_only_endspace_difference
)
res
=
1
;
/* Assume 'a' is bigger */
/*
Check the next not space character of the longer key. If it's < ' ',
then it's smaller than the other key.
...
...
@@ -263,11 +270,12 @@ static int my_strnncollsp_cp932(CHARSET_INFO *cs __attribute__((unused)),
a_end
=
b_end
;
a
=
b
;
swap
=
-
1
;
/* swap sign of result */
res
=
-
res
;
}
for
(;
a
<
a_end
;
a
++
)
{
if
(
*
a
!=
' '
)
return
(
(
int
)
*
a
-
(
int
)
' '
)
^
swap
;
if
(
*
a
!=
(
uchar
)
' '
)
return
(
*
a
<
(
uchar
)
' '
)
?
-
swap
:
swap
;
}
}
return
res
;
...
...
strings/ctype-utf8.c
View file @
d8e024ba
...
...
@@ -2812,16 +2812,19 @@ static int my_strnncoll_utf8_cs(CHARSET_INFO *cs,
static
int
my_strnncollsp_utf8_cs
(
CHARSET_INFO
*
cs
,
const
uchar
*
s
,
size_t
slen
,
const
uchar
*
t
,
size_t
tlen
,
my_bool
diff_if_only_endspace_difference
__attribute__
((
unused
)))
my_bool
diff_if_only_endspace_difference
)
{
int
s_res
,
t_
res
;
my_wc_t
s_wc
,
t_wc
;
const
uchar
*
se
=
s
+
slen
;
const
uchar
*
te
=
t
+
tlen
;
int
save_diff
=
0
;
int
s_res
,
t_res
,
res
;
my_wc_t
s_wc
,
t_wc
;
const
uchar
*
se
=
s
+
slen
;
const
uchar
*
te
=
t
+
tlen
;
int
save_diff
=
0
;
MY_UNICASE_INFO
**
uni_plane
=
cs
->
caseinfo
;
#ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE
diff_if_only_endspace_difference
=
0
;
#endif
while
(
s
<
se
&&
t
<
te
)
{
int
plane
;
...
...
@@ -2853,16 +2856,20 @@ static int my_strnncollsp_utf8_cs(CHARSET_INFO *cs,
slen
=
se
-
s
;
tlen
=
te
-
t
;
res
=
0
;
if
(
slen
!=
tlen
)
{
int
swap
=
0
;
int
swap
=
1
;
if
(
diff_if_only_endspace_difference
)
res
=
1
;
/* Assume 'a' is bigger */
if
(
slen
<
tlen
)
{
slen
=
tlen
;
s
=
t
;
se
=
te
;
swap
=
-
1
;
res
=
-
res
;
}
/*
This following loop uses the fact that in UTF-8
...
...
@@ -2876,8 +2883,8 @@ static int my_strnncollsp_utf8_cs(CHARSET_INFO *cs,
*/
for
(
;
s
<
se
;
s
++
)
{
if
(
*
s
!=
' '
)
return
(
(
int
)
*
s
-
(
int
)
' '
)
^
swap
;
if
(
*
s
!=
(
uchar
)
' '
)
return
(
*
s
<
(
uchar
)
' '
)
?
-
swap
:
swap
;
}
}
return
save_diff
;
...
...
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