[MDEV-14681] Bogus ER_UNSUPPORTED_EXTENSION (Table uses an extension that doesn't exist in this MariaDB version) Created: 2017-12-16  Updated: 2018-01-31  Resolved: 2017-12-21

Status: Closed
Project: MariaDB Server
Component/s: Data Definition - Alter Table, Versioned Tables
Affects Version/s: N/A
Fix Version/s: 10.3.4

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Eugene Kosov (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-15121 ER_UNSUPPORTED_EXTENSION when using O... Closed
relates to MDEV-15136 'delete from user where username = "a... Closed

 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;



 Comments   
Comment by Eugene Kosov (Inactive) [ 2017-12-18 ]

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

Comment by Eugene Kosov (Inactive) [ 2017-12-19 ]

Related commits:
https://github.com/MariaDB/server/commit/d3845132fc50e0bf268b5a9ac904ed89cc533cb5
https://github.com/MariaDB/server/commit/a1141e226d431b820a7619deba8c362a1cea7db2

Comment by Eugene Kosov (Inactive) [ 2017-12-19 ]

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

Comment by Eugene Kosov (Inactive) [ 2017-12-21 ]

Fixed in https://github.com/MariaDB/server/commit/b13f1cc59adb097b8c449730da2c1962493847f4

Comment by Benjamin Bartels [ 2018-01-30 ]

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.

Comment by Eugene Kosov (Inactive) [ 2018-01-30 ]

Confirmed. Thanks! MDEV-15136

Generated at Thu Feb 08 08:15:27 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.