~stewart/drizzle/update-innobase-1.1.3

Viewing all changes in revision 2478.

  • Committer: Stewart Smith
  • Author(s): Martin Hansson, Stewart Smith
  • Date: 2010-12-07 05:49:18 UTC
  • Revision ID: stewart@flamingspork.com-20101207054918-7minllzrg01muh70
Merge Revision revid:martin.hansson@oracle.com-20101007081311-zb72jgqjx2rs831z from MySQL InnoDB

Original revid:martin.hansson@oracle.com-20101007081311-zb72jgqjx2rs831z

Original Authors: Martin Hansson <martin.hansson@oracle.com>
Original commit message:
Bug#56423: Different count with SELECT and CREATE SELECT queries

This is a regression from the fix for bug no 38999. A storage engine capable
of reading only a subset of a table's columns updates corresponding bits in
the read buffer to signal that it has read NULL values for the corresponding
columns. It cannot, and should not, update any other bits. Bug no 38999
occurred because the implementation of UPDATE statements compare the NULL bits
using memcmp, inadvertently comparing bits that were never requested from the
storage engine. The regression was caused by the storage engine trying to
alleviate the situation by writing to all NULL bits, even those that it had no
knowledge of. This has devastating effects for the index merge algorithm,
which relies on all NULL bits, except those explicitly requested, being left
unchanged.

The fix reverts the fix for bug no 38999 in both InnoDB and InnoDB plugin and
changes the server's method of comparing records. For engines that always read
entire rows, we proceed as usual. For engines capable of reading only select
columns, the record buffers are now compared on a column by column basis. An
assertion was also added so that non comparable buffers are never read. Some
relevant copy-pasted code was also consolidated in a new function.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: