Fix for BUG#13814: in mi_pack_key(), when processing NULL value for TINYBLOB key segment,

do advance the source pointer over 2 bytes that specify value length.


myisam/mi_key.c:
  Fix for BUG#13814: in mi_pack_key(), when processing NULL value for TINYBLOB key segment,
  do advance the source pointer over 2 bytes that specify value length (for NULL value the 
  format is: null_marker 0x01, value length 0x00 0x00, data: 0x00 keyseg->length times).
  We need to advance over 2 bytes separately as keyseg->length doesn't include them.
mysql-test/r/myisam.result:
  Testcase for BUG#13814
mysql-test/t/myisam.test:
  Testcase for BUG#13814
This commit is contained in:
unknown 2005-10-28 23:31:32 +04:00
commit 81882f7127
3 changed files with 39 additions and 0 deletions

View file

@ -217,7 +217,10 @@ uint _mi_pack_key(register MI_INFO *info, uint keynr, uchar *key, uchar *old,
{
k_length-=length;
if (keyseg->flag & (HA_VAR_LENGTH | HA_BLOB_PART))
{
old+= 2;
k_length-=2; /* Skip length */
}
continue; /* Found NULL */
}
}