summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2004-07-30 14:17:12 +0200
committerunknown <serg@serg.mylan>2004-07-30 14:17:12 +0200
commit864405db7d9bd1c627ca787324e9db81ea9e19bf (patch)
tree94ee1fe4d2a2a800329f6fe2212f4b9facf1a8a7 /mysql-test
parent274e1bee6bb865ec7b293f87f87cc5428215d971 (diff)
downloadmariadb-git-864405db7d9bd1c627ca787324e9db81ea9e19bf.tar.gz
no_auto_value_on_zero + alter table bug
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/auto_increment.result18
-rw-r--r--mysql-test/t/auto_increment.test5
2 files changed, 16 insertions, 7 deletions
diff --git a/mysql-test/r/auto_increment.result b/mysql-test/r/auto_increment.result
index 79bcff06f68..f5ec5f1f852 100644
--- a/mysql-test/r/auto_increment.result
+++ b/mysql-test/r/auto_increment.result
@@ -206,18 +206,25 @@ select * from t1 order by b;
a b
1 1
200 2
-205 3
+0 3
201 4
202 5
203 6
204 7
+create table t2 (a int);
+insert t2 values (1),(2);
+alter table t2 add b int auto_increment primary key;
+select * from t2;
+a b
+1 1
+2 2
+drop table t2;
delete from t1 where a=0;
update t1 set a=0 where b=5;
select * from t1 order by b;
a b
1 1
200 2
-205 3
201 4
0 5
203 6
@@ -225,7 +232,7 @@ a b
delete from t1 where a=0;
update t1 set a=NULL where b=6;
Warnings:
-Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 5
+Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 4
update t1 set a=300 where b=7;
SET SQL_MODE='';
insert into t1(a,b)values(NULL,8);
@@ -239,7 +246,6 @@ select * from t1 order by b;
a b
1 1
200 2
-205 3
201 4
0 6
300 7
@@ -256,7 +262,6 @@ select * from t1 order by b;
a b
1 1
200 2
-205 3
201 4
300 7
301 8
@@ -269,13 +274,12 @@ a b
delete from t1 where a=0;
update t1 set a=NULL where b=13;
Warnings:
-Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 10
+Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 9
update t1 set a=500 where b=14;
select * from t1 order by b;
a b
1 1
200 2
-205 3
201 4
300 7
301 8
diff --git a/mysql-test/t/auto_increment.test b/mysql-test/t/auto_increment.test
index 65770f32476..e5986e6755d 100644
--- a/mysql-test/t/auto_increment.test
+++ b/mysql-test/t/auto_increment.test
@@ -140,6 +140,11 @@ insert into t1(b)values(7);
select * from t1 order by b;
alter table t1 modify b mediumint;
select * from t1 order by b;
+create table t2 (a int);
+insert t2 values (1),(2);
+alter table t2 add b int auto_increment primary key;
+select * from t2;
+drop table t2;
delete from t1 where a=0;
update t1 set a=0 where b=5;
select * from t1 order by b;