[MDEV-33003] long uniques don't work with spider Created: 2023-12-12  Updated: 2023-12-12

Status: Open
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.4, 10.5, 10.6, 10.11, 11.0, 11.1, 11.2, 11.3
Fix Version/s: 10.4, 10.5, 10.6, 10.11, 11.0, 11.1, 11.2

Type: Bug Priority: Major
Reporter: Sergei Golubchik Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-32839 LONG UNIQUE gives error when used wit... Closed

 Description   

or any other federated engine, fwiw.

In, for example, a test like

--disable_warnings
--disable_query_log
--disable_result_log
--source test_init.inc
--enable_result_log
--enable_query_log
 
--connection child2_1
create database auto_test_remote;
use auto_test_remote;
 
create table ta_r (
  f1 bigint(20) not null auto_increment primary key,
  f2 varchar(30) default null,
  f3 varchar(30) default null,
  f4 varchar(25) default null,
  f5 varchar(30) default null,
  f6 varchar(25) default null,
  f7 varchar(25) default null,
  unique problem_key (f3,f5,f6,f2,f4,f7) using hash
) engine=myisam;
 
--connection master_1
create database auto_test_local;
use auto_test_local;
 
eval create table t1 (
  f1 bigint(20) not null auto_increment primary key,
  f2 varchar(30) default null,
  f3 varchar(30) default null,
  f4 varchar(25) default null,
  f5 varchar(30) default null,
  f6 varchar(25) default null,
  f7 varchar(25) default null,
  unique problem_key (f3,f5,f6,f2,f4,f7) using hash
) engine=spider
  $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
 
insert  t1 (f2, f3, f4, f5, f6, f7) values ('00004', '0001009089999', '', 'netstes', 'psit', 'd');
replace t1 (f2, f3, f4, f5, f6, f7) values ('00004', '0001009089999', '', 'netstes', 'psit', 'd');
insert  t1 (f2, f3, f4, f5, f6, f7) values ('00004', '0001009089999', '', 'netstes', 'psit', 'e');
replace t1 (f2, f3, f4, f5, f6, f7) values ('00004', '0001009089999', '', 'netstes', 'psit', 'e');
select * from t1;
drop database auto_test_local;
 
--connection child2_1
drop database auto_test_remote;
 
--disable_warnings
--disable_query_log
--disable_result_log
--source test_deinit.inc
--enable_result_log
--enable_query_log

On the second replace:

  • master_1 needs to check if there's a duplicate
  • calculates the hash value and needs to read it from the table
  • sends SELECT f1 FROM ta_r WHERE DB_ROW_HASH_1=<hash value> to child2_1
  • child2_1 doesn't have such a column, it's "fully invisible", so the whole fails with

    1054: Unknown column 'DB_ROW_HASH_1' in 'field list'
    



 Comments   
Comment by Elena Stepanova [ 2023-12-12 ]

see also MDEV-29059

Generated at Thu Feb 08 10:35:39 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.