MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
strict_autoinc.inc
1 #
2 # Test for strict-mode autoincrement
3 #
4 
5 --disable_warnings
6 drop table if exists t1;
7 --enable_warnings
8 
9 set @org_mode=@@sql_mode;
10 eval create table t1
11 (
12  `a` tinyint(4) NOT NULL auto_increment,
13  primary key (`a`)
14 ) engine = $type ;
15 set @@sql_mode='strict_all_tables';
16 --error ER_WARN_DATA_OUT_OF_RANGE
17 insert into t1 values(1000);
18 select count(*) from t1;
19 
20 set auto_increment_increment=1000;
21 set auto_increment_offset=700;
22 --error ER_WARN_DATA_OUT_OF_RANGE
23 insert into t1 values(null);
24 select count(*) from t1;
25 
26 set @@sql_mode=@org_mode;
27 insert into t1 values(null);
28 select * from t1;
29 
30 drop table t1;
31 
32 # End of test