[MDEV-15049] Importing InnoDB table from 10.1 to 10.2 causes Schema mismatch (Expected FSP_SPACE_FLAGS=0x21, .ibd file contains 0x0 Created: 2018-01-24 Updated: 2021-07-20 Resolved: 2021-07-20 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.2, 10.3, 10.4, 10.5 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Jan Lindström (Inactive) | Assignee: | Marko Mäkelä |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | NRE_106_INNODB | ||
| Attachments: |
|
||||||||||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||||||||||
| Description |
|
See attached test case that creates table and exports it, this should be run on 10.1 (attached also resulting t0.ibd). Second test case should be run on 10.2 to try import file created above but it fails. Note that final test case should test also row_format=compressed,
|
| Comments |
| Comment by Marko Mäkelä [ 2019-01-05 ] |
|
Starting with MariaDB 10.2.17, we do display a more user-friendly message about this: The FSP_SPACE_FLAGS is 0 for ROW_FORMAT=REDUNDANT (which was the only option before MySQL 5.0.3) and ROW_FORMAT=COMPACT (which was introduced by me and made the default in MySQL 5.0.3) when using the default innodb_page_size=16k. In MariaDB 10.2 (and MySQL 5.7), the parameter innodb_default_row_format was introduced, and it was made dynamic by default. The flags 0x21 are for ROW_FORMAT=DYNAMIC when using the default innodb_page_size=16k. Ultimately, MDEV-11658 should replace the current clumsy and error-prone mechanism of importing InnoDB data files. Perhaps the documentation could be clarified about this. SHOW TABLE STATUS can display the actual ROW_FORMAT that is in effect inside InnoDB. It is also worth noting that even if a ROW_FORMAT was specified in a CREATE TABLE or ALTER TABLE statement, it could be overridden by InnoDB unless innodb_file_format=barracuda and innodb_file_per_table=1. This logic was removed in MariaDB 10.2 or 10.3. |
| Comment by Geoff Montee (Inactive) [ 2019-01-07 ] |
|
I added a note about this here: https://mariadb.com/kb/en/library/innodb-file-per-table-tablespaces/#differing-row_format-values |
| Comment by Jacob Moorman (Inactive) [ 2019-04-10 ] |
|
Geoff, Kenneth and I extensively talked about the coverage of this topic within the existing documentation. Our conclusion is that this topic is covered through the refactor Geoff did (linked above), as well as the COMPRESSED section of https://mariadb.com/kb/en/library/innodb-storage-formats/#compressed It is our shared perception that the ROW_FORMAT section of the CREATE TABLE page, and the InnoDB Storage Formats page at https://mariadb.com/kb/en/library/innodb-storage-formats/ both need some general cleanup. It is further our concern that the ALTER TABLE page does not cover ROW_FORMAT, https://mariadb.com/kb/en/library/alter-table Additional follow-up by Documentation team is planned. |
| Comment by Marko Mäkelä [ 2019-04-12 ] |
|
In |
| Comment by Geoff Montee (Inactive) [ 2019-04-13 ] |
|
I refactored the row format page a bit to better cover the things pointed out by Marko. For example, this warning was made clearer:
https://mariadb.com/kb/en/library/innodb-storage-formats/#setting-a-tables-row-format And this tip was made clearer:
https://mariadb.com/kb/en/library/innodb-storage-formats/#checking-a-tables-row-format It didn't seem valuable to duplicate all of the information on the specific section about this schema mismatch problem, so these sections are linked from that section, which can be found here: https://mariadb.com/kb/en/library/innodb-file-per-table-tablespaces/#differing-row_format-values |
| Comment by Geoff Montee (Inactive) [ 2019-04-15 ] |
|
I've re-assigned this to marko, since he thinks that he can fix the problem by changing how ALTER TABLE ... IMPORT TABLESPACE is done. |
| Comment by Marko Mäkelä [ 2020-04-23 ] |
|
My suggested fix in the now updated I think that we would need additional logic to validate and detect the InnoDB ROW_FORMAT from the FSP_SPACE_FLAGS and the page_is_comp() on the B-tree pages, because that information would not be present in the .frm file. It will likely be present in the .cfg file, but that file is optional. In MDEV-11658 we could streamline this further by making the ALTER TABLE…IMPORT TABLESPACE optional, but that would require file format changes and is not applicable to any GA release branch. |
| Comment by Marko Mäkelä [ 2021-07-20 ] |
|
Because |