summaryrefslogtreecommitdiff
path: root/sql/item.h
diff options
context:
space:
mode:
authorunknown <pem@mysql.comhem.se>2005-06-01 15:42:40 +0200
committerunknown <pem@mysql.comhem.se>2005-06-01 15:42:40 +0200
commitae28b3bd07e2931e5badb8972521d4a3f87bc341 (patch)
tree57a07e5aa1af0e8cb1bf6f58e54c42f9d89c3a6f /sql/item.h
parent77bd9d36e6c703045e01de655952f98f79e6332a (diff)
downloadmariadb-git-ae28b3bd07e2931e5badb8972521d4a3f87bc341.tar.gz
Fixed BUG#10969: Stored procedures: crash if default() function
Return an error if default() is used on a local variable. This is actaully a side-effect of BUG#5967: Stored procedure declared variable used instead of column (to be fixed later), so this is really a workaround until that is fixed. mysql-test/r/sp-error.result: New test case for BUG#10969. mysql-test/t/sp-error.test: New test case for BUG#10969. sql/item.h: Get name of local variable for error messages. sql/sql_yacc.yy: Return an error if default() is applied on a local SP variable.
Diffstat (limited to 'sql/item.h')
-rw-r--r--sql/item.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/sql/item.h b/sql/item.h
index 18b419dd6d5..f2e8e582780 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -584,6 +584,13 @@ public:
Item::maybe_null= TRUE;
}
+ /* For error printing */
+ inline void my_name(char **strp, uint *lengthp)
+ {
+ *strp= m_name.str;
+ *lengthp= m_name.length;
+ }
+
bool is_splocal() { return 1; } /* Needed for error checking */
Item *this_item();