summaryrefslogtreecommitdiff
path: root/sql/sp_pcontext.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2016-10-21 11:51:49 +0400
committerAlexander Barkov <bar@mariadb.org>2017-04-05 15:02:53 +0400
commitf8a714c84858ae63514afe769ff52fac919e918b (patch)
tree54b41fb51cfe105da05f88aade70fe0301b15543 /sql/sp_pcontext.cc
parent4ed804aa4dc6a03d5a983a0aaf71b39e4702e8f3 (diff)
downloadmariadb-git-f8a714c84858ae63514afe769ff52fac919e918b.tar.gz
MDEV-10597 Cursors with parameters
Diffstat (limited to 'sql/sp_pcontext.cc')
-rw-r--r--sql/sp_pcontext.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/sql/sp_pcontext.cc b/sql/sp_pcontext.cc
index 047d0f50aaa..fb162501ebc 100644
--- a/sql/sp_pcontext.cc
+++ b/sql/sp_pcontext.cc
@@ -498,18 +498,18 @@ sp_pcontext::find_handler(const Sql_condition_identity &value) const
}
-bool sp_pcontext::add_cursor(const LEX_STRING name)
+bool sp_pcontext::add_cursor(const LEX_STRING name, sp_pcontext *param_ctx)
{
if (m_cursors.elements() == m_max_cursor_index)
++m_max_cursor_index;
- return m_cursors.append(name);
+ return m_cursors.append(sp_pcursor(name, param_ctx));
}
-bool sp_pcontext::find_cursor(const LEX_STRING name,
- uint *poff,
- bool current_scope_only) const
+const sp_pcursor *sp_pcontext::find_cursor(const LEX_STRING name,
+ uint *poff,
+ bool current_scope_only) const
{
uint i= m_cursors.elements();
@@ -522,13 +522,13 @@ bool sp_pcontext::find_cursor(const LEX_STRING name,
(const uchar *) n.str, n.length) == 0)
{
*poff= m_cursor_offset + i;
- return true;
+ return &m_cursors.at(i);
}
}
return (!current_scope_only && m_parent) ?
m_parent->find_cursor(name, poff, false) :
- false;
+ NULL;
}
@@ -551,7 +551,7 @@ void sp_pcontext::retrieve_field_definitions(
}
-const LEX_STRING *sp_pcontext::find_cursor(uint offset) const
+const sp_pcursor *sp_pcontext::find_cursor(uint offset) const
{
if (m_cursor_offset <= offset &&
offset < m_cursor_offset + m_cursors.elements())