diff options
-rw-r--r-- | mysql-test/r/innodb.result | 6 | ||||
-rw-r--r-- | mysql-test/t/innodb.test | 6 | ||||
-rw-r--r-- | sql/sql_parse.cc | 2 | ||||
-rw-r--r-- | sql/sql_update.cc | 2 |
4 files changed, 14 insertions, 2 deletions
diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 2a6eaaf0bfc..d65e90a6cc0 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -1058,6 +1058,12 @@ create table t2 (b varchar(10) not null unique) type=innodb; select t1.a from t1,t2 where t1.a=t2.b; a drop table t1,t2; +create table t1 (a int not null, b int, primary key (a)) type = innodb; +create table t2 (a int not null, b int, primary key (a)) type = innodb; +insert into t1 values (10, 20); +insert into t2 values (10, 20); +update t1, t2 set t1.b = 150, t2.b = t1.b where t2.a = t1.a and t1.a = 10; +drop table t1,t2; CREATE TABLE t1 (id INT NOT NULL, PRIMARY KEY (id)) TYPE=INNODB; CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id), FOREIGN KEY (t1_id) REFERENCES t1(id) ON DELETE CASCADE ) TYPE=INNODB; insert into t1 set id=1; diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index 8b75d067566..7d13258ede1 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -696,6 +696,12 @@ create table t1 (a varchar(10) not null) type=myisam; create table t2 (b varchar(10) not null unique) type=innodb; select t1.a from t1,t2 where t1.a=t2.b; drop table t1,t2; +create table t1 (a int not null, b int, primary key (a)) type = innodb; +create table t2 (a int not null, b int, primary key (a)) type = innodb; +insert into t1 values (10, 20); +insert into t2 values (10, 20); +update t1, t2 set t1.b = 150, t2.b = t1.b where t2.a = t1.a and t1.a = 10; +drop table t1,t2; # # Test of multi-table-delete with foreign key constraints diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 66f11f3da9f..7ae69a4b77f 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2038,7 +2038,7 @@ mysql_execute_command(void) (ORDER *)NULL,(ORDER *)NULL,(Item *)NULL, (ORDER *)NULL, select_lex->options | thd->options | - SELECT_NO_JOIN_CACHE, + SELECT_NO_JOIN_CACHE | SELECT_NO_UNLOCK, result); delete result; } diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 9817dcd2be5..d1a2d4d5524 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -400,7 +400,7 @@ int mysql_multi_update(THD *thd, res= mysql_select(thd,table_list,total_list, conds, (ORDER *) NULL, (ORDER *)NULL, (Item *) NULL, (ORDER *)NULL, - options | SELECT_NO_JOIN_CACHE, + options | SELECT_NO_JOIN_CACHE | SELECT_NO_UNLOCK, result); delete result; DBUG_RETURN(res); |