[MDEV-6362] The partition engine does not call check_if_supported_inplace_alter. Created: 2014-06-18 Updated: 2014-07-08 Resolved: 2014-07-08 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 10.0.10 |
| Fix Version/s: | 10.0.12 |
| Type: | Bug | Priority: | Major |
| Reporter: | Olivier Bertrand | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
This probably was because all engines currently supporting partitioning do not support in place alter. However, this is wrong for engines that do support in place alter. For instance when doing:
the data of CONNECT outward tables is modified (all rows are doubled) Although it was possible to avoid this, calling check_if_supported_inplace_alter should be done to avoid unnecessary and time consuming operations. |
| Comments |
| Comment by Sergei Golubchik [ 2014-07-03 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
bertrandop, as far as I can see, partition engine calls check_if_supported_inplace_alter(), it's right there in ha_partition::check_if_supported_inplace_alter() method. Could you provide a complete test case for the buggy behavior that you observed? Starting from create table and everything. The connect test suite (in storage/connect/mysql-test/connect) contains no examples of partitioned connect tables. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Olivier Bertrand [ 2014-07-05 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Sure enough the function exists in ha_partition. However, it does not call the engine used by the partition engine and, as it is compiled by default, returns unconditionally HA_ALTER_INPLACE_NOT_SUPPORTED while for CONNECT outward tables it should return HA_ALTER_INPLACE_NO_LOCK. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2014-07-07 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Okay, any way I can repeat this behavior? Because as far as I can see ha_partition::check_if_supported_inplace_alter() does call engine's check_if_supported_inplace_alter(), see:
As you can see, it returns HA_ALTER_INPLACE_NO_LOCK for ALTER PARTITION, returns an error if memory allocation fails, and then calls check_if_supported_inplace_alter for every partition. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Olivier Bertrand [ 2014-07-07 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Sergei: On my machine, the complete code of ha_partition::check_if_supported_inplace_alter is:
It was compiled by default without PARTITION_SUPPORTS_INPLACE_ALTER defined. This is why the check_if_supported_inplace_alter function was not called for each partition. I shall recompile it after defining PARTITION_SUPPORTS_INPLACE_ALTER and let you know of what happens. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Olivier Bertrand [ 2014-07-08 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Apparently, recompiling the partition engine with PARTITION_SUPPORTS_INPLACE_ALTER defined solves the problems I add. In particular, DROP INDEX and CREATE INDEX that used to fail now works. Note however the issue of this pre-compiler variable. Is it still used? If yes, it should be defined by default. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2014-07-08 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Please pull the latest 10.0 source tree. This PARTITION_SUPPORTS_INPLACE_ALTER was removed in 10.0.12. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Olivier Bertrand [ 2014-07-08 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I did try on No revisions or tags to pull. |