Commit 5df3be70 authored by unknown's avatar unknown

Merge mysql.com:/home/jimw/my/mysql-5.0-keysize

into  mysql.com:/home/jimw/my/mysql-5.0-clean

parents 9dcae047 4b4f7f76
...@@ -1891,3 +1891,17 @@ t1 CREATE TABLE `t1` ( ...@@ -1891,3 +1891,17 @@ t1 CREATE TABLE `t1` (
) ENGINE=BerkeleyDB DEFAULT CHARSET=latin1 ) ENGINE=BerkeleyDB DEFAULT CHARSET=latin1
drop table t1; drop table t1;
set storage_engine=MyISAM; set storage_engine=MyISAM;
create table t1 (a varchar(255) character set utf8,
b varchar(255) character set utf8,
c varchar(255) character set utf8,
d varchar(255) character set utf8,
key (a,b,c,d)) engine=bdb;
drop table t1;
create table t1 (a varchar(255) character set utf8,
b varchar(255) character set utf8,
c varchar(255) character set utf8,
d varchar(255) character set utf8,
e varchar(255) character set utf8,
key (a,b,c,d,e)) engine=bdb;
ERROR 42000: Specified key was too long; max key length is 3072 bytes
End of 5.0 tests
...@@ -2772,3 +2772,17 @@ insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken'); ...@@ -2772,3 +2772,17 @@ insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
drop table t1; drop table t1;
drop table t2; drop table t2;
commit; commit;
create table t1 (a varchar(255) character set utf8,
b varchar(255) character set utf8,
c varchar(255) character set utf8,
d varchar(255) character set utf8,
key (a,b,c,d)) engine=innodb;
drop table t1;
create table t1 (a varchar(255) character set utf8,
b varchar(255) character set utf8,
c varchar(255) character set utf8,
d varchar(255) character set utf8,
e varchar(255) character set utf8,
key (a,b,c,d,e)) engine=innodb;
ERROR 42000: Specified key was too long; max key length is 3072 bytes
End of 5.0 tests
...@@ -974,3 +974,22 @@ drop table t1; ...@@ -974,3 +974,22 @@ drop table t1;
# End varchar test # End varchar test
eval set storage_engine=$default; eval set storage_engine=$default;
#
# Test that we can create a large key
#
create table t1 (a varchar(255) character set utf8,
b varchar(255) character set utf8,
c varchar(255) character set utf8,
d varchar(255) character set utf8,
key (a,b,c,d)) engine=bdb;
drop table t1;
--error ER_TOO_LONG_KEY
create table t1 (a varchar(255) character set utf8,
b varchar(255) character set utf8,
c varchar(255) character set utf8,
d varchar(255) character set utf8,
e varchar(255) character set utf8,
key (a,b,c,d,e)) engine=bdb;
--echo End of 5.0 tests
...@@ -1751,3 +1751,22 @@ insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken'); ...@@ -1751,3 +1751,22 @@ insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
drop table t1; drop table t1;
drop table t2; drop table t2;
commit; commit;
#
# Test that we can create a large (>1K) key
#
create table t1 (a varchar(255) character set utf8,
b varchar(255) character set utf8,
c varchar(255) character set utf8,
d varchar(255) character set utf8,
key (a,b,c,d)) engine=innodb;
drop table t1;
--error ER_TOO_LONG_KEY
create table t1 (a varchar(255) character set utf8,
b varchar(255) character set utf8,
c varchar(255) character set utf8,
d varchar(255) character set utf8,
e varchar(255) character set utf8,
key (a,b,c,d,e)) engine=innodb;
--echo End of 5.0 tests
...@@ -50,11 +50,7 @@ ...@@ -50,11 +50,7 @@
#define MAX_SYS_VAR_LENGTH 32 #define MAX_SYS_VAR_LENGTH 32
#define MAX_KEY 64 /* Max used keys */ #define MAX_KEY 64 /* Max used keys */
#define MAX_REF_PARTS 16 /* Max parts used as ref */ #define MAX_REF_PARTS 16 /* Max parts used as ref */
#if SIZEOF_CHARP > 4 #define MAX_KEY_LENGTH 3072 /* max possible key */
#define MAX_KEY_LENGTH 3072 /* max possible key, if 64 bits */
#else
#define MAX_KEY_LENGTH 1024 /* max possible key, if 32 bits */
#endif
#if SIZEOF_OFF_T > 4 #if SIZEOF_OFF_T > 4
#define MAX_REFLENGTH 8 /* Max length for record ref */ #define MAX_REFLENGTH 8 /* Max length for record ref */
#else #else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment