mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Fix for bug #14304: auto_increment field incorrect set from within stored procedure (insert select).
sql/sp_head.cc: Fix for bug #14304: auto_increment field incorrect set from within stored procedure (insert select). - call thd->cleanup_after_query() to clean next_insert_id. sql/sql_class.cc: Fix for bug #14304: auto_increment field incorrect set from within stored procedure (insert select). - save/restore clear_next_insert_id sql/sql_class.h: Fix for bug #14304: auto_increment field incorrect set from within stored procedure (insert select). - clear_next_insert_id added
This commit is contained in:
@ -4046,4 +4046,28 @@ boo
|
||||
2
|
||||
drop procedure bug14643_1|
|
||||
drop procedure bug14643_2|
|
||||
drop procedure if exists bug14304|
|
||||
drop table if exists t3, t4|
|
||||
create table t3(a int primary key auto_increment)|
|
||||
create table t4(a int primary key auto_increment)|
|
||||
create procedure bug14304()
|
||||
begin
|
||||
insert into t3 set a=null;
|
||||
insert into t4 set a=null;
|
||||
insert into t4 set a=null;
|
||||
insert into t4 set a=null;
|
||||
insert into t4 set a=null;
|
||||
insert into t4 set a=null;
|
||||
insert into t4 select null as a;
|
||||
insert into t3 set a=null;
|
||||
insert into t3 set a=null;
|
||||
select * from t3;
|
||||
end|
|
||||
call bug14304()|
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
drop procedure bug14304|
|
||||
drop table t3, t4|
|
||||
drop table t1,t2;
|
||||
|
@ -4823,6 +4823,37 @@ call bug14643_2()|
|
||||
drop procedure bug14643_1|
|
||||
drop procedure bug14643_2|
|
||||
|
||||
#
|
||||
# BUG#14304: auto_increment field incorrect set in SP
|
||||
#
|
||||
--disable_warnings
|
||||
drop procedure if exists bug14304|
|
||||
drop table if exists t3, t4|
|
||||
--enable_warnings
|
||||
|
||||
create table t3(a int primary key auto_increment)|
|
||||
create table t4(a int primary key auto_increment)|
|
||||
|
||||
create procedure bug14304()
|
||||
begin
|
||||
insert into t3 set a=null;
|
||||
insert into t4 set a=null;
|
||||
insert into t4 set a=null;
|
||||
insert into t4 set a=null;
|
||||
insert into t4 set a=null;
|
||||
insert into t4 set a=null;
|
||||
insert into t4 select null as a;
|
||||
|
||||
insert into t3 set a=null;
|
||||
insert into t3 set a=null;
|
||||
|
||||
select * from t3;
|
||||
end|
|
||||
|
||||
call bug14304()|
|
||||
|
||||
drop procedure bug14304|
|
||||
drop table t3, t4|
|
||||
|
||||
#
|
||||
# BUG#NNNN: New bug synopsis
|
||||
|
Reference in New Issue
Block a user