summaryrefslogtreecommitdiff
path: root/sql/rpl_tblmap.cc
diff options
context:
space:
mode:
authorKristofer Pettersson <kristofer.pettersson@sun.com>2009-11-20 16:18:01 +0100
committerKristofer Pettersson <kristofer.pettersson@sun.com>2009-11-20 16:18:01 +0100
commit0a686030589dae2fe6bf99f4c3d4a73d4268a491 (patch)
tree2c684f720a7791634409c9607d9ffcd82d0d1b73 /sql/rpl_tblmap.cc
parente942adb23dfca74fa8db76dbe40d72f0ceff4818 (diff)
downloadmariadb-git-0a686030589dae2fe6bf99f4c3d4a73d4268a491.tar.gz
Bug#45613 handle failures from my_hash_insert
Not all my_hash_insert() calls are checked for return value. This patch adds appropriate checks and failure responses where needed. mysys/hash.c: * Debug hook for testing failures in my_hash_insert()
Diffstat (limited to 'sql/rpl_tblmap.cc')
-rw-r--r--sql/rpl_tblmap.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/rpl_tblmap.cc b/sql/rpl_tblmap.cc
index a004c354263..6ef9a8623fe 100644
--- a/sql/rpl_tblmap.cc
+++ b/sql/rpl_tblmap.cc
@@ -119,7 +119,13 @@ int table_mapping::set_table(ulong table_id, TABLE* table)
}
e->table_id= table_id;
e->table= table;
- my_hash_insert(&m_table_ids,(uchar *)e);
+ if (my_hash_insert(&m_table_ids,(uchar *)e))
+ {
+ /* we add this entry to the chain of free (free for use) entries */
+ e->next= m_free;
+ m_free= e;
+ DBUG_RETURN(ERR_MEMORY_ALLOCATION);
+ }
DBUG_PRINT("info", ("tid %lu -> table 0x%lx (%s)",
table_id, (long) e->table,