diff options
author | unknown <bell@sanja.is.com.ua> | 2004-10-09 18:52:27 +0300 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2004-10-09 18:52:27 +0300 |
commit | 4f81309e563639db9c98f1e956f39be52ea5de33 (patch) | |
tree | 75930db5d87e995b3e5d4a68d4f43a88af40ea1d | |
parent | 79f1eeb87ff8047d1d09578f41c604bf5e31f29b (diff) | |
parent | 13ec43179cd1a6d86591872ec5b25a01b4370b39 (diff) | |
download | mariadb-git-4f81309e563639db9c98f1e956f39be52ea5de33.tar.gz |
Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into sanja.is.com.ua:/home/bell/mysql/bk/work-error-5.0
-rw-r--r-- | mysql-test/r/view.result | 12 | ||||
-rw-r--r-- | mysql-test/t/view.test | 8 | ||||
-rw-r--r-- | sql/sql_update.cc | 5 |
3 files changed, 22 insertions, 3 deletions
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 344bce2a204..f1a32ea0c17 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -1329,6 +1329,18 @@ update v1,t1 set v1.s1='c' where t1.s1=v1.s1; select * from v1; s1 c +prepare stmt1 from "update v1,t1 set v1.s1=? where t1.s1=v1.s1"; +set @arg='d'; +execute stmt1 using @arg; +select * from v1; +s1 +d +set @arg='e'; +execute stmt1 using @arg; +select * from v1; +s1 +e +deallocate prepare stmt1; drop view v1; drop table t1; create table t1 (a int); diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index cfad7e34d0d..a9fd65bbb09 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -1297,6 +1297,14 @@ update v1 set s1='b'; select * from v1; update v1,t1 set v1.s1='c' where t1.s1=v1.s1; select * from v1; +prepare stmt1 from "update v1,t1 set v1.s1=? where t1.s1=v1.s1"; +set @arg='d'; +execute stmt1 using @arg; +select * from v1; +set @arg='e'; +execute stmt1 using @arg; +select * from v1; +deallocate prepare stmt1; drop view v1; drop table t1; diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 7a643933c46..00e70ccb484 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -80,9 +80,8 @@ static bool check_fields(THD *thd, List<Item> &items) we make temporary copy of Item_field, to avoid influence of changing result_field on Item_ref which refer on this field */ - field= new Item_field(thd, field); - it.replace(field); - ((Item_field *)item)->register_item_tree_changing(it.ref()); + it.replace(new Item_field(thd, field)); + field->register_item_tree_changing(it.ref()); } return FALSE; } |