← Back to team overview

maria-developers team mailing list archive

Re: a10facb656b: MDEV-27065 Partitioning tables with custom data directories moves data back to default directory

 

Hi, Nayuta,

On Mar 29, Nayuta Yanagisawa wrote:
> revision-id: a10facb656b (mariadb-10.2.43-48-ga10facb656b)
> parent(s): 33ff18627ea
> author: Nayuta Yanagisawa
> committer: Nayuta Yanagisawa
> timestamp: 2022-03-29 23:43:16 +0900
> message:
> 
> MDEV-27065 Partitioning tables with custom data directories moves data back to default directory
> 
> ---
>  .../suite/parts/r/partition_exch_qa_14.result      | 22 ++++++++++++++++++++++
>  sql/ha_partition.cc                                | 16 ++++++++++++++++
>  2 files changed, 38 insertions(+)
> 
> diff --git a/mysql-test/suite/parts/r/partition_exch_qa_14.result b/mysql-test/suite/parts/r/partition_exch_qa_14.result
> index 1420982436a..52839644f55 100644
> --- a/mysql-test/suite/parts/r/partition_exch_qa_14.result
> +++ b/mysql-test/suite/parts/r/partition_exch_qa_14.result
> @@ -9,6 +9,9 @@ PARTITION BY RANGE (a)
>  (PARTITION p0 VALUES LESS THAN (10) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir',
>  PARTITION p1 VALUES LESS THAN (100) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir',
>  PARTITION p2 VALUES LESS THAN (1000) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir');
> +Warnings:
> +Warning	1618	<DATA DIRECTORY> option ignored
> +Warning	1618	<INDEX DIRECTORY> option ignored

This is very confusing. There are four DATA DIRECTORY and four INDEX
DIRECTORY in the statement. Which one is ignored?
(yes, *I* know, the table level one)

> @@ -148,6 +154,9 @@ PARTITION BY RANGE (a)
>  (PARTITION p0 VALUES LESS THAN (10)  ,
>  PARTITION p1 VALUES LESS THAN (100)  ,
>  PARTITION p2 VALUES LESS THAN (1000)  );
> +Warnings:
> +Warning	1618	<DATA DIRECTORY> option ignored
> +Warning	1618	<INDEX DIRECTORY> option ignored

and here DATA/INDEX DIRECTORY behaves not like other options. For a
normal option table-level value would apply to all partitions. That is

  CREATE TABLE t1 (...) OPT="VAL
  (PARTITION p0 VALUES LESS THAN (10)  ,
  PARTITION p1 VALUES LESS THAN (100)  ,
  PARTITION p2 VALUES LESS THAN (1000)  );

would be the same as

  CREATE TABLE t1 (...)
  (PARTITION p0 VALUES LESS THAN (10)   OPT="VAL,
  PARTITION p1 VALUES LESS THAN (100)   OPT="VAL,
  PARTITION p2 VALUES LESS THAN (1000)  OPT="VAL);

Is that correct?

>  CREATE TABLE tsp (a INT, b VARCHAR(55), PRIMARY KEY (a)) DATA DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-data-dir' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/mysql-test-idx-dir' ENGINE = MYISAM
>  PARTITION BY RANGE (a)
>  SUBPARTITION BY HASH(a)

Regards,
Sergei
VP of MariaDB Server Engineering
and security@xxxxxxxxxxx