An error occurred fetching the project authors.
- 08 Feb, 2005 1 commit
-
-
unknown authored
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.
-
- 01 Feb, 2005 1 commit
-
-
unknown authored
Support for COMMIT/ROLLBACK optional arguments innobase/include/trx0roll.h: WL#1967 trx_release_savepoint_for_mysql() innobase/trx/trx0roll.c: WL#1967 trx_release_savepoint_for_mysql() mysql-test/r/innodb.result: WL#1967 Test for savepoint release mysql-test/t/innodb.test: WL#1967 Test for savepoint release sql/ha_innodb.cc: WL#1967 innobase_release_savepoint_name() sql/ha_innodb.h: WL#1967 innobase_release_savepoint_name() sql/handler.cc: WL#1967 ha_release_savepoint_name() sql/handler.h: WL#1967 ha_release_savepoint_name() sql/lex.h: WL#1967 New tokens: CHAIN, RELEASE sql/mysqld.cc: WL#1967 new option: completion-type sql/set_var.cc: WL#1967 new option: completion-type sql/sql_class.h: WL#1967 new option: completion-type sql/sql_lex.h: WL#1967 Support RELEASE SAVEPOINT additional flags to support COMMIT/ROLLBACK options sql/sql_parse.cc: WL#1967 Transaction operations in mysql_endtrans(), begin_trans() sql/sql_yacc.yy: WL#1967 Support COMMIT/ROLLBACK optional args
-
- 24 Jan, 2005 1 commit
-
-
unknown authored
fixed cols() method call (it have to be called only after fix_fields()) mysql-test/r/subselect.result: Comparison subquery with * and row mysql-test/t/subselect.test: Comparison subquery with * and row sql/item_cmpfunc.h: initialization allowed_arg_cols for autodetection sql/item_func.cc: support of allowed_arg_cols autodetection by first argument sql/item_func.h: commant sql/item_subselect.cc: correct column number fetching for subqueries sql/sql_lex.h: method to check that UNION is prepared
-
- 31 Dec, 2004 1 commit
-
-
unknown authored
This allows use to use INSERT IGNORE ... ON DUPLICATE ... mysql-test/r/drop.result: safety fix mysql-test/t/drop.test: safety fix mysql-test/t/multi_update.test: ensure we cover all possible errors sql/log_event.cc: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/log_event.h: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/mysql_priv.h: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/sql_class.h: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/sql_delete.cc: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/sql_insert.cc: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/sql_lex.cc: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/sql_lex.h: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/sql_load.cc: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/sql_parse.cc: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/sql_repl.cc: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/sql_repl.h: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/sql_select.cc: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/sql_table.cc: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/sql_union.cc: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/sql_update.cc: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/sql_yacc.yy: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag
-
- 27 Dec, 2004 1 commit
-
-
unknown authored
-
- 24 Dec, 2004 1 commit
-
-
unknown authored
Logging to logging@openlogging.org accepted sql_yacc.yy, sql_parse.cc, sql_lex.h, lex.h: Implements the SHOW MUTEX STATUS command set_var.cc, mysqld.cc, mysql_priv.h: Added new GLOBAL variable timed_mutexes ha_innodb.h: New function innodb_mutex_show_status ha_innodb.cc: Added new innodb variables in SHOW STATUS Implements the SHOW MUTEX STATUS command innodb.test, innodb.result: Added new row_lock_waits status variables tests. variables.test, variables.result: test new variable timed_mutexes ut0ut.c: New function ut_usectime. sync0sync.c: Mutex counting. sync0rw.c: New mutex parameters initialization. srv0srv.c: Counting row lock waits row0sel.c, row0mysql.c: Setting row_lock or table_lock state to thd. que0que.c: Added default no_lock_state to thd. univ.i: Added UNIV_SRV_PRINT_LATCH_WAITS debug define sync0sync.ic: Count mutex using. sync0sync.h: Added new parameters to mutex structure for counting. sync0rw.h: Added new parameters to rw_create_func. srv0srv.h: Added new innodb varuables to SHOW STATUS. que0que.h: Added thread lock states. innobase/include/que0que.h: Added thread lock states. innobase/include/srv0srv.h: Added new innodb varuables to SHOW STATUS. innobase/include/sync0rw.h: Added new parameters to rw_create_func. innobase/include/sync0sync.h: Added new parameters to mutex structure for counting. innobase/include/sync0sync.ic: Count mutex using. innobase/include/univ.i: Added UNIV_SRV_PRINT_LATCH_WAITS debug define innobase/que/que0que.c: Added default no_lock_state to thd. innobase/row/row0mysql.c: Setting row_lock or table_lock state to thd. innobase/row/row0sel.c: Setting row_lock or table_lock state to thd. innobase/srv/srv0srv.c: Counting row lock waits innobase/sync/sync0rw.c: New mutex parameters initialization. innobase/sync/sync0sync.c: Mutex counting. innobase/ut/ut0ut.c: New function ut_usectime. mysql-test/r/variables.result: test new variable timed_mutexes mysql-test/r/innodb.result: Added new row_lock_waits status variables tests. mysql-test/t/variables.test: test new variable timed_mutexes mysql-test/t/innodb.test: Added new row_lock_waits status variables tests. sql/ha_innodb.cc: Added new innodb variables in SHOW STATUS Implements the SHOW MUTEX STATUS command sql/ha_innodb.h: New function innodb_mutex_show_status sql/lex.h: Implements the SHOW MUTEX STATUS command sql/mysql_priv.h: Added new GLOBAL variable timed_mutexes sql/mysqld.cc: Added new GLOBAL variable timed_mutexes sql/set_var.cc: Added new GLOBAL variable timed_mutexes sql/sql_lex.h: Implements the SHOW MUTEX STATUS command sql/sql_parse.cc: Implements the SHOW MUTEX STATUS command sql/sql_yacc.yy: Implements the SHOW MUTEX STATUS command BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
-
- 23 Dec, 2004 1 commit
-
-
unknown authored
Implement fine-grained control over access to stored procedures Privileges are cached (same way as existing table/column privs) mysql-test/include/system_db_struct.inc: WL#925 - Privileges for stored routines New system table: procs_priv mysql-test/r/connect.result: WL#925 - Privileges for stored routines New system table: procs_priv mysql-test/r/grant.result: WL#925 - Privileges for stored routines user table has additional privilege attributes SHOW PRIVILEGES amended mysql-test/r/grant2.result: Fix result mysql-test/r/information_schema.result: WL#925 - Privileges for stored routines New system table procs_priv New user privileges mysql-test/r/show_check.result: Fix result mysql-test/r/sp-security.result: WL#925 - Privileges for stored routines Fix existing tests to work with new privileges New tests for new privileges mysql-test/r/sp.result: WL#925 - Privileges for stored routines Fix SHOW PRIVILEGES results mysql-test/r/system_mysql_db.result: WL#925 - Privileges for stored routines New system table: procs_priv user and db tables have new privilege attributes mysql-test/t/grant2.test: Fix test mysql-test/t/show_check.test: Fix test mysql-test/t/sp-security.test: WL#925 - Privileges for stored routines Allow existing tests to run with new privilege checks New tests for privileges mysql-test/t/system_mysql_db_fix.test: WL#925 - Privileges for stored routines New system table: procs_priv scripts/mysql_create_system_tables.sh: WL#925 - Privileges for stored routines db and user has new privilege attributes new system table: procs_priv scripts/mysql_fix_privilege_tables.sql: WL#925 - Privileges for stored routines new system table: procs_priv scripts/mysql_install_db.sh: WL#925 - Privileges for stored routines Amend comment sql/item_func.cc: WL#925 - Privileges for stored routines Privilege check for stored FUNCTION routine sql/lex.h: WL#925 - Privileges for stored routines new token ROUTINE sql/mysql_priv.h: WL#925 - Privileges for stored routines New function: check_procedure_access() sql/mysqld.cc: WL#925 - Privileges for stored routines system option automatic-sp-privileges sql/set_var.cc: WL#925 - Privileges for stored routines system option automatic-sp-privileges sql/share/errmsg.txt: WL#925 - Privileges for stored routines rename errormessage to conform: ER_SP_ACCESS_DENIED_ERROR -> ER_PROCACCESS_DENIED_ERROR New error messages ER_NONEXISTING_PROC_GRANT, ER_PROC_AUTO_GRANT_FAIL, ER_PROC_AUTO_REVOKE_FAIL sql/sp.cc: WL#925 - Privileges for stored routines new function: sp_exists_routine() sql/sp.h: WL#925 - Privileges for stored routines new function: sp_exists_routine() sql/sql_acl.cc: WL#925 - Privileges for stored routines Implementation for SP privileges. Privileges are cached in memory hash. New functions: mysql_procedure_grant() check_grant_procedure() sp_revoke_privileges() sp_grant_privileges() sql/sql_acl.h: WL#925 - Privileges for stored routines New privilege bits: CREATE_PROC_ACL, ALTER_PROC_ACL Alter confusing bit-segments to be shifted New macros: fix_rights_for_procedure() get_rights_for_procedure() New functions: mysql_procedure_grant() check_grant_procedure() sp_grant_privileges() sp_revoke_privileges() sql/sql_lex.h: WL#925 - Privileges for stored routines new all_privileges attribute in LEX sql/sql_parse.cc: WL#925 - Privileges for stored routines Remove function: check_sp_definer_access() Add handling for SP grants/revokes Add privilege checks for stored procedure invocation sql/sql_show.cc: WL#925 - Privileges for stored routines update result for SHOW PRIVILEGES sql/sql_yacc.yy: WL#925 - Privileges for stored routines New token ROUTINE rename some rules handle CREATE ROUTINE / ALTER ROUTINE privileges
-
- 17 Dec, 2004 1 commit
-
-
unknown authored
IN and CONVERT_TZ()" (with after review changes). Now we add implicitly used time zone tables to global table list right at the parsing stage instead of doing it later in mysql_execute_command() or in check_prepared_statement(). No special test-case needed since this bug also manifests itself as timezone2.test failure if one runs it with --ps-protocol option. sql/sql_base.cc: relink_tables_for_multidelete(): presence of implicitly used time zone tables is no longer condition for propagation of TABLE pointers from global table list to local table lists (since now global list is always created...) sql/sql_lex.cc: - Added LEX::add_time_zone_tables_to_query_tables() function which adds implicitly used time zone tables to global table list. - Definition of fake_time_zone_tables_list moved to tztime.cc, since it is no longer used in parser. sql/sql_lex.h: - Since now we add implicitly used time zone tables right at parsing stage, LEX::time_zone_tables_used is either zero or points to valid time zone tables list. Updated its description to reflect that. - Added LEX::add_time_zone_tables_to_query_tables() function which adds implicitly used time zone tables to global table list. - Declaration of fake_time_zone_tables_list moved to tztime.h, since it is no longer used in parser. sql/sql_parse.cc: mysql_execute_command(): Removed adding list of implicitly used time zone tables to global table list, since now we do this right at the parsing stage. sql/sql_yacc.yy: Let us add implicitly used time zone tables to global table list right at the parsing stage instead of doing it later in mysql_execute_command() or in check_prepared_statement(). sql/tztime.cc: Moved fake_time_zone_tables_list definition from sql_lex.cc to tztime.cc since now it is used only for error reporting from my_tz_get_table_list() function. sql/tztime.h: Moved fake_time_zone_tables_list declaration from sql_lex.h to tztime.h since now it is used only for error reporting from my_tz_get_table_list() function.
-
- 13 Dec, 2004 1 commit
-
-
unknown authored
UPDATE clause conflicts with SELECT for use of item_list field. Alter UPDATE clause to use new lex field update_list Tests included mysql-test/r/insert_update.result: WL#2274 New tests for INSERT..SELECT..UPDATE mysql-test/t/insert_update.test: WL#2274 New tests for INSERT..SELECT..UPDATE sql/mysql_priv.h: Remove function - insert_select_precheck() sql/sql_class.h: WL#2274 New constructor for class select_insert sql/sql_insert.cc: WL#2274 Move code into mysql_prepare_insert Add checks as param values may be NULL sql/sql_lex.cc: WL#2274 initialize lex->update_list sql/sql_lex.h: WL#2274 New field in LEX: update_list sql/sql_parse.cc: WL#2274 INSERT..UPDATE clause now populates lex->update_list Remove redundant function: insert_select_precheck() sql/sql_prepare.cc: WL#2274 invoke insert_precheck() instead of insert_select_precheck() sql/sql_yacc.yy: WL#2274 Enable INSERT..SELECT..UPDATE syntax New rule - insert_update_list, to populate lex->update_list
-
- 09 Dec, 2004 1 commit
-
-
unknown authored
transactional table locks to tables mentioned in the query. These locks are released at the end of the transaction automatically. This is fix for bugs #5655, #5998 and issue #3762. innobase/include/lock0lock.h: Added a new lock type LOCK_TABLE_TRANSACTIONAL. innobase/include/trx0trx.h: Added a varible to store the number of transactional table locks reserved by the transaction and stored in the trx_locks list. innobase/lock/lock0lock.c: Added a lock type LOCK_TABLE_TRANSACTIONAL. innobase/row/row0mysql.c: Added support for a transactional table lock. innobase/trx/trx0roll.c: Make compiler happy and format function. innobase/trx/trx0trx.c: Added information about number of explicit and transactional table locks in the innodb monitor. sql/ha_innodb.cc: Added support for a LOCK_TABLE_TRANSACTIONAL table lock (SQLCOM_LOCK_TABLES_TRANSACTIONAL). Transactional table locks are taken in the function ::transactional_table_lock(). sql/ha_innodb.h: Added prototype for a function trandactional_table_lock(). sql/handler.h: Added prototype for a virtual function transactional_table_lock(). Handler does not need to implement this function. sql/lock.cc: Added a function transactional_lock_tables() to lock all tables in the list with transactional table lock. These locks can cause a deadlock and this error should be reported back to user. sql/mysql_priv.h: Added prototype for a function transactional_lock_tables(). sql/sql_lex.h: Added SQLCOM_LOCK_TABLES_TRANSACTIONAL command. sql/sql_parse.cc: Added SQLCOM_LOCK_TABLES_TRANSACTIONAL command. sql/sql_yacc.yy: Added parsing rules for a LOCK TABLES...WHERE ENGINE = x;
-
- 02 Dec, 2004 1 commit
-
-
unknown authored
- add_field_to_list() now uses <List>String instead of TYPELIB to be able to distinguish literals 'aaa' and hex literals 0xaabbcc. - move some code from add_field_to_list() where we don't know column charset yet, to mysql_prepare_table(), where we do.
-
- 30 Nov, 2004 1 commit
-
-
unknown authored
now we create temporary join for all queries with subqueries to make correct cleunup of tables and avoid too early unlock (BUG#6841) mysql-test/t/subselect_innodb.test: possible early unlock sql/sql_lex.cc: subqueries presence flag sql/sql_lex.h: subqueries presence flag sql/sql_parse.cc: subqueries presence flag sql/sql_select.cc: removed some too optimistic optimisation, now we create temporary join for all queries with subqueries to make correct cleunup of tables and avoid too early unlock
-
- 28 Nov, 2004 1 commit
-
-
unknown authored
fixed a bug that it discovered include/my_sys.h: move TRASH to my_sys.h from sql_list.h sql/field.h: use TRASH macro sql/item.h: TRASH in delete sql/item_func.h: never delete item's manually! sql/opt_range.cc: TRASH in delete sql/sql_lex.h: TRASH in delete sql/sql_list.h: move TRASH to my_sys.h from sql_list.h sql/sql_parse.cc: don't use properties of deleted objects (even when it's safe) sql/sql_select.cc: TRASH in delete sql/sql_show.cc: TRASH in delete sql/sql_string.h: TRASH in delete
-
- 25 Nov, 2004 3 commits
-
-
unknown authored
Added new commands CREATE USER and RENAME USER. Changed behaviour of DROP USER. Changed an error messages for the new commands. Docs/mysqld_error.txt: WL#2050 - CREATE USER and DROP USER and RENAME USER Modified an error message for more general use. include/mysqld_error.h: WL#2050 - CREATE USER and DROP USER and RENAME USER Changed an error code for more general use. mysql-test/r/grant.result: WL#2050 - CREATE USER and DROP USER and RENAME USER Changed test results. mysql-test/r/grant2.result: WL#2050 - CREATE USER and DROP USER and RENAME USER New test results. mysql-test/r/ps_1general.result: WL#2050 - CREATE USER and DROP USER and RENAME USER Changed test results. mysql-test/t/grant.test: WL#2050 - CREATE USER and DROP USER and RENAME USER Updated old tests for new behaviour of DROP USER. It does now implicitly remove all privileges and does not fail when privileges are still in place. Fixed a typo, which left an user in the database, whereby other tests could be confused. Added a DROP USER for another test user. mysql-test/t/grant2.test: WL#2050 - CREATE USER and DROP USER and RENAME USER Added new tests for the new features. sql/share/czech/errmsg.txt: WL#2050 - CREATE USER and DROP USER and RENAME USER Modified an error message for more general use. sql/share/danish/errmsg.txt: WL#2050 - CREATE USER and DROP USER and RENAME USER Modified an error message for more general use. sql/share/dutch/errmsg.txt: WL#2050 - CREATE USER and DROP USER and RENAME USER Modified an error message for more general use. sql/share/english/errmsg.txt: WL#2050 - CREATE USER and DROP USER and RENAME USER Modified an error message for more general use. sql/share/estonian/errmsg.txt: WL#2050 - CREATE USER and DROP USER and RENAME USER Modified an error message for more general use. sql/share/french/errmsg.txt: WL#2050 - CREATE USER and DROP USER and RENAME USER Modified an error message for more general use. sql/share/german/errmsg.txt: WL#2050 - CREATE USER and DROP USER and RENAME USER Modified an error message for more general use. sql/share/greek/errmsg.txt: WL#2050 - CREATE USER and DROP USER and RENAME USER Modified an error message for more general use. sql/share/hungarian/errmsg.txt: WL#2050 - CREATE USER and DROP USER and RENAME USER Modified an error message for more general use. sql/share/italian/errmsg.txt: WL#2050 - CREATE USER and DROP USER and RENAME USER Modified an error message for more general use. sql/share/japanese/errmsg.txt: WL#2050 - CREATE USER and DROP USER and RENAME USER Modified an error message for more general use. sql/share/korean/errmsg.txt: WL#2050 - CREATE USER and DROP USER and RENAME USER Modified an error message for more general use. sql/share/norwegian-ny/errmsg.txt: WL#2050 - CREATE USER and DROP USER and RENAME USER Modified an error message for more general use. sql/share/norwegian/errmsg.txt: WL#2050 - CREATE USER and DROP USER and RENAME USER Modified an error message for more general use. sql/share/polish/errmsg.txt: WL#2050 - CREATE USER and DROP USER and RENAME USER Modified an error message for more general use. sql/share/portuguese/errmsg.txt: WL#2050 - CREATE USER and DROP USER and RENAME USER Modified an error message for more general use. sql/share/romanian/errmsg.txt: WL#2050 - CREATE USER and DROP USER and RENAME USER Modified an error message for more general use. sql/share/russian/errmsg.txt: WL#2050 - CREATE USER and DROP USER and RENAME USER Modified an error message for more general use. sql/share/serbian/errmsg.txt: WL#2050 - CREATE USER and DROP USER and RENAME USER Modified an error message for more general use. sql/share/slovak/errmsg.txt: WL#2050 - CREATE USER and DROP USER and RENAME USER Modified an error message for more general use. sql/share/spanish/errmsg.txt: WL#2050 - CREATE USER and DROP USER and RENAME USER Modified an error message for more general use. sql/share/swedish/errmsg.txt: WL#2050 - CREATE USER and DROP USER and RENAME USER Modified an error message for more general use. sql/share/ukrainian/errmsg.txt: WL#2050 - CREATE USER and DROP USER and RENAME USER Modified an error message for more general use. sql/sql_acl.cc: WL#2050 - CREATE USER and DROP USER and RENAME USER Added a destructor for the GRANT_TABLE object to get rid of a hash_column in cases where a nonsense row was read from the privilege tables. Added code to delete such an object when it is not entered into the column_priv_hash due to a nonsense row. Added function comments to two unmodified functions. Replaced mysql_drop_user() by the implementation of all of the functions as specified in the Low Level Design. sql/sql_acl.h: WL#2050 - CREATE USER and DROP USER and RENAME USER Added prototypes for new functions. sql/sql_lex.h: WL#2050 - CREATE USER and DROP USER and RENAME USER Added new command codes for CREATE USER and RENAME USER. sql/sql_parse.cc: WL#2050 - CREATE USER and DROP USER and RENAME USER Added case clauses for the new commands CREATE USER and RENAME USER. sql/sql_yacc.yy: WL#2050 - CREATE USER and DROP USER and RENAME USER Added syntax for the new commands CREATE USER and RENAME USER, reworked DROP USER, introduced a new 'user_list' and 'rename_list', renamed the old 'user_list' to 'grant_list'. The difference is that 'grant_list' contains 'grant_user' (with optional IDENTIFIED BY), while 'user_list' contains 'user'. Concentrated privilege initializazions into a new section 'clear_privileges'.
-
unknown authored
...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)
-
unknown authored
do not leave sql command uninitialized, because it used for detection need of preparation correct idends printing during finding identifiers i sql/sql_lex.h: do not leave sql command uninitialized, because it used for detection need of preparation correct idends printing during finding identifiers in table list (alias resolving tracking)
-
- 24 Nov, 2004 2 commits
-
-
unknown authored
correct printing of aliases mysql-test/r/lowercase_view.result: aliases in VIEWs mysql-test/t/lowercase_view.test: aliases in VIEWs sql/item.cc: tracking using aliases in indentifiers sql/item.h: tracking using aliases in indentifiers sql/sql_base.cc: tracking using aliases in indentifiers sql/sql_lex.cc: tracking using aliases in indentifiers sql/sql_lex.h: tracking using aliases in indentifiers sql/table.h: tracking using aliases in indentifiers
-
unknown authored
out of order". (final version) Now instead of binding Item_trigger_field to TABLE objects during trigger definition parsing at table open, we perform pass through special list of all such objects in trigger. This allows easily check all references to fields in old/new version of row in trigger during execution of CREATE TRIGGER statement (this is more courtesy for users since we can't check everything anyway). We also report that such reference is bad by returning error from Item_trigger_field::fix_fields() method (instead of setup_field()) This means that if trigger is broken we will bark during trigger execution instead of trigger definition parsing at table open. (i.e. now we allow to open tables with broken triggers). mysql-test/r/trigger.result: Added test which attempts to create trigger for table referencing to field which does not exist in this table. mysql-test/t/trigger.test: Added test which attempts to create trigger for table referencing to field which does not exist in this table. sql/item.cc: Item_trigger_field::setup_field() now returns void. If any error will occur we will report it at fix_fields() stage. sql/item.h: Item_trigger_field: - Added next_trg_field member for linking all such objects in trigger in one list. - Also setup_field() now returns void. If any error will occur we will report it at fix_fields() stage. sql/mysql_priv.h: Added SQL_LIST::push_back() method which allows to add another SQL_LIST to the end of this SQL_LIST. sql/sp_head.cc: sp_head::init()/reset_lex()/restore_lex(): In order to fill global LEX::trg_table_fields (list of all Item_trigger_field objects for trigger) we should init the same list in LEX of substatement before its parsing and merge it to global list after parsing. sql/sp_head.h: sp_instr_trigger_field: Made trigger_field member public to be able to add it more easily to global list of all Item_trigger_field objects in trigger. sql/sql_lex.cc: LEX::trg_table was removed. sql/sql_lex.h: Now we are binding Item_trigger_field's to TABLE object by passing through specially constructed list of all such objects in this trigger instead of doing this during trigger definition parsing at table open. So we no longer need LEX::trg_table, we use LEX::trg_table_fields list instead. sql/sql_parse.cc: mysql_execute_command(): Since now we use trigger body for some checks in mysql_create_or_drop_trigger() we should destroy it only after calling this function. sql/sql_trigger.cc: Now instead of binding Item_trigger_field to TABLE objects during trigger definition parsing at table open, we perform pass through special list of all such objects in trigger. This allows easily check all references to fields in old/new version of row in trigger during execution of CREATE TRIGGER statement (this is more courtesy for users since we can't check everything anyway). We also report that such reference is bad by returning error from Item_trigger_field::fix_fields() method (instead of setup_field()) This means that if trigger is broken we will bark during trigger execution instead of trigger definition parsing at table open. (i.e. now we allow to open tables with broken triggers). Table_triggers_list::prepare_old_row_accessors() method was added to be able to reuse code creating Field objects referencing TABLE::record[1] buffer instead of TABLE::record[0]. sql/sql_trigger.h: Added Table_triggers_list::prepare_old_row_accessors() method to be able to reuse code creating Field objects referencing to TABLE::record[1] instead of record[0]. sql/sql_yacc.yy: Now instead of performing binding of Item_trigger_field objects to TABLE object during trigger definition parsing at table open, we perform this binding by passing through specially constructed list of all such items in trigger. We also check value returned from memory allocation functions.
-
- 21 Nov, 2004 1 commit
-
-
unknown authored
-
- 13 Nov, 2004 1 commit
-
-
unknown authored
WL#173: Create Data Dictionary Tables for SHOW Commands
-
- 10 Nov, 2004 1 commit
-
-
unknown authored
WL#1596 "make mysqldump --master-data --single-transaction able to do online dump of InnoDB AND report reliable binlog coordinates corresponding to the dump". The good news is that now mysqldump can be used to get an online backup of InnoDB *which works for point-in-time recovery and replication slave creation*. Formerly, mysqldump --master-data --single-transaction used to call in fact mysqldump --master-data, so the dump was not an online dump (took big lock all time of dump). The only lock which is now taken in this patch is at the beginning of the dump: mysqldump does: FLUSH TABLES WITH READ LOCK; START TRANSACTION WITH CONSISTENT SNAPSHOT; SHOW MASTER STATUS; UNLOCK TABLES; so the lock time is in fact the time FLUSH TABLES WITH READ LOCK takes to return (can be 0 or very long, if a table is undergoing a huge update). I have done some more minor changes listed in the paragraph of mysqldump.c. WL#2237 "WITH CONSISTENT SNAPSHOT clause for START TRANSACTION": it's a START TRANSACTION which additionally starts a consistent read on all capable storage engine (i.e. InnoDB). So, can serve as a replacement for BEGIN; SELECT * FROM some_innodb_table LIMIT 1; which starts a consistent read too. client/mysqldump.c: Main change: mysqldump --single-transaction --master-data is now able to, at the same time, take an online dump of InnoDB (using consistent read) AND get the binlog position corresponding to this dump (before, using the two options used to silently cancel --single-transaction). This uses the new START TRANSACTION WITH CONSISTENT SNAPSHOT syntax. Additional changes: a) cleanup: - DBerror calls exit() so some code was unneeded - no need to call COMMIT at end, leave disconnection do the job - mysql_query_with_error_report() b) requirements I had heard from colleagues: - --master-data now requires an argument, to comment out ("--") the CHANGE MASTER or not (commenting had been asked for point-in-time recovery when replication is not necessary). - --first-slave is renamed to --lock-all-tables c) more sensible behaviours (has been discussed internally): - if used with --master-data, --flush-logs is probably intended to get a flush synchronous with the dump, not one random flush per dumped db. - disabled automatic reconnection as, at least, SQL_MODE would be lost (and also, depending on options, LOCK TABLES, BEGIN, FLUSH TABLES WITH READ LOCK). include/mysqld_error.h: an error if START TRANSACTION WITH CONSISTENT SNAPSHOT is called and there is no consistent-read capable storage engine (idea ((C) PeterG) is that it's a bit like CREATE TABLE ENGINE=InnoDB when there is no support for InnoDB). sql/handler.cc: new ha_start_consistent_snapshot(), which, inside an existing transaction, starts a consistent read (offers an alternative to SELECTing any InnoDB table). Does something only for InnoDB. Warning if no suitable engine supported. sql/handler.h: declarations sql/lex.h: symbols for lex sql/share/czech/errmsg.txt: new message sql/share/danish/errmsg.txt: new message sql/share/dutch/errmsg.txt: new message sql/share/english/errmsg.txt: new message sql/share/estonian/errmsg.txt: new message sql/share/french/errmsg.txt: new message sql/share/german/errmsg.txt: new message sql/share/greek/errmsg.txt: new message sql/share/hungarian/errmsg.txt: new message sql/share/italian/errmsg.txt: new message sql/share/japanese/errmsg.txt: new message sql/share/korean/errmsg.txt: new message sql/share/norwegian-ny/errmsg.txt: new message sql/share/norwegian/errmsg.txt: new message sql/share/polish/errmsg.txt: new message sql/share/portuguese/errmsg.txt: new message sql/share/romanian/errmsg.txt: new message sql/share/russian/errmsg.txt: new message sql/share/serbian/errmsg.txt: new message sql/share/slovak/errmsg.txt: new message sql/share/spanish/errmsg.txt: new message sql/share/swedish/errmsg.txt: new message sql/share/ukrainian/errmsg.txt: new message sql/sql_lex.h: new option in lex (transaction options) sql/sql_parse.cc: warning comment (never make UNLOCK TABLES commit a transaction, please); support for starting consistent snapshot. sql/sql_yacc.yy: new clause WITH CONSISTENT SNAPSHOT (syntax ok'd by PeterG) for START TRANSACTION.
-
- 09 Nov, 2004 1 commit
-
-
unknown authored
-
- 26 Oct, 2004 1 commit
-
-
unknown authored
New mysqltest that can run mysqltest with PS Added support for ZEROFILL in PS Fixed crash when one called mysql_stmt_store_result() without a preceding mysql_stmt_bind_result() Updated test cases to support --ps-protocol (Some tests are still run using old protocol) Fixed crash in PS when using SELECT * FROM t1 NATURAL JOIN t2... Fixed crash in PS when using sub queries Create table didn't signal when table was created. This could cause a "DROP TABLE created_table" in another thread to wait "forever" Fixed wrong permissions check in PS and multi-table updates (one could get permission denied for legal quries) Fix for PS and SELECT ... PROCEDURE Reset all warnings when executing a new PS query group_concat(...ORDER BY) didn't work with PS Fixed problem with test suite when not using innodb BitKeeper/deleted/.del-innodb-lock-master.opt~f76a4a1999728f87: Delete: mysql-test/t/innodb-lock-master.opt client/Makefile.am: mysqltest now uses regex client/mysqltest.c: Added support for testing of prepared statements (with --ps-protocol) Main code was done by Kent, I did mainly some cleanups and minor bug fixes New test commands: --disable_ps_protocol --enable_ps_protocol NOTE: new code still has some things that needs to be cleaned up. For example run_query_stmt_handle_error() should be made more general so that same code can be used also by 'normal' queries configure.in: mysqltest now uses regex libmysql/libmysql.c: Reset warning_count after prepare (safety). In the future we should also provide warnings on prepare integer -> string conversion now handles ZEROFILL double -> string conversion is now closer to the one in the server Fixed crash when one called mysql_stmt_store_result() without preceding mysql_stmt_bind_result() libmysqld/examples/Makefile.am: mysqltest now uses regex mysql-test/include/have_query_cache.inc: Fixes for --ps-protocol mysql-test/include/ps_conv.inc: Fixes for --ps-protocol mysql-test/mysql-test-run.sh: Added options --ps-protocol mysql-test/r/ctype_utf8.result: Fixed test case mysql-test/r/fulltext_cache.result: Changed output of MATCH to use round() to get same numbers with --ps-protocol mysql-test/r/fulltext_left_join.result: Changed output of MATCH to use round() to get same numbers with --ps-protocol mysql-test/r/fulltext_multi.result: Changed output of MATCH to use round() to get same numbers with --ps-protocol mysql-test/r/innodb-lock.result: Fixed test to work even if Innodb is not compiled in. mysql-test/t/create.test: Fixes for --ps-protocol mysql-test/t/ctype_utf8.test: Remove warnings mysql-test/t/date_formats.test: Fixes for --ps-protocol mysql-test/t/fulltext_cache.test: Changed output of MATCH to use round() to get same numbers with --ps-protocol mysql-test/t/fulltext_left_join.test: Changed output of MATCH to use round() to get same numbers with --ps-protocol mysql-test/t/fulltext_multi.test: Changed output of MATCH to use round() to get same numbers with --ps-protocol mysql-test/t/func_group.test: Fixes for --ps-protocol mysql-test/t/func_sapdb.test: Fixes for --ps-protocol mysql-test/t/innodb-lock.test: Fixed test to work even if Innodb is not compiled in. mysql-test/t/insert.test: Fixes for --ps-protocol mysql-test/t/insert_select.test: Fixes for --ps-protocol mysql-test/t/insert_update.test: Fixes for --ps-protocol mysql-test/t/metadata.test: Fixes for --ps-protocol mysql-test/t/multi_statement.test: Fixes for --ps-protocol mysql-test/t/ps_1general.test: Fixes for --ps-protocol mysql-test/t/rollback.test: Fixes for --ps-protocol mysql-test/t/rpl_redirect.test: Fixes for --ps-protocol mysql-test/t/rpl_user_variables.test: Fixes for --ps-protocol mysql-test/t/select.test: Fixes for --ps-protocol mysql-test/t/status.test: Fixes for --ps-protocol mysql-test/t/type_blob.test: Fixes for --ps-protocol mysql-test/t/type_float.test: Fixes for --ps-protocol mysql-test/t/union.test: Fixes for --ps-protocol mysql-test/t/warnings.test: Fixes for --ps-protocol mysys/my_alloc.c: More debugging information sql-common/client.c: More debugging information sql-common/my_time.c: TIME didn't support full range with PS sql/field.cc: TIME didn't support full range with PS sql/item_cmpfunc.cc: IN(constants,...) didn't work with PS sql/item_subselect.cc: Some subqueries didn't work with PS sql/item_sum.cc: group_concat(...ORDER BY) didn't work with PS Removed variable warning_available as 'warning' can be used for this. sql/item_sum.h: Removed not needed variable sql/protocol.cc: TIME didn't support full range with PS sql/set_var.cc: Style fix sql/sql_base.cc: setup_wild() didn't properly restore old arena, which caused core dump in PS when using SELECT * FROM t1 NATURAL JOIN t2... sql/sql_class.cc: Style fix sql/sql_error.cc: Style fix sql/sql_insert.cc: Create table didn't signal when table was created. This could cause a "DROP TABLE created_table" in another thread to wait "forever" sql/sql_lex.h: Fix for PS and procedures sql/sql_parse.cc: More debugging information Make a copy of 'db' in PS as this may change Fixed wrong permissions check in PS and multi-table updates sql/sql_prepare.cc: Fix for PS and SELECT ... PROCEDURE Reset all warnings when executing a new query sql/sql_union.cc: Fixes for PS and SELECT ... PROCEDURE Reset 'with_wild' as 'wild' is resolved on prepare
-
- 22 Oct, 2004 1 commit
-
-
unknown authored
Fixed checking of privilege handling in CREATE ... SELECT (Bug #6094) client/mysql.cc: Fix compiler warnings client/mysqltest.c: Fix wrong counting of lines Remove compiler warnings heap/hp_hash.c: Fix compiler warnings innobase/dict/dict0load.c: Fix compiler warnings innobase/include/mem0mem.h: Fix compiler warnings libmysql/client_settings.h: Fix compiler warnings myisam/ft_nlq_search.c: Add comments about compiler warnings myisam/rt_index.c: Add comments about compiler warnings myisam/rt_mbr.c: Add comments about compiler warnings mysql-test/r/ps.result: Test case for bug#6094 mysql-test/t/ps.test: Test case for bug#6094 mysys/hash.c: Fix compiler warnings mysys/my_handler.c: Add comments about compiler warnings mysys/my_thr_init.c: Add comments about compiler warnings ndb/include/mgmapi/mgmapi.h: Fix compiler warnings regex/main.c: Fix compiler warnings sql/item.h: Fix compiler warnings sql/item_func.h: Add comments about compiler warnings sql/spatial.h: Add comments about compiler warnings sql/sql_lex.h: Fix compiler warning sql/sql_list.h: Fix compiler warning sql/sql_parse.cc: Move testing of access rights of tables in CREATE ... SELECT to create_table_precheck() to fix privilege checking in CREATE ... SELECT (Bug #6094) sql/sql_prepare.cc: Remove not needed empty line sql/sql_string.h: Fix compiler warnings strings/ctype-mb.c: Fix compiler warnings
-
- 21 Oct, 2004 1 commit
-
-
unknown authored
sql/handler.cc: do not delete the table in the "unkonwn" handler (makes no sense anyway) sql/handler.h: more HA_CREATE_USED flags sql/sql_lex.h: more ALTER_ flags, no alter_info->is_simple anymore sql/sql_parse.cc: no alter_info->is_simple anymore sql/sql_table.cc: do not rename the table in the "unkonwn" handler (makes no sense anyway) smarter ALTER TABLE - don't copy the table if only comment or default values are changed sql/sql_yacc.yy: specify what ALTER is todo with flags, not alter_info->is_simple sql/unireg.cc: create frm only (but not in the handler) if requested
-
- 20 Oct, 2004 1 commit
-
-
unknown authored
net_printf/send_error calls replaced by my_error family functions -1/1 (sent/unsent) error reporting removed (WL#2133) include/mysqld_error.h: new errors added. mysql-test/r/rpl_charset.result: new error mysql-test/r/rpl_timezone.result: new error mysql-test/r/sp-security.result: more clean error message mysql-test/r/sp.result: now error state intercepted correctly mysql-test/t/connect.test: new error message mysql-test/t/rpl_charset.test: new error message mysql-test/t/rpl_timezone.test: new error mysql-test/t/sp-security.test: more correct error handling mysql-test/t/sp.test: now error state intercepted correctly sql/ha_innodb.cc: -1/1 (sent/unsent) error reporting removed sql/ha_innodb.h: -1/1 (sent/unsent) error reporting removed sql/item.cc: only boolean values should be returned by fix_fields() sql/item_cmpfunc.cc: only boolean values should be returned by fix_fields() sql/item_func.cc: only boolean values should be returned by fix_fields() net_printf/send_error calls replaced by my_error family functions sql/item_row.cc: only boolean values should be returned by fix_fields() sql/item_subselect.cc: only boolean values should be returned by fix_fields() -1/1 (sent/unsent) error reporting removed sql/item_subselect.h: -1/1 (sent/unsent) error reporting removed sql/item_sum.cc: only boolean values should be returned by fix_fields() sql/item_timefunc.cc: only boolean values should be returned by fix_fields() sql/item_uniq.h: only boolean values should be returned by fix_fields() sql/mysql_priv.h: -1/1 (sent/unsent) error reporting removed sql/mysqld.cc: net_printf/send_error calls replaced by my_error family functions changes in my_message_sql to support error handling correctly sql/protocol.cc: net_printf/send_error calls replaced by my_error family functions sql/protocol_cursor.cc: net_printf/send_error calls replaced by my_error family functions sql/repl_failsafe.cc: net_printf/send_error calls replaced by my_error family functions -1/1 (sent/unsent) error reporting removed sql/repl_failsafe.h: -1/1 (sent/unsent) error reporting removed sql/set_var.cc: net_printf/send_error calls replaced by my_error family functions sql/share/czech/errmsg.txt: new error messages sql/share/danish/errmsg.txt: new error messages sql/share/dutch/errmsg.txt: new error messages sql/share/english/errmsg.txt: new error messages sql/share/estonian/errmsg.txt: new error messages sql/share/french/errmsg.txt: new error messages sql/share/german/errmsg.txt: new error messages sql/share/greek/errmsg.txt: new error messages sql/share/hungarian/errmsg.txt: new error messages sql/share/italian/errmsg.txt: new error messages sql/share/japanese/errmsg.txt: new error messages sql/share/korean/errmsg.txt: new error messages sql/share/norwegian-ny/errmsg.txt: new error messages sql/share/norwegian/errmsg.txt: new error messages sql/share/polish/errmsg.txt: new error messages sql/share/portuguese/errmsg.txt: new error messages sql/share/romanian/errmsg.txt: new error messages sql/share/russian/errmsg.txt: new error messages sql/share/serbian/errmsg.txt: new error messages sql/share/slovak/errmsg.txt: new error messages sql/share/spanish/errmsg.txt: new error messages sql/share/swedish/errmsg.txt: new error messages sql/share/ukrainian/errmsg.txt: new error messages sql/slave.cc: net_printf/send_error calls replaced by my_error family functions -1/1 (sent/unsent) error reporting removed sql/slave.h: -1/1 (sent/unsent) error reporting removed sql/sp.cc: net_printf/send_error calls replaced by my_error family functions sql/sp_head.cc: new eror handling support net_printf/send_error calls replaced by my_error family functions sql/sp_rcontext.cc: net_printf/send_error calls replaced by my_error family functions sql/sql_acl.cc: net_printf/send_error calls replaced by my_error family functions -1/1 (sent/unsent) error reporting removed sql/sql_acl.h: -1/1 (sent/unsent) error reporting removed sql/sql_base.cc: -1/1 (sent/unsent) error reporting removed net_printf/send_error calls replaced by my_error family functions sql/sql_class.cc: net_printf/send_error calls replaced by my_error family functions sql/sql_class.h: my_messhage_sql now set/reset query_error flag sql/sql_db.cc: -1/1 (sent/unsent) error reporting removed sql/sql_delete.cc: -1/1 (sent/unsent) error reporting removed net_printf/send_error calls replaced by my_error family functions sql/sql_do.cc: -1/1 (sent/unsent) error reporting removed sql/sql_error.cc: -1/1 (sent/unsent) error reporting removed sql/sql_handler.cc: -1/1 (sent/unsent) error reporting removed net_printf/send_error calls replaced by my_error family functions sql/sql_help.cc: net_printf/send_error calls replaced by my_error family functions -1/1 (sent/unsent) error reporting removed sql/sql_insert.cc: -1/1 (sent/unsent) error reporting removed net_printf/send_error calls replaced by my_error family functions sql/sql_lex.h: -1/1 (sent/unsent) error reporting removed sql/sql_load.cc: -1/1 (sent/unsent) error reporting removed sql/sql_map.cc: errors without code removed sql/sql_parse.cc: net_printf/send_error calls replaced by my_error family functions -1/1 (sent/unsent) error reporting removed from mysql_execute_command sql/sql_prepare.cc: net_printf/send_error calls replaced by my_error family functions -1/1 (sent/unsent) error reporting removed sql/sql_repl.cc: error messages fixed net_printf/send_error calls replaced by my_error family functions -1/1 (sent/unsent) error reporting removed sql/sql_repl.h: -1/1 (sent/unsent) error reporting removed sql/sql_select.cc: -1/1 (sent/unsent) error reporting removed sql/sql_select.h: -1/1 (sent/unsent) error reporting removed sql/sql_show.cc: -1/1 (sent/unsent) error reporting removed net_printf/send_error calls replaced by my_error family functions sql/sql_table.cc: net_printf/send_error calls replaced by my_error family functions -1/1 (sent/unsent) error reporting removed sql/sql_trigger.cc: -1/1 (sent/unsent) error reporting removed sql/sql_udf.cc: net_printf/send_error calls replaced by my_error family functions sql/sql_union.cc: -1/1 (sent/unsent) error reporting removed sql/sql_update.cc: -1/1 (sent/unsent) error reporting removed net_printf/send_error calls replaced by my_error family functions sql/sql_view.cc: -1/1 (sent/unsent) error reporting removed sql/sql_view.h: -1/1 (sent/unsent) error reporting removed sql/sql_yacc.yy: net_printf/send_error calls replaced by my_error family functions
-
- 14 Oct, 2004 1 commit
-
-
unknown authored
NO SQL CONTAINS SQL (default) READS SQL DATA MODIFIES SQL DATA These are needed as hints for the replication. (Before this, we did have the default in the mysql.proc table, but no support in the parser.) mysql-test/r/sp.result: Modified test cases for new data access characteristics. mysql-test/t/sp.test: Modified test cases for new data access characteristics. scripts/mysql_create_system_tables.sh: We now support all the SP data access characteristics (not just CONTAINS SQL). scripts/mysql_fix_privilege_tables.sql: We now support all the SP data access characteristics (not just CONTAINS SQL). sql/lex.h: New tokens for SP data access characteristics. sql/sp.cc: Store, print and support alter of data access characteristics. sql/sp_head.cc: Added SP_ prefix to some symbols. sql/sql_lex.h: Added SP_ prefix to some symbols, and added SP data access enum. sql/sql_yacc.yy: Parse SP data access characteristics. (And allow "alter ... language sql", mostly as a formality, it was accidently put in the wrong clause before.)
-
- 13 Oct, 2004 1 commit
-
-
unknown authored
crashes server." The fix makes Item_func_rand prepared-statements aware plus it fixes the case when RAND is used in prepared statements and replication is on (as well as several similar issues). Until now we did not reset THD before every execution of a prepared statement, so if some execution had set thd->time_zone_used or thd->rand_used they would not be reset until next mysql_parse. Some of post-review fixes done. mysql-test/r/ps.result: A test case for Bug#5985: test results fixed. mysql-test/t/ps.test: A test case for Bug#5985 "prepare stmt from "select rand(?)" crashes server." sql/item_func.cc: Actual fix for Bug#5985: Item_func_rand rewritten to be prepared statements aware. sql/item_func.h: Actual fix for Bug#5985: Item_func_rand rewritten to be prepared statements aware. sql/mysql_priv.h: We need a separate call to reset THD state before every execute of a prepared statement. Otherwise things like THD->user_var_events are never cleaned up and bloat binary log (as the list of events grows from execution to execution). sql/sql_class.cc: Statement::end_statement -> THD::end_statement() (a leftover from some design change which is not to pushed now, but the leftover is to be pushed). sql/sql_class.h: Statement::end_statement -> THD::end_statement() (a leftover from some design change which is not to pushed now, but the leftover is to be pushed). sql/sql_lex.cc: Move the part responsible for initializing LEX from mysql_init_query to lex_start. sql/sql_lex.h: All lex-related initialization is now in lex_start. Move thd->select_number to lex->select_number to be able to use it easily in lex_start. sql/sql_parse.cc: Split mysql_init_query into two functions: mysql_reset_thd_for_next_query, which is used in PS and conventional execution, and lex_start, used only when we want to parse something. Fix init_connect to use initialized THD. sql/sql_prepare.cc: Deploy mysql_reset_thd_for_next_query to reset THD state before execution of a prepared statement. Normally this should have been added to just one place, but we have to reset thd before assigning placeholders from variables, thus we can't do that in execute_stmt (yuck).
-
- 07 Oct, 2004 1 commit
-
-
unknown authored
Some bigger code changes was necessary becasue of the multi-table-update and the new HANDLER code include/hash.h: Added back function that's was used in 4.0 mysql-test/r/delete.result: Update results after merge mysql-test/r/flush_table.result: Update results after merge mysql-test/r/func_str.result: Update results after merge mysql-test/r/handler.result: Update results after merge Change is big becasue in MySQL 4.1 you are not allowed to qualify the handler alias with a databasename mysql-test/r/multi_update.result: More startup cleanups mysql-test/r/rename.result: More startup-cleanups mysql-test/r/select.result: More startup cleanups mysql-test/r/show_check.result: More startup-cleanups mysql-test/t/ctype_latin1_de.test: Cleanup mysql-test/t/derived.test: Portability fix mysql-test/t/handler.test: Update results after merge Change is big becasue in MySQL 4.1 you are not allowed to qualify the handler alias with a databasename mysql-test/t/multi_update.test: More startup cleanups mysql-test/t/range.test: More comments mysql-test/t/rename.test: More startup cleanups mysql-test/t/select.test: More startup cleanups mysql-test/t/show_check.test: More startup cleanups mysql-test/t/type_timestamp.test: Add back test deleted during merge sql/item_cmpfunc.cc: After merge fixes sql/item_func.cc: Remove compiler warning sql/mysql_priv.h: After merge fixes sql/mysqld.cc: After merge fixes sql/sql_acl.cc: More debugging sql/sql_base.cc: After merge fixes (This fix was needed bacause of multi-table-update reopens tables) sql/sql_handler.cc: After merge fixes sql/sql_lex.h: After merge fixes sql/sql_select.cc: After merge fixes sql/sql_show.cc: After merge fixes sql/sql_table.cc: After merge fixes Simple cleanup of mysql_discard_or_import_tablespace sql/sql_update.cc: After merge fixes Rework mysql_multi_update to take into account derived tables. sql/sql_yacc.yy: After merge fixes
-
- 14 Sep, 2004 1 commit
-
-
unknown authored
support of merged VIEW over several tables added (WL#1809) mysql-test/r/view.result: merge of VIEW with several tables mysql-test/t/view.test: merge of VIEW with several tables sql/item.cc: renaming Item and restoring item name on cleunup() sql/item.h: renaming Item and restoring item name on cleunup() debug output added sql/item_cmpfunc.h: setup_conds() changed to support two tables lists sql/item_subselect.cc: list of table leaves used instead of local table list for name resolving sql/mysql_priv.h: setup_conds() and setup_tables() changed to support two tables lists sql/opt_sum.cc: list of table leaves used instead of local table list for name resolving sql/sp.cc: setup_tables() changed to support two tables lists sql/sql_base.cc: skip temporary tables in table finding fixed merged view fields names (BUG#5147) sql/sql_delete.cc: setup_conds() and setup_tables() changed to support two tables lists sql/sql_help.cc: setup_tables() changed to support two tables lists sql/sql_insert.cc: setup_tables() changed to support two tables lists name handling support sql/sql_lex.cc: allow view with several tables for MERGE sql/sql_lex.h: new table list sql/sql_load.cc: setup_tables() changed to support two tables lists sql/sql_olap.cc: setup_tables() changed to support two tables lists sql/sql_parse.cc: new list support sql/sql_prepare.cc: new list support sql/sql_select.cc: list of table leaves used instead of local table list for name resolving sql/sql_update.cc: setup_conds() and setup_tables() changed to support two tables lists sql/sql_view.cc: support of MERGED VIEWS with several tables sql/sql_yacc.yy: removed blanks in new code sql/table.cc: fixed setup view code support of merged VIEW over several tables added sql/table.h: fixed merged view fields names (BUG#5147)
-
- 11 Sep, 2004 1 commit
-
-
unknown authored
sql/sql_lex.h: comments added new method of adding table to global query tables list sql/sql_parse.cc: used new method to add table to query tables list removed spaces at end of line in new code sql/sql_view.cc: layout fixed table lists management code cleanup
-
- 09 Sep, 2004 1 commit
-
-
unknown authored
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
-
- 08 Sep, 2004 1 commit
-
-
unknown authored
mysql-test/r/multi_update.result: multi* unique updating table check mysql-test/t/multi_update.test: multi* unique updating table check sql/sql_lex.cc: new method to check table only in subqueries sql/sql_lex.h: new method to check table only in subqueries sql/sql_parse.cc: used new method to check table only in subqueries sql/sql_update.cc: check that table is unique added
-
- 07 Sep, 2004 1 commit
-
-
unknown authored
Mostly needed for Monty for him getting notion what needed for triggers from new .FRM format. Things to be done: - Right placement of trigger's invocations - Right handling of errors in triggers (including transaction rollback) - Support for priviliges - Right handling of DROP/RENAME table (hope that it will be handled automatically with merging of .TRG into .FRM file) - Saving/restoring some information critical for trigger creation and replication with their definitions (e.g. sql_mode, creator, ...) - Replication Already has some known bugs so probably not for general review. include/mysqld_error.h: Added trigger related error codes. sql/Makefile.am: Added sql_trigger.* files to list of sources from which mysqld is built. sql/item.cc: Added Item_trigger_field class representing field of new/old version of row which is inserted/updated/deleted and for which trigger is invoked. sql/item.h: Added enums for describing trigger properties. (Here because of dependencies). Added Item_trigger_field class representing field of new/old version of row which is inserted/updated/deleted and for which trigger is invoked. sql/item_func.cc: Added Item_func_set_user_var::print_as_stmt() for printing of assignment to ser variable from stored procedures. Added comment clarifying why we don't need set no_send_ok when calling stored functions. sql/item_func.h: Added Item_func_set_user_var::print_as_stmt() for printing of assignment to ser variable from stored procedures. sql/lex.h: Symbols used in statements defining triggers were added. sql/mysql_priv.h: Exported some functions needed for triggers implementation. sql/parse_file.cc: Cleaned up FILE_OPTIONS_STRLIST handling (needed for triggers). sql/parse_file.h: Cleaned up FILE_OPTIONS_STRLIST handling (needed for triggers). sql/share/czech/errmsg.txt: Added trigger related error messages. sql/share/danish/errmsg.txt: Added trigger related error messages. sql/share/dutch/errmsg.txt: Added trigger related error messages. sql/share/english/errmsg.txt: Added trigger related error messages. sql/share/estonian/errmsg.txt: Added trigger related error messages. sql/share/french/errmsg.txt: Added trigger related error messages. sql/share/german/errmsg.txt: Added trigger related error messages. sql/share/greek/errmsg.txt: Added trigger related error messages. sql/share/hungarian/errmsg.txt: Added trigger related error messages. sql/share/italian/errmsg.txt: Added trigger related error messages. sql/share/japanese/errmsg.txt: Added trigger related error messages. sql/share/korean/errmsg.txt: Added trigger related error messages. sql/share/norwegian-ny/errmsg.txt: Added trigger related error messages. sql/share/norwegian/errmsg.txt: Added trigger related error messages. sql/share/polish/errmsg.txt: Added trigger related error messages. sql/share/portuguese/errmsg.txt: Added trigger related error messages. sql/share/romanian/errmsg.txt: Added trigger related error messages. sql/share/russian/errmsg.txt: Added trigger related error messages. sql/share/serbian/errmsg.txt: Added trigger related error messages. sql/share/slovak/errmsg.txt: Added trigger related error messages. sql/share/spanish/errmsg.txt: Added trigger related error messages. sql/share/swedish/errmsg.txt: Added trigger related error messages. sql/share/ukrainian/errmsg.txt: Added trigger related error messages. sql/sp_head.cc: sp_head::init_strings(): added support for triggers (we don't have most of strings for them) sp_head::execute_function(): triggers don't require RETURN sp_head::reset_lex(): added propagation of trigger properties to LEX used for parsing of statements composing trigger body. Added two more SP instructions: - sp_instr_set_user_var for setting user variables in stored functions and triggers (we can't use sp_instr_stmt and "SET @A:=..." statement since it will close open tables and thus break execution of calling statement. - sp_instr_set_trigger_field for assignment to fields of row being updated/inserted in triggers sql/sp_head.h: Added new type of sp_head object - TYPE_ENUM_TRIGGER Added two more SP instructions: - sp_instr_set_user_var for setting user variables in stored functions and triggers (we can't use sp_instr_stmt and "SET @A:=..." statement since it will close open tables and thus break execution of calling statement. - sp_instr_set_trigger_field for assignment to fields of row being updated/inserted in triggers sql/sql_base.cc: Now freeing memory occupied by trigger related structures when closing tables. open_unireg_entry(): added loading of triggers for table. find_field_in_real_table() is now public since it required by Item_trigger_field in item.cc sql/sql_delete.cc: Added triggers invocation for DELETE (should be fixed for sure :)) sql/sql_insert.cc: Added triggers invocation for INSERT (should be fixed for sure :)) sql/sql_lex.cc: Added trg_new_row_fake_var variable pointer to which is used for distinguishing between assignment to NEW row field (when parsing trigger definition) and structured variable. Added initialization of LEX->trg_table to lex_start(). (When triggers are parsed during opening of table it points to table object.) sql/sql_lex.h: Added trigger related commands. Added st_trg_chistics structure describing properties of trigger being created (as struct and as LEX member). Added trg_new_row_fake_var variable pointer to which is used for distinguishing between assignment to NEW row field (when parsing trigger definition) and structured variable. Added LEX::trg_table which points to table being opened when we are parsing trigger definition while opening table. sql/sql_parse.cc: Added support for CREATE/DROP TRIGGER commands. sql/sql_table.cc: Cleanup. close_cached_table() always returns 0 and its result is not analyzed in most places so chenged its return type to void. sql/sql_update.cc: Added triggers invocation for UPDATE (should be fixed for sure :)) sql/sql_yacc.yy: Added support for CREATE/DROP TRIGGER statements. Added support for OLD/NEW row identifiers in trigger. Made assignment to user variables not to break execution of stored function or trigger. sql/table.h: Added TABLE::triggers member representing triggers for this table.
-
- 03 Sep, 2004 1 commit
-
-
unknown authored
include/mysqld_error.h: new error messages mysql-test/r/view.result: test of CHECK OPTION in a views mysql-test/t/view.test: test of CHECK OPTION in a views sql/share/czech/errmsg.txt: new error messages sql/share/danish/errmsg.txt: new error messages sql/share/dutch/errmsg.txt: new error messages sql/share/english/errmsg.txt: new error messages sql/share/estonian/errmsg.txt: new error messages sql/share/french/errmsg.txt: new error messages sql/share/german/errmsg.txt: new error messages sql/share/greek/errmsg.txt: new error messages sql/share/hungarian/errmsg.txt: new error messages sql/share/italian/errmsg.txt: new error messages sql/share/japanese/errmsg.txt: new error messages sql/share/korean/errmsg.txt: new error messages sql/share/norwegian-ny/errmsg.txt: new error messages sql/share/norwegian/errmsg.txt: new error messages sql/share/polish/errmsg.txt: new error messages sql/share/portuguese/errmsg.txt: new error messages sql/share/romanian/errmsg.txt: new error messages sql/share/russian/errmsg.txt: new error messages sql/share/serbian/errmsg.txt: new error messages sql/share/slovak/errmsg.txt: new error messages sql/share/spanish/errmsg.txt: new error messages sql/share/swedish/errmsg.txt: new error messages sql/share/ukrainian/errmsg.txt: new error messages sql/sql_insert.cc: CHECK OPTIONs added sql/sql_lex.h: CHECK OPTIONs added sql/sql_update.cc: CHECK OPTIONs added sql/sql_view.cc: new parameter added returnrd values fixed sql/sql_yacc.yy: CHECK OPTIONs added sql/table.cc: CHECK OPTIONs added sql/table.h: CHECK OPTIONs added
-
- 01 Sep, 2004 1 commit
-
-
unknown authored
mysql-test/r/view.result: fixed test VIEW over droped function mysql-test/t/view.test: VIEW over droped function sql/item_func.cc: after review fix sql/sp.cc: hint to find mysql.proc sql/sql_lex.h: hint to find mysql.proc sql/sql_parse.cc: hint to find mysql.proc sql/sql_view.cc: adding mysql.proc to table list if view contains stored procedures
-
- 24 Aug, 2004 2 commits
-
-
unknown authored
mysql-test/r/view.result: Showing VIEW with VIEWs in subquery mysql-test/t/view.test: Showing VIEW with VIEWs in subquery sql/sql_lex.cc: new method to detect commands where all VIEWs should be temporary tables sql/sql_lex.h: new method to detect commands where all VIEWs should be temporary tables sql/sql_view.cc: new method to detect commands where all VIEWs should be temporary tables debug output added
-
unknown authored
execute crashes server": we were deleting lex->result after each execute, but prepared statements assumed that it's left intact. The fix adds cleanup() method to select_result hierarchy, so that result objects can be reused. Plus we now need to delete result objects more wisely. mysql-test/r/ps.result: Test results fixed: test case for bug#5034 mysql-test/t/ps.test: A test case for bug#5034, few followups sql/sql_class.cc: - fix warning in THD::THD - implementation of cleanup() for select_result hierarchy - select_export::send_eof was identical to select_dump::send_eof: moved to the base class select_to_file. - Statement::end_statement() to end lex, free items, and delete possible select_result sql/sql_class.h: - select_result::cleanup() declaration - sql/sql_insert.cc: - implementation of select_insert::cleanup(): currently we always create a new instance of select_insert/ select_create on each execute. sql/sql_lex.cc: - with more complicated logic of freeing lex->result it's easier to have it non-zero only if it points to a valid result. sql/sql_lex.h: Now st_lex::st_lex is not empty. sql/sql_parse.cc: mysql_execute_command(): - delete select_result *result only if it was created in this function. - use end_statement() to cleanup lex and thd in the end of each statement. - no need to save THD::lock if this is explain. This save apparently left from times when derived tables were materialized here, not in open_and_lock_tables. sql/sql_prepare.cc: - call result->cleanup() in reset_stmt_for_execute - now Statement is responsible for freeing its lex->result. sql/sql_select.cc: handle_select(): - don't delete result, it might be needed for next executions - result is never null
-
- 13 Aug, 2004 1 commit
-
-
unknown authored
mysql-test/r/func_gconcat.result: fix of test queries mysql-test/r/subselect.result: resolving fields of grouped outer SELECT mysql-test/t/func_gconcat.test: fix of test queries mysql-test/t/subselect.test: resolving fields of grouped outer SELECT sql/item.cc: skip resolving field in table list if table list is not accessable due to groupping layout fixed sql/item_subselect.cc: detection of place of subquery sql/item_subselect.h: detection of place of subquery sql/mysql_priv.h: enum_parsing_place made global type sql/sql_lex.cc: enum_parsing_place made global type sql/sql_lex.h: enum_parsing_place made global type sql/sql_yacc.yy: enum_parsing_place made global type
-
- 10 Aug, 2004 1 commit
-
-
unknown authored
Instead of trying to open time zone tables during calculation of CONVERT_TZ() function or setting of @@time_zone variable we should open and lock them with the rest of statement's table (so we should add them to global table list) and after that use such pre-opened tables for loading info about time zones. mysql-test/r/timezone2.result: Added test for bug #4508 mysql-test/t/timezone2.test: Added test for bug #4508 scripts/mysql_create_system_tables.sh: Added one more test time zone to time zone tables which is needed for test for bug #4508. sql/item_create.cc: CONVERT_TZ() now is treated as special function. sql/item_create.h: CONVERT_TZ() now is treated as special function. sql/item_timefunc.cc: Item_func_convert_tz now uses list of pre-opened time zone tables instead of trying to open them ad-hoc. Also it avoid calling of current_thd. sql/item_timefunc.h: Added comment describing special nature of CONVERT_TZ() function. Optimization: Added own fix_fields() method and tz_tables member for caching pointer to list of open time zone tables to Item_func_convert_tz class. sql/lex.h: CONVERT_TZ() now is treated as special function. sql/mysql_priv.h: Removed function which is no longer used. sql/set_var.cc: Now my_tz_find() accepts list of pre-opened time zone tables as last argument and no longer needs pointer to current THD. sql/set_var.h: Exported sys_time_zone, which is now used in sql_yacc.yy for quick finding out if we are setting @@time_zone variable. sql/sql_base.cc: Moved propagation of pointers to open tables from global list to local select lists to open_and_lock_tables(), also added implicit usage of time zone tables as condition for such propagation. sql/sql_lex.cc: Added fake_time_zone_tables_list which is used to indicate that time zone tables are implicitly used in statement. st_select_lex_unit::create_total_list(): if time zone tables are implicitly used in statement add them to global tables list. sql/sql_lex.h: Added LEX::time_zone_tables_used member which is used to indicate that time zone tables are implicitly used in this statement (by pointing to fake_time_zone_table_list) and for holding pointer to those tables after they've been opened. sql/sql_parse.cc: We should also create global table list if statement uses time zone tables implicitly. Added initialization of LEX::time_zone_tables_used to mysql_query_init(). sql/sql_prepare.cc: We should also create global table list if statement uses time zone tables implicitly. sql/sql_select.cc: Removed functions which are no longer used. sql/sql_yacc.yy: CONVERT_TZ() and @@time_zone variable are handled in special way since they implicitly use time zone tables. sql/tztime.cc: Fix for bug #4508 "CONVERT_TZ() function with new time zone as param crashes server". If statement uses CONVERT_TZ() function or @@time_zone variable is set then it implicitly uses time zone tables. We need to open and lock such tables with all other tables of such statement. All code responsible for opening table was removed from tz_load_from_db() and function was renamed to tz_load_from_open_tables() (which uses list of pre-opened tables). We also have new functions for construction and initialization of table list of time zone tables. my_tz_find() now always require list of pre-opened time zone tables and no longer needs current THD. So we have to pre-open them in my_tz_init(). Also now we try to open time zone tables only if they were found during startup. sql/tztime.h: New function for construction of table list of time zone tables my_tz_get_table_list(). Now my_tz_find() requires list of pre-pened time zone tables instead of current thread.
-