mirror of
https://github.com/MariaDB/server.git
synced 2026-05-16 11:57:38 +02:00
Manual merge of test from 5.0 (needs to be manual because the test files
were copied/split between 5.0 and 5.1). mysql-test/extra/rpl_tests/rpl_auto_increment.test: manual merge of test from 5.0 mysql-test/extra/rpl_tests/rpl_insert_id.test: manuel merge of test from 5.0 mysql-test/r/rpl_auto_increment.result: error messages changed compared to 5.0
This commit is contained in:
parent
f85f9ac2a0
commit
9420186060
3 changed files with 105 additions and 4 deletions
|
|
@ -104,9 +104,47 @@ select * from t1;
|
|||
|
||||
sync_slave_with_master;
|
||||
select * from t1;
|
||||
|
||||
# Test for BUG#20524 "auto_increment_* not observed when inserting
|
||||
# a too large value". When an autogenerated value was bigger than the
|
||||
# maximum possible value of the field, it was truncated to that max
|
||||
# possible value, without being "rounded down" to still honour
|
||||
# auto_increment_* variables.
|
||||
|
||||
connection master;
|
||||
drop table t1;
|
||||
create table t1 (a tinyint not null auto_increment primary key) engine=myisam;
|
||||
insert into t1 values(103);
|
||||
set auto_increment_increment=11;
|
||||
set auto_increment_offset=4;
|
||||
insert into t1 values(null);
|
||||
insert into t1 values(null);
|
||||
--error 1062
|
||||
insert into t1 values(null);
|
||||
select a, mod(a-@@auto_increment_offset,@@auto_increment_increment) from t1 order by a;
|
||||
|
||||
# same but with a larger value
|
||||
create table t2 (a tinyint unsigned not null auto_increment primary key) engine=myisam;
|
||||
set auto_increment_increment=10;
|
||||
set auto_increment_offset=1;
|
||||
set insert_id=1000;
|
||||
insert into t2 values(null);
|
||||
select a, mod(a-@@auto_increment_offset,@@auto_increment_increment) from t2 order by a;
|
||||
|
||||
# An offset so big that even first value does not fit
|
||||
create table t3 like t1;
|
||||
set auto_increment_increment=1000;
|
||||
set auto_increment_offset=700;
|
||||
insert into t3 values(null);
|
||||
select * from t3 order by a;
|
||||
sync_slave_with_master;
|
||||
select * from t1 order by a;
|
||||
select * from t2 order by a;
|
||||
select * from t3 order by a;
|
||||
|
||||
connection master;
|
||||
|
||||
drop table t1;
|
||||
drop table t1,t2,t3;
|
||||
|
||||
# End cleanup
|
||||
sync_slave_with_master;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue