diff options
author | Alexey Botchkov <holyfoot@mysql.com> | 2008-11-21 17:38:42 +0400 |
---|---|---|
committer | Alexey Botchkov <holyfoot@mysql.com> | 2008-11-21 17:38:42 +0400 |
commit | d445b215d10d1239d097d9fb362f232ec9bdb2f4 (patch) | |
tree | 0ee040b7dd3afd19bf08093c172f7445efa8e238 /sql/sp_head.cc | |
parent | 1cd8b9f700a3d20e0af43896b366cef6ef0e7d4c (diff) | |
download | mariadb-git-d445b215d10d1239d097d9fb362f232ec9bdb2f4.tar.gz |
Bug#25058 ignored return codes in memory allocation functions
memory allocation error checks added for functions
calling insert_dynamic()
per-file messages:
myisam/mi_delete.c
Bug#25058 ignored return codes in memory allocation functions
out-of-memory errors handled
myisam/mi_write.c
Bug#25058 ignored return codes in memory allocation functions
out-of-memory errors handled
server-tools/instance-manager/instance_options.cc
Bug#25058 ignored return codes in memory allocation functions
out-of-memory errors handled
sql/slave.cc
Bug#25058 ignored return codes in memory allocation functions
out-of-memory errors handled
sql/sp_head.cc
Bug#25058 ignored return codes in memory allocation functions
out-of-memory errors handled
sql/sp_head.h
Bug#25058 ignored return codes in memory allocation functions
out-of-memory errors handled
sql/sp_pcontext.cc
Bug#25058 ignored return codes in memory allocation functions
out-of-memory errors handled
sql/sp_pcontext.h
Bug#25058 ignored return codes in memory allocation functions
out-of-memory errors handled
sql/sql_select.cc
Bug#25058 ignored return codes in memory allocation functions
out-of-memory errors handled
sql/sql_yacc.yy
Bug#25058 ignored return codes in memory allocation functions
out-of-memory errors handled
Diffstat (limited to 'sql/sp_head.cc')
-rw-r--r-- | sql/sp_head.cc | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 3ec6dd5cf06..57502f240d9 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -1924,17 +1924,16 @@ sp_head::restore_lex(THD *thd) DBUG_VOID_RETURN; } -void +int sp_head::push_backpatch(sp_instr *i, sp_label_t *lab) { bp_t *bp= (bp_t *)sql_alloc(sizeof(bp_t)); - if (bp) - { - bp->lab= lab; - bp->instr= i; - (void)m_backpatch.push_front(bp); - } + if (!bp) + return 1; + bp->lab= lab; + bp->instr= i; + return m_backpatch.push_front(bp); } void @@ -2009,7 +2008,7 @@ sp_head::fill_field_definition(THD *thd, LEX *lex, } -void +int sp_head::new_cont_backpatch(sp_instr_opt_meta *i) { m_cont_level+= 1; @@ -2017,15 +2016,17 @@ sp_head::new_cont_backpatch(sp_instr_opt_meta *i) { /* Use the cont. destination slot to store the level */ i->m_cont_dest= m_cont_level; - (void)m_cont_backpatch.push_front(i); + if (m_cont_backpatch.push_front(i)) + return 1; } + return 0; } -void +int sp_head::add_cont_backpatch(sp_instr_opt_meta *i) { i->m_cont_dest= m_cont_level; - (void)m_cont_backpatch.push_front(i); + return m_cont_backpatch.push_front(i); } void @@ -2207,7 +2208,7 @@ sp_head::show_create_procedure(THD *thd) instr Instruction */ -void sp_head::add_instr(sp_instr *instr) +int sp_head::add_instr(sp_instr *instr) { instr->free_list= m_thd->free_list; m_thd->free_list= 0; @@ -2218,7 +2219,7 @@ void sp_head::add_instr(sp_instr *instr) entire stored procedure, as their life span is equal. */ instr->mem_root= &main_mem_root; - insert_dynamic(&m_instr, (gptr)&instr); + return insert_dynamic(&m_instr, (gptr)&instr); } |