summaryrefslogtreecommitdiff
path: root/sql/sp_pcontext.h
diff options
context:
space:
mode:
authorunknown <pem@mysql.com>2002-12-11 14:24:29 +0100
committerunknown <pem@mysql.com>2002-12-11 14:24:29 +0100
commit37ce17e2cd6e796ca19674fb42f91bd153aaedf2 (patch)
treec0a89d8aee02a69b9c85212ad22f3f7a5e31ca64 /sql/sp_pcontext.h
parent27de9ece815b04651db03ed3d413374f42c9d894 (diff)
downloadmariadb-git-37ce17e2cd6e796ca19674fb42f91bd153aaedf2.tar.gz
Fixed bugs in the parameter evaluation and modified the execution engine
for better jump support. Some flow control support added too (but not complete). sql/lex.h: Added more keywords for embedded SQL. sql/sp_head.cc: Fixed bugs in the parameter evaluation. Modified execute() for better jump support. Added jump instruction and backpatch support. sql/sp_head.h: Fixed bugs in the parameter evaluation. Modified execute() for better jump support. Added jump instruction and backpatch support. sql/sp_pcontext.cc: Added label support. sql/sp_pcontext.h: Added label support. sql/sql_yacc.yy: Outlined flow control constructs (parses, but nothing generated yet).
Diffstat (limited to 'sql/sp_pcontext.h')
-rw-r--r--sql/sp_pcontext.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/sql/sp_pcontext.h b/sql/sp_pcontext.h
index 956b8d99d4d..8a37adcf427 100644
--- a/sql/sp_pcontext.h
+++ b/sql/sp_pcontext.h
@@ -38,6 +38,12 @@ typedef struct
my_bool isset;
} sp_pvar_t;
+typedef struct
+{
+ char *name;
+ uint ip; // Instruction index
+} sp_label_t;
+
class sp_pcontext : public Sql_alloc
{
sp_pcontext(const sp_pcontext &); /* Prevent use of these */
@@ -89,6 +95,7 @@ class sp_pcontext : public Sql_alloc
void
push(LEX_STRING *name, enum enum_field_types type, sp_param_mode_t mode);
+ // Pop the last 'num' slots of the frame
inline void
pop(uint num = 1)
{
@@ -109,6 +116,21 @@ class sp_pcontext : public Sql_alloc
return m_pvar+i;
}
+ void
+ push_label(char *name, uint ip);
+
+ void
+ push_gen_label(uint ip);
+
+ sp_label_t *
+ find_label(char *name);
+
+ inline void
+ pop_label()
+ {
+ m_label.pop();
+ }
+
private:
uint m_params; // The number of parameters
@@ -121,6 +143,9 @@ private:
void
grow();
+ List<sp_label_t> m_label; // The label list
+ uint m_genlab; // Gen. label counter
+
}; // class sp_pcontext : public Sql_alloc