[MDEV-5867] ALTER TABLE t1 ENGINE=InnoDB keeps bad options when t1 ENGINE is CONNECT Created: 2014-03-14 Updated: 2014-07-08 Resolved: 2014-07-08 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 10.0.7 |
| Fix Version/s: | 10.0.13 |
| Type: | Bug | Priority: | Major |
| Reporter: | Gerardo Narvaja (Inactive) | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
$ lsb_release -a |
||
| Description |
|
Start with the following CONNECT table definition:
Now convert to InnoDB: ALTER TABLE test_alter ENGINE=InnoDB; The resulting table definition looks like:
Basic tests show that the new 'test_alter' table is a fully functional InnoDB table. However, the CREATE TABLE statement from the SHOW CREATE TABLE output is unusable and will fail. It should be possible to change the storage engine and the ALTER TABLE operation should 'clean up' the invalid options. |
| Comments |
| Comment by Sergei Golubchik [ 2014-03-17 ] | ||||||
|
This is intentional, generally it allows to alter the engine back and have all options preserved. But I agree that this behavior is not always desirable. As a workaround one can set sql_mode=IGNORE_BAD_TABLE_OPTIONS before applying this CREATE TABLE statement. Then it won't fail. Perhaps, mysqldump should always do it in the dumps. | ||||||
| Comment by Sergei Golubchik [ 2014-07-04 ] | ||||||
|
On the other hand, doing that in mysqldump will make dumps incompatible with MySQL | ||||||
| Comment by Sergei Golubchik [ 2014-07-04 ] | ||||||
|
Another idea — do not show unsupported options in SHOW CREATE TABLE unless IGNORE_BAD_TABLE_OPTIONS is set. | ||||||
| Comment by Sergei Golubchik [ 2014-07-06 ] | ||||||
|
svoj, could you please review this fix? Emails are in the commit list and also linked above. The bug fix is in the second, but it relies on the cleanup, that was done in the first patch. I'm mainly interested to know whether the approach itself is good. | ||||||
| Comment by Sergei Golubchik [ 2014-07-08 ] | ||||||
|
Another option would be to print invalid options inside a comment. Might look confusing though:
and we don't normally use comments in SHOW CREATE TABLE (yet). | ||||||
| Comment by Sergei Golubchik [ 2014-07-08 ] | ||||||
|
Asked on maria-developers, users seem to prefer the last option with the comments. I'll do that. |