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

Report all INSERT ID for bulk operation INSERT

Details

    • 10.2.4-1, 10.2.4-1, 10.2.4-2, 10.2.6-2, 10.2.6-3

    Description

      Before normal OK packet sent result set with 3 fields:
      Id - first ID sequence
      Len - Sequence length (number of sequential Ids)
      Inc - increment of the sequence (same for all records)

      If statement return the same ID after each insert, will be reported only one.

      Function work only if INSERT_ID_REQUEST set as flag for the execute statement.

      Attachments

        Issue Links

          Activity

            Not needed anymore, INSERT ... RETURNING can be used instead.

            serg Sergei Golubchik added a comment - Not needed anymore, INSERT ... RETURNING can be used instead.
            rjasdfiii Rick James added a comment -

            Thanks!
            Alas, the one place I wanted to use it is apparently not allowed:
            INSERT ... SELECT ...
            RETURNING ...;
            Or maybe it would be
            INSERT ... RETURNING ...
            SELECT ...;

            rjasdfiii Rick James added a comment - Thanks! Alas, the one place I wanted to use it is apparently not allowed: INSERT ... SELECT ... RETURNING ...; Or maybe it would be INSERT ... RETURNING ... SELECT ...;
            serg Sergei Golubchik added a comment - It is, https://github.com/MariaDB/server/blob/10.5/mysql-test/main/insert_returning.test#L136 what exactly isn't working for you?
            rjasdfiii Rick James added a comment -

            I was looking at the syntax – It seems to be disallowed. Perhaps it is just a documentation omission?
            (I have not yet tried it.)

            Would the RETURNING come before the SELECT? Or After?

            rjasdfiii Rick James added a comment - I was looking at the syntax – It seems to be disallowed. Perhaps it is just a documentation omission? (I have not yet tried it.) Would the RETURNING come before the SELECT? Or After?

            Looking at the syntax in the KB? https://mariadb.com/kb/en/insertreturning/ shows that it's supported.

            See the manual for the documented supported syntax and the test file (in my previous comment) for actual working examples.

            serg Sergei Golubchik added a comment - Looking at the syntax in the KB? https://mariadb.com/kb/en/insertreturning/ shows that it's supported. See the manual for the documented supported syntax and the test file (in my previous comment) for actual working examples.

            People

              sanja Oleksandr Byelkin
              sanja Oleksandr Byelkin
              Votes:
              4 Vote for this issue
              Watchers:
              9 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.