From 27de9ece815b04651db03ed3d413374f42c9d894 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 8 Dec 2002 19:59:22 +0100 Subject: Simplistic, experimental framework for Stored Procedures (SPs). Implements creation and dropping of PROCEDUREs, IN, OUT, and INOUT parameters, single-statement procedures, rudimentary multi-statement (begin-end) prodedures (when the client can handle it), and local variables. Missing most of the embedded SQL language, all attributes, FUNCTIONs, error handling, reparses procedures at each call (no caching), etc, etc. Certainly buggy too, but procedures can actually be created and called.... sql/Makefile.am: Added SP files. sql/item.cc: Added this*_item() methods for Item_splocal. (SP local variable) sql/item.h: Added this*_item() methods for SPs in Item, and the new Item_splocal class (SP local variable). sql/lex.h: Added new symbols for SPs. (Note: SPSET is temporary and will go away later.) sql/sql_class.cc: Initialize SP runtime context in THD. sql/sql_class.h: Add SP runtime context to THD. sql/sql_lex.cc: Init. buf pointer to beginning of command (needed by SPs). Also initialize SP head and parse time context. sql/sql_lex.h: New SQLCOM_ tags for SPs, and added pointer to beginning of command pointer and SP head and parse-time context to LEX. sql/sql_parse.cc: Added SQLCOM_CREATE_PROCEDURE, _CALL, _ALTER_PROCEDURE and _DROP_PROCEDURE cases. (Still rudimentary and lacking proper error handling...) sql/sql_yacc.yy: Lots and lots of additions for SPs... (Still even more missing, and no error messages...) --- sql/Makefile.am | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sql/Makefile.am') diff --git a/sql/Makefile.am b/sql/Makefile.am index c5af51e8397..1cdfc05ffdc 100644 --- a/sql/Makefile.am +++ b/sql/Makefile.am @@ -57,7 +57,8 @@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \ lex.h lex_symbol.h sql_acl.h sql_crypt.h \ log_event.h mini_client.h sql_repl.h slave.h \ stacktrace.h sql_sort.h sql_cache.h set_var.h \ - spatial.h gstream.h + spatial.h gstream.h sp_head.h sp_pcontext.h \ + sp_rcontext.h mysqld_SOURCES = sql_lex.cc sql_handler.cc \ item.cc item_sum.cc item_buff.cc item_func.cc \ item_cmpfunc.cc item_strfunc.cc item_timefunc.cc \ @@ -85,7 +86,8 @@ mysqld_SOURCES = sql_lex.cc sql_handler.cc \ slave.cc sql_repl.cc sql_union.cc sql_derived.cc \ mini_client.cc mini_client_errors.c \ stacktrace.c repl_failsafe.h repl_failsafe.cc sql_olap.cc\ - gstream.cc spatial.cc sql_help.cc + gstream.cc spatial.cc sql_help.cc \ + sp_head.cc sp_pcontext.cc gen_lex_hash_SOURCES = gen_lex_hash.cc gen_lex_hash_LDADD = $(LDADD) $(CXXLDFLAGS) -- cgit v1.2.1 From b1b62274856c81a5f1f7a49384fc93810fd2a2bd Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 12 Dec 2002 13:14:23 +0100 Subject: 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.) --- sql/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sql/Makefile.am') diff --git a/sql/Makefile.am b/sql/Makefile.am index 1cdfc05ffdc..116c094aa04 100644 --- a/sql/Makefile.am +++ b/sql/Makefile.am @@ -58,7 +58,7 @@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \ log_event.h mini_client.h sql_repl.h slave.h \ stacktrace.h sql_sort.h sql_cache.h set_var.h \ spatial.h gstream.h sp_head.h sp_pcontext.h \ - sp_rcontext.h + sp_rcontext.h sp.h mysqld_SOURCES = sql_lex.cc sql_handler.cc \ item.cc item_sum.cc item_buff.cc item_func.cc \ item_cmpfunc.cc item_strfunc.cc item_timefunc.cc \ @@ -87,7 +87,7 @@ mysqld_SOURCES = sql_lex.cc sql_handler.cc \ mini_client.cc mini_client_errors.c \ stacktrace.c repl_failsafe.h repl_failsafe.cc sql_olap.cc\ gstream.cc spatial.cc sql_help.cc \ - sp_head.cc sp_pcontext.cc + sp_head.cc sp_pcontext.cc sp.cc gen_lex_hash_SOURCES = gen_lex_hash.cc gen_lex_hash_LDADD = $(LDADD) $(CXXLDFLAGS) -- cgit v1.2.1 From f1c754efe9b78fb8497042ebdb1b2245df392381 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 3 Jul 2003 15:58:37 +0200 Subject: Code cleanup (and moved sp cache to separate file). --- sql/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sql/Makefile.am') diff --git a/sql/Makefile.am b/sql/Makefile.am index 74372e9ae2f..77a7e6b2e49 100644 --- a/sql/Makefile.am +++ b/sql/Makefile.am @@ -58,7 +58,7 @@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \ log_event.h mini_client.h sql_repl.h slave.h \ stacktrace.h sql_sort.h sql_cache.h set_var.h \ spatial.h gstream.h sp_head.h sp_pcontext.h \ - sp_rcontext.h sp.h + sp_rcontext.h sp.h sp_cache.h mysqld_SOURCES = sql_lex.cc sql_handler.cc \ item.cc item_sum.cc item_buff.cc item_func.cc \ item_cmpfunc.cc item_strfunc.cc item_timefunc.cc \ @@ -87,7 +87,7 @@ mysqld_SOURCES = sql_lex.cc sql_handler.cc \ mini_client.cc mini_client_errors.c pack.c\ stacktrace.c repl_failsafe.h repl_failsafe.cc sql_olap.cc\ gstream.cc spatial.cc sql_help.cc protocol_cursor.cc \ - sp_head.cc sp_pcontext.cc sp.cc + sp_head.cc sp_pcontext.cc sp.cc sp_cache.cc gen_lex_hash_SOURCES = gen_lex_hash.cc gen_lex_hash_LDADD = $(LDADD) $(CXXLDFLAGS) -- cgit v1.2.1