[MDEV-11172] EXPLAIN shows non-sensical value for key_len with type=index Created: 2016-10-29 Updated: 2021-06-10 Resolved: 2021-01-30 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | 10.1.18, 10.0.28, 10.2.2 |
| Fix Version/s: | 10.2.38, 10.3.29, 10.4.19, 10.5.10 |
| Type: | Bug | Priority: | Major |
| Reporter: | Sergei Petrunia | Assignee: | Varun Gupta (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Sprint: | 10.1.31 | ||||||||
| Description |
|
The key_len=25 does not make any sense. They key format is offset what 25 bytes means include PK's length but not include the PK value itself. |
| Comments |
| Comment by Sergei Petrunia [ 2016-10-29 ] |
|
MySQL 5.6 shows key_len=23. |
| Comment by Sergei Petrunia [ 2016-10-29 ] |
|
The wrong values comes from KEY_INFO::key_length It is computed in TABLE_SHARE::init_from_binary_frm_image(), create_key_infos(). One can see HA_KEY_BLOB_LENGTH to be added twice. |
| Comment by Sergei Petrunia [ 2016-10-29 ] |
|
This issue was discovered when working on |
| Comment by Varun Gupta (Inactive) [ 2019-04-30 ] |
|
Patch |
| Comment by Michael Widenius [ 2021-01-28 ] |
|
Patch generally ok. However I would like to see the following additions: Change in structs.h: In table.cc, add a comment before: |
| Comment by Varun Gupta (Inactive) [ 2021-01-30 ] |
|
Made the changes and pushed the patch |