Commit fff2bc4d authored by ingo@mysql.com's avatar ingo@mysql.com

Merge mysql.com:/home/mydev/mysql-5.0

into  mysql.com:/home/mydev/mysql-5.0-bug5390
parents abf41982 22431de4
...@@ -47,6 +47,17 @@ unlock tables; ...@@ -47,6 +47,17 @@ unlock tables;
lock tables t1 write, t1 as t1_alias read; lock tables t1 write, t1 as t1_alias read;
insert into t1 select index1,nr from t1 as t1_alias; insert into t1 select index1,nr from t1 as t1_alias;
drop table t1,t2; drop table t1,t2;
create table t1 (c1 int);
create table t2 (c1 int);
create table t3 (c1 int);
lock tables t1 write, t2 write, t3 write;
drop table t2, t3, t1;
create table t1 (c1 int);
create table t2 (c1 int);
create table t3 (c1 int);
lock tables t1 write, t2 write, t3 write, t1 as t4 read;
alter table t2 add column c2 int;
drop table t1, t2, t3;
create table t1 ( a int(11) not null auto_increment, primary key(a)); create table t1 ( a int(11) not null auto_increment, primary key(a));
create table t2 ( a int(11) not null auto_increment, primary key(a)); create table t2 ( a int(11) not null auto_increment, primary key(a));
lock tables t1 write, t2 read; lock tables t1 write, t2 read;
......
...@@ -61,6 +61,24 @@ insert into t1 select index1,nr from t1 as t1_alias; ...@@ -61,6 +61,24 @@ insert into t1 select index1,nr from t1 as t1_alias;
drop table t1,t2; drop table t1,t2;
# #
# BUG#5390 - problems with merge tables
# Supplement test for the after-fix optimization
# Check that a dropped table is correctly removed from a lock.
create table t1 (c1 int);
create table t2 (c1 int);
create table t3 (c1 int);
lock tables t1 write, t2 write, t3 write;
# This removes one table after the other from the lock.
drop table t2, t3, t1;
#
# Check that a lock merge works.
create table t1 (c1 int);
create table t2 (c1 int);
create table t3 (c1 int);
lock tables t1 write, t2 write, t3 write, t1 as t4 read;
alter table t2 add column c2 int;
drop table t1, t2, t3;
# Bug7241 - Invalid response when DELETE .. USING and LOCK TABLES used. # Bug7241 - Invalid response when DELETE .. USING and LOCK TABLES used.
# #
create table t1 ( a int(11) not null auto_increment, primary key(a)); create table t1 ( a int(11) not null auto_increment, primary key(a));
......
This diff is collapsed.
...@@ -1537,6 +1537,9 @@ TABLE *delayed_insert::get_local_table(THD* client_thd) ...@@ -1537,6 +1537,9 @@ TABLE *delayed_insert::get_local_table(THD* client_thd)
/* Adjust in_use for pointing to client thread */ /* Adjust in_use for pointing to client thread */
copy->in_use= client_thd; copy->in_use= client_thd;
/* Adjust lock_count. This table object is not part of a lock. */
copy->lock_count= 0;
return copy; return copy;
/* Got fatal error */ /* Got fatal error */
......
...@@ -237,6 +237,9 @@ struct st_table { ...@@ -237,6 +237,9 @@ struct st_table {
timestamp_auto_set_type timestamp_field_type; timestamp_auto_set_type timestamp_field_type;
table_map map; /* ID bit of table (1,2,4,8,16...) */ table_map map; /* ID bit of table (1,2,4,8,16...) */
uint lock_position; /* Position in MYSQL_LOCK.table */
uint lock_data_start; /* Start pos. in MYSQL_LOCK.locks */
uint lock_count; /* Number of locks */
uint tablenr,used_fields; uint tablenr,used_fields;
uint temp_pool_slot; /* Used by intern temp tables */ uint temp_pool_slot; /* Used by intern temp tables */
uint status; /* What's in record[0] */ uint status; /* What's in record[0] */
......
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