[MDEV-29106] The information of the table in INFORMATION_SCHEMA is inconsistent with the actual! Created: 2022-07-15 Updated: 2022-07-15 Resolved: 2022-07-15 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.0.20, 10.9.1 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Critical |
| Reporter: | fengwei | Assignee: | Unassigned |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
MariaDB Server version: 10.0.20-MariaDB OS : |
||
| Description |
|
There is no primary key when the table is created, but INFORMATION_SCHEMA shows that there is a primary key. When querying, FORCE INDEX(`PRIMARY`) cannot be used! I want "INFORMATION_SCHEMA" and "FORCE INDEX" to be consistent!
|
| Comments |
| Comment by Elena Stepanova [ 2022-07-15 ] |
|
In the absence of a primary key, a non-nullable unique index serves as such and is indicated as such. This is intentional and documented behavior. See MariaDB KB and MySQL manual.
If you need constraint names, use information_schema.table_constraints instead. |
| Comment by fengwei [ 2022-07-15 ] |
|
Since this is intentional, why is FORCE INDEX(`PRIMARY`) not allowed? |