diff options
author | svoj@mysql.com/april.(none) <> | 2006-10-06 15:29:30 +0500 |
---|---|---|
committer | svoj@mysql.com/april.(none) <> | 2006-10-06 15:29:30 +0500 |
commit | 8f4b0d946a3d6c21423ca79092154b88580262a5 (patch) | |
tree | c4d07de1cb2757581c36c992b66c9c11b45d097d | |
parent | 60ba9f2b63ff6ddf8a65347b4b6bc28f56823561 (diff) | |
parent | 09b2a2a0566e6cb9ee5f9c5a3efde8957a70fcce (diff) | |
download | mariadb-git-8f4b0d946a3d6c21423ca79092154b88580262a5.tar.gz |
Merge mysql.com:/home/svoj/devel/mysql/BUG22937/mysql-4.1-engines
into mysql.com:/home/svoj/devel/mysql/BUG22937/mysql-5.0-engines
-rw-r--r-- | sql/ha_myisammrg.cc | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sql/ha_myisammrg.cc b/sql/ha_myisammrg.cc index cb11d9b0452..23af831cdf6 100644 --- a/sql/ha_myisammrg.cc +++ b/sql/ha_myisammrg.cc @@ -326,9 +326,22 @@ void ha_myisammrg::info(uint flag) if (flag & HA_STATUS_CONST) { if (table->s->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->s->key_parts); + sizeof(table->key_info[0].rec_per_key) * + min(file->keys, table->s->key_parts)); + } } } |