1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Merge gbichot3.local:/home/mysql_src/mysql-5.1-interval-move-next-insert-id

into  gbichot3.local:/home/mysql_src/mysql-5.1
This commit is contained in:
guilhem@gbichot3.local
2006-07-09 22:50:02 +02:00
30 changed files with 1223 additions and 390 deletions

View File

@@ -144,6 +144,23 @@ insert into t1 (last_id) values (bug15728());
# This should be exactly one greater than in the previous call.
select last_insert_id();
# BUG#20339 - stored procedure using LAST_INSERT_ID() does not
# replicate statement-based
--disable_warnings
drop procedure if exists foo;
--enable_warnings
delimiter |;
create procedure foo()
begin
declare res int;
insert into t2 (last_id) values (bug15728());
insert into t1 (last_id) values (bug15728());
end|
delimiter ;|
call foo();
select * from t1;
select * from t2;
save_master_pos;
connection slave;
sync_with_master;
@@ -154,6 +171,7 @@ connection master;
drop function bug15728;
drop function bug15728_insert;
drop table t1, t2;
drop procedure foo;
# test of BUG#20188 REPLACE or ON DUPLICATE KEY UPDATE in
# auto_increment breaks binlog
@@ -220,4 +238,39 @@ drop table t1;
# End of 5.0 tests
# Test for BUG#20341 "stored function inserting into one
# auto_increment puts bad data in slave"
truncate table t2;
create table t1 (id tinyint primary key); # no auto_increment
delimiter |;
create function insid() returns int
begin
insert into t2 (last_id) values (0);
return 0;
end|
delimiter ;|
set sql_log_bin=0;
insert into t2 (id) values(1),(2),(3);
delete from t2;
set sql_log_bin=1;
#inside SELECT, then inside INSERT
select insid();
set sql_log_bin=0;
insert into t2 (id) values(5),(6),(7);
delete from t2 where id>=5;
set sql_log_bin=1;
insert into t1 select insid();
select * from t1;
select * from t2;
sync_slave_with_master;
select * from t1;
select * from t2;
connection master;
drop table t1, t2;
drop function insid;
sync_slave_with_master;