[MDEV-27273] Confusing column count in IMPORT TABLESPACE error message Created: 2021-12-15 Updated: 2022-04-26 Resolved: 2022-01-21 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.6.5 |
| Fix Version/s: | 10.2.42, 10.3.33, 10.4.23, 10.5.14, 10.6.6, 10.7.2 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Hartmut Holzgraefe | Assignee: | Eugene Kosov (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
When importing into another table with different column count the column counts given in the error message do not match visible columns in the table. Note that the tables below have 3 and 4 columns, respectively, but the error message says 6 and 7 noformat How to reproduce noformat DROP TABLE IF EXISTS t2; ALTER TABLE t2 DISCARD TABLESPACE;
cd /var/lib/mysql/test ### UNLOCK TABLES; |
| Comments |
| Comment by Marko Mäkelä [ 2021-12-15 ] |
|
In the InnoDB clustered index, the system columns DB_TRX_ID and DB_ROLL_PTR will be materialized after the primary key fields. If there is no primary key, a DB_ROW_ID will be added. If the primary key includes column prefixes, then the full columns corresponding to the column prefixes will appear later in the index field list. The message should refer to index fields, not columns. Because of the complex rules, it would only be confusing to try to subtract the internally added index fields from the column counts. (Someone could complain about confusing "Number of columns don’t match: 3 and 3" if there was a PRIMARY KEY defined in one of the tables.) |
| Comment by Marko Mäkelä [ 2022-01-21 ] |
|
kevg, your fix that would remove the confusing message and prevent a more useful and specific message from being issued, is OK to push. |