mysql-test/r/sp.result:
New test case for BUG#3583.
(And current query is now set correctly.)
mysql-test/t/sp.test:
New test case for BUG#3583.
sql/sp_head.cc:
Set the thd->query and try to use cached query, if any, when executing a statement.
sql/sp_head.h:
Extract the sub-query and store in sp_instr_stmt.
sql/sql_cache.cc:
Keep the net->pkt_nr up-to-date when using query cache.
This makes it work with stored procedures too.
sql/sql_cache.h:
Keep the net->pkt_nr up-to-date when using query cache.
This makes it work with stored procedures too.
sql/sql_yacc.yy:
Extract the sub-query and store in sp_instr_stmt.
(And it's never safe to cache references to local variables.)
Dropping the table was not the real problem, the problem was with errors
occuring within error handlers.
mysql-test/r/sp-error.result:
New test case for BUG#3294.
mysql-test/t/sp-error.test:
New test case for BUG#3294.
sql/sp_head.cc:
Use hreturn instruction both for continue and exit handlers (a special case
of a jump).
sql/sp_head.h:
Use hreturn instruction both for continue and exit handlers (a special case
of a jump).
sql/sp_rcontext.cc:
Keep track on if we're in a handler already, for error handling.
sql/sp_rcontext.h:
Keep track on if we're in a handler already, for error handling.
sql/sql_yacc.yy:
Use hreturn instruction both for continue and exit handlers (a special case
of a jump).
After review and after merge fixes.
mysql-test/t/trigger.test:
After merge fix. Updated error codes.
sql/sp_head.cc:
After merge fix.
To give some chances for functions/triggers we have to close tables during sp_instr_*
execution only if we have opened them before.
sql/sp_head.h:
After merge fix. sp_instr constructor now takes one more argument.
sql/sql_trigger.cc:
After merge and review fixes.
Some variable renaming and optimizations.
sql/sql_yacc.yy:
After merge fixes.
sp_instr_* classes now require sp context as constructor parameter.
Also we should be careful with adding table for which we are creating trigger to table
list. Some elements in trigger body can damage LEX::query_tables and so we should add this
table to list only after parsing trigger body.
Mostly needed for Monty for him getting notion what needed for triggers
from new .FRM format.
Things to be done:
- Right placement of trigger's invocations
- Right handling of errors in triggers (including transaction rollback)
- Support for priviliges
- Right handling of DROP/RENAME table (hope that it will be handled automatically
with merging of .TRG into .FRM file)
- Saving/restoring some information critical for trigger creation and replication
with their definitions (e.g. sql_mode, creator, ...)
- Replication
Already has some known bugs so probably not for general review.
include/mysqld_error.h:
Added trigger related error codes.
sql/Makefile.am:
Added sql_trigger.* files to list of sources from which mysqld is built.
sql/item.cc:
Added Item_trigger_field class representing field of new/old version of row which is
inserted/updated/deleted and for which trigger is invoked.
sql/item.h:
Added enums for describing trigger properties. (Here because of dependencies).
Added Item_trigger_field class representing field of new/old version of row which is
inserted/updated/deleted and for which trigger is invoked.
sql/item_func.cc:
Added Item_func_set_user_var::print_as_stmt() for printing of assignment to ser variable
from stored procedures.
Added comment clarifying why we don't need set no_send_ok when calling stored functions.
sql/item_func.h:
Added Item_func_set_user_var::print_as_stmt() for printing of assignment to ser variable
from stored procedures.
sql/lex.h:
Symbols used in statements defining triggers were added.
sql/mysql_priv.h:
Exported some functions needed for triggers implementation.
sql/parse_file.cc:
Cleaned up FILE_OPTIONS_STRLIST handling (needed for triggers).
sql/parse_file.h:
Cleaned up FILE_OPTIONS_STRLIST handling (needed for triggers).
sql/share/czech/errmsg.txt:
Added trigger related error messages.
sql/share/danish/errmsg.txt:
Added trigger related error messages.
sql/share/dutch/errmsg.txt:
Added trigger related error messages.
sql/share/english/errmsg.txt:
Added trigger related error messages.
sql/share/estonian/errmsg.txt:
Added trigger related error messages.
sql/share/french/errmsg.txt:
Added trigger related error messages.
sql/share/german/errmsg.txt:
Added trigger related error messages.
sql/share/greek/errmsg.txt:
Added trigger related error messages.
sql/share/hungarian/errmsg.txt:
Added trigger related error messages.
sql/share/italian/errmsg.txt:
Added trigger related error messages.
sql/share/japanese/errmsg.txt:
Added trigger related error messages.
sql/share/korean/errmsg.txt:
Added trigger related error messages.
sql/share/norwegian-ny/errmsg.txt:
Added trigger related error messages.
sql/share/norwegian/errmsg.txt:
Added trigger related error messages.
sql/share/polish/errmsg.txt:
Added trigger related error messages.
sql/share/portuguese/errmsg.txt:
Added trigger related error messages.
sql/share/romanian/errmsg.txt:
Added trigger related error messages.
sql/share/russian/errmsg.txt:
Added trigger related error messages.
sql/share/serbian/errmsg.txt:
Added trigger related error messages.
sql/share/slovak/errmsg.txt:
Added trigger related error messages.
sql/share/spanish/errmsg.txt:
Added trigger related error messages.
sql/share/swedish/errmsg.txt:
Added trigger related error messages.
sql/share/ukrainian/errmsg.txt:
Added trigger related error messages.
sql/sp_head.cc:
sp_head::init_strings(): added support for triggers
(we don't have most of strings for them)
sp_head::execute_function(): triggers don't require RETURN
sp_head::reset_lex(): added propagation of trigger properties to LEX used for
parsing of statements composing trigger body.
Added two more SP instructions:
- sp_instr_set_user_var for setting user variables in stored functions and triggers
(we can't use sp_instr_stmt and "SET @a:=..." statement since it will close open
tables and thus break execution of calling statement.
- sp_instr_set_trigger_field for assignment to fields of row being updated/inserted in
triggers
sql/sp_head.h:
Added new type of sp_head object - TYPE_ENUM_TRIGGER
Added two more SP instructions:
- sp_instr_set_user_var for setting user variables in stored functions and triggers
(we can't use sp_instr_stmt and "SET @a:=..." statement since it will close open
tables and thus break execution of calling statement.
- sp_instr_set_trigger_field for assignment to fields of row being updated/inserted in
triggers
sql/sql_base.cc:
Now freeing memory occupied by trigger related structures when closing tables.
open_unireg_entry(): added loading of triggers for table.
find_field_in_real_table() is now public since it required by Item_trigger_field in item.cc
sql/sql_delete.cc:
Added triggers invocation for DELETE (should be fixed for sure :))
sql/sql_insert.cc:
Added triggers invocation for INSERT (should be fixed for sure :))
sql/sql_lex.cc:
Added trg_new_row_fake_var variable pointer to which is used for distinguishing between
assignment to NEW row field (when parsing trigger definition) and structured variable.
Added initialization of LEX->trg_table to lex_start(). (When triggers are parsed during
opening of table it points to table object.)
sql/sql_lex.h:
Added trigger related commands.
Added st_trg_chistics structure describing properties of trigger being created
(as struct and as LEX member).
Added trg_new_row_fake_var variable pointer to which is used for
distinguishing between assignment to NEW row field (when parsing trigger definition)
and structured variable.
Added LEX::trg_table which points to table being opened when we are parsing trigger
definition while opening table.
sql/sql_parse.cc:
Added support for CREATE/DROP TRIGGER commands.
sql/sql_table.cc:
Cleanup. close_cached_table() always returns 0 and its result is not analyzed in most
places so chenged its return type to void.
sql/sql_update.cc:
Added triggers invocation for UPDATE (should be fixed for sure :))
sql/sql_yacc.yy:
Added support for CREATE/DROP TRIGGER statements.
Added support for OLD/NEW row identifiers in trigger.
Made assignment to user variables not to break execution of stored function or trigger.
sql/table.h:
Added TABLE::triggers member representing triggers for this table.
This finishes (almost) WL#2002: Implement stored procedure GOTO.
Only the syntax issue for free labels remains ("label L;" vs "L:").
include/mysqld_error.h:
New error code for GOTO in SP handler.
mysql-test/r/sp-error.result:
New error test cases for GOTO.
mysql-test/r/sp.result:
New test cases for GOTO.
Also removed some things that made it impossible to run the test in
an external (debugged) mysqld.
mysql-test/t/sp-error.test:
New error test cases for GOTO.
mysql-test/t/sp.test:
New test cases for GOTO.
Also removed some things that made it impossible to run the test in
an external (debugged) mysqld.
sql/share/czech/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/danish/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/dutch/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/english/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/estonian/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/french/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/german/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/greek/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/hungarian/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/italian/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/japanese/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/korean/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/norwegian-ny/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/norwegian/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/polish/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/portuguese/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/romanian/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/russian/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/serbian/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/slovak/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/spanish/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/swedish/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/ukrainian/errmsg.txt:
New error message for GOTO in SP handler.
sql/sp_head.cc:
Code cleanup (renaming of pcontext methods), support goto, and fixed bug
in jump shortcutting in the optimizer (detect infinite loops).
sql/sp_head.h:
Code cleanup (renaming of pcontext methods), support goto, and fixed bug
in jump shortcutting in the optimizer (detect infinite loops).
sql/sp_pcontext.cc:
Major rehack and cleanup:
- We now push and pop a chain of contexts during parsing (instead of having
a single one).
- Makes error detection for GOTO easier and enables some optmizations and
debugger support.
- Makes it a little trickier to keep track on variable and cursor indexes instead.
- Renamed things to get a more consistent naming scheme too.
sql/sp_pcontext.h:
Major rehack and cleanup:
- We now push and pop a chain of contexts during parsing (instead of having
a single one).
- Makes error detection for GOTO easier and enables some optmizations and
debugger support.
- Makes it a little trickier to keep track on variable and cursor indexes instead.
- Renamed things to get a more consistent naming scheme too.
sql/sql_yacc.yy:
Changes to reflect the rework and renamings in sp_pcontext, and fixed
some GOTO error checking.
and BUG#336: Subselects with tables does not work as values for
local SP variables (which was closed before with a temp. fix, but not
actually fixed).
mysql-test/r/sp-error.result:
Moved test case for BUG#336 to sp.test, as it's not generating an error any longer.
mysql-test/r/sp.result:
Move test case for BUG#336 from sp-error.test and added new test case
for BUG#3157.
mysql-test/t/sp-error.test:
Moved test case for BUG#336 to sp.test, as it's not generating an error any longer.
mysql-test/t/sp.test:
Move test case for BUG#336 from sp-error.test and added new test case
for BUG#3157.
sql/sp_head.cc:
Open and close tables in set, jump-if[-not] and freturn instructions if
the value expression is a subselect.
sql/sp_head.h:
Store tables in set, jump-if[-not] and freturn instructions if
the value expression is a subselect.
sql/sql_yacc.yy:
Store tables in set, jump-if[-not] and freturn instructions if
the value expression is a subselect.
Mostly done, it works, but the temporary LABEL syntax still to be fixed.
mysql-test/r/sp-error.result:
New test case for WL#2002 (GOTO).
mysql-test/r/sp.result:
New test case for WL#2002 (GOTO).
(Also corrected another test)
mysql-test/t/sp-error.test:
New test case for WL#2002 (GOTO).
mysql-test/t/sp.test:
New test case for WL#2002 (GOTO).
(Also corrected another test)
sql/lex.h:
New symbol GOTO.
Also a temporary symbol LABEL, which hopefully will go away soon.
sql/sp_head.cc:
Fixed backpatching to cope with free GOTO labels an hpop and cpop instructions.
Also optimized away pointless jump instructions.
sql/sp_head.h:
Fixed backpatching to cope with free GOTO labels an hpop and cpop instructions.
We now sometimes generate hpop/cpop 0 instructions but the optimizer removes them.
sql/sp_pcontext.cc:
Added free GOTO labels, and support for coping with jumps out of blocks
with handlers or cursors.
sql/sp_pcontext.h:
Added free GOTO labels, and support for coping with jumps out of blocks
with handlers or cursors.
sql/sql_yacc.yy:
Added GOTO and LABEL, and adjusted backpatching accordingly. Also fixed LEAVE
out of blocks. The LABEL syntax will go away soon, hopefully.
and tried to do it properly this time, digging out all show commands that
need the multi results flag set.
mysql-test/r/sp.result:
New test case for BUG#4902, with lots of other show commands as well.
mysql-test/t/sp.test:
New test case for BUG#4902, with lots of other show commands as well.
sql/sp_head.cc:
The check for possible multiple result commands was becomming unwieldly,
so we moved it to a separate function, and added loads of new command codes
to the test.
sql/sp_head.h:
The check for possible multiple result commands was becomming unwieldly,
so we moved it to a separate function.
sql/sql_yacc.yy:
The check for possible multiple result commands was becomming unwieldly,
so we moved it to a separate function.
Added a simple optimizer that shortcuts jumps and skip unused instructions.
sql/sp.cc:
Optimize the code after parsing.
sql/sp_head.cc:
Added a simple optimizer that shortcuts jumps and skip unused instructions.
sql/sp_head.h:
Added a simple optimizer that shortcuts jumps and skip unused instructions.
It's not possible to quote the definition according to the current sql_mode
setting, so instead we use the setting stored with the SP (that's how it's
parsed anyway), and show this setting in the SHOW CREATE output.
mysql-test/r/sp.result:
Modifed SHOW CREATE FUNCTION|PROCEDURE output. Show the sql_mode used at
creation as well.
New test case for BUG#2564: SHOW CREATE inconsistent W.R.T ANSI_QUOTES.
mysql-test/t/sp.test:
New test case for BUG#2564: SHOW CREATE inconsistent W.R.T ANSI_QUOTES.
sql/sp.cc:
Rewrote create_string to quote things correctly according to the sql_mode
used at creation time.
sql/sp_head.cc:
Store sql_mode in sp_head and use it for SHOW CREATE.
sql/sp_head.h:
Store sql_mode in sp_head and use it for SHOW CREATE.
mysql-test/r/sp.result:
test suite for Bug #2266
mysql-test/t/sp.test:
test suite for Bug #2266
sql/item_subselect.cc:
made ancestor for Statement (Item_arena)
sql/item_subselect.h:
made ancestor for Statement (Item_arena)
sql/item_sum.cc:
made ancestor for Statement (Item_arena)
sql/item_sum.h:
made ancestor for Statement (Item_arena)
sql/mysql_priv.h:
reset_stmt_for_execute use PS and SP
sql/sp_head.cc:
sp_head use Item_arena as ancestor to be PS cleunup compatible
SP use PS storing/restoring/cleanup mechanisms
cleanup() of SP Items added
Items created in temporary memory pool during SP execution saved for normal freeing after SP execution
sql/sp_head.h:
sp_head use Item_arena
sql/sql_base.cc:
made ancestor for Statement (Item_arena)
results of wild_setup made permanent
setup_conds make natural joins expanding only once and store results in PS/SP memory
sql/sql_class.cc:
made ancestor for Statement (Item_arena)
sql/sql_class.h:
made ancestor for Statement (Item_arena)
method to detect PS preparation added
sql/sql_delete.cc:
storing where for DELETE and mark first execution
sql/sql_derived.cc:
use method
sql/sql_insert.cc:
mark first execution for INSERT
sql/sql_lex.cc:
flags to correctly make transformations of query and storing them in memory of PS/SP
made ancestor for Statement (Item_arena)
sql/sql_lex.h:
reved variable od SP ol saving data
flags to correctly make transformations of query and storing them in memory of PS/SP
sql/sql_parse.cc:
cleunup unit for any query
sql/sql_prepare.cc:
made ancestor for Statement (Item_arena)
storing where moved to preparation
changed interface of reset_stmt_for_execute to use it is SP
do not restore where/order by/group by before first execution (but tables and unit can be chenged without execution and should be prepared (subqueries executes on demand))
sql/sql_select.cc:
storing where for SELECT/multi-DELETE/... and mark first execution
sql/sql_union.cc:
made ancestor for Statement (Item_arena)
sql/sql_update.cc:
storing where for UPDATE and mark first execution
Complex return types were not stored correctly in the mysql.proc table.
mysql-test/r/sp.result:
New testcase for BUG2772.
mysql-test/t/sp.test:
New testcase for BUG2772.
sql/sp_head.cc:
Pick up character set for "returns" types in functions and add it separately,
since it's missed when extracting the type during the parser. (Due to LALR
behaviour.)
sql/sp_head.h:
Save the character set for returns clause in functions.
sql/sql_yacc.yy:
Pick up character set for "returns" types in functions since it's missed otherwise.
(Due to LALR behaviour.)
Backpatching overwrote already backpatched instructions, which made it
skip the hpop instruction; possibly not only a problem for handlers,
but this is one known case when it happened.
mysql-test/r/sp-error.result:
New testcase for BUG#3287
mysql-test/t/sp-error.test:
New testcase for BUG#3287
sql/sp_head.cc:
Made the debug printout of hpush_jump instructions somewhat clearer.
sql/sp_head.h:
Don't backpatch the same instruction more than once.
Added new test cases for this, and adjusted old tests accordingly,
and new error codes and messages.
Fixed bugs in some tests (bug2673 and use test).
Added debug printing of instructions in SPs.
include/mysqld_error.h:
New error codes for non-standard declaration order in SPs.
include/sql_state.h:
New error codes for non-standard declaration order in SPs.
mysql-test/r/sp-error.result:
Enforce standard declaration order.
Fixed syntax error in use-test.
New test cases for wrong order.
mysql-test/r/sp.result:
Enforce strict declaration order.
Fixed platform dependent bug2673 test.
mysql-test/t/sp-error.test:
Enforce standard declaration order.
Fixed syntax error in use-test.
New test cases for wrong order.
mysql-test/t/sp.test:
Enforce strict declaration order.
Fixed platform dependent bug2673 test.
sql/share/czech/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/danish/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/dutch/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/english/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/estonian/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/french/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/german/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/greek/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/hungarian/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/italian/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/japanese/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/korean/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/norwegian-ny/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/norwegian/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/polish/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/portuguese/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/romanian/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/russian/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/serbian/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/slovak/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/spanish/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/swedish/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/share/ukrainian/errmsg.txt:
New error messages for strict (standard) declaration order in SPs.
sql/sp_head.cc:
Debug printing of instructions in procedures.
New error instruction for future use.
sql/sp_head.h:
Debug printing of instructions in procedures.
New error instruction for future use.
sql/sql_string.cc:
New methods needed by debug printing of instruction in SPs.
sql/sql_string.h:
New methods needed by debug printing of instruction in SPs.
sql/sql_yacc.yy:
Check for standard order of declarations in SPs.
Phase 2: Make SPs belong to a DB, and use qualified names.
As a side effect, using USE in an SP is no longer allowed.
(It just doesn't work otherwise.)
include/mysqld_error.h:
New error code (USE is no longer allowed in a stored procedure).
include/sql_state.h:
New error state (USE is no longer allowed in a stored procedure).
mysql-test/r/sp-error.result:
Updated result for test of USE in SP (not allowed now).
mysql-test/r/sp-security.result:
Updated test results for new db column and qualified procedured names.
mysql-test/r/sp.result:
Updated results for USE in SP (as it's no longer allowed), and
for new db column in status result.
mysql-test/t/sp-error.test:
Moved test of USE in SP from sp.test (as it's no longer allowed).
mysql-test/t/sp-security.test:
Ajusted tests for new db column and qualified procedured names.
mysql-test/t/sp.test:
Moved test of USE in SP to sp-error.test (as it's no longer allowed).
Adjusted tests for new db column in status result.
sql/mysql_priv.h:
mysql_change_db() now has optional arguments for use by SP with qualified names.
sql/share/czech/errmsg.txt:
New error message: USE is not allowed in a stored procedure.
sql/share/danish/errmsg.txt:
New error message: USE is not allowed in a stored procedure.
sql/share/dutch/errmsg.txt:
New error message: USE is not allowed in a stored procedure.
sql/share/english/errmsg.txt:
New error message: USE is not allowed in a stored procedure.
sql/share/estonian/errmsg.txt:
New error message: USE is not allowed in a stored procedure.
sql/share/french/errmsg.txt:
New error message: USE is not allowed in a stored procedure.
sql/share/german/errmsg.txt:
New error message: USE is not allowed in a stored procedure.
sql/share/greek/errmsg.txt:
New error message: USE is not allowed in a stored procedure.
sql/share/hungarian/errmsg.txt:
New error message: USE is not allowed in a stored procedure.
sql/share/italian/errmsg.txt:
New error message: USE is not allowed in a stored procedure.
sql/share/japanese/errmsg.txt:
New error message: USE is not allowed in a stored procedure.
sql/share/korean/errmsg.txt:
New error message: USE is not allowed in a stored procedure.
sql/share/norwegian-ny/errmsg.txt:
New error message: USE is not allowed in a stored procedure.
sql/share/norwegian/errmsg.txt:
New error message: USE is not allowed in a stored procedure.
sql/share/polish/errmsg.txt:
New error message: USE is not allowed in a stored procedure.
sql/share/portuguese/errmsg.txt:
New error message: USE is not allowed in a stored procedure.
sql/share/romanian/errmsg.txt:
New error message: USE is not allowed in a stored procedure.
sql/share/russian/errmsg.txt:
New error message: USE is not allowed in a stored procedure.
sql/share/serbian/errmsg.txt:
New error message: USE is not allowed in a stored procedure.
sql/share/slovak/errmsg.txt:
New error message: USE is not allowed in a stored procedure.
sql/share/spanish/errmsg.txt:
New error message: USE is not allowed in a stored procedure.
sql/share/swedish/errmsg.txt:
New error message: USE is not allowed in a stored procedure.
sql/share/ukrainian/errmsg.txt:
New error message: USE is not allowed in a stored procedure.
sql/sp.cc:
SPs are now "belong" to a DB and may have qualified names.
New functions for changing DB ("use") when parsing and invoking SPs.
sql/sp.h:
New functions for changing DB ("use") when parsing and invoking SPs.
sql/sp_cache.cc:
Use the qualified name in the SP cache.
sql/sp_head.cc:
New function for allocating a qualified SP name (used in sql_yacc.yy).
Change DB when executing an SP (if needed).
Moved thd_mem_root swap functions from sp_head.h.
sql/sp_head.h:
New function for allocating a qualified SP name (used in sql_yacc.yy).
Moved thd_mem_root swap functions to sp_head.cc.
sql/sql_db.cc:
mysql_change_db() now has optional arguments for use by SP with qualified names
(for use when reading an SP from database and executing it); also allow "unusing"
a database, i.e. setting thd->thd to "".
sql/sql_yacc.yy:
Initialize qualfied SP names correctly.
USE is no longer allowed in an SP.
Phase 1: Introduced sp_name class, for qualified name support.
sql/item_func.cc:
Introduced sp_name class; moved some methods from item_func.h.
sql/item_func.h:
Introduced sp_name class; moved some methods to item_func.cc.
sql/sp.cc:
Introduced sp_name class, for qualified name support.
sql/sp.h:
Introduced sp_name class, for qualified name support.
sql/sp_cache.cc:
Introduced sp_name class, for qualified name support.
sql/sp_cache.h:
Introduced sp_name class, for qualified name support.
sql/sp_head.cc:
Introduced sp_name class, for qualified name support.
sql/sp_head.h:
Introduced sp_name class, for qualified name support.
sql/sql_lex.h:
Introduced sp_name class, for qualified name support.
sql/sql_parse.cc:
Introduced sp_name class, for qualified name support.
sql/sql_yacc.yy:
Introduced sp_name class, for qualified name support.
Added missing cleanup in sp-security.test.
mysql-test/r/sp-security.result:
Added clean-up.
mysql-test/t/sp-security.test:
Added clean-up.
sql/item_func.cc:
Forgot to wrap things in #ifndef NO_EMBEDDED_ACCESS_CHECKS for the embedded server.
sql/sp_head.cc:
Forgot to wrap things in #ifndef NO_EMBEDDED_ACCESS_CHECKS for the embedded server.
sql/sp_head.h:
Forgot to wrap things in #ifndef NO_EMBEDDED_ACCESS_CHECKS for the embedded server.
sql/sql_parse.cc:
Forgot to wrap things in #ifndef NO_EMBEDDED_ACCESS_CHECKS for the embedded server.
sql/sp.cc:
Fixed memory leaks. Deletion of sps now in sp_cache.
sql/sp_cache.cc:
Fixed memory leaks. Use implicit delete of objects to make sure
they're always freed.
sql/sp_cache.h:
Fixed memory leaks. Use implicit delete of objects to make sure
they're always freed.
sql/sp_head.cc:
Fixed memory leaks. Make sure we use the right mem_root during parsing.
sql/sp_head.h:
Fixed memory leaks. Make sure we use the right mem_root during parsing.
sql/sql_parse.cc:
Fixed memory leaks. Don't forget to free the temporary object created at definition.
sql/sql_yacc.yy:
Fixed memory leaks. Make sure we use the right mem_root during parsing.
(Also put the hostpart back in the definer column.)
mysql-test/r/sp-error.result:
Moved error test from sp.test
mysql-test/r/sp.result:
Moved error test to sp-error.test.
Put hostpart back into definer column in mysql.proc.
mysql-test/t/sp-error.test:
Moved error test from sp.test
mysql-test/t/sp.test:
Moved error test to sp-error.test.
Put hostpart back into definer column in mysql.proc.
sql/item_func.cc:
(Maybe) switch security context before invoking a stored function.
sql/sp.cc:
Renamed creator into definer, for more consistent terminology, and put the
hostpart back.
sql/sp_head.cc:
Some fixes in the way things are allocated, and moved set_info() definition
here from sp_head.h. creator is now called definer, and is split into a
user and host part.
Added functions for (possible) change and restore of privileges, for sql security
definer calls.
sql/sp_head.h:
Moved set_info() definition here from sp_head.h.
creator is now called definer, and is split into a user and host part.
Added functions for (possible) change and restore of privileges, for sql security
definer calls.
sql/sql_acl.cc:
New function acl_getroot_no_password() for getting the privileges used when
calling an SP with sql security definer.
sql/sql_acl.h:
New function acl_getroot_no_password() for getting the privileges used when
calling an SP with sql security definer.
sql/sql_parse.cc:
(Maybe) switch security context before invoking a stored procedure.
sql/sql_yacc.yy:
Fixed typo.
make characteristics (and SHOW) work right, we had to separate the old
definition blob in the mysql.proc table into separate fields for parameters,
return type, and body, and handle the characteristics (like SQL SECURITY)
separately... and then reassemble the CREATE string for parsing, of course.
This is rather ugly, mostly the parser bit. (Hopefully that will be better
with the new parser.)
Docs/sp-imp-spec.txt:
Separated the definitions string of the procedure into different columns
in the mysql.proc schema.
mysql-test/r/sp.result:
New characteristics tests.
mysql-test/t/sp.test:
New characteristics tests.
scripts/mysql_create_system_tables.sh:
Separated the definitions string of the procedure into different columns
in the mysql.proc schema.
scripts/mysql_fix_privilege_tables.sql:
Separated the definitions string of the procedure into different columns
in the mysql.proc schema.
sql/sp.cc:
Separated the definitions string of the procedure into different columns.
Rewrote much of the code related this (have a assemble the definition
string from its different parts now) and the way characteristics are now
handled, in order to make ALTER actually work.
sql/sp.h:
Changed prototypes.
sql/sp_head.cc:
Rewrote much of the code related to the new mysql.proc schema with separate
definition fields (have to assemble the definition string from its different
parts now) and the way characteristics are now handled, in order to make ALTER
actually work.
sql/sp_head.h:
Separated the different parts of the definition strings: name, parameters,
return type (for functions) and body.
sql/sql_yacc.yy:
Separated the different parts of the definition strings: name, parameters,
return type (for functions) and body.
This is ugly and messy; hopefully there's a more elegant way to do this
when the new parser is installed.
Also made the parsing and handling of SP characteristics
more general and extendable, and added a few ch:istics.
Docs/sp-imp-spec.txt:
Updated spec with new schema.
Docs/sp-implemented.txt:
Added info about ALTER and SHOW.
mysql-test/r/sp.result:
Minor change in SHOW FUNCTION|PROCEDURE STATUS output.
scripts/mysql_create_system_tables.sh:
New mysql.proc schema.
scripts/mysql_fix_privilege_tables.sql:
New mysql.proc schema.
sql/lex.h:
New lex words for SP characteristics.
sql/sp.cc:
New mysql.proc schema.
Also made the characteristics handling slightly more extendable.
sql/sp.h:
Made the characteristics handling slightly more extendable.
sql/sp_head.cc:
Made the characteristics handling slightly more extendable.
sql/sp_head.h:
Made the characteristics handling slightly more extendable.
sql/sql_lex.h:
Made the characteristics handling slightly more extendable.
sql/sql_parse.cc:
Made the characteristics handling slightly more extendable.
sql/sql_yacc.yy:
Made the characteristics handling slightly more extendable
and made the parsing of characteristics more general, and
added a few new dito. (LANGUAGE SQL, and [NOT] DETERMINISTIC
for starters).
WL#1263: Support for the attributes COMMENT and SUID
in CREATE/ALTER PROCEDURE/FUNCTION
include/mysqld_error.h:
Error code for 'alter procedure'
mysql-test/r/sp-error.result:
Test for WL#1241&WL#1263
mysql-test/r/sp.result:
Test for WL#1241&WL#1263
mysql-test/t/sp-error.test:
Test for WL#1241&WL#1263
mysql-test/t/sp.test:
Test for WL#1241&WL#1263
sql/share/czech/errmsg.txt:
Error massage for 'alter procedure'
sql/share/danish/errmsg.txt:
Error massage for 'alter procedure'
sql/share/dutch/errmsg.txt:
Error massage for 'alter procedure'
sql/share/english/errmsg.txt:
Error massage for 'alter procedure'
sql/share/estonian/errmsg.txt:
Error massage for 'alter procedure'
sql/share/french/errmsg.txt:
Error massage for 'alter procedure'
sql/share/german/errmsg.txt:
Error massage for 'alter procedure'
sql/share/greek/errmsg.txt:
Error massage for 'alter procedure'
sql/share/hungarian/errmsg.txt:
Error massage for 'alter procedure'
sql/share/italian/errmsg.txt:
Error massage for 'alter procedure'
sql/share/japanese/errmsg.txt:
Error massage for 'alter procedure'
sql/share/korean/errmsg.txt:
Error massage for 'alter procedure'
sql/share/norwegian-ny/errmsg.txt:
Error massage for 'alter procedure'
sql/share/norwegian/errmsg.txt:
Error massage for 'alter procedure'
sql/share/polish/errmsg.txt:
Error massage for 'alter procedure'
sql/share/portuguese/errmsg.txt:
Error massage for 'alter procedure'
sql/share/romanian/errmsg.txt:
Error massage for 'alter procedure'
sql/share/russian/errmsg.txt:
Error massage for 'alter procedure'
sql/share/serbian/errmsg.txt:
Error massage for 'alter procedure'
sql/share/slovak/errmsg.txt:
Error massage for 'alter procedure'
sql/share/spanish/errmsg.txt:
Error massage for 'alter procedure'
sql/share/swedish/errmsg.txt:
Error massage for 'alter procedure'
sql/share/ukrainian/errmsg.txt:
Error massage for 'alter procedure'
(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.
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.
using a hash table instead (and made it work with lex pointers).
Some additional code cleanup too.
sql/sp.cc:
Fixed the old kludge for pre-loading functions and made it more efficient
using a hash table instead (and made it work with lex pointers).
Some additional cleanup of comments too.
sql/sp_head.h:
Some additional code cleanup.
sql/sql_lex.cc:
Use hash table for function pre-loading (isntead of list).
sql/sql_lex.h:
Use hash table for function pre-loading (isntead of list).
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.
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.
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.
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.
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.
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.
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 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.)
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...)