mariadb/myisammrg
unknown 6866ca008c BUG#24342 - Incorrect results with query over MERGE table
MERGE engine may return incorrect values when several representations
of equal keys are present in the index. For example "groß" and "gross"
or "gross" and "gross " (trailing space), which are considered equal,
but have different lengths.

The problem was that key length was not recalculated after key lookup.

Only MERGE engine is affected.


myisam/mi_rkey.c:
  info->lastkey gets rewritten by mi_search. Later we recalculate found lastkey
  length. This is done to make sure that mi_rnext_same gets true, found (not
  searched) lastkey length. Searched and found key lengths may be different,
  for example in case searched key is "groß" and found is "gross" or in case
  a key has trailing spaces.
  
  Unfortunately we recalculate found lastkey length only for first
  underlying table. To recalculate found key length for non-first underlying
  table we need to know how much key segments were used to create this key.
  
  When mi_rkey is called for first underlying table of a merge table, store
  offset to last used key segment.
  
  Restore last_used_keyseg variable when mi_rkey is called for non-first
  underlying table.
myisam/myisamdef.h:
  Added last_used_keyseg variable to MI_INFO. It is used by merge engine to calculate
  key length.
myisammrg/myrg_rkey.c:
  Pass last used key segment returned by first table key read to other
  table key reads.
mysql-test/r/merge.result:
  A test case for bug#24342.
mysql-test/t/merge.test:
  A test case for bug#24342.
2007-04-11 01:40:35 +05:00
..
.cvsignore
make-ccc
Makefile.am
myrg_close.c
myrg_create.c
myrg_def.h
myrg_delete.c
myrg_extra.c
myrg_info.c
myrg_locking.c
myrg_open.c
myrg_panic.c
myrg_queue.c
myrg_range.c
myrg_rfirst.c
myrg_rkey.c
myrg_rlast.c
myrg_rnext.c
myrg_rnext_same.c
myrg_rprev.c
myrg_rrnd.c
myrg_rsame.c
myrg_static.c
myrg_update.c
myrg_write.c