summaryrefslogtreecommitdiff
path: root/sql/sp_pcontext.cc
diff options
context:
space:
mode:
authorunknown <pem@mysql.com>2005-11-18 16:30:27 +0100
committerunknown <pem@mysql.com>2005-11-18 16:30:27 +0100
commit6726a6b8b9cc6059f8080846185114e42f248556 (patch)
tree511c72f417c8aa02f30a0a354d4641217c9c1dca /sql/sp_pcontext.cc
parent91ab707678870966b9410cd3bdd783eb2a7c19e4 (diff)
downloadmariadb-git-6726a6b8b9cc6059f8080846185114e42f248556.tar.gz
Post-review fixes, mainly fixing all print() methods for sp_instr* classes.
Also added mysql-test files: include/is_debug_build.inc r/is_debug_build.require r/sp-code.result t/sp-code.test sql/sp_head.cc: Review fixes: - Some minor editorial changes - Fixed all print() methods for instructions: - reserve() enough space - check return value from reserve() - use qs_append, with length arg, whenever possible sql/sp_pcontext.cc: Review fixes. Also fixed bug in find_cursor(). sql/sp_pcontext.h: Changed parameter names (review fix). sql/sql_parse.cc: Moved comment. (Review fix) mysql-test/include/is_debug_build.inc: New BitKeeper file ``mysql-test/include/is_debug_build.inc'' mysql-test/r/is_debug_build.require: New BitKeeper file ``mysql-test/r/is_debug_build.require'' mysql-test/r/sp-code.result: New BitKeeper file ``mysql-test/r/sp-code.result'' mysql-test/t/sp-code.test: New BitKeeper file ``mysql-test/t/sp-code.test''
Diffstat (limited to 'sql/sp_pcontext.cc')
-rw-r--r--sql/sp_pcontext.cc26
1 files changed, 12 insertions, 14 deletions
diff --git a/sql/sp_pcontext.cc b/sql/sp_pcontext.cc
index 32824b75847..147173ab4d8 100644
--- a/sql/sp_pcontext.cc
+++ b/sql/sp_pcontext.cc
@@ -177,19 +177,18 @@ sp_pcontext::find_pvar(LEX_STRING *name, my_bool scoped)
- For printing of sp_instr_set. (Debug mode only.)
*/
sp_pvar_t *
-sp_pcontext::find_pvar(uint i)
+sp_pcontext::find_pvar(uint offset)
{
- if (m_poffset <= i && i < m_poffset + m_pvar.elements)
+ if (m_poffset <= offset && offset < m_poffset + m_pvar.elements)
{ // This frame
sp_pvar_t *p;
- get_dynamic(&m_pvar, (gptr)&p, i - m_poffset);
+ get_dynamic(&m_pvar, (gptr)&p, offset - m_poffset);
return p;
}
- else if (m_parent)
- return m_parent->find_pvar(i); // Some previous frame
- else
- return NULL; // index out of bounds
+ if (m_parent)
+ return m_parent->find_pvar(offset); // Some previous frame
+ return NULL; // index out of bounds
}
void
@@ -360,16 +359,15 @@ sp_pcontext::find_cursor(LEX_STRING *name, uint *poff, my_bool scoped)
This is only used for debugging.
*/
my_bool
-sp_pcontext::find_cursor(uint i, LEX_STRING *n)
+sp_pcontext::find_cursor(uint offset, LEX_STRING *n)
{
- if (m_coffset <= i && i < m_coffset + m_cursor.elements)
+ if (m_coffset <= offset && offset < m_coffset + m_cursor.elements)
{ // This frame
- get_dynamic(&m_cursor, (gptr)n, i - m_poffset);
+ get_dynamic(&m_cursor, (gptr)n, offset - m_coffset);
return TRUE;
}
- else if (m_parent)
- return m_parent->find_cursor(i, n); // Some previous frame
- else
- return FALSE; // index out of bounds
+ if (m_parent)
+ return m_parent->find_cursor(offset, n); // Some previous frame
+ return FALSE; // index out of bounds
}