summaryrefslogtreecommitdiff
path: root/sql/sp.h
diff options
context:
space:
mode:
authorunknown <pem@mysql.com>2002-12-12 13:14:23 +0100
committerunknown <pem@mysql.com>2002-12-12 13:14:23 +0100
commitb1b62274856c81a5f1f7a49384fc93810fd2a2bd (patch)
tree595d5056b5c8e5c0258b01e6b1a3236f595f773f /sql/sp.h
parent37ce17e2cd6e796ca19674fb42f91bd153aaedf2 (diff)
downloadmariadb-git-b1b62274856c81a5f1f7a49384fc93810fd2a2bd.tar.gz
Moved create/find/drop functions to a separate files (sp.cc,sp.h).
Fixed backpatching of forward jumps. Implemented LOOP, WHILE, REPEAT (temporarily known as SPREPEAT). Known bug: Expression evaluation still not quite ok (e.g. "x > 0"), which is why IF and CASE is not yet implemented. sql/Makefile.am: Added new sp.h/sp.cc file. sql/item.h: New deferred result_type() method in Item_splocal. sql/lex.h: Temporary fix until REPEAT conflict is solved. Use SPREPEAT for now. sql/sp_head.cc: Moved create/find/drop functions to sp.cc. Fixed the backpatch stuff. (Also removed some dead code and updated comments.) sql/sp_head.h: Moved create/find/drop declarations to sp.h. Fixed the backpatch stuff. sql/sp_pcontext.h: New method: last_label(). sql/sql_parse.cc: Include sp.h. sql/sql_yacc.yy: Fixed backpatching of forward jumps. Implemented LOOP, WHILE, and REPEAT. (Note: SPREPEAT for now.)
Diffstat (limited to 'sql/sp.h')
-rw-r--r--sql/sp.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/sql/sp.h b/sql/sp.h
new file mode 100644
index 00000000000..cb3343a4e92
--- /dev/null
+++ b/sql/sp.h
@@ -0,0 +1,33 @@
+/* -*- C++ -*- */
+/* Copyright (C) 2002 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#ifndef _SP_H_
+#define _SP_H_
+
+//
+// Finds a stored procedure given its name. Returns NULL if not found.
+//
+sp_head *
+sp_find(THD *thd, Item_string *name);
+
+int
+sp_create_procedure(THD *thd, char *name, uint namelen, char *def, uint deflen);
+
+int
+sp_drop(THD *thd, char *name, uint namelen);
+
+#endif /* _SP_H_ */