|
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
|
|
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
|
|
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.
|