summaryrefslogtreecommitdiff
path: root/storage/innobase/row
diff options
context:
space:
mode:
authorMartin Hansson <martin.hansson@oracle.com>2010-10-07 10:13:11 +0200
committerMartin Hansson <martin.hansson@oracle.com>2010-10-07 10:13:11 +0200
commit30f57b33233baf08741aa91f9c0209b1e77689f9 (patch)
tree3dc341edaf8736f3f9fd27bd3652f82393d03ff4 /storage/innobase/row
parent19a7cf49cc259765cad56c2d82b1db01d49370d7 (diff)
downloadmariadb-git-30f57b33233baf08741aa91f9c0209b1e77689f9.tar.gz
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.
Diffstat (limited to 'storage/innobase/row')
-rw-r--r--storage/innobase/row/row0sel.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/storage/innobase/row/row0sel.c b/storage/innobase/row/row0sel.c
index a64dd3151ee..ecc5b47d377 100644
--- a/storage/innobase/row/row0sel.c
+++ b/storage/innobase/row/row0sel.c
@@ -2621,12 +2621,6 @@ row_sel_store_mysql_rec(
prebuilt->blob_heap = NULL;
}
- /* init null bytes with default values as they might be
- left uninitialized in some cases and this uninited bytes
- might be copied into mysql record buffer that leads to
- valgrind warnings */
- memcpy(mysql_rec, prebuilt->default_rec, prebuilt->null_bitmap_len);
-
for (i = 0; i < prebuilt->n_template; i++) {
templ = prebuilt->mysql_template + i;