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

Bogus ER_UNSUPPORTED_EXTENSION (Table uses an extension that doesn't exist in this MariaDB version)

Details

    Description

      CREATE OR REPLACE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY, c VARCHAR(8)) ENGINE=MyISAM WITH SYSTEM VERSIONING;
      INSERT INTO t1 VALUES (1,'foo');
      DELETE FROM t1;
      ALTER TABLE t1 ENGINE=MyISAM;
      

      ERROR 1112 (42000): Table '#sql-17fe_b' uses an extension that doesn't exist in this MariaDB version
      

      Also reproducible with Aria.

      This variation causes the same problem with InnoDB:

      CREATE OR REPLACE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY, c VARCHAR(8), FULLTEXT(c)) ENGINE=InnoDB WITH SYSTEM VERSIONING;
      INSERT INTO t1 VALUES (1,'foo');
      DELETE FROM t1;
      ALTER TABLE t1 ENGINE=InnoDB;
      

      Attachments

        Issue Links

          Activity

            Thread 28 "mysqld" hit Breakpoint 5, handler::update_auto_increment (this=0x61d00020e508) at handler.cc:3070
            3070 DBUG_RETURN(HA_ERR_UNSUPPORTED);
            #0 handler::update_auto_increment (this=0x61d00020e508) at handler.cc:3070
            #1 ha_myisam::write_row (this=0x61d00020e508, buf=0x6190000dc108 "\374\001") at ha_myisam.cc:896
            #2 handler::ha_write_row (this=0x61d00020e508, buf=0x6190000dc108 "\374\001") at handler.cc:6113
            #3 copy_data_between_tables (thd=0x62a0000ba270, from=0x61f0000524f0, to=0x61f000054ef0, create=List<Create_field> with 4 elements, ignore=false, order_num=0, order=0x0, copied=0x7fffde9527e0, deleted=0x7fffde952800, keys_onoff=Alter_info::LEAVE_AS_IS, alter_ctx=0x7fffde951890) at sql_table.cc:10391
            #4 mysql_alter_table (thd=0x62a0000ba270, new_db=0x62b0000009a8 "test", new_name=0x0, create_info=0x7fffde955600, table_list=0x62b000000370, alter_info=0x7fffde9557e0, order_num=0, order=0x0, ignore=false) at sql_table.cc:9795
            #5 Sql_cmd_alter_table::execute (this=0x62b0000009b8, thd=0x62a0000ba270) at sql_alter.cc:325
            #6 mysql_execute_command (thd=0x62a0000ba270) at sql_parse.cc:6258
            #7 mysql_parse (thd=0x62a0000ba270, rawbuf=0x62b000000288 "ALTER TABLE t1 ENGINE=MyISAM", length=28, parser_state=0x7fffde95ca20, is_com_multi=false, is_next_command=false) at sql_parse.cc:7988
            #8 dispatch_command (command=COM_QUERY, thd=0x62a0000ba270, packet=0x62900012c271 "ALTER TABLE t1 ENGINE=MyISAM", packet_length=28, is_com_multi=false, is_next_command=false) at sql_parse.cc:1825

            kevg Eugene Kosov (Inactive) added a comment - Thread 28 "mysqld" hit Breakpoint 5, handler::update_auto_increment (this=0x61d00020e508) at handler.cc:3070 3070 DBUG_RETURN(HA_ERR_UNSUPPORTED); #0 handler::update_auto_increment (this=0x61d00020e508) at handler.cc:3070 #1 ha_myisam::write_row (this=0x61d00020e508, buf=0x6190000dc108 "\374\001") at ha_myisam.cc:896 #2 handler::ha_write_row (this=0x61d00020e508, buf=0x6190000dc108 "\374\001") at handler.cc:6113 #3 copy_data_between_tables (thd=0x62a0000ba270, from=0x61f0000524f0, to=0x61f000054ef0, create=List<Create_field> with 4 elements, ignore=false, order_num=0, order=0x0, copied=0x7fffde9527e0, deleted=0x7fffde952800, keys_onoff=Alter_info::LEAVE_AS_IS, alter_ctx=0x7fffde951890) at sql_table.cc:10391 #4 mysql_alter_table (thd=0x62a0000ba270, new_db=0x62b0000009a8 "test", new_name=0x0, create_info=0x7fffde955600, table_list=0x62b000000370, alter_info=0x7fffde9557e0, order_num=0, order=0x0, ignore=false) at sql_table.cc:9795 #5 Sql_cmd_alter_table::execute (this=0x62b0000009b8, thd=0x62a0000ba270) at sql_alter.cc:325 #6 mysql_execute_command (thd=0x62a0000ba270) at sql_parse.cc:6258 #7 mysql_parse (thd=0x62a0000ba270, rawbuf=0x62b000000288 "ALTER TABLE t1 ENGINE=MyISAM", length=28, parser_state=0x7fffde95ca20, is_com_multi=false, is_next_command=false) at sql_parse.cc:7988 #8 dispatch_command (command=COM_QUERY, thd=0x62a0000ba270, packet=0x62900012c271 "ALTER TABLE t1 ENGINE=MyISAM", packet_length=28, is_com_multi=false, is_next_command=false) at sql_parse.cc:1825
            kevg Eugene Kosov (Inactive) added a comment - Related commits: https://github.com/MariaDB/server/commit/d3845132fc50e0bf268b5a9ac904ed89cc533cb5 https://github.com/MariaDB/server/commit/a1141e226d431b820a7619deba8c362a1cea7db2

            ek
            10:58 AM
            @serg could you check this ticket? Is there a bug or something we need to improve? https://jira.mariadb.org/browse/MDEV-14681
            serg
            11:08 AM
            I think it's a bug. "Unsupported" is adding NOT NULL AUTO_INCREMENT column to a versioned table. But here it's not being added, it's already present in the table
            ek
            11:09 AM
            So, it that case we just copy data as is?
            serg
            11:14 AM
            Sure. That's true for any NOT NULL UNIQUE column — you cannot generate data for historical rows. But if you don't need to — it should work
            11:15
            here comes a corner case, adding an auto-inc column to a versioned table, that only has current rows :relaxed:
            11:15
            technically we can support it. I don't know if it's worth doing so
            11:16
            it's something the server cannot decide just looking at the metadata, so it's easier not to allow it

            kevg Eugene Kosov (Inactive) added a comment - ek 10:58 AM @serg could you check this ticket? Is there a bug or something we need to improve? https://jira.mariadb.org/browse/MDEV-14681 serg 11:08 AM I think it's a bug. "Unsupported" is adding NOT NULL AUTO_INCREMENT column to a versioned table. But here it's not being added, it's already present in the table ek 11:09 AM So, it that case we just copy data as is? serg 11:14 AM Sure. That's true for any NOT NULL UNIQUE column — you cannot generate data for historical rows. But if you don't need to — it should work 11:15 here comes a corner case, adding an auto-inc column to a versioned table, that only has current rows :relaxed: 11:15 technically we can support it. I don't know if it's worth doing so 11:16 it's something the server cannot decide just looking at the metadata, so it's easier not to allow it
            kevg Eugene Kosov (Inactive) added a comment - Fixed in https://github.com/MariaDB/server/commit/b13f1cc59adb097b8c449730da2c1962493847f4
            bbartels Benjamin Bartels added a comment - - edited

            I was testing out the new system-versioned tables and stumbled upon this error when using ON DELETE CASCADE in my table definition.

            DROP DATABASE IF EXISTS test;
            CREATE DATABASE test;
            USE test;
             
            CREATE TABLE User
            (
                Id               INT AUTO_INCREMENT PRIMARY KEY,
                Username         VARCHAR(50) NOT NULL
            ) WITH SYSTEM VERSIONING;
             
             
            CREATE TABLE Products
            (
                Id                INT AUTO_INCREMENT PRIMARY KEY,
                Name              VARCHAR(100) NOT NULL,
                ModifiedBy        INT NOT NULL,
                FOREIGN KEY(ModifiedBy) REFERENCES User(Id) ON DELETE CASCADE
            ) WITH SYSTEM VERSIONING;
             
             
            INSERT INTO User(Username) VALUES ("admin");
             
            INSERT INTO Products(Name, ModifiedBy) VALUES ("Apple", 1);
            DELETE FROM User WHERE Username = "admin";
            

            Not sure how relevant this is, but seems like it is a similar issue.

            bbartels Benjamin Bartels added a comment - - edited I was testing out the new system-versioned tables and stumbled upon this error when using ON DELETE CASCADE in my table definition. DROP DATABASE IF EXISTS test; CREATE DATABASE test; USE test;   CREATE TABLE User ( Id INT AUTO_INCREMENT PRIMARY KEY, Username VARCHAR(50) NOT NULL ) WITH SYSTEM VERSIONING;     CREATE TABLE Products ( Id INT AUTO_INCREMENT PRIMARY KEY, Name VARCHAR(100) NOT NULL, ModifiedBy INT NOT NULL, FOREIGN KEY(ModifiedBy) REFERENCES User(Id) ON DELETE CASCADE ) WITH SYSTEM VERSIONING;     INSERT INTO User(Username) VALUES ("admin");   INSERT INTO Products(Name, ModifiedBy) VALUES ("Apple", 1); DELETE FROM User WHERE Username = "admin"; Not sure how relevant this is, but seems like it is a similar issue.
            kevg Eugene Kosov (Inactive) added a comment - - edited

            Confirmed. Thanks! MDEV-15136

            kevg Eugene Kosov (Inactive) added a comment - - edited Confirmed. Thanks! MDEV-15136

            People

              kevg Eugene Kosov (Inactive)
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.