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

CREATE SEQUENCE with huge MAXVALUE

    XMLWordPrintable

    Details

      Description

      Oracle example hr ddl script has following command:

      CREATE SEQUENCE EMPLOYEES_SEQ 
          INCREMENT BY 1 
          MAXVALUE 9999999999999999999999999999 
          MINVALUE 1 
          NOCACHE 
      ;
      

      Which fails in 10.3.0 with sql_mode='oracle'::

      MariaDB [test]> CREATE SEQUENCE EMPLOYEES_SEQ
          ->     INCREMENT BY 1
          ->     MAXVALUE 9999999999999999999999999999
          ->     MINVALUE 1
          ->     NOCACHE
          -> ;
      ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '9999999999999999999999999999
          MINVALUE 1
          NOCACHE' at line 3
      

      The command succeeds when MAXVALUE is reduced down to 18x9s, i.e.:

      MariaDB [test]> create sequence d18 maxvalue 999999999999999999;
      Query OK, 0 rows affected (0.03 sec)
       
      MariaDB [test]> create sequence d19 maxvalue 9999999999999999999;
      ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '9999999999999999999' at line 1
      

      I am not sure that we should implement sequence with such high range, but we definitely should make sure that such commands succeed (maybe with a warning that maxvalue was adjusted). That should simplify typical migration and eventual testing with existing scripts.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: