Commit graph

5 commits

Author SHA1 Message Date
unknown
b12330b3d9 Added parsing of CASE (both generic and "simple").
sql/sp_head.cc:
  Init. the simple_case flag.
sql/sp_head.h:
  New flag for (simple)case parsing.
sql/sp_pcontext.cc:
  Removed push_gen_label method (not needed any more).
sql/sp_pcontext.h:
  Removed push_gen_label method (not needed any more).
  Fixed bug in pop().
sql/sql_yacc.yy:
  Added CASE parsing.
2002-12-17 10:01:52 +01:00
unknown
f6611aa0ab Fixed the broken backpatching implementation.
Implemented IF-THEN-ELSE.


sql/sp_head.cc:
  Reimplemented the broken backpatching, so it works for nested constructions and
  IF-THEN-ELSE too.
sql/sp_head.h:
  Reimplemented the broken backpatching, so it works for nested constructions and
  IF-THEN-ELSE too.
sql/sp_pcontext.cc:
  Return the value from push-methods, for convenience.
sql/sp_pcontext.h:
  Return the value from push-methods, for convenience.
sql/sql_yacc.yy:
  Implemented IF-THEN-ELSE.
  Corrected for the new backpatch method.
2002-12-16 15:40:44 +01:00
unknown
b1b6227485 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.)
2002-12-12 13:14:23 +01:00
unknown
37ce17e2cd Fixed bugs in the parameter evaluation and modified the execution engine
for better jump support. Some flow control support added too (but not
complete).


sql/lex.h:
  Added more keywords for embedded SQL.
sql/sp_head.cc:
  Fixed bugs in the parameter evaluation.
  Modified execute() for better jump support.
  Added jump instruction and backpatch support.
sql/sp_head.h:
  Fixed bugs in the parameter evaluation.
  Modified execute() for better jump support.
  Added jump instruction and backpatch support.
sql/sp_pcontext.cc:
  Added label support.
sql/sp_pcontext.h:
  Added label support.
sql/sql_yacc.yy:
  Outlined flow control constructs (parses, but nothing generated yet).
2002-12-11 14:24:29 +01:00
unknown
27de9ece81 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...)
2002-12-08 19:59:22 +01:00