summaryrefslogtreecommitdiff
path: root/sql/sp_pcontext.cc
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@mysql.com>2009-04-29 07:59:10 +0500
committerAlexey Botchkov <holyfoot@mysql.com>2009-04-29 07:59:10 +0500
commit0e88c80580b244a960afd39408f4a459c555fb56 (patch)
tree4f09cda898568a4480e2d228438c4b9befbdd3b8 /sql/sp_pcontext.cc
parent755d312e8456da751f432fd0e9c211dc4aeba131 (diff)
parentddc9a195508c35fc3f83ce58327b5fe7f09f4277 (diff)
downloadmariadb-git-0e88c80580b244a960afd39408f4a459c555fb56.tar.gz
merging
Diffstat (limited to 'sql/sp_pcontext.cc')
-rw-r--r--sql/sp_pcontext.cc23
1 files changed, 11 insertions, 12 deletions
diff --git a/sql/sp_pcontext.cc b/sql/sp_pcontext.cc
index 414ea12cd7a..302faf3f681 100644
--- a/sql/sp_pcontext.cc
+++ b/sql/sp_pcontext.cc
@@ -265,8 +265,8 @@ sp_pcontext::push_variable(LEX_STRING *name, enum enum_field_types type,
p->mode= mode;
p->offset= current_var_count();
p->dflt= NULL;
- insert_dynamic(&m_vars, (uchar*)&p);
-
+ if (insert_dynamic(&m_vars, (uchar*)&p))
+ return NULL;
return p;
}
@@ -310,18 +310,17 @@ sp_pcontext::find_label(char *name)
return NULL;
}
-void
+int
sp_pcontext::push_cond(LEX_STRING *name, sp_cond_type_t *val)
{
sp_cond_t *p= (sp_cond_t *)sql_alloc(sizeof(sp_cond_t));
- if (p)
- {
- p->name.str= name->str;
- p->name.length= name->length;
- p->val= val;
- insert_dynamic(&m_conds, (uchar*)&p);
- }
+ if (p == NULL)
+ return 1;
+ p->name.str= name->str;
+ p->name.length= name->length;
+ p->val= val;
+ return insert_dynamic(&m_conds, (uchar *)&p);
}
/*
@@ -384,7 +383,7 @@ sp_pcontext::find_handler(sp_cond_type_t *cond)
return FALSE;
}
-void
+int
sp_pcontext::push_cursor(LEX_STRING *name)
{
LEX_STRING n;
@@ -393,7 +392,7 @@ sp_pcontext::push_cursor(LEX_STRING *name)
m_max_cursor_index+= 1;
n.str= name->str;
n.length= name->length;
- insert_dynamic(&m_cursors, (uchar*)&n);
+ return insert_dynamic(&m_cursors, (uchar *)&n);
}
/*