| Bug #40358 | HA_KEY_HAS_PART_KEY_SEG does not properly get passed to storage engine | ||
|---|---|---|---|
| Submitted: | 27 Oct 2008 20:34 | Modified: | 9 Jul 17:06 |
| Reporter: | Zardosht Kasheff (SCA) | ||
| Status: | Not a Bug | ||
| Category: | Server | Severity: | S3 (Non-critical) |
| Version: | 5.1.28 | OS: | Any |
| Assigned to: | Alexander Nozdrin | Target Version: | 5.4+ |
| Tags: | HA_KEY_HAS_PART_KEY_SEG | ||
| Triage: | Triaged: D2 (Serious) / R3 (Medium) / E3 (Medium) | ||
[27 Oct 2008 20:34]
Zardosht Kasheff
[28 Oct 2008 1:12]
Miguel Solorzano
Thank you for the bug report. Verified as described:
- keyinfo 0x01f4efc0 {key_length=0x00000009 flags=0x00010068 key_parts=0x00000001
...} st_key *
key_length 0x00000009 unsigned int
flags 0x00010068 unsigned long
key_parts 0x00000001 unsigned int
extra_length 0x00000000 unsigned int
usable_key_parts 0x00000000 unsigned int
block_size 0x00000000 unsigned int
algorithm HA_KEY_ALG_UNDEF ha_key_alg
+ parser 0x00000000 st_plugin_int * *
<cut>
- table_arg 0x0392d8ac {s=0x0392d458 {table_category=TABLE_CATEGORY_USER
name_hash={key_offset=0x00000000 key_length=0x00000000 blength=0x00000000 ...}
mem_root={free=0x01f2dc50 {next=0x00000000 left=0x000000f8 size=0x000003c8 }
used=0x00000000 {next=??? left=??? size=??? } pre_alloc=0x00000000 {next=??? left=???
size=??? } ...} ...} file=0x01f54a10 {file=0x00000000 {s=??? state=???
save_state={records=??? del=??? empty=??? ...} ...} int_table_flags=0x0000000d14626d91
data_file_name=0xa5a5a5a5 <Bad Ptr> ...} next=0x00000000 {s=??? file=??? next=??? ...}
...} st_table *
<cut>
- key_info 0x01f54c40 {key_length=0x0000000c flags=0x00000068 key_parts=0x00000001
...} st_key *
key_length 0x0000000c unsigned int
flags 0x00000068 unsigned long
key_parts 0x00000001 unsigned int
extra_length 0x00000003 unsigned int
usable_key_parts 0x00000001 unsigned int
block_size 0x00000000 unsigned int
algorithm HA_KEY_ALG_UNDEF ha_key_alg
+ parser 0x00000000 st_plugin_int * *
<cut>
[9 Jul 8:35]
Alexander Nozdrin
I discussed this issue with Sergei Golubchik. It is not a bug, because HA_KEY_HAS_PART_KEY_SEG flag is internal to the MySQL server by design. It is not supposed neither to be saved in FRM-files, nor to be passed to storage engines (it's intended to pass information into internal static sort_keys(KEY *, KEY *) function) This flag can actually be calculated -- it's based on key lengths comparison. So, a storage engine can determine it by itself.
[9 Jul 17:06]
Zardosht Kasheff
The main motivation for filing this bug is that the fact that the .frm file only uses 2 bytes to store key flags can be a problem. The internal data structure uses 4 bytes. So, the key flags cannot be extended. I will file a separate bug on this.
[9 Jul 18:30]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/78300 2826 Alexander Nozdrin 2009-07-09 Add a comment in the source (Bug#40358).
