Bug #21410 Flow control functions within the general SQL context

Submitted: 2 Aug 2006 4:54 Modified: 2 Sep 2006 12:51
Reporter: Morgan Tocker Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server Severity:S4 (Feature request)
Version: OS:
Assigned to: CPU Architecture:Any

[2 Aug 2006 4:54] Morgan Tocker
Description:
This is perhaps non-standard, but because there is no support for ROLLBACK/COMMIT statements within routines, it is very difficult to do something like this in just SQL...

How to repeat:
drop table if exists test;
create table test(id int not null) type=InnoDB;

set autocommit=0;
start transaction;

set @error='bad';
insert into test select 15;
insert into test select 16;
if @error='' then
rollback;
else
commit;
end if;

Suggested fix:
Add the same flow control from routines into general SQL context.
[2 Aug 2006 12:51] Valeriy Kravchuk
Thank you for a feature request. I think, request for COMMIT/ROLLBACK support in stored procedures (not triggers!) is much more reasonable. SQL is not a good place to introduce flow control statements.
[2 Sep 2006 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.049 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.