[MDEV-33183] Per-partition engine-defined attributes don't work for OQGraph Created: 2024-01-04  Updated: 2024-01-08

Status: Open
Project: MariaDB Server
Component/s: Partitioning, Storage Engine - OQGRAPH
Affects Version/s: 10.8, 10.11, 11.0, 11.1, 11.2, 11.3
Fix Version/s: 10.11, 11.0, 11.1, 11.2, 11.3

Type: Bug Priority: Trivial
Reporter: Elena Stepanova Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-5271 Support engine-defined attributes per... Closed

 Description   

Per-partitioned engine-defined attributes were implemented in 10.8 in the scope of MDEV-5271. To my understanding, data_table is defined as such attribute in OQGraph, however it doesn't work.

--source include/have_partition.inc
 
INSTALL SONAME 'ha_oqgraph';
 
CREATE TABLE oq_backing (
  origid INT UNSIGNED NOT NULL,
  destid INT UNSIGNED NOT NULL,
  PRIMARY KEY (origid, destid),
  KEY (destid)
);
INSERT INTO oq_backing (origid, destid) VALUES (1,2), (2,3), (3,4), (4,5), (2,6), (5,6);
 
CREATE TABLE oq_backing1 (
  origid INT UNSIGNED NOT NULL,
  destid INT UNSIGNED NOT NULL,
  PRIMARY KEY (origid, destid),
  KEY (destid)
);
INSERT INTO oq_backing1 (origid, destid) VALUES (11,12), (12,13), (13,14), (14,15), (12,16), (15,16);
 
CREATE TABLE oq_backing2 (
  origid INT UNSIGNED NOT NULL,
  destid INT UNSIGNED NOT NULL,
  PRIMARY KEY (origid, destid),
  KEY (destid)
);
INSERT INTO oq_backing2 (origid, destid) VALUES (21,22), (22,23), (23,24), (24,25), (22,26), (25,26);
 
CREATE TABLE oq_graph (
  latch VARCHAR(32) NULL,
  origid BIGINT UNSIGNED NULL,
  destid BIGINT UNSIGNED NULL,
  weight DOUBLE NULL,
  seq BIGINT UNSIGNED NULL,
  linkid BIGINT UNSIGNED NULL,
  KEY (latch, origid, destid) USING HASH,
  KEY (latch, destid, origid) USING HASH
)
ENGINE=OQGRAPH
data_table='oq_backing' origid='origid' destid='destid'
PARTITION BY RANGE (origid) (
  PARTITION p0 VALUES LESS THAN (20) data_table='oq_backing1' origid='origid' destid='destid',
  PARTITION p1 VALUES LESS THAN (30) data_table='oq_backing2' origid='origid' destid='destid'
);
 
SELECT * FROM oq_graph;
 
DROP TABLE IF EXISTS oq_backing, oq_backing1, oq_backing2, oq_graph;
UNINSTALL SONAME 'ha_oqgraph';

10.8.8

SELECT * FROM oq_graph;
latch	origid	destid	weight	seq	linkid
NULL	1	2	1	NULL	NULL
NULL	2	3	1	NULL	NULL
NULL	3	4	1	NULL	NULL
NULL	4	5	1	NULL	NULL
NULL	2	6	1	NULL	NULL
NULL	5	6	1	NULL	NULL
NULL	1	2	1	NULL	NULL
NULL	2	3	1	NULL	NULL
NULL	3	4	1	NULL	NULL
NULL	4	5	1	NULL	NULL
NULL	2	6	1	NULL	NULL
NULL	5	6	1	NULL	NULL

So, neither oq_backing1 nor oq_backing2 are used, instead each partition seems to be treated as a separate table with data_table='oq_backing' – default table option, which cannot be omitted because OQGraph requires it.

It works the same way without per-partition attributes – adding a partition leads to an extra set of rows in the result set.


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