Commit graph

662 commits

Author SHA1 Message Date
unknown
8a9422bd2a Made FUNCTIONs work in insert and select queries, as well as nested function invocations.
Had to add a cahing mechanism which is in parts an ugly kludge, but it will be
reworked once the real SP caching is implemented.


mysql-test/r/sp.result:
  New function tests.
mysql-test/t/sp.test:
  New function tests.
sql/sp.cc:
  Big rehack of mysql.proc table usage strategy and adding a function cache
  mechanism, since we need to read used functions from the db before doing anything else
  when executing a query. (This cache is temporary and will probably be replaced by
  the real thing later.)
sql/sp.h:
  New (temporary) FUNCTION caching functions.
sql/sp_head.cc:
  Fixed some bugs in the function and procedure execution.
  Disabled some data collections that's not used at the moment.
sql/sp_head.h:
  Fixed some bugs in the function and procedure execution.
  Disabled some data collections that's not used at the moment.
sql/sql_class.h:
  Added SP function cache list to thd.
sql/sql_lex.cc:
  Added SP function name list to lex.
sql/sql_lex.h:
  Added SP function name list to lex.
sql/sql_parse.cc:
  Read used FUNCTIONs from db and cache them in thd before doing anything else
  in a query execution. (This is necessary since we can't open mysql.proc during
  query execution.)
sql/sql_yacc.yy:
  Collect used function names in lex.
2003-03-02 19:17:41 +01:00
unknown
aecc6a21bd A small step forward. Fixed a few bugs and made string type functions work,
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.
2003-02-27 19:08:52 +01:00
unknown
76b037dc42 Made stored FUNCTION invokation work almost always. Still buggy and unstable, and
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.
2003-02-26 19:22:29 +01:00
unknown
0521fb5444 Most of the groundwork for sprint task 729 (implement FUNCTIONs).
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.
2003-02-21 17:37:05 +01:00
unknown
3c88ebdc9d Fixed SELECT INTO OUTFILE/DUMPFILE and stored procedures, and extended and
reorganized the sp.test file.


mysql-test/r/sp.result:
  New results from the reorganized sp.test file.
mysql-test/t/sp.test:
  Reorganized the tests, and added a few new ones. ("fac" and more "select into")
sql/sql_class.cc:
  Unlock tables and set thd->lock=0 in select_export::send_eof() and
  select_dump::send_eof().
  This fixes a problem with an assert() in lock_tables(), and made
  SELECT ... INTO OUTFILE and ... INTO DUMPFILE work in stored procedures.
2003-02-19 12:42:32 +01:00
unknown
f8b7968e04 Added another select into test.
mysql-test/r/sp.result:
  Added another test for select into (mixed variable types), and made into_test
  independent of previous tests.
mysql-test/t/sp.test:
  Added another test for select into (mixed variable types), and made into_test
  independent of previous tests.
2003-02-02 17:41:21 +01:00
unknown
d2b6620621 Merge sinisa@work.mysql.com:/home/bk/mysql-5.0
into sinisa.nasamreza.org:/mnt/work/petica


mysql-test/r/sp.result:
  Auto merged
mysql-test/t/sp.test:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2003-01-28 14:44:13 +02:00
unknown
cbc7570665 Added check for selects without into in SPs, and updated error messages and tests
accordingly.


include/mysqld_error.h:
  Added bad select in SP error (and fixed leave/iterate label mismatch error).
sql/share/czech/errmsg.txt:
  Added bad select in SP error (and fixed leave/iterate label mismatch error).
sql/share/danish/errmsg.txt:
  Added bad select in SP error (and fixed leave/iterate label mismatch error).
sql/share/dutch/errmsg.txt:
  Added bad select in SP error (and fixed leave/iterate label mismatch error).
sql/share/english/errmsg.txt:
  Added bad select in SP error (and fixed leave/iterate label mismatch error).
sql/share/estonian/errmsg.txt:
  Added bad select in SP error (and fixed leave/iterate label mismatch error).
sql/share/french/errmsg.txt:
  Added bad select in SP error (and fixed leave/iterate label mismatch error).
sql/share/german/errmsg.txt:
  Added bad select in SP error (and fixed leave/iterate label mismatch error).
sql/share/greek/errmsg.txt:
  Added bad select in SP error (and fixed leave/iterate label mismatch error).
sql/share/hungarian/errmsg.txt:
  Added bad select in SP error (and fixed leave/iterate label mismatch error).
sql/share/italian/errmsg.txt:
  Added bad select in SP error (and fixed leave/iterate label mismatch error).
sql/share/japanese/errmsg.txt:
  Added bad select in SP error (and fixed leave/iterate label mismatch error).
sql/share/korean/errmsg.txt:
  Added bad select in SP error (and fixed leave/iterate label mismatch error).
sql/share/norwegian-ny/errmsg.txt:
  Added bad select in SP error (and fixed leave/iterate label mismatch error).
sql/share/norwegian/errmsg.txt:
  Added bad select in SP error (and fixed leave/iterate label mismatch error).
sql/share/polish/errmsg.txt:
  Added bad select in SP error (and fixed leave/iterate label mismatch error).
sql/share/portuguese/errmsg.txt:
  Added bad select in SP error (and fixed leave/iterate label mismatch error).
sql/share/romanian/errmsg.txt:
  Added bad select in SP error (and fixed leave/iterate label mismatch error).
sql/share/russian/errmsg.txt:
  Added bad select in SP error (and fixed leave/iterate label mismatch error).
sql/share/serbian/errmsg.txt:
  Added bad select in SP error (and fixed leave/iterate label mismatch error).
sql/share/slovak/errmsg.txt:
  Added bad select in SP error (and fixed leave/iterate label mismatch error).
sql/share/spanish/errmsg.txt:
  Added bad select in SP error (and fixed leave/iterate label mismatch error).
sql/share/swedish/errmsg.txt:
  Added bad select in SP error (and fixed leave/iterate label mismatch error).
sql/share/ukrainian/errmsg.txt:
  Added bad select in SP error (and fixed leave/iterate label mismatch error).
mysql-test/r/sp.result:
  New test for repeat(...) and select with and without into in SPs.
mysql-test/t/sp.test:
  New test for repeat(...) and select with and without into in SPs.
sql/sql_yacc.yy:
  Check if an SP substatement is a SELECT and if so, has an INTO. If not, it's an
  error.
2003-01-23 14:00:32 +01:00
unknown
172dc5b371 solve the lex conflict between the existing repeat() function
and repeat SP-construction
2003-01-23 17:00:31 +04:00
unknown
6d5f7d1c4b Changing some proc names to a more suitable one. 2003-01-20 15:38:35 +02:00
unknown
69047e719a SELECT ... INTO local_vars ...;
For Stored Procedures
2003-01-18 18:21:13 +02:00
unknown
838303a731 Added the Stored Procedure tests.
Removed newly added, but now redundant, test file.



BitKeeper/deleted/.del-mysql_proc.result~63faae2f407c3fc2:
  Delete: mysql-test/r/mysql_proc.result
BitKeeper/deleted/.del-mysql_proc.test~8863f59cfc347469:
  Delete: mysql-test/t/mysql_proc.test
2003-01-17 14:38:05 +01:00