| 1 |
# Test of auto-increment. |
| 2 |
# |
| 3 |
# BUG#11754117-45670 |
| 4 |
# Multipart primary key with the autoincrement part not first in it |
| 5 |
# is replication unsafe. |
| 6 |
# |
| 7 |
|
| 8 |
source include/master-slave.inc; |
| 9 |
source include/have_binlog_format_mixed.inc; |
| 10 |
|
| 11 |
|
| 12 |
call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.'); |
| 13 |
|
| 14 |
--connection master |
| 15 |
--error ER_WRONG_AUTO_KEY |
| 16 |
create table ti (b int auto_increment, a int, primary key (a,b)) engine= innodb; |
| 17 |
create table ti (b int auto_increment, a int, primary key (b,a)) engine= innodb; |
| 18 |
|
| 19 |
set @@binlog_format=statement; |
| 20 |
--echo *** no warning when autoincrement is the first in PK |
| 21 |
insert into ti set b=null, a=1; |
| 22 |
show warnings; |
| 23 |
|
| 24 |
|
| 25 |
# cleanup |
| 26 |
|
| 27 |
--connection master |
| 28 |
|
| 29 |
drop table ti; |
| 30 |
|
| 31 |
--source include/sync_slave_sql_with_master.inc |
| 32 |
|
| 33 |
--source include/rpl_end.inc |