summaryrefslogtreecommitdiff
path: root/sql/sp.h
diff options
context:
space:
mode:
authorpem@mysql.com <>2003-02-21 17:37:05 +0100
committerpem@mysql.com <>2003-02-21 17:37:05 +0100
commitd8c75ec8aa867ec002c543e7931d54fd7144fd46 (patch)
tree09532f901b8cb45042f6189083d6fe928d50f20f /sql/sp.h
parent52cd3e3142da39afb30855d24833209cae924c90 (diff)
downloadmariadb-git-d8c75ec8aa867ec002c543e7931d54fd7144fd46.tar.gz
Most of the groundwork for sprint task 729 (implement FUNCTIONs).
Expanded the mysql.proc table, reworked the find/create/drop functions completely, added new functions for FUNCTIONs (lotta functions here :), got rid of some unnecessary use of Item_strings while at it. Extended the parser correspondingly, and fiddled around a bit to make SP FUNCTIONs coexist with UDFs. Can now CREATE and DROP FUNCTIONs. Invoking yet to come...
Diffstat (limited to 'sql/sp.h')
-rw-r--r--sql/sp.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/sql/sp.h b/sql/sp.h
index 99ea97cba8f..084afb8c8e0 100644
--- a/sql/sp.h
+++ b/sql/sp.h
@@ -18,11 +18,17 @@
#ifndef _SP_H_
#define _SP_H_
-//
-// Finds a stored procedure given its name. Returns NULL if not found.
-//
+// Return codes from sp_create_* and sp_drop_*:
+#define SP_OK 0
+#define SP_KEY_NOT_FOUND -1
+#define SP_OPEN_TABLE_FAILED -2
+#define SP_WRITE_ROW_FAILED -3
+#define SP_DELETE_ROW_FAILED -4
+#define SP_GET_FIELD_FAILED -5
+#define SP_PARSE_ERROR -6
+
sp_head *
-sp_find_procedure(THD *thd, Item_string *name);
+sp_find_procedure(THD *thd, LEX_STRING *name);
int
sp_create_procedure(THD *thd, char *name, uint namelen, char *def, uint deflen);
@@ -30,15 +36,14 @@ sp_create_procedure(THD *thd, char *name, uint namelen, char *def, uint deflen);
int
sp_drop_procedure(THD *thd, char *name, uint namelen);
-#if 0
+
sp_head *
-sp_find_function(THD *thd, Item_string *name);
+sp_find_function(THD *thd, LEX_STRING *name);
int
sp_create_function(THD *thd, char *name, uint namelen, char *def, uint deflen);
int
sp_drop_function(THD *thd, char *name, uint namelen);
-#endif
#endif /* _SP_H_ */