diff options
author | jimw@mysql.com <> | 2005-05-24 12:21:15 -0700 |
---|---|---|
committer | jimw@mysql.com <> | 2005-05-24 12:21:15 -0700 |
commit | bbdfea15da85696b19d029f9c3760d6898bd7cb8 (patch) | |
tree | 5b9334998567432d4b090ba9be4e173195cd9539 | |
parent | ed2e508bdd92be3a73a06b7ec5c77b367817e9a5 (diff) | |
download | mariadb-git-bbdfea15da85696b19d029f9c3760d6898bd7cb8.tar.gz |
Increase limit of partial key length in MEMORY storage engine
to the same as a full key. (Bug #10566)
-rw-r--r-- | mysql-test/r/heap.result | 5 | ||||
-rw-r--r-- | mysql-test/t/heap.test | 9 | ||||
-rw-r--r-- | sql/ha_heap.h | 1 |
3 files changed, 15 insertions, 0 deletions
diff --git a/mysql-test/r/heap.result b/mysql-test/r/heap.result index 29207a4ae98..53dec294ef8 100644 --- a/mysql-test/r/heap.result +++ b/mysql-test/r/heap.result @@ -291,3 +291,8 @@ a b 1 7 1 8 drop table t1; +create table t1 (c char(255), primary key(c(90))); +insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"); +insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"); +ERROR 23000: Duplicate entry 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl' for key 1 +drop table t1; diff --git a/mysql-test/t/heap.test b/mysql-test/t/heap.test index e082993a58e..c0977819487 100644 --- a/mysql-test/t/heap.test +++ b/mysql-test/t/heap.test @@ -224,3 +224,12 @@ insert t1 (a) values (1); insert t1 (a) values (1); select * from t1; drop table t1; + +# +# Bug #10566: Verify that we can create a prefixed key with length > 255 +# +create table t1 (c char(255), primary key(c(90))); +insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"); +--error 1062 +insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"); +drop table t1; diff --git a/sql/ha_heap.h b/sql/ha_heap.h index 60e2e84c5d2..33de0156074 100644 --- a/sql/ha_heap.h +++ b/sql/ha_heap.h @@ -53,6 +53,7 @@ public: } const key_map *keys_to_use_for_scanning() { return &btree_keys; } uint max_supported_keys() const { return MAX_KEY; } + uint max_supported_key_part_length() const { return MAX_KEY_LENGTH; } double scan_time() { return (double) (records+deleted) / 20.0+10; } double read_time(uint index, uint ranges, ha_rows rows) { return (double) rows / 20.0+1; } |