An error occurred fetching the project authors.
- 01 Sep, 2006 1 commit
-
-
unknown authored
make st_select_lex::setup_ref_array() take into account that Item_sum-descendant objects located within descendant SELECTs may be added into ref_pointer_array. sql/item_sum.cc: BUG#21477 "memory overruns for certain kinds of subqueries": Make SELECT_LEX::n_sum_items contain # of Item_sum-derived objects that exist within this SELECT. sql/sql_lex.h: BUG#21477 "memory overruns for certain kinds of subqueries": Add SELECT_LEX::n_sum_items and SELECT_LEXT::n_child_sum_items. sql/sql_yacc.yy: BUG#21477 "memory overruns for certain kinds of subqueries": Make SELECT_LEX::n_sum_items contain # of Item_sum-derived objects that exist within this SELECT.
-
- 08 Aug, 2006 1 commit
-
-
unknown authored
issue an error in case of DECIMAL(M,N) if N > M mysql-test/r/type_newdecimal.result: Bug#16172 DECIMAL data type processed incorrectly result fix & test case mysql-test/t/type_newdecimal.test: Bug#16172 DECIMAL data type processed incorrectly test fix
-
- 31 Jul, 2006 2 commits
-
-
unknown authored
The problem was that the grammar allows to create a function with an optional definer clause, and define it as a UDF with the SONAME keyword. Such combination should be reported as an error. The solution is to not change the grammar itself, and to introduce a specific check in the yacc actions in 'create_function_tail' for UDF, that now reports ER_WRONG_USAGE when using both DEFINER and SONAME. mysql-test/r/udf.result: Added tests for Bug#21269 (DEFINER-clause is allowed for UDF-functions) mysql-test/t/udf.test: Added tests for Bug#21269 (DEFINER-clause is allowed for UDF-functions) sql/sql_yacc.yy: Creating a UDF function with a DEFINER clause is now a syntax error.
-
unknown authored
When executing ALTER TABLE all the attributes of the view were overwritten. This is contrary to the user's expectations. So some of the view attributes are preserved now : namely security and algorithm. This means that if they are not specified in ALTER VIEW their values are preserved from CREATE VIEW instead of being defaulted. mysql-test/r/view.result: Bug #21080: ALTER VIEW makes user restate SQL SECURITY mode, and ALGORITHM - test suite mysql-test/t/view.test: Bug #21080: ALTER VIEW makes user restate SQL SECURITY mode, and ALGORITHM - test suite sql/sql_lex.h: Bug #21080: ALTER VIEW makes user restate SQL SECURITY mode, and ALGORITHM - must make create_view_suid a tristate : on/off/unspecified sql/sql_view.cc: Bug #21080: ALTER VIEW makes user restate SQL SECURITY mode, and ALGORITHM - open the view to get it's attributes and put then as defaults for ALTER VIEW sql/sql_yacc.yy: Bug #21080: ALTER VIEW makes user restate SQL SECURITY mode, and ALGORITHM - must make create_view_suid a tristate : on/off/unspecified sql/table.h: Bug #21080: ALTER VIEW makes user restate SQL SECURITY mode, and ALGORITHM - must make create_view_suid a tristate : on/off/unspecified
-
- 27 Jul, 2006 1 commit
-
-
unknown authored
Fix for BUG#16676: Database CHARSET not used for stored procedures The problem in BUG#16211 is that CHARSET-clause of the return type for stored functions is just ignored. The problem in BUG#16676 is that if character set is not explicitly specified for sp-variable, the server character set is used instead of the database one. The fix has two parts: - always store CHARSET-clause of the return type along with the type definition in mysql.proc.returns column. "Always" means that CHARSET-clause is appended even if it has not been explicitly specified in CREATE FUNCTION statement (this affects BUG#16211 only). Storing CHARSET-clause if it is not specified is essential to avoid changing character set if the database character set is altered in the future. NOTE: this change is not backward compatible with the previous releases. - use database default character set if CHARSET-clause is not explicitly specified (this affects both BUG#16211 and BUG#16676). NOTE: this also breaks backward compatibility. mysql-test/r/mysqldump.result: Updated result file. mysql-test/r/sp.result: Updated result file. mysql-test/t/sp.test: Provided test cases for BUG#16211, BUG#16676. sql/mysql_priv.h: Added two convenient functions for work with databases. sql/sp.cc: 1. Add CHARSET-clause to CREATE-statement if it has been explicitly specified. 2. Polishing -- provided some comments. sql/sp_head.cc: Use database charset as default charset of sp-variable. sql/sp_head.h: Move init_sp_name() out of init_strings(). sql/sql_db.cc: Two new functions created: - load_db_opt_by_name(); - check_db_dir_existence(); sql/sql_show.cc: Eliminate duplicated code by using check_db_dir_existence() and load_db_opt_by_name() sql/sql_table.cc: Eliminate duplicated code by using check_db_dir_existence() and load_db_opt_by_name() sql/sql_yacc.yy: Call sp_head::init_sp_name() to initialize stored routine name.
-
- 15 Jul, 2006 1 commit
-
-
unknown authored
When an alias is set to a column leading spaces are removed from the alias. But when this is done on aliases set by user this can lead to confusion. Now Item::set_name() method issues the warning if leading spaces were removed from an alias set by user. New warning message is added. mysql-test/t/select.test: Added test case for bug#10977:No warning issued if a column name is truncated. mysql-test/r/select.result: Added test case for bug#10977:No warning issued if a column name is truncated. sql/sql_yacc.yy: Fixed bug#10977: No warning issued if a column name is truncated The is_autogenerated_name flag is set before set_name() method call. sql/item.cc: Fixed bug#10977: No warning issued if a column name is truncated Now Item::set_name() method issues the warning if leading spaces were removed from an alias set by user.
-
- 12 Jul, 2006 1 commit
-
-
unknown authored
The character set was not being properly initialized in CAST() with a type like "CHAR(2) BINARY", which resulted in incorrect results or even a crash. mysql-test/r/cast.result: Add new results mysql-test/t/cast.test: Add new regression test sql/sql_yacc.yy: Make sure Lex->charset is set to NULL when nothing follows BINARY in type declaration.
-
- 07 Jul, 2006 1 commit
-
-
unknown authored
Wrong criteria was used to distinguish the case when there was no lookahead performed in the parser. Bug affected only statements ending in one-character token without any optional tail, like CREATE INDEX and CALL. mysql-test/r/sp-code.result: Add result for bug#19207: Final parenthesis omitted for CREATE INDEX in Stored Procedure mysql-test/t/sp-code.test: Add test case for bug#19207: Final parenthesis omitted for CREATE INDEX in Stored Procedure sql/sql_yacc.yy: Use (yychar == YYEMPTY) as the criteria of whether lookahead was not performed.
-
- 02 Jul, 2006 1 commit
-
-
unknown authored
invoker name The bug was fixed similar to how context switch is handled in Item_func_sp::execute_impl(): we store pointer to current Name_resolution_context in Item_func_current_user class, and use its Security_context in Item_func_current_user::fix_fields(). mysql-test/r/view_grant.result: Add result for bug#20570. mysql-test/t/view_grant.test: Add test case for bug#20570. sql/item_create.cc: Remove create_func_current_user(), as it is not used for automatic function creation. sql/item_create.h: Remove prototype for create_func_current_user(). sql/item_strfunc.cc: Add implementations for Item_func_user::init(), Item_func_user::fix_fields() and Item_func_current_user::fix_fields() methods. The latter uses Security_context from current Name_resolution_context, if one is defined. sql/item_strfunc.h: Move implementation of CURRENT_USER() out of Item_func_user to to new Item_func_current_user class. For both classes calculate user name in fix_fields() method. For Item_func_current_user add context field to store Name_resolution_context in effect. sql/sql_yacc.yy: Pass current Name_resolution_context to Item_func_current_user.
-
- 29 Jun, 2006 2 commits
-
-
unknown authored
Table comment: issue a warning(error in traditional mode) if length of comment > 60 symbols Column comment: issue a warning(error in traditional mode) if length of comment > 255 symbols Table 'comment' is changed from char* to LEX_STRING mysql-test/r/strict.result: test case mysql-test/t/strict.test: test case sql/handler.h: Table 'comment' is changed from char* to LEX_STRING sql/sql_show.cc: Table 'comment' is changed from char* to LEX_STRING sql/sql_table.cc: Table 'comment' is changed from char* to LEX_STRING sql/sql_yacc.yy: Table 'comment' is changed from char* to LEX_STRING sql/table.cc: Table 'comment' is changed from char* to LEX_STRING sql/table.h: Table 'comment' is changed from char* to LEX_STRING sql/unireg.cc: Fix for bug#13934 Silent truncation of table comments Table comment: issue a warning(error in traditional mode) if length of comment > 60 symbols Column comment: issue a warning(error in traditional mode) if length of comment > 255 symbols
-
unknown authored
user name is calculated on function execution stage instead of parse stage mysql-test/r/sp_notembedded.result: Bug#15298 SHOW GRANTS FOR CURRENT_USER: Incorrect output in DEFINER context test case mysql-test/t/sp_notembedded.test: Bug#15298 SHOW GRANTS FOR CURRENT_USER: Incorrect output in DEFINER context test case sql/mysql_priv.h: Bug#15298 SHOW GRANTS FOR CURRENT_USER: Incorrect output in DEFINER context new get_current_user(THD *thd, LEX_USER *user) function sql/sql_acl.cc: Bug#15298 SHOW GRANTS FOR CURRENT_USER: Incorrect output in DEFINER context user name is calculated using get_current_user() function sql/sql_parse.cc: Bug#15298 SHOW GRANTS FOR CURRENT_USER: Incorrect output in DEFINER context new get_current_user() function user name is calculated using get_current_user() function sql/sql_yacc.yy: Bug#15298 SHOW GRANTS FOR CURRENT_USER: Incorrect output in DEFINER context empty LEX_USER struct for CURRENT USER, user name is calculated on function execution stage
-
- 27 Jun, 2006 1 commit
-
-
unknown authored
The problem was that we restored SQL_CACHE, SQL_NO_CACHE flags in SELECT statement from internal structures based on value set later at runtime, not the original value set by the user. The solution is to remember that original value. mysql-test/r/auto_increment.result: Update result to not report SQL_NO_CACHE if it wasn't there at first place. mysql-test/r/func_compress.result: Update result to not report SQL_NO_CACHE if it wasn't there at first place. mysql-test/r/func_math.result: Update result to not report SQL_NO_CACHE if it wasn't there at first place. mysql-test/r/func_system.result: Update result to not report SQL_NO_CACHE if it wasn't there at first place. mysql-test/r/func_time.result: Update result to not report SQL_NO_CACHE if it wasn't there at first place. mysql-test/r/information_schema.result: Update result to not report SQL_NO_CACHE if it wasn't there at first place. mysql-test/r/query_cache.result: Update result to not report SQL_NO_CACHE if it wasn't there at first place. mysql-test/r/rpl_get_lock.result: Update result to not report SQL_NO_CACHE if it wasn't there at first place. mysql-test/r/rpl_master_pos_wait.result: Update result to not report SQL_NO_CACHE if it wasn't there at first place. mysql-test/r/show_check.result: Add result for bug#17203. mysql-test/r/subselect.result: Update result to not report SQL_NO_CACHE if it wasn't there at first place. mysql-test/r/type_blob.result: Update result to not report SQL_NO_CACHE if it wasn't there at first place. mysql-test/r/variables.result: Update result to not report SQL_NO_CACHE if it wasn't there at first place. mysql-test/r/view.result: Update result to not report SQL_NO_CACHE if it wasn't there at first place. mysql-test/t/show_check.test: Add test case for bug#17203. sql/sql_lex.cc: Reset SELECT_LEX::sql_cache together with SELECT_LEX::options. sql/sql_lex.h: Add SELECT_LEX::sql_cache field to store original user setting. sql/sql_select.cc: Output SQL_CACHE and SQL_NO_CACHE depending on stored original user setting. sql/sql_yacc.yy: Make effect of SQL_CACHE and SQL_NO_CACHE mutually exclusive. Ignore SQL_CACHE if SQL_NO_CACHE was used. Remember what was set by the user. Reset SELECT_LEX::sql_cache together with SELECT_LEX::options.
-
- 26 Jun, 2006 1 commit
-
-
unknown authored
Bug#19022 "Memory bug when switching db during trigger execution" Bug#17199 "Problem when view calls function from another database." Bug#18444 "Fully qualified stored function names don't work correctly in SELECT statements" Documentation note: this patch introduces a change in behaviour of prepared statements. This patch adds a few new invariants with regard to how THD::db should be used. These invariants should be preserved in future: - one should never refer to THD::db by pointer and always make a deep copy (strmake, strdup) - one should never compare two databases by pointer, but use strncmp or my_strncasecmp - TABLE_LIST object table->db should be always initialized in the parser or by creator of the object. For prepared statements it means that if the current database is changed after a statement is prepared, the database that was current at prepare remains active. This also means that you can not prepare a statement that implicitly refers to the current database if the latter is not set. This is not documented, and therefore needs documentation. This is NOT a change in behavior for almost all SQL statements except: - ALTER TABLE t1 RENAME t2 - OPTIMIZE TABLE t1 - ANALYZE TABLE t1 - TRUNCATE TABLE t1 -- until this patch t1 or t2 could be evaluated at the first execution of prepared statement. CURRENT_DATABASE() still works OK and is evaluated at every execution of prepared statement. Note, that in stored routines this is not an issue as the default database is the database of the stored procedure and "use" statement is prohibited in stored routines. This patch makes obsolete the use of check_db_used (it was never used in the old code too) and all other places that check for table->db and assign it from THD::db if it's NULL, except the parser. How this patch was created: THD::{db,db_length} were replaced with a LEX_STRING, THD::db. All the places that refer to THD::{db,db_length} were manually checked and: - if the place uses thd->db by pointer, it was fixed to make a deep copy - if a place compared two db pointers, it was fixed to compare them by value (via strcmp/my_strcasecmp, whatever was approproate) Then this intermediate patch was used to write a smaller patch that does the same thing but without a rename. TODO in 5.1: - remove check_db_used - deploy THD::set_db in mysql_change_db See also comments to individual files. mysql-test/r/create.result: Modify the result file: a database can never be NULL. mysql-test/r/ps.result: Update test results (Bug#17199 et al) mysql-test/r/sp.result: Update test results (Bug#17199 et al) mysql-test/t/create.test: Update the id of the returned error. mysql-test/t/ps.test: Add test coverage for prepared statements and current database. In scope of work on Bug#17199 "Problem when view calls function from another database." mysql-test/t/sp.test: Add a test case for Bug#17199 "Problem when view calls function from another database." and Bug#18444 "Fully qualified stored function names don't work correctly in SELECT statements". Test a complementary problem. sql/item_strfunc.cc: Touch the code that reads thd->db (cleanup). sql/log_event.cc: While we are at it, replace direct access to thd->db with a method. Should simplify future conversion of THD::db to LEX_STRING. sql/slave.cc: While we are at it, replace direct access to thd->db with a method. Should simplify future conversion of THD::db to LEX_STRING. sql/slave.h: Remove a declaration for a method that is used only in one module. sql/sp.cc: Rewrite sp_use_new_db: this is a cleanup that I needed in order to understand this function and ensure that it has no bugs. sql/sp.h: Add a new declaration for sp_use_new_db (uses LEX_STRINGs) and a comment. sql/sp_head.cc: - drop sp_name_current_db_new - a creator of sp_name class that was used when sp_name was created for an identifier without an explicitly initialized database. Now we pass thd->db to constructor of sp_name right in the parser. - rewrite sp_head::init_strings: name->m_db is always set now - use the new variant of sp_use_new_db - we don't need to update thd->db with SP MEM_ROOT pointer anymore when parsing a stored procedure, as noone will refer to it (yes!) sql/sp_head.h: - remove unneded methods and members sql/sql_class.h: - introduce 3 THD methods to work with THD::db: .set_db to assign the current database .reset_db to reset the current database (temporarily) or set it to NULL .opt_copy_db_to - to deep-copy thd->db to a pointer if it's not NULL sql/sql_db.cc: While we are at it, replace direct access to thd->db with a method. Should simplify future conversion of THD::db to LEX_STRING. sql/sql_insert.cc: - replace checks with asserts: table_list->db must be always set in the parser. sql/sql_lex.h: - add a comment sql/sql_parse.cc: - implement the invariant described in the changeset comment. - remove juggling with lex->sphead in SQLCOM_CREATE_PROCEDURE: now db_load_routine uses its own LEX object and doesn't damage the main LEX. - add DBUG_ASSERT(0) to unused "check_db_used" sql/sql_table.cc: - replace a check with an assert (table_ident->db) sql/sql_trigger.cc: While we are at it, replace direct access to thd->db with a method. Should simplify future conversion of THD::db to LEX_STRING. sql/sql_udf.cc: - use thd->set_db instead of direct modification of to thd->db sql/sql_view.cc: - replace a check with an assert (view->db) sql/sql_yacc.yy: - make sure that we always copy table->db or name->db or ident->db or select_lex->db from thd->db if the former is not set. If thd->db is not set but is accessed, return an error. sql/tztime.cc: - be nice, never copy thd->db by pointer.
-
- 15 Jun, 2006 1 commit
-
-
unknown authored
resulted in a wrong error message. The nest_level counter indicates the depth of nesting for a subselect. It is needed to properly resolve aggregate functions in nested subselects. Obviously it shouldn't be incremented for UNION parts because they have the same level of nesting. This counter was incremented by 1 in the mysql_new_select() function for any new select and wasn't decremented for UNION parts. This resulted in wrongly reported error messages. Now the nest_level counter is decremented by 1 for any union part. mysql-test/t/union.test: Added test case for the bug#18175: The nest_level counter wasn't decremented for union parts which resulted in a wrong error message. mysql-test/r/union.result: Added test case for the bug#18175: The nest_level counter wasn't decremented for union parts which resulted in a wrong error message. sql/sql_yacc.yy: Fixed bug#18175: The nest_level counter wasn't decremented for union parts which resulted in a wrong error message. Now the nest_level counter is decremented by 1 for any union part.
-
- 13 May, 2006 1 commit
-
-
unknown authored
over two views when using syntax with curly braces. Each outer join operation must be placed in a separate nest. This was not done when the syntax with curly braces was used. In some cases, in particular, for queries with outer join operation over views it could cause a crash. mysql-test/r/join_outer.result: Added a test case for bug #19396. mysql-test/t/join_outer.test: Added a test case for bug #19396.
-
- 12 May, 2006 1 commit
-
-
unknown authored
from within triggers Add support for passing NEW.x as INOUT and OUT parameters to stored procedures. Passing NEW.x as INOUT parameter requires SELECT and UPDATE privileges on that column, and passing it as OUT parameter requires only UPDATE privilege. mysql-test/r/sp-error.result: Update the result for new message. mysql-test/r/trigger-grant.result: Add result for bug#14635. mysql-test/r/trigger.result: Add result for bug#14635. mysql-test/t/trigger-grant.test: Add test case for bug#14635. mysql-test/t/trigger.test: Add test case for bug#14635. sql/item.cc: Add implementations of set_value() and set_required_privilege() methods of Settable_routine_parameter interface. Use Item_trigger_field::want_privilege instead of Item_trigger_field::access_type. Reset privileges on Item_trigger_field::cleanup(). sql/item.h: Add interface class Settable_routine_parameter and interface query method to Item class. Item_splocal and Item_trigger_field implement this interface. For Item_trigger_field: - add read_only attribute and is_read_only() method. - remove access_type and add original_privilege and want_privilege instead. - add set_value() method. - add reset_privilege() method. sql/item_func.cc: Add implementations of set_value() method of Settable_routine_parameter interface. sql/item_func.h: Item_func_get_user_var implements Settable_routine_parameter interface. sql/share/errmsg.txt: Update english ER_SP_NOT_VAR_ARG message. sql/sp_head.cc: Use Settable_routine_parameter interface for parameter update. sql/sql_yacc.yy: Set read_only and want_privilege members in Item_trigger_field appropriately. For NEW.x trigger variable used in left-hand-side of SET statement the latter is set to UPDATE_ACL, otherwise it is set to SELECT_ACL (but see Item_trigger_field::set_required_privilege(), where it may be updated to different value).
-
- 03 May, 2006 1 commit
-
-
unknown authored
There were two distict bugs: parse error was returned for valid statement and that error wasn't reported to the client. The fix ensures that EXPLAIN SELECT..INTO is accepted by parser and any other parse error will be reported to the client. mysql-test/r/explain.result: Add result for bug#15463. mysql-test/t/explain.test: Add test case for bug#15463. sql/sql_parse.cc: Assert that if parsing error has occured then apropriate error message has been pushed into error stack. sql/sql_yacc.yy: If there is no lex->result in select_var_ident rule, then we have to be in DESCRIBE mode.
-
- 21 Apr, 2006 2 commits
-
-
unknown authored
-
unknown authored
The bug caused wrong result sets for union constructs of the form (SELECT ... ORDER BY order_list1 [LIMIT n]) ORDER BY order_list2. For such queries order lists were concatenated and limit clause was completely neglected. mysql-test/r/order_by.result: Added a test case for bug #18767. mysql-test/t/order_by.test: Added a test case for bug #18767. sql/sql_lex.h: Fixed bug #18767. Placed the code the created a fake SELECT_LEX into a separate function. sql/sql_parse.cc: Fixed bug #18767. Placed the code the created a fake SELECT_LEX into a separate function. sql/sql_select.cc: Fixed bug #18767. Changed the condition on which a SELECT is treated as part of a UNION. The SELECT in (SELECT ... ORDER BY order_list1 [LIMIT n]) ORDER BY order_list2 now is handled in the same way as the first SELECT in a UNION sequence. sql/sql_union.cc: Fixed bug #18767. Changed the condition at which a SELECT is treated as part of a UNION. The SELECT in (SELECT ... ORDER BY order_list1 [LIMIT n]) ORDER BY order_list2 now is handled in the same way as the first SELECT in a UNION sequence. sql/sql_yacc.yy: Fixed bug #18767. Changed the condition at which a SELECT is treated as part of a UNION. The SELECT in (SELECT ... ORDER BY order_list1 [LIMIT n]) ORDER BY order_list2 now is handled in the same way as the first SELECT in a UNION sequence. In the same way is handled the SELECT in (SELECT ... LIMIT n) ORDER BY order list. Yet if there is neither ORDER BY nor LIMIT in the single-select union construct (SELECT ...) ORDER BY order_list then it is still handled as simple select with an order clause.
-
- 18 Apr, 2006 1 commit
-
-
unknown authored
Removed sp-goto.test, sp-goto.result and all (disabled) GOTO code. Also removed some related code that's not needed any more (no possible unresolved label references any more, so no need to check for them). NB: Keeping the ER_SP_GOTO_IN_HNDLR in errmsg.txt; it might become useful in the future, and removing it (and thus re-enumerating error codes) might upset things. (Anything referring to explicit error codes.) BitKeeper/deleted/.del-sp-goto.result~f343103c63f64b7a: Delete: mysql-test/r/sp-goto.result BitKeeper/deleted/.del-sp-goto.test~5054d3f729692d3d: Delete: mysql-test/t/sp-goto.test mysql-test/t/disabled.def: sp-goto.test no longer exists. sql/lex.h: Removed (disabled) GOTO definitions. sql/sp_head.cc: Removed sp_head::check_backpatch() and simplified sp_head::backpatch(). Without GOTO, unresolved label references are not possible, so no need to check for them. sql/sp_head.h: Removed sp_head::check_backpatch(). (Not needed with no GOTO) sql/sp_pcontext.cc: SP_LAB_GOTO was renamed to SP_LAB_IMPL sql/sp_pcontext.h: Removed SP_LAB_REF (no longer needed) and renamed SP_LAB_GOTO to SP_LAB_IMPL, since it's only used for implicit labels now. sql/sql_yacc.yy: Removed GOTO symbols and (disabled) code, and the no longer needed sp_head::check_backpatch() calls.
-
- 12 Apr, 2006 1 commit
-
-
unknown authored
Fixed in parser. rpl_view gained no changes but rpl_view-slave.opt. sql/sql_yacc.yy: UPDATING option for create/alter view is added for tables_ok to finds the view's TABLE_LIST.updating as true. FIXME: Regarding to UPDATING option `create view' should not have any difference from `create table'. mysql-test/t/rpl_view-slave.opt: The option is needed to force slave executes tables_ok which must return OK in conditions of this tests (no table foo is used.
-
- 07 Apr, 2006 1 commit
-
-
unknown authored
Also added comments, and fixing some coding style (mostly in comments too). There are no functional changes, so no tests or documentation needed. (This was originally part of a bugfix, but it was decided to not include this in that patch; instead it's done separately.) sql/sp_head.cc: Renaming sp_pcontext members and methods; less cryptic and more consistent. sql/sp_head.h: Renaming sp_pcontext members and methods; less cryptic and more consistent. sql/sp_pcontext.cc: Renaming sp_pcontext members and methods; less cryptic and more consistent. Also added comments, and fixing some coding style (mostly in comments too). sql/sp_pcontext.h: Renaming sp_pcontext members and methods; less cryptic and more consistent. Also added comments, and fixing some coding style (mostly in comments too). sql/sp_rcontext.cc: Renaming sp_pcontext members and methods; less cryptic and more consistent. sql/sp_rcontext.h: Renaming sp_pcontext members and methods; less cryptic and more consistent. sql/sql_yacc.yy: Renaming sp_pcontext members and methods; less cryptic and more consistent.
-
- 15 Mar, 2006 1 commit
-
-
unknown authored
because it can couse problem with Query cache (BUG#14767) mysql-test/r/query_cache_notembedded.result: BUG#14767 test suite. mysql-test/t/query_cache_notembedded.test: BUG#14767 test suite. sql/sql_insert.cc: Query cache invalidation table we was inserting in just after unlocking table added to avoid the race condition as we had with SP. sql/sql_parse.cc: Query cache invalidation table we was inserting in just after unlocking table added to avoid the race condition as we had with SP. sql/sql_yacc.yy: We should prohibit concurent read of unserting file in SP because it can cause problem with query cache.
-
- 10 Mar, 2006 1 commit
-
-
unknown authored
After the ChangeSet 1.1892.20.1 2005/08/24 (Bug #12562) SYSDATE() is not an alias of NOW() and is unsafe for replication. `SYSDATE()' backward compatible aliasing clashes with the idea #12562 fix. To make it safe-replicatable we have to either use RBR or to restore the pre-5.0 style. --sysdate-is-now command line flag was introduced to provide backward compatibility. sql/mysqld.cc: New option to force SYSDATE's backward compatible with 4.1 aliasing to NOW (not default) sql/sql_class.h: new slot to fill at init time and check at parse sql/sql_yacc.yy: calling NOW's branches when --sysdate-is-now mysql-test/r/sysdate_is_now.result: New BitKeeper file ``mysql-test/r/sysdate_is_now.result'' mysql-test/t/sysdate_is_now-master.opt: New BitKeeper file ``mysql-test/t/sysdate_is_now-master.opt'' mysql-test/t/sysdate_is_now.test: New BitKeeper file ``mysql-test/t/sysdate_is_now.test''
-
- 06 Mar, 2006 1 commit
-
-
unknown authored
-
- 04 Mar, 2006 1 commit
-
-
unknown authored
qualified subject table" which was introduced during work on bug #13525 "Rename table does not keep info of triggers". The bug was caused by the fact that during reconstruction of CREATE TRIGGER statement stored in .TRG file which happened during RENAME TABLE we damaged trigger definition in case when it contained fully qualified name of subject table (see comment for sql_yacc.yy for more info). mysql-test/r/trigger.result: Added test for bug #17866 "Problem with renaming table with triggers with fully qualified subject table". mysql-test/t/trigger.test: Added test for bug #17866 "Problem with renaming table with triggers with fully qualified subject table". sql/sql_trigger.cc: Table_triggers_list::change_table_name_in_triggers(): Instead of trying to use pointer to the end of subject table identifier we use pointer to the beginning of FOR lexeme now, so during reconstruction of CREATE TRIGGER statement in this function we need to add extra space before part which begins with FOR to get nice trigger definition. sql/sql_yacc.yy: trigger_tail: In this rule we can't rely on using remember_end token after table_ident token, since value returned depends on whether table name is fully qualified or not. So instead of trying to get pointer to the end of table identifier we use pointer to the beginning of FOR lexeme.
-
- 02 Mar, 2006 1 commit
-
-
unknown authored
The idea is to add DEFINER-clause in CREATE PROCEDURE and CREATE FUNCTION statements. Almost all support of definer in stored routines had been already done before this patch. NOTE: this patch changes behaviour of dumping stored routines in mysqldump. Before this patch, mysqldump did not dump DEFINER-clause for stored routines and this was documented behaviour. In order to get full information about stored routines, one should have dumped mysql.proc table. This patch changes this behaviour, so that DEFINER-clause is dumped. Since DEFINER-clause is not supported in CREATE PROCEDURE | FUNCTION statements before this patch, the clause is covered by additional version-specific comments. client/mysqldump.c: Updated the code for dumping stored routines: cover DEFINER-clause into version-specific comment. mysql-test/r/gis.result: Updated result file after adding DEFINER-clause. mysql-test/r/information_schema.result: Updated result file after adding DEFINER-clause. mysql-test/r/mysqldump.result: Updated result file after adding DEFINER-clause. mysql-test/r/rpl_ddl.result: Updated result file after adding DEFINER-clause. mysql-test/r/rpl_sp.result: Updated result file after adding DEFINER-clause. mysql-test/r/rpl_trigger.result: Updated result file after adding DEFINER-clause. mysql-test/r/sp-security.result: Updated result file after adding DEFINER-clause. mysql-test/r/sp.result: Updated result file after adding DEFINER-clause. mysql-test/r/sql_mode.result: Updated result file after adding DEFINER-clause. mysql-test/t/sp-security.test: Updated result file after adding DEFINER-clause. sql/sp.cc: Added DEFINER-clause. sql/sp_head.cc: Added a new convenient variant of set_definer() operation. sql/sp_head.h: Updated result file after adding DEFINER-clause. sql/sql_lex.h: Renamed trigger_definition_begin into stmt_definition_begin to be used for triggers and stored routines. sql/sql_parse.cc: Check DEFINER-clause. sql/sql_trigger.cc: Renamed trigger_definition_begin into stmt_definition_begin to be used for triggers and stored routines. sql/sql_yacc.yy: Added DEFINER-clause.
-
- 01 Mar, 2006 1 commit
-
-
unknown authored
The idea of the fix is to extend support of non-SUID triggers for backward compatibility. Formerly non-SUID triggers were appeared when "new" server is being started against "old" database. Now, they are also created when "new" slave receives updates from "old" master. mysql-test/r/rpl_trigger.result: Updated the result file with the results of the test for BUG#16266. mysql-test/t/rpl_trigger.test: Added the test case for BUG#16266. sql/mysql_priv.h: Added an utility operation to be used from sql_yacc.yy. sql/sql_parse.cc: Add a utility operation to be used from sql_yacc.yy. sql/sql_trigger.cc: Extend support of non-SUID triggers. sql/sql_view.cc: Initialize LEX::definer if DEFINER-clause is missing. sql/sql_yacc.yy: Extended support of non-SUID triggers. mysql-test/std_data/bug16266.000001: A new binlog file for testing a patch for BUG#16266.
-
- 24 Feb, 2006 1 commit
-
-
unknown authored
Let us transfer triggers associated with table when we rename it (but only if we are not changing database to which table belongs, in the latter case we will emit error). mysql-test/r/trigger.result: Added test for bug #13525 "Rename table does not keep info of triggers". mysql-test/t/trigger.test: Added test for bug #13525 "Rename table does not keep info of triggers". sql/sql_rename.cc: rename_tables(): Now after renaming table's .FRM file and updating handler data we call Table_triggers_list::change_table_name() which is reponsible for updating .TRG and .TRN files. sql/sql_table.cc: mysql_alter_table(): Now in case when ALTER should rename table we call Table_triggers_list::change_table_name() which is responsible for updating .TRG and .TRN files after renaming table. sql/sql_trigger.cc: Added Table_triggers_list::change_table_name() method and change_table_name_in_triggers()/trignames() methods responsible for updating .TRG and .TRN files for table during its renaming. Two small cleanups - removed versioning for .TRG files (since it was not working before anyway) and emphasized that type of lock specified in tables list is unimportant for DROP TABLE (since this statement uses name-locking). sql/sql_trigger.h: Table_triggers_list: Added on_table_names_list member to store pointers and lenghts of "ON table_name" parts in triggers' definitions to be able easily change them during RENAME TABLE. Added change_table_name() method and change_table_name_in_trignames/triggers() helper methods responsible for updating .TRG and .TRN files. sql/sql_yacc.yy: trigger_tail: To be able properly update triggers' definitions with new table names when renaming tables we need to know where in CREATE TRIGGER statement "ON db_name.table_name" part resides. Small cleanup - let us emphasize that for CREATE TRIGGER statement lock type which is specified in table list is unimportant since name-locking is used.
-
- 17 Feb, 2006 1 commit
-
-
unknown authored
necessary implementation in the server mysql_upgrade script added client/mysqlcheck.c: --check-upgrade option added include/my_base.h: errcode added include/myisam.h: option added scripts/Makefile.am: mysql_upgrade script added sql/handler.cc: checks for old types/bugs added sql/handler.h: declarations regarding checks for upgrade sql/lex.h: sym added sql/share/errmsg.txt: error message added sql/slave.cc: now ha_repair is for public use sql/sql_table.cc: upgrade in ha_repair implemented sql/sql_yacc.yy: CHECK ... FOR UPGRADE added to syntax
-
- 15 Feb, 2006 1 commit
-
-
unknown authored
The problem was a code generation bug: cpop instructions were not generated when using ITERATE back to an outer block from a context with a declared cursor; this would make it push a new cursor without popping in-between, eventually overrunning the cursor stack with a crash as the result. Fixed the calculation of how many cursors to pop (in sp_pcontext.cc: diff_cursors()), and also corrected diff_cursors() and diff_handlers() to when doing a "leave"; don't include the last context we're leaving (we are then jumping to the appropriate pop instructions). mysql-test/r/sp.result: Updated result for new test case (BUG#16887) mysql-test/t/sp.test: New test case for BUG#16887 sql/sp_pcontext.cc: Added new parameter to sp_pcontext::diff_handlers() and diff_cursors(): They can either include (for iterate jumps) or exclude (for leave jumps) the outer context. Fixed bug in diff_cursors(); it was just plain wrong and would return zero in some situations when it shouldn't. sql/sp_pcontext.h: Added new parameter to sp_pcontext::diff_handlers() and diff_cursors(): They can either include (for iterate jumps) or exclude (for leave jumps) the outer context. sql/sql_yacc.yy: Added parameter to diff_handlers/diff_cursors depending on if it's an iterate or leave jump. For "leave", we don't have to include the last context we're leaving since we will jump to the appropriate pop instructions.
-
- 14 Feb, 2006 1 commit
-
-
unknown authored
Backporting character_set_filesystem from 5.0 to 5.1. sql/mysqld.cc: Backporting character_set_filesystem from 5.0 to 5.1. sql/set_var.cc: Backporting character_set_filesystem from 5.0 to 5.1. sql/set_var.h: Backporting character_set_filesystem from 5.0 to 5.1. sql/sql_class.cc: Backporting character_set_filesystem from 5.0 to 5.1. sql/sql_class.h: Backporting character_set_filesystem from 5.0 to 5.1. sql/sql_yacc.yy: Backporting character_set_filesystem from 5.0 to 5.1. mysql-test/t/variables.test: Backporting character_set_filesystem from 5.0 to 5.1. mysql-test/r/variables.result: Backporting character_set_filesystem from 5.0 to 5.1.
-
- 09 Feb, 2006 1 commit
-
-
unknown authored
Check if AGGREGATE was given with a stored (non-UDF) function, and return error in that case. Also made udf_example/udf_test work again, by adding a missing *_init() function. (_init() functions required unless --allow_suspicious_udfs is given to the server, since March 2005 - it seems udf_example wasn't updated at the time.) mysql-test/r/sp-error.result: Updated results for BUG#16896. mysql-test/t/sp-error.test: Added test case for BUG#16896. sql/share/errmsg.txt: New error message: ER_SP_NO_AGGREGATE sql/sql_yacc.yy: Check if AGGREGATE was used when creating a stored function (i.e. not an UDF). sql/udf_example.cc: Added myfunc_int_init() function to make it work when the server is running without --allow_suspicious_udfs.
-
- 28 Jan, 2006 1 commit
-
-
unknown authored
We should disallow usage of RETURN statement in triggers and emit error at parsing time (instead of crashing when trigger is fired). mysql-test/r/trigger.result: Added test for bug #16829 "Firing trigger with RETURN crashes the server". mysql-test/t/trigger.test: Added test for bug #16829 "Firing trigger with RETURN crashes the server". sql/sql_yacc.yy: We should disallow usage of RETURN statement in triggers and emit error at parsing time (instead of crashing when trigger is fired).
-
- 26 Jan, 2006 1 commit
-
-
unknown authored
After trying multiple inheritance (to messy and hard make it work) and sublassing jump_if_not (worked, but ugly), decided to on this solution instead: Inserting an abstract sp_instr_opt_meta class as parent for all instructions with destinations makes it possible to handle a continuation pointer for sp_instr_set_case_expr too. Note: No special test case; the fix is captured by the changed behaviour of bug14643_2, and bug14498_4 (formerly disabled), in sp.test. mysql-test/r/sp.result: Updated results for BUG#16568 (affects results for bug14643_2 and bug14498_4) mysql-test/t/sp.test: Enabled test bug14498_4 for BUG#16568. sql/sp_head.cc: Changed type of some parameters and variables (sp_instr_opt_meta instead of sp_instr_jump*). Added consistency check of m_ip member in instructions in sp_head::show_routine_code(). Updated print() method of, and added opt_mark() and opt_move() methods to sp_instr_set_case_expr, to handle the new continuation destination. sql/sp_head.h: New abstract class between sp_instr and instructions with destinations, in particular sp_instr_set_case_expr, for continuation destination handling. Changed type of some parameters and variables (sp_instr_opt_meta instead of sp_instr_jump*). Added opt_mark(), opt_move() and set_destination() methods to sp_instr_set_case_expr. sql/sql_parse.cc: Fixed small bug at show_routine_code() call (tested return value the wrong way). sql/sql_yacc.yy: sp_instr_set_case_expr is now added to backpatch list (for the new cont. destination).
-
- 25 Jan, 2006 1 commit
-
-
unknown authored
Second version. The problem was that the optimizer didn't work correctly with forwards jumps to "no-op" hpop and cpop instructions. Don't generate "no-op" instructions (hpop 0 and cpop 0), it isn't actually necessary. mysql-test/r/sp-code.result: Updated results for new test case (BUG#15737) mysql-test/t/sp-code.test: New test case (BUG#15737) sql/sp_head.cc: Removed backpatch methods from sp_instr_hpop/cpop, since they're not needed any more. Added more documentation to sp_head::optimize() sql/sp_head.h: Removed backpatch and opt_mark methods from sp_instr_hpop/cpop, since they're not needed any more. Added comments to optimizer methods in sp_instr. sql/sql_yacc.yy: Don't generate "no-op" hpop and cpop instructions for LEAVE, it's not necessary. Just generate them when needed.
-
- 24 Jan, 2006 1 commit
-
-
unknown authored
- BUG#15166: Wrong update permissions required to execute triggers - BUG#15196: Wrong select permission required to execute triggers The idea of the fix is to check necessary privileges in Item_trigger_field::fix_fields(), instead of having "special variables" technique. To achieve this, we should pass to an Item_trigger_field instance a flag, which will indicate the usage/access type of this trigger variable. mysql-test/r/trigger-grant.result: Update the result file. mysql-test/t/trigger-grant.test: Add test cases for BUG#15166 and BUG#15196 sql/item.cc: Item_trigger_field: check appropriate (SELECT/UPDATE) privilege in fix_fields(). sql/item.h: Add a flag to specify access type for trigger field. sql/sql_trigger.cc: "Special variable" technique of checking privileges for NEW/OLD variables was replaced by checking table- and column-level privileges in Item_trigger_field::fix_fields(). sql/sql_trigger.h: "Special variable" technique of checking privileges for NEW/OLD variables was replaced by checking table- and column-level privileges in Item_trigger_field::fix_fields(). sql/sql_yacc.yy: Specify access type for trigger fields.
-
- 19 Jan, 2006 1 commit
-
-
unknown authored
sql/sp_head.cc: Post-review fix. sql/sp_head.h: Post-review fix. sql/sql_yacc.yy: Post-review fix.
-
- 12 Jan, 2006 1 commit
-
-
unknown authored
mysql-test/r/information_schema.result: Remove extra spaces from result file. mysql-test/r/mysqldump.result: Remove extra spaces from result file. mysql-test/r/rpl_ddl.result: Remove extra spaces from result file. mysql-test/r/trigger-compat.result: Remove extra spaces from result file. mysql-test/r/trigger-grant.result: Remove extra spaces from result file. mysql-test/r/trigger.result: Remove extra spaces from result file. sql/sql_yacc.yy: Remove leading spaces.
-
- 11 Jan, 2006 1 commit
-
-
unknown authored
Absence of table in left part of LEFT/RIGHT join wasn't checked before name resolution which resulted in NULL dereferencing and server crash. Modified rules: "table_ref LEFT opt_outer JOIN_SYM table_ref" and "table_ref RIGHT opt_outer JOIN_SYM table_ref" NULL check is moved before push_new_name_resolution_context() sql/sql_yacc.yy: Fixed bug #15538: unchecked table absence caused server crash. Modified rules: "table_ref LEFT opt_outer JOIN_SYM table_ref" and "table_ref RIGHT opt_outer JOIN_SYM table_ref" NULL check is moved before push_new_name_resolution_context() mysql-test/r/select.result: Added test case for bug #15538: unchecked table absence caused server crash. mysql-test/t/select.test: Added test case for bug #15538: unchecked table absence caused server crash.
-