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

create table /*!50100 PARTITION BY HASH (compid) PARTITIONS 400 */ AUTO_INCREMENT=61308 ; failes

    XMLWordPrintable

Details

    Description

      as reported by @Ara4Sh on #mariab

       
      16:50 < Ara4Sh> Hello i dump my backup in a mariadb server (mysql  Ver 15.1 Distrib 10.0.14-MariaDB) and import in another mariadb server (mysql  Ver 15.1 Distrib 10.0.21-MariaDB) and here is
                      the problem
      16:51 < Ara4Sh> ERROR 1064 (42000) at line 4185: 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
                      'AUTO_INCREMENT=61308' at line 10

      MariaDB [test]> CREATE TABLE IF NOT EXISTS `arash` (
          ->   `call_id` int(11) NOT NULL AUTO_INCREMENT,
          ->   `number` varchar(15) CHARACTER SET utf8 COLLATE utf8_persian_ci DEFAULT NULL,
          ->   `date` datetime DEFAULT '0000-00-00 00:00:00',
          ->   `sms_call` int(1) DEFAULT NULL,
          ->   `compid` int(11) NOT NULL DEFAULT '0',
          ->   PRIMARY KEY (`call_id`,`compid`)
          -> ) ENGINE=InnoDB  DEFAULT CHARSET=utf8
          -> /*!50100 PARTITION BY HASH (compid)
          -> PARTITIONS 400 */ AUTO_INCREMENT=61308 ;
      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 'AUTO_INCREMENT=61308' at line 10

      swapping parition and auto_increment table options is successful:

      MariaDB [test]> CREATE TABLE IF NOT EXISTS `arash` (   `call_id` int(11) NOT NULL AUTO_INCREMENT,   `number` varchar(15) CHARACTER SET utf8 COLLATE utf8_persian_ci DEFAULT NULL,   `date` datetime DEFAULT '0000-00-00 00:00:00',   `sms_call` int(1) DEFAULT NULL,   `compid` int(11) NOT NULL DEFAULT '0',   PRIMARY KEY (`call_id`,`compid`) ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=61308 /*!50100 PARTITION BY HASH (compid) PARTITIONS 400 */;
      Query OK, 0 rows affected (1.06 sec)
       

      Attachments

        Activity

          People

            Unassigned Unassigned
            danblack Daniel Black
            Votes:
            1 Vote for this issue
            Watchers:
            3 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.