[MDEV-5317] Compound statement / anonymous blocks Created: 2013-11-20 Updated: 2014-10-11 Resolved: 2014-10-11 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | OTHER |
| Fix Version/s: | 10.1.1 |
| Type: | Task | Priority: | Major |
| Reporter: | Antony T Curtis (Inactive) | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 3 |
| Labels: | contribution | ||
| Attachments: |
|
||||||||||||||||
| Issue Links: |
|
||||||||||||||||
| Description |
|
Code contribution, New BSD license. 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. |
| Comments |
| Comment by Colin Charles [ 2014-04-09 ] |
|
Was contributed upstream also http://bugs.mysql.com/bug.php?id=70948 |
| Comment by Sergei Golubchik [ 2014-06-16 ] |
|
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? |
| Comment by Sergei Golubchik [ 2014-08-13 ] |
|
Ah, and there's also SET ? = expr syntax. |
| Comment by Sergei Golubchik [ 2014-08-18 ] |
|
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. |
| Comment by Sergei Golubchik [ 2014-08-18 ] |
|
elenst, could you please do some testing of this feature? |
| Comment by Elena Stepanova [ 2014-08-19 ] |
|
Assorted notes New status variable: Com_compound_sql From http://dev.mysql.com/doc/refman/5.6/en/sql-syntax-compound-statements.html
|
| Comment by Elena Stepanova [ 2014-08-25 ] |
|
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. |
| Comment by Oleksandr Byelkin [ 2014-09-08 ] |
|
OK to push |