summaryrefslogtreecommitdiff
path: root/storage/myisam/ha_myisam.cc
diff options
context:
space:
mode:
authorAnurag Shekhar <anurag.shekhar@sun.com>2009-02-13 17:11:54 +0530
committerAnurag Shekhar <anurag.shekhar@sun.com>2009-02-13 17:11:54 +0530
commitc55d8297d84480691dcd397201c206635428c79a (patch)
tree922f1617afff6295dbcb27530f6538efdeffed0c /storage/myisam/ha_myisam.cc
parent4d5668d93b2c01a30cc7fc052ffa4a75b2ba6da8 (diff)
downloadmariadb-git-c55d8297d84480691dcd397201c206635428c79a.tar.gz
Bug#40321 ha_myisam::info could update rec_per_key incorrectly
MyISAM did copy of key statistics incorrectly, which may cause server crash or incorrect cardinality values. This may happen only on platforms where size of long differs from size of pointer. To determine number of bytes to be copied from array of ulong, MyISAM mistakenly used sizoef(pointer) instead of sizeof(ulong).
Diffstat (limited to 'storage/myisam/ha_myisam.cc')
-rw-r--r--storage/myisam/ha_myisam.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index 4073044bf63..eb31c0b84cf 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -1753,7 +1753,7 @@ int ha_myisam::info(uint flag)
if (share->key_parts)
memcpy((char*) table->key_info[0].rec_per_key,
(char*) misam_info.rec_per_key,
- sizeof(table->key_info[0].rec_per_key)*share->key_parts);
+ sizeof(table->key_info[0].rec_per_key[0])*share->key_parts);
if (share->tmp_table == NO_TMP_TABLE)
pthread_mutex_unlock(&share->mutex);