summaryrefslogtreecommitdiff
path: root/sql/sp_pcontext.cc
diff options
context:
space:
mode:
authorunknown <pem@mysql.comhem.se>2004-04-06 15:48:58 +0200
committerunknown <pem@mysql.comhem.se>2004-04-06 15:48:58 +0200
commitc22ccc136bfe8eaeaa9797775bde423cf0931bc1 (patch)
treebc2c17cd1e1f52242adcfb62808c8e18f12dc83a /sql/sp_pcontext.cc
parent91dcd01159b2bcca753dd699fdf6a52d496ff7c1 (diff)
downloadmariadb-git-c22ccc136bfe8eaeaa9797775bde423cf0931bc1.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.) mysql-test/r/sp.result: New testcases for BUG#2776. mysql-test/t/sp.test: New testcases for BUG#2776. sql/sp_pcontext.cc: Initialize local variable default value. sql/sp_pcontext.h: New method for saving default value. sql/sql_yacc.yy: If DEFAULT is use as a value in SET variable = ... in an SP, actually use the default.
Diffstat (limited to 'sql/sp_pcontext.cc')
-rw-r--r--sql/sp_pcontext.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/sp_pcontext.cc b/sql/sp_pcontext.cc
index b7e23c9f5ad..03333a2da72 100644
--- a/sql/sp_pcontext.cc
+++ b/sql/sp_pcontext.cc
@@ -118,6 +118,7 @@ sp_pcontext::push_pvar(LEX_STRING *name, enum enum_field_types type,
p->mode= mode;
p->offset= m_pvar.elements;
p->isset= (mode == sp_param_out ? FALSE : TRUE);
+ p->dflt= NULL;
insert_dynamic(&m_pvar, (gptr)&p);
}
}