[MDEV-27604] Values of partition-level options are not validated Created: 2022-01-24  Updated: 2023-11-28

Status: Open
Project: MariaDB Server
Component/s: Partitioning
Affects Version/s: 10.8
Fix Version/s: 10.11

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Alexey Botchkov
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Problem/Incident
is caused by MDEV-5271 Support engine-defined attributes per... Closed

 Description   

10.8 05050867

MariaDB [test]> create table t (a int) partition by hash(a) (partition p1 encrypted= "i will think about it");
Query OK, 0 rows affected (0.034 sec)
 
MariaDB [test]> create or replace table t (a int) partition by hash(a) (partition p1 encrypted= 42);
Query OK, 0 rows affected (0.062 sec)

On the table level both would have thrown ER_BAD_OPTION_VALUE.

The practical side of the problem is that values which look meaningful but are in fact incorrect may bypass validation.
For example, on a server without configured encryption, both of

create table t (a int) encrypted=yes;
create table t (a int) encrypted=1;

will fail – the first one with ER_CANT_CREATE_TABLE and a bunch of warnings, because there is no encryption available, and the second one with ER_BAD_OPTION_VALUE because "1" is in fact not a valid value.
However, with the same options on the partition level

create table t (a int) partition by hash(a) (partition p0 encrypted=yes);
create table t (a int) partition by hash(a) (partition p0 encrypted=1);

the first one will again fail with ER_CANT_CREATE_TABLE, but the second one will work, giving the impression that an encrypted partition has been created.


Generated at Thu Feb 08 09:54:11 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.