Commit graph

73 commits

Author SHA1 Message Date
unknown
ae28b3bd07 Fixed BUG#10969: Stored procedures: crash if default() function
Return an error if default() is used on a local variable.
  This is actaully a side-effect of BUG#5967: Stored procedure declared
  variable used instead of column (to be fixed later), so this is really a
  workaround until that is fixed.


mysql-test/r/sp-error.result:
  New test case for BUG#10969.
mysql-test/t/sp-error.test:
  New test case for BUG#10969.
sql/item.h:
  Get name of local variable for error messages.
sql/sql_yacc.yy:
  Return an error if default() is applied on a local SP variable.
2005-06-01 15:42:40 +02:00
unknown
3f7b0f708e Fixed BUG#9529: Stored Procedures: No Warning on truncation of procedure name
during creation.
  Although it returns an error, consistent with the behaviour for other objects.
  (Unclear why we would allow the creation of SPs with truncated names.)


mysql-test/r/sp-error.result:
  New test case for BUG#9529.
mysql-test/t/sp-error.test:
  New test case for BUG#9529.
sql/sp.cc:
  Check SP name length on creation (and drop).
sql/sp.h:
  New status code for bad (too long) name.
sql/sql_parse.cc:
  New status code for bad (too long) name.
2005-05-31 18:36:32 +02:00
unknown
166accffda Fixed BUG#8409: Stored procedure crash if function contains FLUSH
by simply disabling FLUSH for stored functions. (I can't really work.)


mysql-test/r/sp-error.result:
  New test case for BUG#8409.
mysql-test/t/sp-error.test:
  New test case for BUG#8409.
sql/sql_yacc.yy:
  Disable FLUSH for stored functions.
2005-05-27 16:19:25 +02:00
unknown
2a5a3de285 Fixed BUG#10537: Server crashes while loading data file into table through
procedure.
  by simply disabling 'load' in stored procedures, like it's already disabled
  for prepared statements. (They must be made "re-execution" safe before
  working with either PS or SP.)


mysql-test/r/sp-error.result:
  New test case for BUG#10537.
mysql-test/t/sp-error.test:
  New test case for BUG#10537.
sql/sql_yacc.yy:
  Disable LOAD in stored procedures (just as for prepared statements).
2005-05-20 17:47:08 +02:00
unknown
5c44e1acfe Post-review fixes of the patch for BUG#8408: Stored procedure crash if function contains SHOW
(Review on irc by monty)


mysql-test/r/sp-error.result:
  Renamed a procedure and function to avoid confusion
mysql-test/t/sp-error.test:
  Renamed a procedure and function to avoid confusion
sql/item_func.cc:
  Corrected (and better) way to set/reset the client cap. flag in Item_func_sp::execute()
sql/share/errmsg.txt:
  Changed the ER_SP_BADSELECT error; more accurate, and includes the procedure name.
sql/sql_parse.cc:
  Include the procedure name in the new error message.
2005-04-27 16:35:49 +02:00
unknown
ede5261679 Fixed BUG#8408: Stored procedure crash if function contains SHOW
We simply have to disallow any kind of result set being sent back
  from a function. Can't see any way to make that to work.


mysql-test/r/sp-error.result:
  New test case for BUG#8408.
mysql-test/t/sp-error.test:
  New test case for BUG#8408.
sql/item_func.cc:
  Disable result sets from functions but temporarily turning CLIENT_MULTI_RESULTS off.
sql/share/errmsg.txt:
  Added error message for statements not allowed in functions (detected during parsing).
sql/sql_yacc.yy:
  Don't allow result sets in functions.
2005-04-26 17:31:59 +02:00
unknown
c751c6ce7c Fixed BUG#7047: Stored procedure crash if alter procedure
by simply disallowing alter procedure/function in an SP (as for drop).


mysql-test/r/sp-error.result:
  Added test case for BUG#7047.
mysql-test/t/sp-error.test:
  Added test case for BUG#7047.
sql/share/errmsg.txt:
  Modified error message for "update procedure/function" too.
sql/sql_yacc.yy:
  Don't allow alter procedure/function in an SP.
2005-04-20 17:59:28 +02:00
unknown
e0fdbeba7e Fixed BUG#9598: stored procedure call within stored procedure
overwrites IN variable
  and added error checking of variables for [IN]OUT parameters while
  rewriting the out parameter handling.


mysql-test/r/sp-error.result:
  New test case for non-variable argument for [IN]OUT parameters.
  (And changed to qualified names in some other error messages.)
mysql-test/r/sp.result:
  New test case for BUG#9598.
mysql-test/t/sp-error.test:
  New test case for non-variable argument for [IN]OUT parameters.
mysql-test/t/sp.test:
  New test case for BUG#9598.
sql/item.h:
  Need to distinguish between SP local variable items and other items,
  for error checking and [IN]OUT parameter handling.
sql/share/errmsg.txt:
  New error message for non-variable arguments for [IN]OUT parameters in stored procedures.
sql/sp_head.cc:
  Rewrote the [IN]OUT parameter handling in procedure invokation, to make
  it work properly when using user variables in sub-calls.
  Also added error checking for non-variable arguments for such parameters
  (and changed to qualified names for wrong number of arg. errors).
sql/sp_rcontext.cc:
  No need to keep track on the out index for an [IN]OUT parameter any more.
sql/sp_rcontext.h:
  No need to keep track on the out index for an [IN]OUT parameter any more.
2005-04-14 14:52:35 +02:00
unknown
fc5db93516 Fixed BUG#9073: Able to declare two handlers for same condition in same scope
mysql-test/r/sp-error.result:
  Added test case for BUG#9073.
mysql-test/t/sp-error.test:
  Added test case for BUG#9073.
sql/share/errmsg.txt:
  New error message for duplicate condition handlers in stored procedures.
sql/sp_pcontext.cc:
  Keep track on condition handlers in the same block for error checking.
sql/sp_pcontext.h:
  Keep track on condition handlers in the same block for error checking.
sql/sql_yacc.yy:
  Keep track on condition handlers in the same block for error checking.
2005-04-08 19:58:04 +02:00
unknown
5f006200d1 Fixed BUG#7299: Stored procedures: exception handler catches not-found conditions
mysql-test/r/sp-error.result:
  Added test case for BUG#7299.
mysql-test/t/sp-error.test:
  Added test case for BUG#7299.
sql/sp_rcontext.cc:
  Corrected cut&paste error; make sure we only catch actual errors with sqlexception.
2005-04-08 16:05:16 +02:00
unknown
b2ff4e9ce5 Moved test for bug #9566 "explicit LOCK TABLE and store procedures result in illegal
state" to sp-error.test.

According to Per-Erik all SP related tests which should result in error
should go into sp-error.test and not in sp.test, because we want to be
able to run sp.test using normal client.


mysql-test/r/sp-error.result:
  Moved test for bug #9566 "explicit LOCK TABLE and store procedures result in illegal
  state" to sp-error.test.
mysql-test/r/sp.result:
  Moved test for bug #9566 "explicit LOCK TABLE and store procedures result in illegal
  state" to sp-error.test.
mysql-test/t/sp-error.test:
  Moved test for bug #9566 "explicit LOCK TABLE and store procedures result in illegal
  state" to sp-error.test.
mysql-test/t/sp.test:
  Moved test for bug #9566 "explicit LOCK TABLE and store procedures result in illegal
  state" to sp-error.test.
2005-04-07 11:57:47 +04:00
unknown
66b71ca378 Fixed BUG#6600: Stored procedure crash after repeated calls with check table.
Sedond attempt: Simply disallow CHECK in SPs, since it can't work.


mysql-test/r/sp-error.result:
  New test cast for BUG#6600
mysql-test/r/sp.result:
  Removed old test case for BUG#6600
mysql-test/t/sp-error.test:
  New test cast for BUG#6600
mysql-test/t/sp.test:
  Removed old test case for BUG#6600
sql/share/errmsg.txt:
  Made the SP bad statement error message more general.
sql/sp_head.cc:
  CHECK is not possible in stored procedures.
sql/sql_parse.cc:
  Undid attempt to fix CHECK in stored procedures, it didn't work.
sql/sql_yacc.yy:
  CHECK is not possible in stored procedures.
  (And updated error messages for LOCK/UNLOCK.)
2005-03-30 17:43:52 +02:00
unknown
7e79e70515 Did some SP test style changes and added explanatory comments,
and removed a have_innodb.inc inclusion which was left by mistake
in an earlier change.


mysql-test/r/sp_trans.result:
  Changed procedure name and delimiter setting to follow the style of the other SP test files.
mysql-test/t/sp-error.test:
  Added comment with hint for bug test case style.
mysql-test/t/sp-threads.test:
  Added comments, with hint for bug test case style.
mysql-test/t/sp.test:
  Removed have_innodb.inc inclusion.
  Added comments about different SP test files, table usage and
  hint for bug test case style.
mysql-test/t/sp_trans.test:
  Changed procedure name and delimiter setting to follow the style of the other SP test files.
2005-03-18 14:33:46 +01:00
unknown
110f6abd38 Fixed BUG#8760: Stored Procedures: Invalid SQLSTATE is allowed in
a DECLARE ? HANDLER FOR stmt.


mysql-test/r/sp-error.result:
  New test case for BUG#8776 (check format of sqlstates in handler declarations).
mysql-test/t/sp-error.test:
  New test case for BUG#8776 (check format of sqlstates in handler declarations).
sql/share/errmsg.txt:
  New error message for malformed SQLSTATEs.
sql/sp_pcontext.cc:
  Added function for checking SQLSTATE format.
sql/sp_pcontext.h:
  Added function for checking SQLSTATE format.
sql/sql_yacc.yy:
  Check format of SQLSTATE in handler declaration.
2005-02-28 18:07:06 +01:00
unknown
3f24932124 WL#2130: Table locking for stored FUNCTIONs
Collect all tables and SPs refered by a statement, and open all tables
with an implicit LOCK TABLES. Do find things refered by triggers and views,
we open them first (and then repeat this until nothing new is found), before
doing the actual lock tables.


mysql-test/r/information_schema.result:
  Updated result for WL#2130.
mysql-test/r/lock.result:
  Updated result for WL#2130.
mysql-test/r/sp-error.result:
  Updated result for WL#2130.
mysql-test/r/sp.result:
  Updated result for WL#2130.
mysql-test/r/view.result:
  Updated result for WL#2130.
mysql-test/t/information_schema.test:
  Disabled one test case due to a bug involving LOCK TABLES,
  which shows up with WL#2130.
mysql-test/t/lock.test:
  New error message with WL#2130. This change is under debate and might change
  in the future, but will do for now.
mysql-test/t/sp-error.test:
  Updated for WL#2130. Some tests are voided when table access does work from
  functions.
mysql-test/t/sp.test:
  Updated for WL#2130.
mysql-test/t/view.test:
  Updated for WL#2130.
sql/item_func.cc:
  We now have to set net.no_send_ok for functions too, with WL#2130.
sql/share/errmsg.txt:
  Reused an error code since the old use was voided by WL#2130, but a new
  one was needed instead (similar, but more specific restriction).
sql/sp.cc:
  Fixed error handling and collection of used tables for WL#2130.
sql/sp.h:
  Fixed error handling and collection of used tables for WL#2130.
sql/sp_head.cc:
  Added support functions for collecting and merging hash tables and lists
  of used tables from SPs and substatements, for WL#2130.
sql/sp_head.h:
  Added support functions for collecting and merging hash tables and lists
  of used tables from SPs and substatements, for WL#2130.
sql/sql_base.cc:
  Changed the way table->query_id is tested and set during with locked tables
  in effect. This makes some SP test cases work with WL#2130, but has a side
  effect on some error cases with explicit LOCK TABLES. It's still debated if
  this is the correct way, so it might change.
sql/sql_class.h:
  Added flags for circumventing some interference between WL#2130 and mysql_make_view().
sql/sql_derived.cc:
  Added some missing initializations. (Potential bugs.)
sql/sql_lex.cc:
  Clear the new hash tables for WL#2130.
sql/sql_lex.h:
  Added hash tables for procedures and tables too (as for functions), for WL#2130.
sql/sql_parse.cc:
  WL#2130: Make table accesses from stored functions work by adding an implicit
  LOCK TABLES around (most) executed statements. To do this, we have to go through
  a loop where we collect all SPs and tables in mysql_execute_statement.
sql/sql_prepare.cc:
  Cache both functions and procedures for WL#2130.
sql/sql_show.cc:
  Added some missing initializations. (Potential bugs.)
sql/sql_view.cc:
  Shortcut mysql_make_view() if thd->shortcut_make_view is true during
  the pre-open phase for collecting tables in WL#2130. Otherwise, the
  similar mechanism here causes interference.
sql/sql_yacc.yy:
  For WL#2130, added caching of procedures and disallowed LOCK/UNLOCK TABLES in SPs.
2005-02-08 20:52:50 +01:00
unknown
c39c21b537 Fix 'SHOW CREATE FUNCTION' to say 'FUNCTION' in its error message. (Bug #6338)
sql/sql_parse.cc:
  Fix SP_COM_STRING() macro for 'SHOW CREATE FUNCTION' case
mysql-test/r/sp-error.result:
  results for SHOW CREATE FUNCTION test
mysql-test/t/sp-error.test:
  test SHOW CREATE FUNCTION
2005-01-03 19:53:54 +01:00
unknown
ea75abc513 Fixed BUG#6807: Stored procedure crash if CREATE PROCEDURE ... KILL QUERY
...and for PURGE BEFORE too. (Don't fix_fields in the parser!)


mysql-test/r/sp-error.result:
  New test case for BUG#6807
mysql-test/t/sp-error.test:
  New test case for BUG#6807
sql/sql_lex.h:
  Purge and kill query args not needed in lex. (Using value_list instead)
sql/sql_parse.cc:
  Evaluate purge before and kill query args in mysql_execute_command
  instead of in the parser. (Makes it work with stored procedures)
sql/sql_yacc.yy:
  Don't evaluate (fix_fields) args in the parser for purge before and kill query.
  (Doesn't work with stored procedures)
2004-11-25 16:13:06 +01:00
unknown
f5a47f156b Fixes after merge with 4.1
FOUND is not a reserved keyword anymore
Added Item_field::set_no_const_sub() to be able to mark fields that can't be substituted
Added 'simple_select' method to be able to quickly determinate if a select_result is a normal SELECT
Note that the 5.0 tree is not yet up to date: Sanja will have to fix multi-update-locks for this merge to be complete


BUILD/SETUP.sh:
  Portability fix
client/mysqltest.c:
  Portability fix
mysql-test/r/drop.result:
  updated results
mysql-test/r/func_str.result:
  New warnings (after merge)
mysql-test/r/insert.result:
  Updated tests
mysql-test/r/join_nested.result:
  Updated results (because of new column types in 5.0)
mysql-test/r/lock_multi.result:
  Temporarly wrong results until Sanja fixes multi-update-lock in 5.0
mysql-test/r/multi_update.result:
  Temporary fix until Sanja fixes multi-update locking
mysql-test/r/ps_1general.result:
  Update of results after merge
mysql-test/r/ps_2myisam.result:
  Update of results after merge
mysql-test/r/ps_3innodb.result:
  Update of results after merge
mysql-test/r/ps_4heap.result:
  Update of results after merge
mysql-test/r/ps_5merge.result:
  Update of results after merge
mysql-test/r/ps_6bdb.result:
  Update of results after merge
mysql-test/r/query_cache.result:
  Update of results after merge
mysql-test/r/range.result:
  New results for new tests
mysql-test/r/rpl_auto_increment.result:
  Update with new 4.0 information
mysql-test/r/rpl_charset.result:
  After merge fixes
mysql-test/r/subselect.result:
  After merge fixes
mysql-test/r/view.result:
  Temporary fix until multi-update-locking is fixed
mysql-test/t/drop.test:
  Safety fix
mysql-test/t/multi_update.test:
  Temporary fix until multi-update-locking is fixed
mysql-test/t/rpl_charset.test:
  More comments
mysql-test/t/sp-error.test:
  Updated comments
mysql-test/t/view.test:
  Temporary fix until multi-update-locking is fixed
scripts/mysql_fix_privilege_tables.sh:
  Better error message
sql-common/client.c:
  More debugging
sql/ha_ndbcluster.cc:
  After merge fixes
sql/handler.cc:
  After merge fixes
sql/item.cc:
  Simple optimization of creating item
  After merge fixed
  Added Item_field::set_no_const_sub() to be able to mark fields that can't be substituted
  The problem is that if you compare a string field to a binary string, you can't replace the field with a string constant as the binary comparison may then fail (The original field value may be in a different case)
sql/item.h:
  Added Item::set_no_const_sub() to be able to mark fields that can't be substituted
sql/item_cmpfunc.cc:
  Mark fields compared as binary to not be substituted.
sql/item_func.cc:
  After merge fix
sql/log_event.cc:
  After merge fix
sql/mysql_priv.h:
  After merge fix
sql/opt_range.cc:
  After merge fix
sql/protocol.cc:
  Made flags uint instead of int (as it's used as a bit mask)
sql/protocol.h:
  Made flags uint instead of int (as it's used as a bit mask)
sql/protocol_cursor.cc:
  Made flags uint instead of int (as it's used as a bit mask)
  Indentation cleanups
sql/sp.cc:
  After merge fixes
  Removed compiler warnings
sql/sp_head.cc:
  After merge fixes
sql/sql_base.cc:
  After merge fixes
  Removed 'send_error' from 'insert_fields()' as the error is sent higher up
sql/sql_class.cc:
  Give assert if set_n_backup_item_arena is used twice
sql/sql_class.h:
  Give assert if set_n_backup_item_arena is used twice
  After merge fixes
  Added 'simple_select' method to be able to quickly determinate if a select_result is a normal SELECT
sql/sql_handler.cc:
  After merge fixes
sql/sql_parse.cc:
  After merge fixes
sql/sql_prepare.cc:
  After merge fixes
sql/sql_select.cc:
  After merge fixes
  Moved 'build_equal_items' to optimize_cond() (logical place)
sql/sql_table.cc:
  After merge fixes
sql/sql_trigger.cc:
  After merge fixes
sql/sql_update.cc:
  After merge fixes
  (This should be fixed by Sanja to have lower granuality locking of tables in multi-update)
sql/sql_view.cc:
  After merge fixes
sql/sql_yacc.yy:
  After merge fixes
  Don't have FOUND as a reserved keyword
2004-11-03 12:39:38 +02:00
unknown
a50cd5c53d Fixed BUG#6030: Stored procedure has no appropriate DROP privilege.
...and no ALTER privilege either.
  For now, only the definer and root can drop or alter an SP.


include/mysqld_error.h:
  New access denied error code when dropping/altering stored procedures.
include/sql_state.h:
  New access denied error code when dropping/altering stored procedures.
mysql-test/r/sp-error.result:
  Removed warning for "unitialized variable", as this popped up in unexpected
  places after the access control for drop/alter SPs was added. (And the warning
  was wrong and planned to be removed anyway.)
mysql-test/r/sp-security.result:
  Added tests for access control on who's allowed to drop and alter SPs.
mysql-test/r/sp.result:
  Updated results. (Warning removed.)
mysql-test/t/sp-error.test:
  Removed warning for "unitialized variable", as this popped up in unexpected
  places after the access control for drop/alter SPs was added. (And the warning
  was wrong and planned to be removed anyway.)
mysql-test/t/sp-security.test:
  Added tests for access control on who's allowed to drop and alter SPs.
sql/share/czech/errmsg.txt:
  New access denied error message when dropping/altering stored procedures.
sql/share/danish/errmsg.txt:
  New access denied error message when dropping/altering stored procedures.
sql/share/dutch/errmsg.txt:
  New access denied error message when dropping/altering stored procedures.
sql/share/english/errmsg.txt:
  New access denied error message when dropping/altering stored procedures.
sql/share/estonian/errmsg.txt:
  New access denied error message when dropping/altering stored procedures.
sql/share/french/errmsg.txt:
  New access denied error message when dropping/altering stored procedures.
sql/share/german/errmsg.txt:
  New access denied error message when dropping/altering stored procedures.
sql/share/greek/errmsg.txt:
  New access denied error message when dropping/altering stored procedures.
sql/share/hungarian/errmsg.txt:
  New access denied error message when dropping/altering stored procedures.
sql/share/italian/errmsg.txt:
  New access denied error message when dropping/altering stored procedures.
sql/share/japanese/errmsg.txt:
  New access denied error message when dropping/altering stored procedures.
sql/share/korean/errmsg.txt:
  New access denied error message when dropping/altering stored procedures.
sql/share/norwegian-ny/errmsg.txt:
  New access denied error message when dropping/altering stored procedures.
sql/share/norwegian/errmsg.txt:
  New access denied error message when dropping/altering stored procedures.
sql/share/polish/errmsg.txt:
  New access denied error message when dropping/altering stored procedures.
sql/share/portuguese/errmsg.txt:
  New access denied error message when dropping/altering stored procedures.
sql/share/romanian/errmsg.txt:
  New access denied error message when dropping/altering stored procedures.
sql/share/russian/errmsg.txt:
  New access denied error message when dropping/altering stored procedures.
sql/share/serbian/errmsg.txt:
  New access denied error message when dropping/altering stored procedures.
sql/share/slovak/errmsg.txt:
  New access denied error message when dropping/altering stored procedures.
sql/share/spanish/errmsg.txt:
  New access denied error message when dropping/altering stored procedures.
sql/share/swedish/errmsg.txt:
  New access denied error message when dropping/altering stored procedures.
sql/share/ukrainian/errmsg.txt:
  New access denied error message when dropping/altering stored procedures.
sql/sql_parse.cc:
  Added minimal access control for DROP/ALTER PROCEDURE/FUNCTION. Only the definer
  and root are allowed to do this.
sql/sql_yacc.yy:
  Removed warning for "unitialized variable", as this popped up in unexpected
  places after the access control for drop/alter SPs was added. (And the warning
  was wrong and planned to be removed anyway.)
2004-10-22 20:29:06 +02:00
unknown
35588c9dd0 Fixed BUG#6027: Stored procedures can be renamed.
Removed the support for renaming SPs. It's non-standard, conflicted with a standard
syntax, and was a bit broken anyway.


mysql-test/r/sp-error.result:
  Removed test for renaming procedures with alter.
mysql-test/r/sp.result:
  Removed test for renaming procedures with alter.
mysql-test/t/sp-error.test:
  Removed test for renaming procedures with alter.
mysql-test/t/sp.test:
  Removed test for renaming procedures with alter.
sql/sp.cc:
  Removed support for renaming SPs. It's non-standard, conflicted with a standard
  syntax, and was a bit broken anyway.
sql/sp.h:
  Removed support for renaming SPs. It's non-standard, conflicted with a standard
  syntax, and was a bit broken anyway.
sql/sql_parse.cc:
  Removed support for renaming SPs. It's non-standard, conflicted with a standard
  syntax, and was a bit broken anyway.
sql/sql_yacc.yy:
  Removed support for renaming SPs. It's non-standard, conflicted with a standard
  syntax, and was a bit broken anyway.
2004-10-22 19:05:17 +02:00
unknown
437855378f Revised BUG#5000: SPs can be created with no default database.
Now simply give an error if no database. (The "global SP feature" will be
done using PATH instead.)


mysql-test/r/sp-error.result:
  Removed test cases for undone "feature".
mysql-test/t/sp-error.test:
  Removed test cases for undone "feature".
sql/sql_parse.cc:
  Check if created procedure/function has a database; give error if not.
sql/sql_yacc.yy:
  Undid the "global SP feature".
2004-10-07 15:32:36 +02:00
unknown
1912148cec Fixed BUG#3294: Stored procedure crash if table dropped before use.
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).
2004-09-10 11:11:52 +02:00
unknown
bc78725424 Update after merge 2004-09-09 14:55:28 +03:00
unknown
e18b7ea959 Merge on pull
BitKeeper/etc/logging_ok:
  auto-union
include/my_sys.h:
  Auto merged
mysql-test/r/func_in.result:
  Auto merged
2004-09-09 07:26:28 +03:00
unknown
33efc9677d After merge fixes of merge with 4.1 that included the new arena code.
Fixed (together with Guilhem) bugs in mysqlbinlog regarding --offset
Prefix addresses with 0x for easier comparisons of debug logs
Fixed problem where MySQL choosed index-read even if there would be a much better range on the same index
This fix changed some 'index' queries to 'range' queries in the test suite
Don't create 'dummy' WHERE clause for trivial WHERE clauses where we can remove the WHERE clause.
This fix removed of a lot of 'Using where' notes in the test suite.
Give NOTE instead of WARNING if table/function doesn't exists when using DROP IF EXISTS
Give NOTE instead of WARNING for safe field-type conversions


Makefile.am:
  Don't automaticly update files from bk
client/mysqlbinlog.cc:
  Merge with 4.1 (+ apply bug fixes for --offset and --start-position)
include/my_sys.h:
  Faster clear_alloc_root()
mysql-test/r/bdb.result:
  Updated results after merge
mysql-test/r/create.result:
  Updated results after merge
mysql-test/r/func_group.result:
  Updated results after merge
mysql-test/r/func_if.result:
  Updated results after merge
mysql-test/r/heap_btree.result:
  Updated results after merge
mysql-test/r/index_merge.result:
  Updated results after merge
mysql-test/r/index_merge_ror.result:
  Updated results after merge
mysql-test/r/innodb.result:
  Updated results after merge
mysql-test/r/join_outer.result:
  Updated results after merge
mysql-test/r/mysqlbinlog2.result:
  Updated results after merge
mysql-test/r/negation_elimination.result:
  Updated results after merge
mysql-test/r/null.result:
  Updated results after merge
  Added more tests
mysql-test/r/null_key.result:
  Updated results after merge
  Added more tests
mysql-test/r/order_by.result:
  Updated results after merge
mysql-test/r/range.result:
  Updated results after merge
  Added more tests
mysql-test/r/rpl_charset.result:
  Updated results after merge
mysql-test/r/sp-error.result:
  Updated results after merge
mysql-test/r/sp.result:
  Updated results after merge
  Added delete of some stored procedures in an attempt to be able to re-run test even if it aborts in the middle
mysql-test/r/type_blob.result:
  Updated results after merge
  (Some warnings are now notes)
mysql-test/r/user_var.result:
  Updated results after merge
  Added more tests
mysql-test/r/variables.result:
  Updated results after merge
mysql-test/r/view.result:
  Updated results after merge
mysql-test/t/mysqlbinlog2.test:
  Updated tests to use new positions
mysql-test/t/null.test:
  More tests
mysql-test/t/null_key.test:
  More tests
mysql-test/t/range.test:
  More tests
mysql-test/t/rpl_charset.test:
  Avoid big diffs in the future if tests changes
mysql-test/t/sp-error.test:
  Updated error numbers
mysql-test/t/sp-security.test:
  Updated error numbers
mysql-test/t/sp.test:
  Updated results after merge
  Added delete of some stored procedures in an attempt to be able to re-run test even if it aborts in the middle
mysql-test/t/user_var.test:
  More tests
mysql-test/t/view.test:
  Updated error numbers
mysys/my_alloc.c:
  Write into debug log the address of the allocated area
sql/ha_isam.cc:
  Prefix addresses with 0x for easier comparisons of debug logs
sql/ha_myisam.cc:
  Prefix addresses with 0x for easier comparisons of debug logs
sql/ha_ndbcluster.cc:
  Add missing enum to switch
sql/handler.cc:
  remove compiler warning
sql/item.cc:
  More debugging
  Simple cleanup
sql/item.h:
  Move Item::cleanup() to item.cc
sql/item_cmpfunc.cc:
  Fix arena code
sql/item_subselect.cc:
  After merge fixes
sql/item_subselect.h:
  After merge fixes
sql/item_sum.cc:
  Updated comment
sql/log_event.cc:
  Remove wrong test
sql/mysql_priv.h:
  Indentation fixes
sql/mysqld.cc:
  After merge fixes
  Added 0x to pointers in debug log
sql/opt_range.cc:
  Fixed problem where MySQL choosed index-read even if there would be a much better range on the same index
  This fix changed some 'index' queries to 'range' queries in the test suite
sql/set_var.cc:
  Indentation fixes
sql/sp_head.cc:
  Set state to INITIALIZED to make SP work with new arena code
sql/sql_base.cc:
  After merge fixes
sql/sql_class.cc:
  More debugging
  Use clear_alloc_root() instead of init_alloc_root() as the former is faster
sql/sql_class.h:
  New method 'only_prepare()'
sql/sql_lex.cc:
  After merge fixes
sql/sql_lex.h:
  After merge fixes
sql/sql_parse.cc:
  Fix for timezone tables. (The old way to add timezone tables to global list in 'create_total_list' doesn't work anymore)
  Give NOTE instead of WARNING if table/function doesn't exists when using DROP IF EXISTS
sql/sql_prepare.cc:
  After merge fixes
sql/sql_select.cc:
  Don't create 'dummy' WHERE clause for trivial WHERE clauses where we can remove the WHERE clause.
  This fix removed of a lot of 'Using where' notes in the test suite
sql/sql_table.cc:
  Give NOTE instead of WARNING if table/function doesn't exists when using DROP IF EXISTS
sql/sql_union.cc:
  After merge fix
sql/sql_view.cc:
  After merge fix
sql/table.cc:
  After merge fix
sql/tztime.cc:
  Update timezone table handling to use new table lists structure
sql/tztime.h:
  Update timezone table handling to use new table lists structure
sql/unireg.cc:
  Use 0x before pointers
2004-09-09 06:59:26 +03:00
unknown
c92b534970 Fixed BUG#5000: SPs can be created with no default database.
Easy to prevent crash, but the question was how to treat this case?
  We ended up implementing the "global" SPs (i.e. with no associated
  db), which were planned but left unresolved when SPs moved into dbs.
  So now things like "call .p()" work too.


mysql-test/r/sp-error.result:
  New test case for BUG#5000, and "global" SPs in general.
mysql-test/t/sp-error.test:
  New test case for BUG#5000, and "global" SPs in general.
sql/sp.cc:
  Prevent crash when the new db is null.
sql/sp_head.cc:
  Don't set the db part of the name to thd->db, we have already set it correctly
  in the provided name struct.
  Also, don't attempt to change "no-db" when executing an SP.
sql/sql_yacc.yy:
  Added support for the "global SP" syntax, e.g ".p()".
2004-09-08 14:23:14 +02:00
unknown
071651efbd Major rehacking and cleanup of sp_pcontext.
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.
2004-08-26 12:54:30 +02:00
unknown
ac06195caa Fixed BUG#3157: Crash if stored procedure contains IF EXISTS,
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.
2004-08-24 16:07:39 +02:00
unknown
9b5a6f7228 WL#2002: Implement stored procedure GOTO.
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.
2004-08-17 20:20:58 +02:00
unknown
4467bcf26e Fixed BUG#434: Stored procedure which drops itself causes crash.
Simply disallow it, just as we disallow creation of routines from within
other SPs.


include/mysqld_error.h:
  New error code for when attempting to drop a stored routine from within
  another stored routine.
mysql-test/r/sp-error.result:
  New test case for BUG#4344.
mysql-test/t/sp-error.test:
  New test case for BUG#4344.
sql/share/czech/errmsg.txt:
  New error message for when attempting to drop a stored routine from within
  another stored routine.
sql/share/danish/errmsg.txt:
  New error message for when attempting to drop a stored routine from within
  another stored routine.
sql/share/dutch/errmsg.txt:
  New error message for when attempting to drop a stored routine from within
  another stored routine.
sql/share/english/errmsg.txt:
  New error message for when attempting to drop a stored routine from within
  another stored routine.
sql/share/estonian/errmsg.txt:
  New error message for when attempting to drop a stored routine from within
  another stored routine.
sql/share/french/errmsg.txt:
  New error message for when attempting to drop a stored routine from within
  another stored routine.
sql/share/german/errmsg.txt:
  New error message for when attempting to drop a stored routine from within
  another stored routine.
sql/share/greek/errmsg.txt:
  New error message for when attempting to drop a stored routine from within
  another stored routine.
sql/share/hungarian/errmsg.txt:
  New error message for when attempting to drop a stored routine from within
  another stored routine.
sql/share/italian/errmsg.txt:
  New error message for when attempting to drop a stored routine from within
  another stored routine.
sql/share/japanese/errmsg.txt:
  New error message for when attempting to drop a stored routine from within
  another stored routine.
sql/share/korean/errmsg.txt:
  New error message for when attempting to drop a stored routine from within
  another stored routine.
sql/share/norwegian-ny/errmsg.txt:
  New error message for when attempting to drop a stored routine from within
  another stored routine.
sql/share/norwegian/errmsg.txt:
  New error message for when attempting to drop a stored routine from within
  another stored routine.
sql/share/polish/errmsg.txt:
  New error message for when attempting to drop a stored routine from within
  another stored routine.
sql/share/portuguese/errmsg.txt:
  New error message for when attempting to drop a stored routine from within
  another stored routine.
sql/share/romanian/errmsg.txt:
  New error message for when attempting to drop a stored routine from within
  another stored routine.
sql/share/russian/errmsg.txt:
  New error message for when attempting to drop a stored routine from within
  another stored routine.
sql/share/serbian/errmsg.txt:
  New error message for when attempting to drop a stored routine from within
  another stored routine.
sql/share/slovak/errmsg.txt:
  New error message for when attempting to drop a stored routine from within
  another stored routine.
sql/share/spanish/errmsg.txt:
  New error message for when attempting to drop a stored routine from within
  another stored routine.
sql/share/swedish/errmsg.txt:
  New error message for when attempting to drop a stored routine from within
  another stored routine.
sql/share/ukrainian/errmsg.txt:
  New error message for when attempting to drop a stored routine from within
  another stored routine.
sql/sql_yacc.yy:
  Don't allow drop function/procedure from within another function/procedure.
2004-07-29 17:33:45 +02:00
unknown
1d29e6b0d4 after merge fixes
sql/opt_range.h:
  compatibility fix
sql/sql_lex.cc:
  cleanup
2004-07-22 00:26:33 +02:00
unknown
28287c0dc5 Fixed BUG#2653: Undeclared variables not detected in stored procedures.
We now get an run-time error instead of a crash (although a slightly misleading
error message, but it's an improvement).


mysql-test/r/sp-error.result:
  New test case for BUG#2653.
mysql-test/t/sp-error.test:
  New test case for BUG#2653.
sql/sp_head.cc:
  Detect failed evals (fix item really), which are due to unresolved variables/fields.
  Typically this would be a reference to an undeclared variable.
  (Also got rid of some compiler warnings.)
sql/sp_rcontext.cc:
  Detect failed evals (fix item really), which are due to unresolved variables/fields.
  Typically this would be a reference to an undeclared variable.
sql/sp_rcontext.h:
  Changed return type to int, so be able to detect failed evals (fix item).
sql/sql_class.cc:
  Changed return type to int, so be able to detect failed evals (fix item).
2004-07-21 14:53:09 +02:00
unknown
46ea874fb7 After merge fixes
Note: The following tests fails
- fulltext (Sergei has promised to fix)
- rpl_charset (Guilhem should fix)
- rpl_timezone (Dimitray has promised to fix)

Sanja needs to check out the calling of close_thread_tables() in sp_head.cc


myisam/mi_check.c:
  After merge fix
myisam/sort.c:
  After merge fix
mysql-test/mysql-test-run.sh:
  Export master socket to mysqltest
mysql-test/r/func_group.result:
  Make result repeatable
mysql-test/r/mysqlbinlog.result:
  After merge fix
mysql-test/r/ps_1general.result:
  After merge fix
mysql-test/r/ps_2myisam.result:
  After merge fix
mysql-test/r/ps_3innodb.result:
  After merge fix
mysql-test/r/ps_4heap.result:
  After merge fix
mysql-test/r/ps_5merge.result:
  After merge fix
mysql-test/r/ps_6bdb.result:
  After merge fix
mysql-test/r/rpl_flush_log_loop.result:
  After merge fix
mysql-test/r/rpl_replicate_do.result:
  After merge fix
mysql-test/r/rpl_temporary.result:
  After merge fix
mysql-test/r/rpl_timezone.result:
  After merge fix
  Note that this test fails now (Dimitry has promised to fix this)
mysql-test/r/rpl_user_variables.result:
  After merge fix
mysql-test/r/select.result:
  After merge fix
mysql-test/r/sp-error.result:
  After merge fix
mysql-test/r/sp-security.result:
  After merge fix
mysql-test/r/sp.result:
  After merge fix
mysql-test/r/user_var.result:
  After merge fix
mysql-test/r/variables.result:
  After merge fix
mysql-test/t/alter_table.test:
  After merge fix
mysql-test/t/derived.test:
  After merge fix
mysql-test/t/func_group.test:
  Make result repeatable
mysql-test/t/grant_cache.test:
  Use MASTER_MYSOCK instead of master.sock
mysql-test/t/multi_update.test:
  Use MASTER_MYSOCK instead of master.sock
mysql-test/t/rpl000015.test:
  Use MASTER_MYSOCK instead of master.sock
mysql-test/t/rpl000017.test:
  Use MASTER_MYSOCK instead of master.sock
mysql-test/t/rpl000018.test:
  Use MASTER_MYSOCK instead of master.sock
mysql-test/t/rpl_charset.test:
  After merge fix
mysql-test/t/rpl_heap.test:
  Use MASTER_MYSOCK instead of master.sock
mysql-test/t/rpl_rotate_logs.test:
  Use MASTER_MYSOCK instead of master.sock
mysql-test/t/sp-error.test:
  after merge fix
mysql-test/t/sp-security.test:
  after merge fix
mysql-test/t/user_var.test:
  after merge fix
scripts/mysql_fix_privilege_tables.sh:
  This can now be exectued from the source distribution
sql/handler.cc:
  Cleanup
sql/handler.h:
  More debugging
sql/item.h:
  Indentation fixes
sql/item_cmpfunc.cc:
  After merge fixes
sql/opt_range.cc:
  After merge fixes
sql/opt_range.h:
  After merge fixes
sql/sp.cc:
  After merge fixes
sql/sp_head.cc:
  Remove closing of thread tables in a SP function as this caused a core dump.
  (Has to be fixed better)
sql/sql_base.cc:
  More debugging
sql/sql_handler.cc:
  After merge fixes
  (We have to call ha_index_or_rnd_end() before calling close_thread_table())
sql/sql_parse.cc:
  More debugging
sql/sql_prepare.cc:
  After merge fixes
sql/sql_select.cc:
  After merge fixes
2004-07-15 04:19:07 +03:00
unknown
44d2934f0b Fixed BUG#3339: Stored procedures in nonexistent schemas are uncallable.
Also added some related security tests and corrected related error messages.


mysql-test/r/sp-error.result:
  New test case for BUG#3339, and updated results for other modified error messages.
mysql-test/r/sp-security.result:
  Added tests for creating procedures in another database with and wihout
  access rights.
mysql-test/t/sp-error.test:
  New test case for BUG#3339.
mysql-test/t/sp-security.test:
  Added tests for creating procedures in another database with and wihout
  access rights.
sql/sp.cc:
  Check existance (and access rights) for database when creating a stored routine.
sql/sp.h:
  New error return value for sp_create_* functions, for non existing database.
sql/sql_parse.cc:
  Check error return for create stored routine (non existing database),
  and corrected the error output for some other commands. (Use qualified
  name, not just name.)
2004-06-15 15:42:28 +02:00
unknown
6a0f352bcd Added test case for SELECT INTO with too many rows. 2004-06-09 18:50:03 +02:00
unknown
3a272c1fa9 Post-merge fixes.
Note: One sp.test still fails (prime), and rpl_server_id2.test fails (will be fixed by guilhem ASAP).


mysql-test/r/index_merge.result:
  Fixed syntax error (no ',' after last index in create table any more).
mysql-test/r/index_merge_bdb.result:
  Fixed syntax error (no ',' after last index in create table any more).
mysql-test/r/index_merge_innodb.result:
  Fixed syntax error (no ',' after last index in create table any more).
mysql-test/r/index_merge_innodb2.result:
  Fixed syntax error (no ',' after last index in create table any more).
mysql-test/r/rpl_server_id1.result:
  Update result after merge.
mysql-test/r/sp-error.result:
  Update result after merge.
mysql-test/r/variables.result:
  Update result after merge.
mysql-test/t/index_merge.test:
  Fixed syntax error (no ',' after last index in create table any more).
mysql-test/t/index_merge_bdb.test:
  Fixed syntax error (no ',' after last index in create table any more).
mysql-test/t/index_merge_innodb.test:
  Fixed syntax error (no ',' after last index in create table any more).
mysql-test/t/index_merge_innodb2.test:
  Fixed syntax error (no ',' after last index in create table any more).
mysql-test/t/sp-error.test:
  Post-merge fix of error codes.
sql/opt_range.cc:
  Manually merged by Monty.
sql/opt_range.h:
  Manually merged by Monty.
sql/slave.cc:
  Post-merge fixes with some help from Guilhem.
sql/slave.h:
  Post-merge fixes with some help from Guilhem.
sql/sp_head.cc:
  Got rid of warning (reordering initialization).
sql/sql_parse.cc:
  Post-merge fix: Need to set/reset select_limit at SP CALL time as well.
tests/client_test.c:
  Post-merge fix: key_len length in explain has changed.
2004-05-14 16:00:57 +02:00
unknown
2eecc377a6 Post-merge fixes, some quite complex. client/mysqlbinlog.cc and sql/log_event.cc
merged manually by guilhem.


client/mysqlbinlog.cc:
  Post-merge fixes; manually merged by guilhem.
include/mysqld_error.h:
  Post-merge fixes.
mysql-test/r/drop_temp_table.result:
  Post-merge fixes.
mysql-test/r/insert.result:
  Post-merge fixes.
mysql-test/r/mysqlbinlog.result:
  Post-merge fixes.
mysql-test/r/query_cache.result:
  Post-merge fixes.
mysql-test/r/rpl_error_ignored_table.result:
  Post-merge fixes.
mysql-test/r/rpl_relayrotate.result:
  Post-merge fixes.
mysql-test/r/rpl_trunc_binlog.result:
  Post-merge fixes.
mysql-test/r/sp-error.result:
  Post-merge fixes.
mysql-test/r/sp.result:
  Post-merge fixes.
mysql-test/r/system_mysql_db.result:
  Post-merge fixes.
mysql-test/r/variables.result:
  Post-merge fixes.
mysql-test/t/rpl_error_ignored_table.test:
  Post-merge fixes.
mysql-test/t/sp-error.test:
  Post-merge fixes.
sql/ha_innodb.cc:
  Post-merge fixes.
sql/log_event.cc:
  Post-merge fixes; manually merged by guilhem.
sql/set_var.cc:
  Post-merge fixes.
sql/share/danish/errmsg.txt:
  Post-merge fixes.
sql/share/dutch/errmsg.txt:
  Post-merge fixes.
sql/share/english/errmsg.txt:
  Post-merge fixes.
sql/share/estonian/errmsg.txt:
  Post-merge fixes.
sql/sp.cc:
  Post-merge fixes.
sql/sql_insert.cc:
  Post-merge fixes.
sql/sql_table.cc:
  Post-merge fixes.
2004-04-28 12:08:54 +02:00
unknown
4a7c72e9df Fixed BUG#3287: Stored procedure handler scope outside of begin/end.
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.
2004-04-05 17:01:19 +02:00
unknown
5c7f368b78 Fixed BUG#3287: Stored Procedure Case Statement Not SQL:2003 Compliant.
include/mysqld_error.h:
  New error code for missing ELSE in SP CASE statement.
include/sql_state.h:
  New error code for missing ELSE in SP CASE statement.
mysql-test/r/sp-error.result:
  Test case for missing ELSE in SP CASE statement.
mysql-test/t/sp-error.test:
  Test case for missing ELSE in SP CASE statement.
sql/share/czech/errmsg.txt:
  New error message for missing ELSE in SP CASE statement.
sql/share/danish/errmsg.txt:
  New error message for missing ELSE in SP CASE statement.
sql/share/dutch/errmsg.txt:
  New error message for missing ELSE in SP CASE statement.
sql/share/english/errmsg.txt:
  New error message for missing ELSE in SP CASE statement.
sql/share/estonian/errmsg.txt:
  New error message for missing ELSE in SP CASE statement.
sql/share/french/errmsg.txt:
  New error message for missing ELSE in SP CASE statement.
sql/share/german/errmsg.txt:
  New error message for missing ELSE in SP CASE statement.
sql/share/greek/errmsg.txt:
  New error message for missing ELSE in SP CASE statement.
sql/share/hungarian/errmsg.txt:
  New error message for missing ELSE in SP CASE statement.
sql/share/italian/errmsg.txt:
  New error message for missing ELSE in SP CASE statement.
sql/share/japanese/errmsg.txt:
  New error message for missing ELSE in SP CASE statement.
sql/share/korean/errmsg.txt:
  New error message for missing ELSE in SP CASE statement.
sql/share/norwegian-ny/errmsg.txt:
  New error message for missing ELSE in SP CASE statement.
sql/share/norwegian/errmsg.txt:
  New error message for missing ELSE in SP CASE statement.
sql/share/polish/errmsg.txt:
  New error message for missing ELSE in SP CASE statement.
sql/share/portuguese/errmsg.txt:
  New error message for missing ELSE in SP CASE statement.
sql/share/romanian/errmsg.txt:
  New error message for missing ELSE in SP CASE statement.
sql/share/russian/errmsg.txt:
  New error message for missing ELSE in SP CASE statement.
sql/share/serbian/errmsg.txt:
  New error message for missing ELSE in SP CASE statement.
sql/share/slovak/errmsg.txt:
  New error message for missing ELSE in SP CASE statement.
sql/share/spanish/errmsg.txt:
  New error message for missing ELSE in SP CASE statement.
sql/share/swedish/errmsg.txt:
  New error message for missing ELSE in SP CASE statement.
sql/share/ukrainian/errmsg.txt:
  New error message for missing ELSE in SP CASE statement.
sql/sql_yacc.yy:
  Generate run-time error instruction when no ELSE in SP CASE statement.
2004-03-29 12:29:06 +02:00
unknown
7456a3e92f Enforce standard declaration order in SPs.
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.
2004-03-29 11:16:45 +02:00
unknown
eb4aa092e5 WL#1366: Use the schema (db) associated with an SP.
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.
2004-03-11 17:18:59 +01:00
unknown
b5c8de4c83 Post-merge fixes. 2004-02-11 18:21:55 +01:00
unknown
612078813b Fixed BUG#2329: Crash if insert with variable name in stored procedure.
Found a few more places in the parser (insert, replace and update) where
local stored procedure variables should not be recognized.


mysql-test/r/sp-error.result:
  Test cases for BUG#2329
mysql-test/r/sp.result:
  New test case for certain context dependencies for symbols.
mysql-test/t/sp-error.test:
  Test cases for BUG#2329
mysql-test/t/sp.test:
  New test case for certain context dependencies for symbols.
sql/sql_yacc.yy:
  Found a few more places where local SP variables should not be recognized.
2004-01-14 12:47:03 +01:00
unknown
027535733d Fix BUG#2259: Crash after fetch from not-open cursor in stored procedure
Initialize and test properly when cleaning up, to avoid crash in some error cases.


mysql-test/r/sp-error.result:
  Test case for BUG#2259
mysql-test/t/sp-error.test:
  Test case for BUG#2259
sql/sp_rcontext.cc:
  Cleanup in a more controlled way to avoid crashes in some error cases.
  Remove unused variable.
sql/sp_rcontext.h:
  Initialize member var, for cleanup tests.
2004-01-08 10:37:31 +01:00
unknown
952e2cd42a Fix BUG#2272: Crash if update with variable name in stored procedure.
Parse column names (and not variables) only in UPDATE ... SET ...


mysql-test/r/sp-error.result:
  New test case for BUG#2272
mysql-test/t/sp-error.test:
  New test case for BUG#2272
sql/sql_yacc.yy:
  "UPDATE table SET id = val" should only recognize column names, and not
  local SP variables for 'id'.
  (Also removed "as locator" syntax which is not supported.)
2004-01-08 09:27:29 +01:00
unknown
bc748bef53 Post-merge fixes.
Multiple result sets from stored procedures now works with the
mysql and mysqltest clients.


client/mysqltest.c:
  Post-merge fixes.
mysql-test/r/index_merge_innodb.result:
  Post-merge fixes.
mysql-test/r/sp-error.result:
  Post-merge fixes.
  Removed now obsolete error test for multiple selects (without "into").
mysql-test/r/sp.result:
  Post-merge fixes.
  Added test for mulple result sets.
mysql-test/r/variables.result:
  Post-merge fixes.
mysql-test/t/index_merge_innodb.test:
  Post-merge fixes.
mysql-test/t/sp-error.test:
  Post-merge fixes.
  Removed now obsolete error test for multiple selects (without "into").
mysql-test/t/sp.test:
  Post-merge fixes.
  Added test for mulple result sets.
sql/lex.h:
  Post-merge fixes.
2003-12-16 18:09:22 +01:00
unknown
a6f85eeac1 WL#1365: Implement definer's rights execution of stored procedures.
(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.
2003-12-13 16:40:52 +01:00
unknown
b731040383 Post-merge fixes. 2003-12-05 14:45:48 +01:00
unknown
3aaa8ab94e Fixed BUG#336: Subselects with tables does not work as values for local SP variables
and BUG#1654: Stored Procedure Crash if contains subquery and set function

Disallowed subselects in RETURN (for FUNCTIONs) and SET of local variables.
The latter should work, but turned out to be difficult to fix, so we just
disallow it for the time being.


include/mysqld_error.h:
  New error message for unsupported subselect as SP set values (for the time being).
include/sql_state.h:
  New error message for unsupported subselect as SP set values (for the time being).
mysql-test/r/sp-error.result:
  Test cases for BUG#336 and BUG#1654. (Unsupported use of subselect)
mysql-test/t/sp-error.test:
  Test cases for BUG#336 and BUG#1654. (Unsupported use of subselect)
sql/item.cc:
  Made Item_splocal::type() work at compile time, for error checking.
sql/item.h:
  Made Item_splocal::type() work at compile time, for error checking.
sql/share/czech/errmsg.txt:
  New error message for unsupported subselect as SP set values (for the time being).
sql/share/danish/errmsg.txt:
  New error message for unsupported subselect as SP set values (for the time being).
sql/share/dutch/errmsg.txt:
  New error message for unsupported subselect as SP set values (for the time being).
sql/share/english/errmsg.txt:
  New error message for unsupported subselect as SP set values (for the time being).
sql/share/estonian/errmsg.txt:
  New error message for unsupported subselect as SP set values (for the time being).
sql/share/french/errmsg.txt:
  New error message for unsupported subselect as SP set values (for the time being).
sql/share/german/errmsg.txt:
  New error message for unsupported subselect as SP set values (for the time being).
sql/share/greek/errmsg.txt:
  New error message for unsupported subselect as SP set values (for the time being).
sql/share/hungarian/errmsg.txt:
  New error message for unsupported subselect as SP set values (for the time being).
sql/share/italian/errmsg.txt:
  New error message for unsupported subselect as SP set values (for the time being).
sql/share/japanese/errmsg.txt:
  New error message for unsupported subselect as SP set values (for the time being).
sql/share/korean/errmsg.txt:
  New error message for unsupported subselect as SP set values (for the time being).
sql/share/norwegian-ny/errmsg.txt:
  New error message for unsupported subselect as SP set values (for the time being).
sql/share/norwegian/errmsg.txt:
  New error message for unsupported subselect as SP set values (for the time being).
sql/share/polish/errmsg.txt:
  New error message for unsupported subselect as SP set values (for the time being).
sql/share/portuguese/errmsg.txt:
  New error message for unsupported subselect as SP set values (for the time being).
sql/share/romanian/errmsg.txt:
  New error message for unsupported subselect as SP set values (for the time being).
sql/share/russian/errmsg.txt:
  New error message for unsupported subselect as SP set values (for the time being).
sql/share/serbian/errmsg.txt:
  New error message for unsupported subselect as SP set values (for the time being).
sql/share/slovak/errmsg.txt:
  New error message for unsupported subselect as SP set values (for the time being).
sql/share/spanish/errmsg.txt:
  New error message for unsupported subselect as SP set values (for the time being).
sql/share/swedish/errmsg.txt:
  New error message for unsupported subselect as SP set values (for the time being).
sql/share/ukrainian/errmsg.txt:
  New error message for unsupported subselect as SP set values (for the time being).
sql/sp_head.cc:
  Fixed (bogus) compile error on HP-UX alpha.
sql/sql_yacc.yy:
  Disallowed subselects in RETURN (for FUNCTIONs) and SET of local variables.
  The latter should work, but turned out to be difficult to fix, so we just
  disallow it for the time being.
2003-12-04 15:17:55 +01:00
unknown
da7ca9ba04 Post-merge fixes. 2003-12-01 18:24:09 +01:00