summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2004-02-17 16:57:39 +0100
committerunknown <serg@serg.mylan>2004-02-17 16:57:39 +0100
commita0040b0bdabae307e19fa5bd46fc13968db17135 (patch)
tree10dd74bbc0033df4fdbb4f4c120fd51f31d5ad98 /mysql-test
parent66a266203fe162b2ebd78651032777d5c5f15f22 (diff)
downloadmariadb-git-a0040b0bdabae307e19fa5bd46fc13968db17135.tar.gz
if a key length exceeds the supported maximum and it is safe to auto-decrease it, do it.
include/my_global.h: do macro correctly mysql-test/r/ctype_utf8.result: updated mysql-test/r/myisam.result: updated mysql-test/r/type_blob.result: updated mysql-test/t/ctype_utf8.test: updated mysql-test/t/type_blob.test: new tests sql/share/english/errmsg.txt: specify that max key length is in BYTES sql/share/russian/errmsg.txt: specify that max key length is in BYTES sql/share/ukrainian/errmsg.txt: specify that max key length is in BYTES sql/sql_table.cc: if a key length exceeds the supported maximum and it is safe to auto-decrease it, do it. cleanup
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/ctype_utf8.result2
-rw-r--r--mysql-test/r/myisam.result4
-rw-r--r--mysql-test/r/type_blob.result12
-rw-r--r--mysql-test/t/ctype_utf8.test2
-rw-r--r--mysql-test/t/type_blob.test6
5 files changed, 18 insertions, 8 deletions
diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result
index 8b7178993a7..0ea07baf42c 100644
--- a/mysql-test/r/ctype_utf8.result
+++ b/mysql-test/r/ctype_utf8.result
@@ -168,4 +168,4 @@ 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
+ERROR 42000: Specified key was too long; max key length is 255 bytes
diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result
index ec70cefc63f..377c45ac8ab 100644
--- a/mysql-test/r/myisam.result
+++ b/mysql-test/r/myisam.result
@@ -323,10 +323,10 @@ Table Op Msg_type Msg_text
test.t1 check status OK
drop table t1;
CREATE TABLE t1 (a varchar(255), b varchar(255), c varchar(255), KEY t1 (a, b, c));
-ERROR 42000: Specified key was too long. Max key length is 500
+ERROR 42000: Specified key was too long; max key length is 500 bytes
CREATE TABLE t1 (a varchar(255), b varchar(255), c varchar(255));
ALTER TABLE t1 ADD INDEX t1 (a, b, c);
-ERROR 42000: Specified key was too long. Max key length is 500
+ERROR 42000: Specified key was too long; max key length is 500 bytes
DROP TABLE t1;
CREATE TABLE t1 (a int not null, b int, c int, key(b), key(c), key(a,b), key(c,a));
INSERT into t1 values (0, null, 0), (0, null, 1), (0, null, 2), (0, null,3), (1,1,4);
diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result
index 255b7f0d942..9c6d5b8fcf5 100644
--- a/mysql-test/r/type_blob.result
+++ b/mysql-test/r/type_blob.result
@@ -346,9 +346,17 @@ HELLO MY 1
a 1
hello 1
drop table t1;
+create table t1 (a text, unique (a(300)));
+ERROR 42000: Specified key was too long; max key length is 255 bytes
create table t1 (a text, key (a(300)));
-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
-create table t1 (a text, key (a(255)));
+Warnings:
+Warning 1071 Specified key was too long; max key length is 255 bytes
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` text,
+ KEY `a` (`a`(255))
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
CREATE TABLE t1 (
t1_id bigint(21) NOT NULL auto_increment,
diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test
index 49b1ed94757..6361f49fe55 100644
--- a/mysql-test/t/ctype_utf8.test
+++ b/mysql-test/t/ctype_utf8.test
@@ -103,5 +103,5 @@ drop table t1;
# Bug 2699
# UTF8 breaks primary keys for cols > 85 characters
#
---error 1089
+--error 1071
create table t1 (a char(160) character set utf8, primary key(a));
diff --git a/mysql-test/t/type_blob.test b/mysql-test/t/type_blob.test
index 70fa2f9b172..ca4762daf24 100644
--- a/mysql-test/t/type_blob.test
+++ b/mysql-test/t/type_blob.test
@@ -121,8 +121,10 @@ select c,count(*) from t1 group by c;
select d,count(*) from t1 group by d;
drop table t1;
-!$1089 create table t1 (a text, key (a(300))); # should give an error
-create table t1 (a text, key (a(255)));
+-- error 1071
+create table t1 (a text, unique (a(300))); # should give an error
+create table t1 (a text, key (a(300))); # key is auto-truncated
+show create table t1;
drop table t1;
#