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
7a27f2ce
Commit
7a27f2ce
authored
Aug 20, 2004
by
bar@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug#4594 "column index make = failed for gbk, but like works"
Fix for MyISAM. Tests for MyISAM and HASH+BTREE.
parent
64fc12f3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
4 deletions
+49
-4
myisam/mi_key.c
myisam/mi_key.c
+4
-4
mysql-test/r/ctype_utf8.result
mysql-test/r/ctype_utf8.result
+20
-0
mysql-test/t/ctype_utf8.test
mysql-test/t/ctype_utf8.test
+25
-0
No files found.
myisam/mi_key.c
View file @
7a27f2ce
...
...
@@ -42,7 +42,7 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key,
byte
*
pos
,
*
end
;
uchar
*
start
;
reg1
HA_KEYSEG
*
keyseg
;
my_bool
is_
unique
=
info
->
s
->
keyinfo
[
keynr
].
flag
&
HA_NOSAME
;
my_bool
is_
ft
=
info
->
s
->
keyinfo
[
keynr
].
flag
&
HA_FULLTEXT
;
DBUG_ENTER
(
"_mi_make_key"
);
if
(
info
->
s
->
keyinfo
[
keynr
].
flag
&
HA_SPATIAL
)
...
...
@@ -75,7 +75,7 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key,
*
key
++=
1
;
/* Not NULL */
}
char_length
=
(
is_unique
&&
cs
&&
cs
->
mbmaxlen
>
1
)
?
length
/
cs
->
mbmaxlen
:
length
;
char_length
=
(
!
is_ft
&&
cs
&&
cs
->
mbmaxlen
>
1
)
?
length
/
cs
->
mbmaxlen
:
length
;
pos
=
(
byte
*
)
record
+
keyseg
->
start
;
if
(
keyseg
->
flag
&
HA_SPACE_PACK
)
...
...
@@ -193,7 +193,7 @@ uint _mi_pack_key(register MI_INFO *info, uint keynr, uchar *key, uchar *old,
{
uchar
*
start_key
=
key
;
HA_KEYSEG
*
keyseg
;
my_bool
is_
unique
=
info
->
s
->
keyinfo
[
keynr
].
flag
&
HA_NOSAME
;
my_bool
is_
ft
=
info
->
s
->
keyinfo
[
keynr
].
flag
&
HA_FULLTEXT
;
DBUG_ENTER
(
"_mi_pack_key"
);
for
(
keyseg
=
info
->
s
->
keyinfo
[
keynr
].
seg
;
...
...
@@ -217,7 +217,7 @@ uint _mi_pack_key(register MI_INFO *info, uint keynr, uchar *key, uchar *old,
continue
;
/* Found NULL */
}
}
char_length
=
(
is_unique
&&
cs
&&
cs
->
mbmaxlen
>
1
)
?
length
/
cs
->
mbmaxlen
:
length
;
char_length
=
(
!
is_ft
&&
cs
&&
cs
->
mbmaxlen
>
1
)
?
length
/
cs
->
mbmaxlen
:
length
;
pos
=
old
;
if
(
keyseg
->
flag
&
HA_SPACE_PACK
)
{
...
...
mysql-test/r/ctype_utf8.result
View file @
7a27f2ce
...
...
@@ -540,3 +540,23 @@ select c as c_a from t1 where c='б';
c_a
б
drop table t1;
create table t1 (
str varchar(255) character set utf8 not null,
key str (str(2))
) engine=myisam;
INSERT INTO t1 VALUES ('str');
INSERT INTO t1 VALUES ('str2');
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 btree (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 @
7a27f2ce
...
...
@@ -392,3 +392,28 @@ select c as c_all from t1 order by c;
select
c
as
c_a
from
t1
where
c
=
'a'
;
select
c
as
c_a
from
t1
where
c
=
'б'
;
drop
table
t1
;
# Bug#4594: column index make = failed for gbk, but like works
# Check MYISAM
#
create
table
t1
(
str
varchar
(
255
)
character
set
utf8
not
null
,
key
str
(
str
(
2
))
)
engine
=
myisam
;
INSERT
INTO
t1
VALUES
(
'str'
);
INSERT
INTO
t1
VALUES
(
'str2'
);
select
*
from
t1
where
str
=
'str'
;
drop
table
t1
;
# the same for HEAP+BTREE
#
create
table
t1
(
str
varchar
(
255
)
character
set
utf8
not
null
,
key
str
using
btree
(
str
(
2
))
)
engine
=
heap
;
INSERT
INTO
t1
VALUES
(
'str'
);
INSERT
INTO
t1
VALUES
(
'str2'
);
select
*
from
t1
where
str
=
'str'
;
drop
table
t1
;
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