Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-5317

Compound statement / anonymous blocks

Details

    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.

      Attachments

        Issue Links

          Activity

            colin Colin Charles added a comment -

            Was contributed upstream also http://bugs.mysql.com/bug.php?id=70948

            colin Colin Charles added a comment - Was contributed upstream also http://bugs.mysql.com/bug.php?id=70948
            serg 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 ?

            serg 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 ?

            Ah, and there's also SET ? = expr syntax.
            atcurtis — why did you do that? Any use cases?

            serg Sergei Golubchik added a comment - Ah, and there's also SET ? = expr syntax. atcurtis — why did you do that? Any use cases?

            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.

            serg 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 .

            elenst, could you please do some testing of this feature?

            serg Sergei Golubchik added a comment - elenst , could you please do some testing of this feature?

            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
            elenst 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.

            elenst 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.

            OK to push

            sanja Oleksandr Byelkin added a comment - OK to push

            People

              serg Sergei Golubchik
              atcurtis Antony T Curtis (Inactive)
              Votes:
              3 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.