summaryrefslogtreecommitdiff
path: root/sql/sp_head.h
diff options
context:
space:
mode:
authorunknown <pem@mysql.com>2003-03-02 19:17:41 +0100
committerunknown <pem@mysql.com>2003-03-02 19:17:41 +0100
commit8a9422bd2af6ea39676171b9ec16897c64104dc8 (patch)
treef607e9e9c2756612d8e622c239e1781b56f51e63 /sql/sp_head.h
parent1ff79b61a056e5b50fc0402680f6f74ca1eb2a57 (diff)
downloadmariadb-git-8a9422bd2af6ea39676171b9ec16897c64104dc8.tar.gz
Made FUNCTIONs work in insert and select queries, as well as nested function invocations.
Had to add a cahing mechanism which is in parts an ugly kludge, but it will be reworked once the real SP caching is implemented. mysql-test/r/sp.result: New function tests. mysql-test/t/sp.test: New function tests. sql/sp.cc: Big rehack of mysql.proc table usage strategy and adding a function cache mechanism, since we need to read used functions from the db before doing anything else when executing a query. (This cache is temporary and will probably be replaced by the real thing later.) sql/sp.h: New (temporary) FUNCTION caching functions. sql/sp_head.cc: Fixed some bugs in the function and procedure execution. Disabled some data collections that's not used at the moment. sql/sp_head.h: Fixed some bugs in the function and procedure execution. Disabled some data collections that's not used at the moment. sql/sql_class.h: Added SP function cache list to thd. sql/sql_lex.cc: Added SP function name list to lex. sql/sql_lex.h: Added SP function name list to lex. sql/sql_parse.cc: Read used FUNCTIONs from db and cache them in thd before doing anything else in a query execution. (This is necessary since we can't open mysql.proc during query execution.) sql/sql_yacc.yy: Collect used function names in lex.
Diffstat (limited to 'sql/sp_head.h')
-rw-r--r--sql/sp_head.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/sql/sp_head.h b/sql/sp_head.h
index fa2a76753e7..ee64a1bd0cf 100644
--- a/sql/sp_head.h
+++ b/sql/sp_head.h
@@ -46,8 +46,11 @@ public:
int m_type; // TYPE_ENUM_FUNCTION or TYPE_ENUM_PROCEDURE
enum enum_field_types m_returns; // For FUNCTIONs only
my_bool m_simple_case; // TRUE if parsing simple case, FALSE otherwise
+#if 0
+ // We're not using this at the moment.
List<char *> m_calls; // Called procedures.
List<char *> m_tables; // Used tables.
+#endif
static void *operator new(size_t size)
{
@@ -59,7 +62,7 @@ public:
/* Empty */
}
- sp_head(LEX_STRING *name, LEX* lex);
+ sp_head(LEX_STRING *name, LEX *lex);
int
create(THD *thd);
@@ -118,7 +121,7 @@ private:
Item_string *m_name;
Item_string *m_defstr;
- LEX *m_call_lex; // The CALL's own lex
+ sp_pcontext *m_pcont; // Parse context
LEX m_lex; // Temp. store for the other lex
DYNAMIC_ARRAY m_instr; // The "instructions"
typedef struct