MDEV-40915 Table options (PAGE_COMPRESSED, ENCRYPTED) are ignored by ALTER TABLE on partitioned tables - #5621
Merged
Merged
Conversation
|
|
There was a problem hiding this comment.
Pull request overview
Fixes partitioned ALTER TABLE operations so storage engines receive updated per-partition options.
Changes:
- Sources options from the altered table definition.
- Propagates options during prepare.
- Adds PAGE_COMPRESSED regression coverage.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
sql/ha_partition.cc |
Uses new per-partition options during ALTER phases. |
mysql-test/suite/parts/t/partition_alter_innodb.test |
Adds regression test. |
mysql-test/suite/parts/r/partition_alter_innodb.result |
Records expected output. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+44
to
+45
| ALTER TABLE t1 PAGE_COMPRESSED=1; | ||
| SHOW CREATE TABLE t1; |
vuvova
approved these changes
Sep 1, 2026
Thirunarayanan
force-pushed
the
MDEV-40915
branch
from
September 1, 2026 11:26
f16d100 to
1d6f826
Compare
…ALTER TABLE on partitioned tables Problem: ========= ha_partition::check_if_supported_inplace_alter() sourced the per-partition engine options from m_part_info, which describes the table as it is now. The engine compares create_info->option_struct against handler::option_struct (old options), both are pointing to source table. It leads to make the engine believe that there is no change in table structure and allows to proceed PAGE_COMPRESSED=1 with INSTANT algorithm. Fix: ==== Take the new options from altered_table->part_info, which was opened from the new .frm with the new table-level options already merged into every partition_element by parse_engine_part_options(). Do the same in prepare_inplace_alter_table(), so that both phases agree and a per-partition option override reaches the rebuilt table.
Thirunarayanan
force-pushed
the
MDEV-40915
branch
from
September 1, 2026 12:07
1d6f826 to
e19ed7e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem:
ha_partition::check_if_supported_inplace_alter() sourced the per-partition engine options from m_part_info, which describes the table as it is now. The engine compares
create_info->option_struct against handler::option_struct (old options), both are pointing to source table.
It leads to make the engine believe that there is no change in table structure and allows to proceed PAGE_COMPRESSED=1 with INSTANT algorithm.
Fix:
Take the new options from altered_table->part_info, which was opened from the new .frm with the new table-level options already merged into every partition_element by parse_engine_part_options().
Do the same in prepare_inplace_alter_table(), so that both phases agree and a per-partition option override reaches the rebuilt table.