|
In the test case below two Spider tables use the same backend and insert auto-incremented values.
When the Spider tables have an auto-increment with a normal ascending index, it works all right. However, with the descending keys it doesn't, the second insert fails with ER_DUP_ENTRY.
--source include/have_innodb.inc
|
--source include/have_partition.inc
|
|
install soname 'ha_spider';
|
set spider_same_server_link= on;
|
|
select @@spider_auto_increment_mode;
|
|
eval create server s foreign data wrapper mysql options
|
(host '127.0.0.1', database 'test', user 'root', port $MASTER_MYPORT);
|
|
create or replace table t (id int primary key) engine=InnoDB;
|
|
create or replace table t_sp1 (id int auto_increment, primary key(id desc))
|
engine=Spider COMMENT='wrapper "mysql", srv "s", table "t"';
|
|
create or replace table t_sp2 (id int auto_increment, primary key(id desc))
|
engine=Spider COMMENT='wrapper "mysql", srv "s", table "t"';
|
|
insert into t_sp1 () values (),(),();
|
insert into t_sp2 () values (),(),();
|
|
select * from t_sp2;
|
|
preview-10.8-MDEV-13756-desc-indexes c10e10c6
|
mysqltest: At line 21: query 'insert into t_sp2 () values (),(),()' failed: ER_DUP_ENTRY (1062): Duplicate entry '2' for key 'PRIMARY'
|
Same test case, but with ascending keys:
insert into t_sp1 () values (),(),();
|
insert into t_sp2 () values (),(),();
|
select * from t_sp2;
|
id
|
1
|
2
|
3
|
4
|
5
|
6
|
|