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
2f8f0f2e
Commit
2f8f0f2e
authored
Oct 14, 2004
by
bar@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug #6043 erratic searching for diacriticals in indexed MyISAM UTF-8 table
parent
9b2cc44e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
6 deletions
+55
-6
mysql-test/r/ctype_utf8.result
mysql-test/r/ctype_utf8.result
+29
-0
mysql-test/t/ctype_utf8.test
mysql-test/t/ctype_utf8.test
+20
-0
sql/field.cc
sql/field.cc
+6
-6
No files found.
mysql-test/r/ctype_utf8.result
View file @
2f8f0f2e
...
@@ -750,3 +750,32 @@ SELECT id FROM t1 WHERE (list_id = 1) AND (term = "letterd");
...
@@ -750,3 +750,32 @@ SELECT id FROM t1 WHERE (list_id = 1) AND (term = "letterd");
id
id
4
4
DROP TABLE t1;
DROP TABLE t1;
SET NAMES latin1;
CREATE TABLE t1 (
id int unsigned NOT NULL auto_increment,
list_id smallint unsigned NOT NULL,
term text NOT NULL,
PRIMARY KEY(id),
INDEX(list_id, term(19))
) TYPE=MyISAM CHARSET=utf8;
Warnings:
Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead
INSERT INTO t1 set list_id = 1, term = "testtest";
INSERT INTO t1 set list_id = 1, term = "testetest";
INSERT INTO t1 set list_id = 1, term = "testtest";
SELECT id, term FROM t1 where (list_id = 1) AND (term = "testtest");
id term
1 testtest
2 testetest
3 testtest
SELECT id, term FROM t1 where (list_id = 1) AND (term = "testetest");
id term
1 testtest
2 testetest
3 testtest
SELECT id, term FROM t1 where (list_id = 1) AND (term = "testtest");
id term
1 testtest
2 testetest
3 testtest
DROP TABLE t1;
mysql-test/t/ctype_utf8.test
View file @
2f8f0f2e
...
@@ -592,3 +592,23 @@ SELECT id FROM t1 WHERE (list_id = 1) AND (term = "letterb");
...
@@ -592,3 +592,23 @@ SELECT id FROM t1 WHERE (list_id = 1) AND (term = "letterb");
SELECT
id
FROM
t1
WHERE
(
list_id
=
1
)
AND
(
term
=
"lettera"
);
SELECT
id
FROM
t1
WHERE
(
list_id
=
1
)
AND
(
term
=
"lettera"
);
SELECT
id
FROM
t1
WHERE
(
list_id
=
1
)
AND
(
term
=
"letterd"
);
SELECT
id
FROM
t1
WHERE
(
list_id
=
1
)
AND
(
term
=
"letterd"
);
DROP
TABLE
t1
;
DROP
TABLE
t1
;
#
# Bug #6043 erratic searching for diacriticals in indexed MyISAM UTF-8 table
#
SET
NAMES
latin1
;
CREATE
TABLE
t1
(
id
int
unsigned
NOT
NULL
auto_increment
,
list_id
smallint
unsigned
NOT
NULL
,
term
text
NOT
NULL
,
PRIMARY
KEY
(
id
),
INDEX
(
list_id
,
term
(
19
))
)
TYPE
=
MyISAM
CHARSET
=
utf8
;
INSERT
INTO
t1
set
list_id
=
1
,
term
=
"testtest"
;
INSERT
INTO
t1
set
list_id
=
1
,
term
=
"testetest"
;
INSERT
INTO
t1
set
list_id
=
1
,
term
=
"testtest"
;
SELECT
id
,
term
FROM
t1
where
(
list_id
=
1
)
AND
(
term
=
"testtest"
);
SELECT
id
,
term
FROM
t1
where
(
list_id
=
1
)
AND
(
term
=
"testetest"
);
SELECT
id
,
term
FROM
t1
where
(
list_id
=
1
)
AND
(
term
=
"testtest"
);
DROP
TABLE
t1
;
sql/field.cc
View file @
2f8f0f2e
...
@@ -5000,10 +5000,10 @@ String *Field_blob::val_str(String *val_buffer __attribute__((unused)),
...
@@ -5000,10 +5000,10 @@ String *Field_blob::val_str(String *val_buffer __attribute__((unused)),
int
Field_blob
::
cmp
(
const
char
*
a
,
uint32
a_length
,
const
char
*
b
,
int
Field_blob
::
cmp
(
const
char
*
a
,
uint32
a_length
,
const
char
*
b
,
uint32
b_length
)
uint32
b_length
)
{
{
int
diff
=
my_strnncoll
(
field_charset
,
return
field_charset
->
coll
->
strnncoll
(
field_charset
,
(
const
uchar
*
)
a
,
min
(
a_length
,
b_length
)
,
(
const
uchar
*
)
a
,
a_length
,
(
const
uchar
*
)
b
,
min
(
a_length
,
b_length
));
(
const
uchar
*
)
b
,
b_length
,
return
diff
?
diff
:
(
int
)
(
a_length
-
b_length
);
0
);
}
}
...
@@ -5087,8 +5087,8 @@ void Field_blob::get_key_image(char *buff,uint length,
...
@@ -5087,8 +5087,8 @@ void Field_blob::get_key_image(char *buff,uint length,
get_ptr
(
&
blob
);
get_ptr
(
&
blob
);
uint
char_length
=
length
/
cs
->
mbmaxlen
;
uint
char_length
=
length
/
cs
->
mbmaxlen
;
char_length
=
my_charpos
(
cs
,
blob
,
blob
+
length
,
char_length
);
char_length
=
my_charpos
(
cs
,
blob
,
blob
+
blob_
length
,
char_length
);
set_if_smaller
(
length
,
char_length
);
set_if_smaller
(
blob_
length
,
char_length
);
if
((
uint32
)
length
>
blob_length
)
if
((
uint32
)
length
>
blob_length
)
{
{
...
...
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