summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <svoj@mysql.com/april.(none)>2006-10-06 15:18:25 +0500
committerunknown <svoj@mysql.com/april.(none)>2006-10-06 15:18:25 +0500
commita6a93d6f19d8e97a4fb4b9b7e51dd76c4dd6c6a6 (patch)
tree08c57f05735a37856691715e1a3faecb61b03175
parentb7d1c482130820faa714a126c4a858517c1f268c (diff)
parent47a70282f91fed6dfae77d5d0e5ce3424cfb6c1d (diff)
downloadmariadb-git-a6a93d6f19d8e97a4fb4b9b7e51dd76c4dd6c6a6.tar.gz
Merge svojtovich@bk-internal.mysql.com:/home/bk/mysql-4.1-engines
into mysql.com:/home/svoj/devel/mysql/BUG22937/mysql-4.1-engines
-rw-r--r--sql/ha_myisammrg.cc15
1 files changed, 14 insertions, 1 deletions
diff --git a/sql/ha_myisammrg.cc b/sql/ha_myisammrg.cc
index edb3521470f..3408f7090f2 100644
--- a/sql/ha_myisammrg.cc
+++ b/sql/ha_myisammrg.cc
@@ -249,9 +249,22 @@ void ha_myisammrg::info(uint flag)
if (flag & HA_STATUS_CONST)
{
if (table->key_parts && info.rec_per_key)
+ {
+#ifdef HAVE_purify
+ /*
+ valgrind may be unhappy about it, because optimizer may access values
+ between file->keys and table->key_parts, that will be uninitialized.
+ It's safe though, because even if opimizer will decide to use a key
+ with such a number, it'll be an error later anyway.
+ */
+ bzero((char*) table->key_info[0].rec_per_key,
+ sizeof(table->key_info[0].rec_per_key) * table->key_parts);
+#endif
memcpy((char*) table->key_info[0].rec_per_key,
(char*) info.rec_per_key,
- sizeof(table->key_info[0].rec_per_key)*table->key_parts);
+ sizeof(table->key_info[0].rec_per_key) *
+ min(file->keys, table->key_parts));
+ }
}
}