[MDEV-16594] ALTER DATA DIRECTORY in PARTITIONS of InnoDB storage does nothing silently Created: 2018-06-27 Updated: 2019-09-09 Resolved: 2019-09-09 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Partitioning, Storage Engine - InnoDB |
| Affects Version/s: | 10.0.35 |
| Fix Version/s: | 10.1.42 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Eugene Kosov (Inactive) | Assignee: | Alexey Botchkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||
| Description |
|
It is documented that InnoDB ignores DATA DIRECTORY for partitions on ALTER TABLE. But it ignores it silently and that's an issue. In contrast altering DATA DIRECTORY for table (not partitions) issues a warning for both InnoDB and MyISAM. https://mariadb.com/kb/en/library/create-table/#data-directoryindex-directory
The fix is to add a warning for that case. |
| Comments |
| Comment by Sergei Golubchik [ 2018-07-17 ] | |||||||||||||||
| |||||||||||||||
| Comment by Eugene Kosov (Inactive) [ 2018-07-18 ] | |||||||||||||||
|
I understand that engine-specific code in sql is not a good idea. But for this particular topic some InnoDB-specific code already exists: https://github.com/MariaDB/server/blob/ada54101a7185782657813c553907f61f2a35faf/sql/ha_partition.cc#L2201 I've tried first to put my code here, but eventually put it in another place because bool add_or_reorg_part is very handy for my check and I've reused it. Right now I can't move that check inside InnoDB because it should work with ALGORITHM=COPY too. Or maybe I don't understand something? warn_if_dir_in_part_elem is a different think. Warning should mention InnoDB, because it warns on InnoDB-specific case. I've updated PR: added separate WARN_ | |||||||||||||||
| Comment by Alexey Botchkov [ 2018-07-31 ] | |||||||||||||||
|
It feels like i don't understand something. But as far as i can see
And that warning is raised in Sql_cmd_alter_table::execute(). | |||||||||||||||
| Comment by Eugene Kosov (Inactive) [ 2018-08-01 ] | |||||||||||||||
|
> it is not an engine-specific problem. MariaDB ignores DATA DIRECTORY option for all the engines DATA DIRECTORY for whole table and for partitions are different things. Somewhat similar check for partitions happens here https://github.com/MariaDB/server/blob/90b66c169957962de612bc951cdf369cdfccc99c/sql/partition_info.cc#L1606 If you think it would be better I can merge my function with that one. | |||||||||||||||
| Comment by Alexey Botchkov [ 2018-08-03 ] | |||||||||||||||
|
> > it is not an engine-specific problem. MariaDB ignores DATA DIRECTORY option for all the engines Do you mean DATA DIRECTORY for the partition tables is engine-specific? I need to see a test case showing that. BTW the warn_if_dir_or_idx_in_innodb_part_elem() doesn't warn on that query:
even if the 't' partitions are InnoDB. Also I'd note that the warn_if_dir_or_idx_in_innodb_part_elem() only works > Somewhat similar check for partitions happens here | |||||||||||||||
| Comment by Eugene Kosov (Inactive) [ 2018-08-07 ] | |||||||||||||||
|
I've updated PR. > Do you mean DATA DIRECTORY for the partition tables is engine-specific? I need to see a test case showing that. It's main.partition_not_windows Check was moved to prep_alter_part_table(). Table should be opened to perform this check. Sql_cmd_alter_table::execute() is too early, f.ex. | |||||||||||||||
| Comment by Eugene Kosov (Inactive) [ 2018-08-08 ] | |||||||||||||||
|
> And i'd prefer the ignored-data-directory check in a single place - Sql_cmd_alter_table::execute looks good enough to me. It's already in one place and works for both ALTER TABLE and CREATE TABLE. If I'll move that check to Sql_cmd_alter_table::execute() I will also have to duplicate it somewhere for CREATE TABLE. | |||||||||||||||
| Comment by Alexey Botchkov [ 2019-09-09 ] | |||||||||||||||
|
https://github.com/MariaDB/server/commit/031c695b8c865e5eb6c4c09ced404ae08f98430f |