Commit 364139c5 authored by aelkin/elkin@andrepl.(none)'s avatar aelkin/elkin@andrepl.(none)

Merge aelkin@bk-internal.mysql.com:/home/bk/mysql-5.0-marvel

into  andrepl.(none):/home/elkin/MySQL/MAIN/mysql-5.0-marvel
parents 30c8ec9f 9856be57
...@@ -5779,3 +5779,28 @@ SUM(f2) bug25373(f1) ...@@ -5779,3 +5779,28 @@ SUM(f2) bug25373(f1)
DROP FUNCTION bug25373| DROP FUNCTION bug25373|
DROP TABLE t3| DROP TABLE t3|
drop table t1,t2; drop table t1,t2;
CREATE TABLE t1 (a int auto_increment primary key) engine=MyISAM;
CREATE TABLE t2 (a int auto_increment primary key, b int) engine=innodb;
set @a=0;
CREATE function bug27354() RETURNS int deterministic
begin
insert into t1 values (null);
set @a=@a+1;
return @a;
end|
update t2 set b=1 where a=bug27354();
select count(t_1.a),count(t_2.a) from t1 as t_1, t2 as t_2 /* must be 0,0 */;
count(t_1.a) count(t_2.a)
0 0
insert into t2 values (1,1),(2,2),(3,3);
update t2 set b=-b where a=bug27354();
select * from t2 /* must return 1,-1 ... */;
a b
1 -1
2 -2
3 -3
select count(*) from t1 /* must be 3 */;
count(*)
3
drop table t1,t2;
drop function bug27354;
...@@ -6770,3 +6770,27 @@ DROP TABLE t3| ...@@ -6770,3 +6770,27 @@ DROP TABLE t3|
# practical, or create table t3, t4 etc temporarily (and drop them). # practical, or create table t3, t4 etc temporarily (and drop them).
delimiter ;| delimiter ;|
drop table t1,t2; drop table t1,t2;
CREATE TABLE t1 (a int auto_increment primary key) engine=MyISAM;
CREATE TABLE t2 (a int auto_increment primary key, b int) engine=innodb;
set @a=0;
delimiter |;
CREATE function bug27354() RETURNS int deterministic
begin
insert into t1 values (null);
set @a=@a+1;
return @a;
end|
delimiter ;|
update t2 set b=1 where a=bug27354();
select count(t_1.a),count(t_2.a) from t1 as t_1, t2 as t_2 /* must be 0,0 */;
insert into t2 values (1,1),(2,2),(3,3);
update t2 set b=-b where a=bug27354();
select * from t2 /* must return 1,-1 ... */;
select count(*) from t1 /* must be 3 */;
drop table t1,t2;
drop function bug27354;
...@@ -1422,6 +1422,8 @@ class Item_func_sp :public Item_func ...@@ -1422,6 +1422,8 @@ class Item_func_sp :public Item_func
virtual ~Item_func_sp() virtual ~Item_func_sp()
{} {}
table_map used_tables() const { return RAND_TABLE_BIT; }
void cleanup(); void cleanup();
const char *func_name() const; const char *func_name() const;
......
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