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

Reset Sequence doesn't reset the value the second time.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Won't Fix
    • Affects Version/s: 10.2.14
    • Fix Version/s: N/A
    • Component/s: Sequences
    • Labels:
      None

      Description

      Reset Sequence doesn't reset the value the second time.

       
      Test case:-
       
      MariaDB [test1]> set sql_mode=ORACLE;
      Query OK, 0 rows affected (0.001 sec)
       
      MariaDB [test1]> CREATE or replace SEQUENCE "entkaisgc_sg" start with 1 minvalue 1 maxvalue 9999999999999999 increment by 1 cache 20 cycle ;
      Query OK, 0 rows affected (0.022 sec)
       
      MariaDB [test1]> select entkaisgc_sg.nextval;
      +----------------------+
      | entkaisgc_sg.nextval |
      +----------------------+
      | 1 |
      +----------------------+
      1 row in set (0.012 sec)
       
      MariaDB [test1]> select entkaisgc_sg.nextval;
      +----------------------+
      | entkaisgc_sg.nextval |
      +----------------------+
      | 2 |
      +----------------------+
      1 row in set (0.001 sec)
       
      MariaDB [test1]> SELECT setval(entkaisgc_sg,9999999999999999);
      +---------------------------------------+
      | setval(entkaisgc_sg,9999999999999999) |
      +---------------------------------------+
      | 9999999999999999 |
      +---------------------------------------+
      1 row in set (0.001 sec)
       
      MariaDB [test1]> select entkaisgc_sg.nextval;
      +----------------------+
      | entkaisgc_sg.nextval |
      +----------------------+
      | 1 |
      +----------------------+
      1 row in set (0.001 sec)
       
      MariaDB [test1]> select entkaisgc_sg.nextval;
      +----------------------+
      | entkaisgc_sg.nextval |
      +----------------------+
      | 2 |
      +----------------------+
      1 row in set (0.000 sec)
       
      MariaDB [test1]> SELECT setval(entkaisgc_sg,9999999999999999);
      +---------------------------------------+
      | setval(entkaisgc_sg,9999999999999999) |
      +---------------------------------------+
      | NULL |
      +---------------------------------------+
      1 row in set (0.000 sec)
       
      MariaDB [test1]> select entkaisgc_sg.nextval;
      +----------------------+
      | entkaisgc_sg.nextval |
      +----------------------+
      | 3 |
      +----------------------+
      1 row in set (0.001 sec)
       
      
      

        Attachments

          Activity

            People

            Assignee:
            greenman Ian Gilfillan
            Reporter:
            pramod.mahto@mariadb.com Pramod Mahto
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: