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

NEXTVAL should increment only once for a given row

    Details

      Description

      According to discussion in comments in MDEV-10139 "If there are multiple instances of <next value expression>s specifying the same sequence generator within a single SQL-statement, all those instances return the same value for a given row processed by that SQL-statement."

      So SELECT below should show the same number twice, and it doesn't:

      MariaDB [test]> create or replace sequence x;
      Query OK, 0 rows affected (0.18 sec)
       
      MariaDB [test]> select nextval(x), nextval(x);
      +------------+------------+
      | nextval(x) | nextval(x) |
      +------------+------------+
      |          1 |          2 |
      +------------+------------+
      1 row in set (0.04 sec)
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                monty Michael Widenius
                Reporter:
                anikitin Andrii Nikitin (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: