fix to functions as well.
mysql-test/r/sp.result:
Modified test to trap yet another bug (now fixed).
mysql-test/t/sp.test:
Modified test to trap yet another bug (now fixed).
sql/item.h:
Another bugfix; need to override yet another method in Item_splocal.
sql/sp_head.cc:
Completed previous initialization bug; now for FUNCTIONs. too.
mysql-test/r/sp.result:
New test case for bugfix (when a variable is not set due to an exception).
mysql-test/t/sp.test:
New test case for bugfix (when a variable is not set due to an exception).
sql/item.h:
Local variables are initialized to null.
sql/sp_head.cc:
Local variables are initialized to null.
mysql-test/r/sp.result:
Test cases for user variables (@-vars) as OUT and INOUT parameters.
mysql-test/t/sp.test:
Test cases for user variables (@-vars) as OUT and INOUT parameters.
sql/item_func.h:
We need to be able to detect Item_func_get_user_vars when used as arguments to SPs.
sql/sp_head.cc:
Handle user variables (@-vars) as OUT and INOUT parameters.
But we still just ignore it, if it's anything else.
Also copy and restore order_list and group_list for selects in SPs.
mysql-test/r/sp.result:
Test for BUG#1495, and an additional cursor test.
mysql-test/t/sp.test:
Test for BUG#1495, and an additional cursor test.
sql/sp_head.cc:
Fix BUG#1495: renamed eval_func_item() into sp_eval_func_item() and made it
non-static.
Also need to copy and restore order_list and group_list pointers before and
after execution of a substatement. (Which means these must always be properly
initialized for all queries.)
sql/sp_rcontext.cc:
Fix BUG#1495: Evaluate and set a local variable (for SELECT INTO).
sql/sp_rcontext.h:
Fix BUG#1495: Evaluate and set a local variable (for SELECT INTO).
sql/sql_class.cc:
Fix BUG#1495: Evaluate and set a local variable (for SELECT INTO).
sql/sql_class.h:
Fix BUG#1495: Evaluate and set a local variable (for SELECT INTO); need type for this.
sql/sql_parse.cc:
order_list and group_list must be initialized in select_lex for all queries,
to make SP sub statement execution work.
sql/sql_yacc.yy:
Type needed for setting local variables.
sql/table.h:
Need a copy of the Item* pointer when executing sub-statements in SPs. (Since
it's modified and must be restored afterwards.)
(updated) Protocol_cursor class.
Also did some bug fixes.
Docs/sp-imp-spec.txt:
Added CURSOR docs (and fixed typos)
Docs/sp-implemented.txt:
Updated for CURSORs
include/mysqld_error.h:
New error codes/messages for CURSORs
libmysqld/Makefile.am:
SP cursors now needs this.
mysql-test/r/sp-error.result:
New tests for cursors.
mysql-test/r/sp.result:
New tests for cursors.
mysql-test/t/sp-error.test:
New tests for cursors.
mysql-test/t/sp.test:
New tests for cursors.
sql/protocol.cc:
We now always have Protocol_cursor (SPs use it)
sql/protocol.h:
Fixed bugs in Protocol_cursor (for SPs)
sql/protocol_cursor.cc:
Fixed bugs in Protocol_cursor (for SPs)
sql/share/czech/errmsg.txt:
New error codes/messages for CURSORs
sql/share/danish/errmsg.txt:
New error codes/messages for CURSORs
sql/share/dutch/errmsg.txt:
New error codes/messages for CURSORs
sql/share/english/errmsg.txt:
New error codes/messages for CURSORs
sql/share/estonian/errmsg.txt:
New error codes/messages for CURSORs
sql/share/french/errmsg.txt:
New error codes/messages for CURSORs
sql/share/german/errmsg.txt:
New error codes/messages for CURSORs
sql/share/greek/errmsg.txt:
New error codes/messages for CURSORs
sql/share/hungarian/errmsg.txt:
New error codes/messages for CURSORs
sql/share/italian/errmsg.txt:
New error codes/messages for CURSORs
sql/share/japanese/errmsg.txt:
New error codes/messages for CURSORs
sql/share/korean/errmsg.txt:
New error codes/messages for CURSORs
sql/share/norwegian-ny/errmsg.txt:
New error codes/messages for CURSORs
sql/share/norwegian/errmsg.txt:
New error codes/messages for CURSORs
sql/share/polish/errmsg.txt:
New error codes/messages for CURSORs
sql/share/portuguese/errmsg.txt:
New error codes/messages for CURSORs
sql/share/romanian/errmsg.txt:
New error codes/messages for CURSORs
sql/share/russian/errmsg.txt:
New error codes/messages for CURSORs
sql/share/serbian/errmsg.txt:
New error codes/messages for CURSORs
sql/share/slovak/errmsg.txt:
New error codes/messages for CURSORs
sql/share/spanish/errmsg.txt:
New error codes/messages for CURSORs
sql/share/swedish/errmsg.txt:
New error codes/messages for CURSORs
sql/share/ukrainian/errmsg.txt:
New error codes/messages for CURSORs
sql/sp_head.cc:
Added cursor support.
Also fixed problems with item_lists, where pointers and ref_pointer_arrays.
sql/sp_head.h:
Added cursor support
sql/sp_pcontext.cc:
Added cursor support
sql/sp_pcontext.h:
Added cursor support
sql/sp_rcontext.cc:
Added cursor support, in particular the new sp_cursor class.
sql/sp_rcontext.h:
Added cursor support, in particular the new sp_cursor class.
sql/sql_lex.h:
We sometimes need to copy item_lists in LEX when executing substatements in SPs
sql/sql_yacc.yy:
Added minimal cursor support (not the full syntax yet).
include/mysqld_error.h:
New error codes/messages for missing RETURNs in FUNCTIONs.
mysql-test/r/sp-error.result:
New error tests for missing RETURNs in FUNCTIONs.
mysql-test/t/sp-error.test:
New error tests for missing RETURNs in FUNCTIONs.
sql/share/czech/errmsg.txt:
New error codes/messages for missing RETURNs in FUNCTIONs.
sql/share/danish/errmsg.txt:
New error codes/messages for missing RETURNs in FUNCTIONs.
sql/share/dutch/errmsg.txt:
New error codes/messages for missing RETURNs in FUNCTIONs.
sql/share/english/errmsg.txt:
New error codes/messages for missing RETURNs in FUNCTIONs.
sql/share/estonian/errmsg.txt:
New error codes/messages for missing RETURNs in FUNCTIONs.
sql/share/french/errmsg.txt:
New error codes/messages for missing RETURNs in FUNCTIONs.
sql/share/german/errmsg.txt:
New error codes/messages for missing RETURNs in FUNCTIONs.
sql/share/greek/errmsg.txt:
New error codes/messages for missing RETURNs in FUNCTIONs.
sql/share/hungarian/errmsg.txt:
New error codes/messages for missing RETURNs in FUNCTIONs.
sql/share/italian/errmsg.txt:
New error codes/messages for missing RETURNs in FUNCTIONs.
sql/share/japanese/errmsg.txt:
New error codes/messages for missing RETURNs in FUNCTIONs.
sql/share/korean/errmsg.txt:
New error codes/messages for missing RETURNs in FUNCTIONs.
sql/share/norwegian-ny/errmsg.txt:
New error codes/messages for missing RETURNs in FUNCTIONs.
sql/share/norwegian/errmsg.txt:
New error codes/messages for missing RETURNs in FUNCTIONs.
sql/share/polish/errmsg.txt:
New error codes/messages for missing RETURNs in FUNCTIONs.
sql/share/portuguese/errmsg.txt:
New error codes/messages for missing RETURNs in FUNCTIONs.
sql/share/romanian/errmsg.txt:
New error codes/messages for missing RETURNs in FUNCTIONs.
sql/share/russian/errmsg.txt:
New error codes/messages for missing RETURNs in FUNCTIONs.
sql/share/serbian/errmsg.txt:
New error codes/messages for missing RETURNs in FUNCTIONs.
sql/share/slovak/errmsg.txt:
New error codes/messages for missing RETURNs in FUNCTIONs.
sql/share/spanish/errmsg.txt:
New error codes/messages for missing RETURNs in FUNCTIONs.
sql/share/swedish/errmsg.txt:
New error codes/messages for missing RETURNs in FUNCTIONs.
sql/share/ukrainian/errmsg.txt:
New error codes/messages for missing RETURNs in FUNCTIONs.
sql/sp_head.h:
Check that a FUNCTION contains RETURN.
sql/sql_parse.cc:
Check that a FUNCTION contains RETURN.
sql/sql_yacc.yy:
Check that a FUNCTION contains RETURN.
executing sub-statements (selects) prevents crashes intermittent
crashes.
Also fixed bug in sql_yacc.yy (generated a hpop instruction when
not needed).
mysql-test/r/sp.result:
Test-case for BUG#822.
mysql-test/t/sp.test:
Test-case for BUG#822.
sql/sp_head.cc:
Fixed BUG#822; needed to copy and clear some stuff when calling sub-statements.
sql/sql_yacc.yy:
Only generate hpop instruction when we actually have handlers.
executing sub-statements (selects) prevents crashes intermittent
crashes.
Also fixed bug in sql_yacc.yy (generated a hpop instruction when
not needed).
MySQL error codes as well.
(No UNDO HANDLERs yet, and no SIGNAL or RESIGNAL.)
WL#850
Docs/sp-imp-spec.txt:
Spec of CONDITIONs and HANDLERs (and updated some old stuff too).
Docs/sp-implemented.txt:
Updated info about caching, CONDITIONs and HANDLERs.
include/mysqld_error.h:
New error for undeclared CONDITION.
libmysqld/Makefile.am:
New file: sp_rcontext.cc.
mysql-test/r/sp-error.result:
New tests for CONDITIONs and HANDLERs.
mysql-test/r/sp.result:
New tests for CONDITIONs and HANDLERs.
mysql-test/t/sp-error.test:
New tests for CONDITIONs and HANDLERs.
mysql-test/t/sp.test:
New tests for CONDITIONs and HANDLERs.
sql/Makefile.am:
New file: sp_rcontext.cc.
sql/lex.h:
New symbols for CONDITIONs, HANDLERs and CURSORs.
sql/mysqld.cc:
Catch error if we have a handler for it.
sql/protocol.cc:
Catch error if we have a handler for it.
sql/share/czech/errmsg.txt:
New error for undeclared CONDITION.
sql/share/danish/errmsg.txt:
New error for undeclared CONDITION.
sql/share/dutch/errmsg.txt:
New error for undeclared CONDITION.
sql/share/english/errmsg.txt:
New error for undeclared CONDITION.
sql/share/estonian/errmsg.txt:
New error for undeclared CONDITION.
sql/share/french/errmsg.txt:
New error for undeclared CONDITION.
sql/share/german/errmsg.txt:
New error for undeclared CONDITION.
sql/share/greek/errmsg.txt:
New error for undeclared CONDITION.
sql/share/hungarian/errmsg.txt:
New error for undeclared CONDITION.
sql/share/italian/errmsg.txt:
New error for undeclared CONDITION.
sql/share/japanese/errmsg.txt:
New error for undeclared CONDITION.
sql/share/korean/errmsg.txt:
New error for undeclared CONDITION.
sql/share/norwegian-ny/errmsg.txt:
New error for undeclared CONDITION.
sql/share/norwegian/errmsg.txt:
New error for undeclared CONDITION.
sql/share/polish/errmsg.txt:
New error for undeclared CONDITION.
sql/share/portuguese/errmsg.txt:
New error for undeclared CONDITION.
sql/share/romanian/errmsg.txt:
New error for undeclared CONDITION.
sql/share/russian/errmsg.txt:
New error for undeclared CONDITION.
sql/share/serbian/errmsg.txt:
New error for undeclared CONDITION.
sql/share/slovak/errmsg.txt:
New error for undeclared CONDITION.
sql/share/spanish/errmsg.txt:
New error for undeclared CONDITION.
sql/share/swedish/errmsg.txt:
New error for undeclared CONDITION.
sql/share/ukrainian/errmsg.txt:
New error for undeclared CONDITION.
sql/sp_head.cc:
New HANDLER code.
sql/sp_head.h:
New HANDLER code.
sql/sp_pcontext.cc:
New CONDITION and HANDLER code.
sql/sp_pcontext.h:
New CONDITION and HANDLER code.
sql/sp_rcontext.h:
New CONDITION and HANDLER code.
sql/sql_yacc.yy:
New CONDITION and HANDLER code.
sql/sp.cc:
Bugfixes for the sp_head memroot stuff. (Do things in the correct order
at error clean-up.)
sql/sp_head.cc:
Bugfixes for the sp_head memroot stuff. Make sure everything goes to the
right memroot. Need separate post-reset-memroot init in sp_head.
sql/sp_head.h:
Need separate post-reset-memroot init method.
sql/sql_yacc.yy:
Bugfixes for the sp_head memroot stuff. Make sure everything goes to the
right memroot. Must do things in the correct order for this.
Also fixed some difficult memory leaks that became apparent
in this task.
sql/sp.cc:
sp_head now has its own mem_root.
sql/sp_head.cc:
sp_head now has its own mem_root.
Also fixed some difficult memory leaks.
sql/sp_head.h:
sp_head now has its own mem_root.
sql/sql_lex.h:
Fixed some memory leaks in sp_head. Need to keep track on used lex:es.
sql/sql_parse.cc:
sp_head now has its own mem_root.
Fixed SP memory leaks.
sql/sql_prepare.cc:
Fixed SP memory leaks.
sql/sql_yacc.yy:
sp_head now has its own mem_root.
syntax errors in stored procedures.
mysql-test/r/sp-error.result:
New test case for bugfix (#643)
mysql-test/t/sp-error.test:
New test case for bugfix (#643)
sql/sp_head.cc:
Forgot to copy a slot from the original lex. (bug #643)
mysql-test/r/sp.result:
New test (of more call levels).
mysql-test/t/sp.test:
New test (of more call levels).
sql/mysql_priv.h:
SPs wants to init lex only.
sql/sp.cc:
Restore lex pointer (and fixed memory leak).
sql/sp_head.cc:
lex is now a pointer, so reset things the right way.
sql/sp_head.h:
lex is now a pointer.
sql/sql_lex.h:
SPs wants to init lex only.
sql/sql_parse.cc:
SPs wants to init lex only.
sql/sql_prepare.cc:
Restore lex pointer.
into eagle.mysql.r18.ru:/home/vva/work/LEX_PTR/mysql-5.0
sql/sp.cc:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
Fixed bug #320.
Some new tests and cosmetic changes.
Another strcasecmp() replaced.
mysql-test/r/sp.result:
Moved SP tests from subselect and added some more.
mysql-test/r/subselect.result:
Moved SP tests to sp.test.
mysql-test/t/sp.test:
Moved SP tests from subselect and added some more.
mysql-test/t/subselect.test:
Moved SP tests to sp.test.
sql/sp.cc:
Don't close derived tables.
sql/sp_head.cc:
Minor layout and comment fix.
sql/sp_head.h:
Minor comment fix.
sql/sql_derived.cc:
Don't set org_table_list->derived to 1 when debugging, as this breaks certain
subselect args to SPs.
sql/sql_parse.cc:
Post-fix of bugfix (free memory on error), and added comment.
sql/sql_yacc.yy:
Another strcasecmp() replaced.
BitKeeper/etc/ignore:
Added libmysqld/sp_pcontext.cc libmysqld/sp.cc libmysqld/sp_head.cc to the ignore list
mysql-test/r/subselect.result:
test of subselect in procedure argument list
mysql-test/t/subselect.test:
test of subselect in procedure argument list
sql/sp_head.cc:
subselect in procedure argument list
sql/sql_parse.cc:
subselect in procedure argument list
This included bug fixes in the 4.1 protocol (actually send and receive the
server_status flags).
libmysql/libmysql.c:
Pick up the server_status (with the 4.1 protocol) as well.
mysql-test/r/sp-error.result:
Test for "bad selects" in non-CLIENT_MULTI_QUERIES clients (as mysqltest for the
momen; this test will have to go away eventually).
mysql-test/t/sp-error.test:
Test for "bad selects" in non-CLIENT_MULTI_QUERIES clients (as mysqltest for the
momen; this test will have to go away eventually).
sql/protocol.cc:
Actually send the server_status flags in send_eof() (4.1 protocol), not just zero.
sql/sp_head.cc:
Made multiple queries (SELECT without INTO) work in SPs.
sql/sp_head.h:
Made multiple queries (SELECT without INTO) work in SPs.
sql/sql_parse.cc:
Made multiple queries (SELECT without INTO) work in SPs.
sql/sql_yacc.yy:
Made multiple queries (SELECT without INTO) work in SPs.
Fixes bug #280.
include/mysqld_error.h:
Check the number of args to SPs.
mysql-test/r/sp-error.result:
Check the number of args to SPs.
mysql-test/t/sp-error.test:
Check the number of args to SPs.
sql/share/czech/errmsg.txt:
Check the number of args to SPs.
sql/share/danish/errmsg.txt:
Check the number of args to SPs.
sql/share/dutch/errmsg.txt:
Check the number of args to SPs.
sql/share/english/errmsg.txt:
Check the number of args to SPs.
sql/share/estonian/errmsg.txt:
Check the number of args to SPs.
sql/share/french/errmsg.txt:
Check the number of args to SPs.
sql/share/german/errmsg.txt:
Check the number of args to SPs.
sql/share/greek/errmsg.txt:
Check the number of args to SPs.
sql/share/hungarian/errmsg.txt:
Check the number of args to SPs.
sql/share/italian/errmsg.txt:
Check the number of args to SPs.
sql/share/japanese/errmsg.txt:
Check the number of args to SPs.
sql/share/korean/errmsg.txt:
Check the number of args to SPs.
sql/share/norwegian-ny/errmsg.txt:
Check the number of args to SPs.
sql/share/norwegian/errmsg.txt:
Check the number of args to SPs.
sql/share/polish/errmsg.txt:
Check the number of args to SPs.
sql/share/portuguese/errmsg.txt:
Check the number of args to SPs.
sql/share/romanian/errmsg.txt:
Check the number of args to SPs.
sql/share/russian/errmsg.txt:
Check the number of args to SPs.
sql/share/serbian/errmsg.txt:
Check the number of args to SPs.
sql/share/slovak/errmsg.txt:
Check the number of args to SPs.
sql/share/spanish/errmsg.txt:
Check the number of args to SPs.
sql/share/swedish/errmsg.txt:
Check the number of args to SPs.
sql/share/ukrainian/errmsg.txt:
Check the number of args to SPs.
sql/sp_head.cc:
Check the number of args to SPs.
sql/sp.cc:
Fixed clear_function_cache bug that made memory freeing work for functions too.
sql/sp_head.cc:
Added more DBUG output to help finding memory leak.
sql/sql_parse.cc:
Moved sp_clear_function_cache call so it *works*.
Added missing memory freeing call.
Disabled queries in FUNCTIONs.
include/mysqld_error.h:
New error message for queries in FUNCTIONs.
mysql-test/t/sp.test:
Moved error tests to sp-error.test.
sql/share/czech/errmsg.txt:
New error message for queries in FUNCTIONs.
Improved most of the SP error messages with added info.
sql/share/danish/errmsg.txt:
New error message for queries in FUNCTIONs.
Improved most of the SP error messages with added info.
sql/share/dutch/errmsg.txt:
New error message for queries in FUNCTIONs.
Improved most of the SP error messages with added info.
sql/share/english/errmsg.txt:
New error message for queries in FUNCTIONs.
Improved most of the SP error messages with added info.
sql/share/estonian/errmsg.txt:
New error message for queries in FUNCTIONs.
Improved most of the SP error messages with added info.
sql/share/french/errmsg.txt:
New error message for queries in FUNCTIONs.
Improved most of the SP error messages with added info.
sql/share/german/errmsg.txt:
New error message for queries in FUNCTIONs.
Improved most of the SP error messages with added info.
sql/share/greek/errmsg.txt:
New error message for queries in FUNCTIONs.
Improved most of the SP error messages with added info.
sql/share/hungarian/errmsg.txt:
New error message for queries in FUNCTIONs.
Improved most of the SP error messages with added info.
sql/share/italian/errmsg.txt:
New error message for queries in FUNCTIONs.
Improved most of the SP error messages with added info.
sql/share/japanese/errmsg.txt:
New error message for queries in FUNCTIONs.
Improved most of the SP error messages with added info.
sql/share/korean/errmsg.txt:
New error message for queries in FUNCTIONs.
Improved most of the SP error messages with added info.
sql/share/norwegian-ny/errmsg.txt:
New error message for queries in FUNCTIONs.
Improved most of the SP error messages with added info.
sql/share/norwegian/errmsg.txt:
New error message for queries in FUNCTIONs.
Improved most of the SP error messages with added info.
sql/share/polish/errmsg.txt:
New error message for queries in FUNCTIONs.
Improved most of the SP error messages with added info.
sql/share/portuguese/errmsg.txt:
New error message for queries in FUNCTIONs.
Improved most of the SP error messages with added info.
sql/share/romanian/errmsg.txt:
New error message for queries in FUNCTIONs.
Improved most of the SP error messages with added info.
sql/share/russian/errmsg.txt:
New error message for queries in FUNCTIONs.
Improved most of the SP error messages with added info.
sql/share/serbian/errmsg.txt:
New error message for queries in FUNCTIONs.
Improved most of the SP error messages with added info.
sql/share/slovak/errmsg.txt:
New error message for queries in FUNCTIONs.
Improved most of the SP error messages with added info.
sql/share/spanish/errmsg.txt:
New error message for queries in FUNCTIONs.
Improved most of the SP error messages with added info.
sql/share/swedish/errmsg.txt:
New error message for queries in FUNCTIONs.
Improved most of the SP error messages with added info.
sql/share/ukrainian/errmsg.txt:
New error message for queries in FUNCTIONs.
Improved most of the SP error messages with added info.
sql/sp_head.cc:
Added debug output to sp_instr_jump::execute(). (Moved from sp_head.h)
sql/sp_head.h:
Moved sp_instr_jump::execute() to sp_head.cc.
sql/sql_lex.h:
Added SQLCOM_CREATE_SPFUNCTION (for improved error handling).
sql/sql_parse.cc:
Improved error handling regarding SPs (adding info like names etc in output).
sql/sql_yacc.yy:
Improved error handling regarding SPs (adding info like names etc in output).
Disabled queries in FUNCTIONS (since it can't work anyway).
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.
mysql-test/r/show_check.result:
proc table now shows up in different places.
mysql-test/r/status.result:
proc table now shows up in different places.
sql/sp.cc:
Fixed closing of tables.
sql/sp_head.cc:
Close tables after each sub statement.
sql/sql_class.cc:
Removed closing of tables in various send_eof() methods again.
but still strange interferences between multiple function invocations...
mysql-test/r/sp.result:
New FUNCTION tests.
mysql-test/t/sp.test:
New FUNCTION tests.
sql/item_func.cc:
Fixed field_type bug; now string functions work too.
Removed unecessary function which was added in a state of confusion.
sql/item_func.h:
Fixed field_type bug; now string functions work too.
Removed unecessary function which was added in a state of confusion.
sql/sp_head.cc:
Fixed string type bug, and set the right charset.
various known problems, but good enough for a checkpoint commit.
mysql-test/r/sp.result:
New tests for invoking simple FUNCTIONs.
mysql-test/t/sp.test:
New tests for invoking simple FUNCTIONs.
sql/item_func.cc:
New Item_func_sp for stored FUNCTIONs.
sql/item_func.h:
New Item_func_sp for stored FUNCTIONs.
sql/sp.cc:
Close mysql.proc table earlier so recursive find_function calls work.
Added temporary sp_function_exists() function for checking without parsing.
sql/sp.h:
Added temporary sp_function_exists() function for checking without parsing.
sql/sp_head.cc:
New code for executing a FUNCTION. (And reworked some of the old code in the process.)
sql/sp_head.h:
New code for executing a FUNCTION.
sql/sp_rcontext.h:
Added result slot for FUNCTIONs.
sql/sql_lex.cc:
Added check for stored FUNCTION, analogous to UDFs.
sql/sql_parse.cc:
sp_head::execute was renamed into execute_procedure.
sql/sql_yacc.yy:
Added parsing of stored FUNCTION invocation and code generation for RETURN statement.
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...
Docs/sp-implemented.txt:
Updated with info about CASCADE/RESTICT and METHOD, and some answers to questions.
include/mysqld_error.h:
New error message for misuse of RETURN.
mysql-test/install_test_db.sh:
Added enum field to mysql.proc to distinguish between FUNCTION and PROCEDURE.
mysql-test/r/sp.result:
New test for creating and dropping FUNCTIONS.
mysql-test/t/sp.test:
New test for creating and dropping FUNCTIONS.
scripts/mysql_install_db.sh:
Added enum field to mysql.proc to distinguish between FUNCTION and PROCEDURE.
sql/lex.h:
De-UDFed some symbol names, as they are now used for SPs as well.
Added RETURN_SYM.
sql/share/czech/errmsg.txt:
New error message for misuse of RETURN.
sql/share/danish/errmsg.txt:
New error message for misuse of RETURN.
sql/share/dutch/errmsg.txt:
New error message for misuse of RETURN.
sql/share/english/errmsg.txt:
New error message for misuse of RETURN.
sql/share/estonian/errmsg.txt:
New error message for misuse of RETURN.
sql/share/french/errmsg.txt:
New error message for misuse of RETURN.
sql/share/german/errmsg.txt:
New error message for misuse of RETURN.
sql/share/greek/errmsg.txt:
New error message for misuse of RETURN.
sql/share/hungarian/errmsg.txt:
New error message for misuse of RETURN.
sql/share/italian/errmsg.txt:
New error message for misuse of RETURN.
sql/share/japanese/errmsg.txt:
New error message for misuse of RETURN.
sql/share/korean/errmsg.txt:
New error message for misuse of RETURN.
sql/share/norwegian-ny/errmsg.txt:
New error message for misuse of RETURN.
sql/share/norwegian/errmsg.txt:
New error message for misuse of RETURN.
sql/share/polish/errmsg.txt:
New error message for misuse of RETURN.
sql/share/portuguese/errmsg.txt:
New error message for misuse of RETURN.
sql/share/romanian/errmsg.txt:
New error message for misuse of RETURN.
sql/share/russian/errmsg.txt:
New error message for misuse of RETURN.
sql/share/serbian/errmsg.txt:
New error message for misuse of RETURN.
sql/share/slovak/errmsg.txt:
New error message for misuse of RETURN.
sql/share/spanish/errmsg.txt:
New error message for misuse of RETURN.
sql/share/swedish/errmsg.txt:
New error message for misuse of RETURN.
sql/share/ukrainian/errmsg.txt:
New error message for misuse of RETURN.
sql/sp.cc:
Major rehack to accomodate FUNCTIONs, and to make it easier to add
future in-memory cache of prepared SPs.
sql/sp.h:
Major rehack to accomodate FUNCTIONs, and to make it easier to add
future in-memory cache of prepared SPs.
sql/sp_head.cc:
Now creates FUNCTIONs too. (And got rid of some unnecessary Item_string use.)
sql/sp_head.h:
Now creates FUNCTIONs too. (And got rid of some unnecessary Item_string use.)
sql/sql_lex.h:
New stored FUNCTION commands.
sql/sql_parse.cc:
Added FUNCTION support ("drop" merged with the old UDF code), and made some
additional changes for better error handling (following the sp.cc rehacking).
sql/sql_yacc.yy:
Some former UDF specific symbols renamed.
Added CREATE FUNCTION parsing.
DROP FUNCTION had to be partly merged with the old UDF code, because of the similar
syntax.
RETURN statement added, but still a no-op.
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...
sql/sp.cc:
Added DBUG statements.
sql/sp_head.cc:
Added DBUG statements.
sql/sql_parse.cc:
Changed returns into DBUG_RETURNs in mysql_execute_command().
sql/sql_yacc.yy:
Small optimization: Don't generate sp_instr_stmt instructions for empty
SET_OPTIONs. (Which happened if there were only local variables in the SET
statement.)
sql/sp_head.cc:
Fixed crash bug when certain procedures are called from the top level.
Attempted to support global user vars as OUT/INOUT parameters too, but
unfortunately we can't quite manage that yet.
include/mysqld_error.h:
Added error codes for SPs
sql/mysql_priv.h:
Changed return value of mysql_execute_command() from void to int; need to be able
to detect if executions of substatements in SPs failed.
sql/share/czech/errmsg.txt:
Added error messages for SPs.
sql/share/danish/errmsg.txt:
Added error messages for SPs.
sql/share/dutch/errmsg.txt:
Added error messages for SPs.
sql/share/english/errmsg.txt:
Added error messages for SPs.
sql/share/estonian/errmsg.txt:
Added error messages for SPs.
sql/share/french/errmsg.txt:
Added error messages for SPs.
sql/share/german/errmsg.txt:
Added error messages for SPs.
sql/share/greek/errmsg.txt:
Added error messages for SPs.
sql/share/hungarian/errmsg.txt:
Added error messages for SPs.
sql/share/italian/errmsg.txt:
Added error messages for SPs.
sql/share/japanese/errmsg.txt:
Added error messages for SPs.
sql/share/korean/errmsg.txt:
Added error messages for SPs.
sql/share/norwegian-ny/errmsg.txt:
Added error messages for SPs.
sql/share/norwegian/errmsg.txt:
Added error messages for SPs.
sql/share/polish/errmsg.txt:
Added error messages for SPs.
sql/share/portuguese/errmsg.txt:
Added error messages for SPs.
sql/share/romanian/errmsg.txt:
Added error messages for SPs.
sql/share/russian/errmsg.txt:
Added error messages for SPs.
sql/share/serbian/errmsg.txt:
Added error messages for SPs.
sql/share/slovak/errmsg.txt:
Added error messages for SPs.
sql/share/spanish/errmsg.txt:
Added error messages for SPs.
sql/share/swedish/errmsg.txt:
Added error messages for SPs.
sql/share/ukrainian/errmsg.txt:
Added error messages for SPs.
sql/sp_head.cc:
Moved net.no_send_ok fiddling to sql_parse.cc.
Check if mysql_execute_command() failed.
sql/sql_parse.cc:
Changed return value of mysql_execute_command() from void to int; need to be able
to detect if executions of substatements in SPs failed. Fixed all returns
accordingly.
Added error checks for SQLCOM_CREATE_PROCEDURE, CALL, ALTER_PROCEDURE, and
DROP_PROCEDURE.
sql/sp_head.cc:
Renamed m_mylex into m_call_lex.
Fixed some data collection.
sql/sp_head.h:
Renamed m_mylex into m_call_lex.
Put called procedures and used tables in class member vars (for now at least).
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.
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.
Fixed eval bug; now conditions with local variables work in WHILE et al.
Made mysql_install_db.sh create proc table.
scripts/mysql_install_db.sh:
Added creation of the mysql.proc table.
Note: The table format will change later, right now it's rather minimalistic,
just so things can be tested (and the database can easily be recreated when
I break it :-/ ).
sql/item.h:
Removed unused method.
sql/sp_head.cc:
Added collection of called procedures in a list.
Fixed eval bug; now conditions with local variables work in WHILE et al.
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.)
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.
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).
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...)
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....