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
3bdb96d3
Commit
3bdb96d3
authored
Feb 13, 2004
by
bar@bar.intranet.mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug #2699 UTF8 breaks primary keys for cols > 85 characters
parent
a0529097
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
1 deletion
+15
-1
mysql-test/r/ctype_utf8.result
mysql-test/r/ctype_utf8.result
+2
-0
mysql-test/t/ctype_utf8.test
mysql-test/t/ctype_utf8.test
+7
-0
sql/sql_table.cc
sql/sql_table.cc
+6
-1
No files found.
mysql-test/r/ctype_utf8.result
View file @
3bdb96d3
...
...
@@ -167,3 +167,5 @@ select hex(s1) from t1;
hex(s1)
41
drop table t1;
create table t1 (a char(160) character set utf8, primary key(a));
ERROR HY000: Incorrect sub part key. The used key part isn't a string, the used length is longer than the key part or the storage engine doesn't support unique sub keys
mysql-test/t/ctype_utf8.test
View file @
3bdb96d3
...
...
@@ -98,3 +98,10 @@ create table t1 (s1 text character set utf8);
insert
into
t1
values
(
0x41FF
);
select
hex
(
s1
)
from
t1
;
drop
table
t1
;
#
# Bug 2699
# UTF8 breaks primary keys for cols > 85 characters
#
--
error
1089
create
table
t1
(
a
char
(
160
)
character
set
utf8
,
primary
key
(
a
));
sql/sql_table.cc
View file @
3bdb96d3
...
...
@@ -877,7 +877,12 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
column
->
field_name
);
DBUG_RETURN
(
-
1
);
}
key_part_info
->
length
=
(
uint8
)
length
;
if
(
length
>
file
->
max_key_part_length
())
{
my_error
(
ER_WRONG_SUB_KEY
,
MYF
(
0
));
DBUG_RETURN
(
-
1
);
}
key_part_info
->
length
=
(
uint16
)
length
;
/* Use packed keys for long strings on the first column */
if
(
!
(
db_options
&
HA_OPTION_NO_PACK_KEYS
)
&&
(
length
>=
KEY_DEFAULT_PACK_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