diff options
author | acurtis/antony@xiphis.org/ltantony.xiphis.org <> | 2006-08-30 13:20:39 -0700 |
---|---|---|
committer | acurtis/antony@xiphis.org/ltantony.xiphis.org <> | 2006-08-30 13:20:39 -0700 |
commit | 678e15174eacc04306c09175781e68a462fcc4f7 (patch) | |
tree | 8420b990a80a44f9a16ab6d77359c0a179d2893a /mysql-test/include/strict_autoinc.inc | |
parent | 6509ad6e8ab2839344b99610f77dbe1d666eb3db (diff) | |
download | mariadb-git-678e15174eacc04306c09175781e68a462fcc4f7.tar.gz |
Bug#20573
"strict mode: inserts autogenerated auto_increment value bigger than max"
Strict mode should fail if autoincrement value is out of range
Diffstat (limited to 'mysql-test/include/strict_autoinc.inc')
-rw-r--r-- | mysql-test/include/strict_autoinc.inc | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/mysql-test/include/strict_autoinc.inc b/mysql-test/include/strict_autoinc.inc new file mode 100644 index 00000000000..6960440f3a7 --- /dev/null +++ b/mysql-test/include/strict_autoinc.inc @@ -0,0 +1,28 @@ +# +# Test for strict-mode autoincrement +# + +set @org_mode=@@sql_mode; +eval create table t1 +( + `a` tinyint(4) NOT NULL auto_increment, + primary key (`a`) +) engine = $type ; +set @@sql_mode='strict_all_tables'; +--error ER_WARN_DATA_OUT_OF_RANGE +insert into t1 values(1000); +select count(*) from t1; + +set auto_increment_increment=1000; +set auto_increment_offset=700; +--error ER_WARN_DATA_OUT_OF_RANGE +insert into t1 values(null); +select count(*) from t1; + +set @@sql_mode=@org_mode; +insert into t1 values(null); +select * from t1; + +drop table t1; + +# End of test |