[MDEV-32001] Spider hint key does not really check the idx number Created: 2023-08-24  Updated: 2023-08-24

Status: Open
Project: MariaDB Server
Component/s: Storage Engine - Spider
Affects Version/s: 11.2
Fix Version/s: 11.2

Type: Bug Priority: Major
Reporter: Yuchen Pei Assignee: Yuchen Pei
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-32000 spider_mbase_share::convert_key_hint_... Open

 Description   

Probably affects other versions too.

The following test sends "select `d` from `test`.`t2` force index(d) order by `d` desc limit 1" to the data node, even though d is not the 0th key (c is). I am not sure why we need to indicate the idx number - it is not shown in show create table as claimed by [1] anyway

--echo #
--echo # tmp
--echo #
--disable_query_log
--disable_result_log
--source ../../t/test_init.inc
--enable_result_log
--enable_query_log
 
evalp CREATE SERVER srv FOREIGN DATA WRAPPER mysql
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
 
create table t2 (c int, d int, primary key (c), key (d));
show create table t2;
create table t1 (c int, d int, primary key (c), key (d)) ENGINE=Spider
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2", idx000 "f d"';
show create table t1;
/* 13 */ insert into t1 values (42, 23), (37, 93);
select max(d) from t1;
 
drop table t1, t2;
 
drop server srv;
 
--disable_query_log
--disable_result_log
--source ../../t/test_deinit.inc
--enable_result_log
--enable_query_log
--echo #
--echo # end of test tmp
--echo #

[1] https://mariadb.com/kb/en/spider-table-parameters/#idx000


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