--
-- ### Update return on first check
-- 

drop if exists table t1;
create table t1( a int, b string(30));

insert into t1 values ( 1, 'DONE');
insert into t1 values ( 2, 'DONE');
insert into t1 values ( 3, 'WAIT');
insert into t1 values ( 4, 'WAIT');
insert into t1 values ( 5, 'WAIT');
insert into t1 values ( 6, 'WAIT');
insert into t1 values ( 7, 'WAIT');

drop if exists procedure checkOnFirstTrue;
@
create procedure checkOnFirstTrue()
begin
	var a int;
	update t1 set b = 'DONE' where b = 'WAIT' return on first :a = a;
end;
@

drop if exists procedure checkOnFirstFalse;
@
create procedure checkOnFirstFalse()
begin
	var a int;
	update t1 set b = 'DONE' where b = 'WAIT' return :a = a;
end;
@

call checkOnFirstTrue();
select * from t1 order by a;

call checkOnFirstFalse();
select * from t1 order by a;


