diff options
author | unknown <holyfoot@deer.(none)> | 2006-05-12 18:02:42 +0500 |
---|---|---|
committer | unknown <holyfoot@deer.(none)> | 2006-05-12 18:02:42 +0500 |
commit | 273e1e01fede7508c3b4905e90a25d573c4dd610 (patch) | |
tree | 8a98bab5c8013718b49b0907550f96d5008152ca /mysql-test | |
parent | 77dedc31e922d3bfdc4379f4be5b7a9ec02a309d (diff) | |
download | mariadb-git-273e1e01fede7508c3b4905e90a25d573c4dd610.tar.gz |
bug #14573 (Error on adding auto_increment on to a column with '0' values)
mysql-test/r/auto_increment.result:
test result
mysql-test/t/auto_increment.test:
test case
sql/handler.cc:
print_keydupp_error implemented
sql/handler.h:
handler::print_keydupp_error declared
sql/share/errmsg.txt:
error message added
sql/sql_table.cc:
now we return different error message for auto_increment case
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/auto_increment.result | 6 | ||||
-rw-r--r-- | mysql-test/t/auto_increment.test | 11 |
2 files changed, 17 insertions, 0 deletions
diff --git a/mysql-test/r/auto_increment.result b/mysql-test/r/auto_increment.result index 525f64ea902..20936bcc10c 100644 --- a/mysql-test/r/auto_increment.result +++ b/mysql-test/r/auto_increment.result @@ -418,3 +418,9 @@ a val 2 1 3 1 drop table t1; +CREATE TABLE t1 (t1 INT(10) PRIMARY KEY, t2 INT(10)); +INSERT INTO t1 VALUES(0, 0); +INSERT INTO t1 VALUES(1, 1); +ALTER TABLE t1 CHANGE t1 t1 INT(10) auto_increment; +ERROR 23000: ALTER TABLE causes auto_increment resequencing, causing Duplicate entry '1' for key 'PRIMARY' +DROP TABLE t1; diff --git a/mysql-test/t/auto_increment.test b/mysql-test/t/auto_increment.test index 26b103b0107..e0b024d021b 100644 --- a/mysql-test/t/auto_increment.test +++ b/mysql-test/t/auto_increment.test @@ -275,3 +275,14 @@ update t1 set a=2 where a=1; insert into t1 (val) values (1); select * from t1; drop table t1; + +# +# Test key duplications with auto-increment in ALTER TABLE +# bug #14573 +# +CREATE TABLE t1 (t1 INT(10) PRIMARY KEY, t2 INT(10)); +INSERT INTO t1 VALUES(0, 0); +INSERT INTO t1 VALUES(1, 1); +--error ER_DUP_ENTRY +ALTER TABLE t1 CHANGE t1 t1 INT(10) auto_increment; +DROP TABLE t1; |