summaryrefslogtreecommitdiff
path: root/sql/sp_pcontext.h
diff options
context:
space:
mode:
authorpem@mysql.comhem.se <>2004-04-06 15:48:58 +0200
committerpem@mysql.comhem.se <>2004-04-06 15:48:58 +0200
commit4a6e6251e760450197d0dce26b5e9b9a6a0ac8a1 (patch)
treebc2c17cd1e1f52242adcfb62808c8e18f12dc83a /sql/sp_pcontext.h
parenteb7319e850f7f9c363ef83812c74a5cc8e06c429 (diff)
downloadmariadb-git-4a6e6251e760450197d0dce26b5e9b9a6a0ac8a1.tar.gz
Fixed BUG#2776: Stored procedure crash if variable assigned to default.
Keep track on the default value and use it. (Or NULL, if not declared.)
Diffstat (limited to 'sql/sp_pcontext.h')
-rw-r--r--sql/sp_pcontext.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/sql/sp_pcontext.h b/sql/sp_pcontext.h
index 02134e3604f..a82cefa2e42 100644
--- a/sql/sp_pcontext.h
+++ b/sql/sp_pcontext.h
@@ -36,6 +36,7 @@ typedef struct sp_pvar
sp_param_mode_t mode;
uint offset; // Offset in current frame
my_bool isset;
+ Item *dflt;
} sp_pvar_t;
typedef struct sp_label
@@ -130,6 +131,15 @@ class sp_pcontext : public Sql_alloc
p->isset= val;
}
+ inline void
+ set_default(uint i, Item *it)
+ {
+ sp_pvar_t *p= find_pvar(i);
+
+ if (p)
+ p->dflt= it;
+ }
+
void
push_pvar(LEX_STRING *name, enum enum_field_types type, sp_param_mode_t mode);