MariaDB server is a community developed fork of MySQL server. Started by core members of the original MySQL team, MariaDB actively works with outside developers to deliver the most featureful, stable, and sanely licensed open SQL server in the industry.
Find a file
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
bdb
BitKeeper
BUILD
client
cmd-line-utils
dbug
Docs
extra
heap
include
innobase
isam
libmysql
libmysql_r
libmysqld
man
merge
myisam
myisammrg
mysql-test
mysys
ndb
netware
os2
pstack
regex
scripts
sql
sql-bench
sql-common
SSL
strings
support-files
tests
tools
VC++Files
vio
zlib
.bzrignore
.cvsignore
acinclude.m4
config.guess
config.sub
configure.in
configure.in.rej
COPYING
depcomp
EXCEPTIONS-CLIENT
install-sh
ltconfig
ltmain.sh
Makefile.am
missing
mkinstalldirs
README

This is a release of MySQL, a dual-license SQL database server.
MySQL is brought to you by the MySQL team at MySQL AB.

License information can be found in these files:
- For GPL (free) distributions, see the COPYING file and
  the EXCEPTIONS-CLIENT file.
- For commercial distributions, see the LICENSE.mysql file.


For further information about MySQL or additional documentation, see:
- The latest information about MySQL: http://www.mysql.com
- The current MySQL documentation: http://dev.mysql.com/doc

Some manual sections of special interest:

- If you are migrating from an older version of MySQL, please read the
  "Upgrading from..." section first!
- To see what MySQL can do, take a look at the features section.
- For installation instructions, see the Installing and Upgrading chapter.
- For the new features/bugfix history, see the Change History appendix.
- For the currently known bugs/misfeatures (known errors) see the Problems
  and Common Errors appendix.
- For a list of developers and other contributors, see the Credits
  appendix.

A local copy of the MySQL Reference Manual can be found in the Docs
directory in GNU Info format.  You can also browse the manual online or
download it in any of several formats at the URL given earlier in this
file.

************************************************************

IMPORTANT:

Bug or error reports should be sent to http://bugs.mysql.com.