Commit 18b301e2 authored by unknown's avatar unknown

Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.0-kt

into  mysql.com:/usr/home/bar/mysql-5.0-kt.b20392
parents 9a472db6 6b640d5c
...@@ -421,6 +421,28 @@ set tmp_table_size=100; ...@@ -421,6 +421,28 @@ set tmp_table_size=100;
set tx_isolation="READ-COMMITTED"; set tx_isolation="READ-COMMITTED";
set wait_timeout=100; set wait_timeout=100;
set log_warnings=1; set log_warnings=1;
select @@session.insert_id;
@@session.insert_id
1
set @save_insert_id=@@session.insert_id;
set session insert_id=20;
select @@session.insert_id;
@@session.insert_id
20
set session last_insert_id=100;
select @@session.insert_id;
@@session.insert_id
20
select @@session.last_insert_id;
@@session.last_insert_id
100
select @@session.insert_id;
@@session.insert_id
20
set @@session.insert_id=@save_insert_id;
select @@session.insert_id;
@@session.insert_id
1
create table t1 (a int not null auto_increment, primary key(a)); create table t1 (a int not null auto_increment, primary key(a));
create table t2 (a int not null auto_increment, primary key(a)); create table t2 (a int not null auto_increment, primary key(a));
insert into t1 values(null),(null),(null); insert into t1 values(null),(null),(null);
......
...@@ -301,6 +301,22 @@ set tx_isolation="READ-COMMITTED"; ...@@ -301,6 +301,22 @@ set tx_isolation="READ-COMMITTED";
set wait_timeout=100; set wait_timeout=100;
set log_warnings=1; set log_warnings=1;
#
# Bugs: #20392: INSERT_ID session variable has weird value
#
select @@session.insert_id;
set @save_insert_id=@@session.insert_id;
set session insert_id=20;
select @@session.insert_id;
set session last_insert_id=100;
select @@session.insert_id;
select @@session.last_insert_id;
select @@session.insert_id;
set @@session.insert_id=@save_insert_id;
select @@session.insert_id;
# #
# key buffer # key buffer
# #
......
...@@ -2578,7 +2578,7 @@ bool sys_var_insert_id::update(THD *thd, set_var *var) ...@@ -2578,7 +2578,7 @@ bool sys_var_insert_id::update(THD *thd, set_var *var)
byte *sys_var_insert_id::value_ptr(THD *thd, enum_var_type type, byte *sys_var_insert_id::value_ptr(THD *thd, enum_var_type type,
LEX_STRING *base) LEX_STRING *base)
{ {
return (byte*) &thd->current_insert_id; return (byte*) &thd->next_insert_id;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment