summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
authorKristofer Pettersson <kristofer.pettersson@sun.com>2009-11-20 21:56:43 +0100
committerKristofer Pettersson <kristofer.pettersson@sun.com>2009-11-20 21:56:43 +0100
commit8e80deb52f64d345e64b146b9aea5a96b207621b (patch)
treed942b1e12f96e633ab490237e450308772c5f7c6 /sql/sql_base.cc
parent762d5cf10ebef0fb38d65d9707ccf8d110e54e9c (diff)
parent3771d623b1d7ea26bb59bc064b85ea7102246e1a (diff)
downloadmariadb-git-8e80deb52f64d345e64b146b9aea5a96b207621b.tar.gz
merge
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index be31ffe04dd..cf8a0b32764 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -2935,7 +2935,12 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
DBUG_PRINT("info", ("inserting table '%s'.'%s' 0x%lx into the cache",
table->s->db.str, table->s->table_name.str,
(long) table));
- VOID(my_hash_insert(&open_cache,(uchar*) table));
+ if (my_hash_insert(&open_cache,(uchar*) table))
+ {
+ my_free(table, MYF(0));
+ VOID(pthread_mutex_unlock(&LOCK_open));
+ DBUG_RETURN(NULL);
+ }
}
check_unused(); // Debugging call