Commit 91a43f7e authored by osku's avatar osku

Port r225 from branches/5.0:

Fix memory allocation bug (by changing MY_WME to MY_FAE) in
ha_innodb.cc:get_share.
parent 6be49d67
...@@ -6787,8 +6787,10 @@ static INNOBASE_SHARE* get_share(const char* table_name) ...@@ -6787,8 +6787,10 @@ static INNOBASE_SHARE* get_share(const char* table_name)
if (!(share=(INNOBASE_SHARE*) hash_search(&innobase_open_tables, if (!(share=(INNOBASE_SHARE*) hash_search(&innobase_open_tables,
(mysql_byte*) table_name, (mysql_byte*) table_name,
length))) { length))) {
if ((share=(INNOBASE_SHARE *) my_malloc(sizeof(*share)+length+1,
MYF(MY_WME | MY_ZEROFILL)))) { share = (INNOBASE_SHARE *) my_malloc(sizeof(*share)+length+1,
MYF(MY_FAE | MY_ZEROFILL));
share->table_name_length=length; share->table_name_length=length;
share->table_name=(char*) (share+1); share->table_name=(char*) (share+1);
strmov(share->table_name,table_name); strmov(share->table_name,table_name);
...@@ -6804,7 +6806,6 @@ static INNOBASE_SHARE* get_share(const char* table_name) ...@@ -6804,7 +6806,6 @@ static INNOBASE_SHARE* get_share(const char* table_name)
thr_lock_init(&share->lock); thr_lock_init(&share->lock);
pthread_mutex_init(&share->mutex,MY_MUTEX_INIT_FAST); pthread_mutex_init(&share->mutex,MY_MUTEX_INIT_FAST);
} }
}
share->use_count++; share->use_count++;
pthread_mutex_unlock(&innobase_share_mutex); pthread_mutex_unlock(&innobase_share_mutex);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment