Missing functionality: implement ATOMIC support which should create an anonymous savepoint at start of block and rollback on failure. commit if AUTOCOMMIT or remove anonymous savepoint if already in transaction.
Okay. This is more than simply BEGIN...END, as it also includes output placeholders for prepared statements (e.g. in PREPARE "SELECT...INTO ?"). Which looks like a cool, but different feature.
And it's unfortunately less than I expected, as it only covers (and tests) BEGIN...END (and DECLARE), but not IF and loops.
atcurtis, what did you need this feature for, I mean, in that exactly scope?
Do you want to work more on it, or you'd prefer if I take it as is and finalize it myself ?
Sergei Golubchik
added a comment - - edited Okay. This is more than simply BEGIN...END , as it also includes output placeholders for prepared statements (e.g. in PREPARE "SELECT...INTO ?" ). Which looks like a cool, but different feature.
And it's unfortunately less than I expected, as it only covers (and tests) BEGIN...END (and DECLARE), but not IF and loops.
atcurtis , what did you need this feature for, I mean, in that exactly scope?
Do you want to work more on it, or you'd prefer if I take it as is and finalize it myself ?
I've now pushed a — significantly reworked — patch to github. Without SET ? = expr syntax, but with SELECT ... INTO ?. Without BEGIN ATOMIC (it wasn't atomic in the contributed patch either, in mine it is not accepted at all). And with support for IF, CASE, LOOP, REPEAT, WHILE.
Sergei Golubchik
added a comment - I've now pushed a — significantly reworked — patch to github. Without SET ? = expr syntax, but with SELECT ... INTO ? . Without BEGIN ATOMIC (it wasn't atomic in the contributed patch either, in mine it is not accepted at all). And with support for IF , CASE , LOOP , REPEAT , WHILE .
(for outermost blocks) labels, ITERATE, LEAVE do not work
Elena Stepanova
added a comment - Assorted notes
New status variable: Com_compound_sql
From http://dev.mysql.com/doc/refman/5.6/en/sql-syntax-compound-statements.html
RETURN does not work (expectedly)
(for outermost blocks) labels, ITERATE , LEAVE do not work
Ran some manual and automated tests, haven't got anything except for the issues listed in "Issue Links" section. Please push, and I will include new functionality in my general auto tests.
Elena Stepanova
added a comment - Ran some manual and automated tests, haven't got anything except for the issues listed in "Issue Links" section. Please push, and I will include new functionality in my general auto tests.
Was contributed upstream also http://bugs.mysql.com/bug.php?id=70948