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
c3c483e0
Commit
c3c483e0
authored
Aug 23, 2004
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug#4594: column index make = failed for gbk, but like works
Fix for HEAP+HASH prefix keys.
parent
8522f830
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
4 deletions
+33
-4
mysql-test/r/ctype_utf8.result
mysql-test/r/ctype_utf8.result
+10
-0
mysql-test/t/ctype_utf8.test
mysql-test/t/ctype_utf8.test
+12
-0
sql/key.cc
sql/key.cc
+11
-4
No files found.
mysql-test/r/ctype_utf8.result
View file @
c3c483e0
...
...
@@ -560,3 +560,13 @@ select * from t1 where str='str';
str
str
drop table t1;
create table t1 (
str varchar(255) character set utf8 not null,
key str using hash (str(2))
) engine=heap;
INSERT INTO t1 VALUES ('str');
INSERT INTO t1 VALUES ('str2');
select * from t1 where str='str';
str
str
drop table t1;
mysql-test/t/ctype_utf8.test
View file @
c3c483e0
...
...
@@ -417,3 +417,15 @@ INSERT INTO t1 VALUES ('str');
INSERT
INTO
t1
VALUES
(
'str2'
);
select
*
from
t1
where
str
=
'str'
;
drop
table
t1
;
# the same for HEAP+HASH
#
create
table
t1
(
str
varchar
(
255
)
character
set
utf8
not
null
,
key
str
using
hash
(
str
(
2
))
)
engine
=
heap
;
INSERT
INTO
t1
VALUES
(
'str'
);
INSERT
INTO
t1
VALUES
(
'str2'
);
select
*
from
t1
where
str
=
'str'
;
drop
table
t1
;
sql/key.cc
View file @
c3c483e0
...
...
@@ -211,10 +211,17 @@ bool key_cmp_if_same(TABLE *table,const byte *key,uint idx,uint key_length)
if
(
!
(
key_part
->
key_type
&
(
FIELDFLAG_NUMBER
+
FIELDFLAG_BINARY
+
FIELDFLAG_PACK
)))
{
if
(
my_strnncoll
(
key_part
->
field
->
charset
(),
(
const
uchar
*
)
key
,
length
,
(
const
uchar
*
)
table
->
record
[
0
]
+
key_part
->
offset
,
length
))
CHARSET_INFO
*
cs
=
key_part
->
field
->
charset
();
uint
char_length
=
key_part
->
length
/
cs
->
mbmaxlen
;
const
byte
*
pos
=
table
->
record
[
0
]
+
key_part
->
offset
;
if
(
length
>
char_length
)
{
char_length
=
my_charpos
(
cs
,
pos
,
pos
+
length
,
char_length
);
set_if_smaller
(
char_length
,
length
);
}
if
(
cs
->
coll
->
strnncollsp
(
cs
,
(
const
uchar
*
)
key
,
length
,
(
const
uchar
*
)
pos
,
char_length
))
return
1
;
}
else
if
(
memcmp
(
key
,
table
->
record
[
0
]
+
key_part
->
offset
,
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