From ae398d995a925e8bc2fe096f4c6fe55618a58543 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 26 Jun 2007 13:15:43 +0200 Subject: Bug #29245: Bad Merge Caused Error Codes Conflict between 5.0/5.1 Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/backup.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/events_bugs.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/events_trans.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/ndb_dd_basic.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/ndb_dd_ddl.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/ndb_gis.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/ndb_row_format.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/rpl_extraCol_innodb.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/rpl_extraCol_myisam.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/rpl_incident.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/rpl_ndb_extraCol.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/rpl_row_tabledefs_2myisam.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/rpl_row_tabledefs_3innodb.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/rpl_sp.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/select.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/show_check.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/sp.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/sp_gis.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/sp_trans.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/type_timestamp.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/warnings.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/xml.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/t/grant.test: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/t/partition_grant.test: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 sql/mysql_priv.h: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 sql/share/errmsg.txt: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 --- sql/mysql_priv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/mysql_priv.h') diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 5a50b03282f..e6455a82c33 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -98,7 +98,7 @@ char* query_table_status(THD *thd,const char *db,const char *table_name); DBUG_ASSERT(strncmp(Ver, MYSQL_SERVER_VERSION, sizeof(Ver)-1) > 0); \ if (((uchar*)Thd) != NULL) \ push_warning_printf(((THD *)Thd), MYSQL_ERROR::WARN_LEVEL_WARN, \ - ER_WARN_DEPRECATED_SYNTAX, ER(ER_WARN_DEPRECATED_SYNTAX), \ + ER_WARN_DEPRECATED_SYNTAX, ER(ER_WARN_DEPRECATED_SYNTAX_WITH_VER), \ (Old), (Ver), (New)); \ else \ sql_print_warning("The syntax '%s' is deprecated and will be removed " \ -- cgit v1.2.1 From 289cc26c646f5a45e2c9fc6c0bb75f6f61d301a1 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 2 Jul 2007 19:14:48 +0200 Subject: Bug#21074 Large query_cache freezes mysql server sporadically under heavy load Invaldating a subset of a sufficiently large query cache can take a long time. During this time the server is efficiently frozen and no other operation can be executed. This patch addresses this problem by moving the locks which cause the freezing and also by temporarily disable the query cache while the invalidation takes place. sql/ha_ndbcluster.cc: - mysql_rm_table_part2 has a new parameter to indicate if OPEN_lock mutex protection is needed. sql/lock.cc: - Added function for acquiring table name exclusive locks. - Added function for asserting that table name lock is acquired. sql/mysql_priv.h: - Added function for acquiring table name exclusive locks. - Added function for asserting that table name lock is acquired. - Added parameter to mysql_rm_table_part2 to indicate whether OPEN_lock mutex protection is needed or not. sql/sql_cache.cc: - Changed flush_in_progress-flag into a state and added a function, is_flushing() to reflect on this state. A new state was needed to indicate that a partial invalidation was in progress. - An unused parameter 'under_guard' was removed. - The Query_cache mutex structural_guard was pushed down into one invalidate_table function to avoid multiple entry points which makes maintainens more difficult. - Instead of keeping the structural_guard mutex during the entire invalidation we set the query cache status state to TABLE_FLUSH_IN_PROGRESS to temporarily disable the cache and avoid locking other threads needing the Query_cache resource. sql/sql_cache.h: - Changed flush_in_progress-flag into a state and added a function, is_flushing() to reflect on this state. A new state was needed to indicate that a partial invalidation was in progress. - An unused parameter 'under_guard' was removed. - The Query_cache mutex structural_guard was pushed down into one invalidate_table function to avoid multiple entry points which makes maintainens more difficult. - Instead of keeping the structural_guard mutex during the entire invalidation we set the query cache status state to TABLE_FLUSH_IN_PROGRESS to temporarily disable the cache and avoid locking other threads needing the the Query_cache resource. sql/sql_db.cc: - mysql_rm_table_part2_with_lock is redundant and replaced with mysql_rm_table_part2. sql/sql_parse.cc: - Function query_cache_invalidate3 isn't protect by a lock and we have a race condition. - Moving this function into mysql_rename_tables and make sure it is protected by a exclusive table name lock. sql/sql_rename.cc: - Function query_cache_invalidation3 isn't protect by a lock and we have a race condition. - Moving this function into mysql_rename_tables and make sure it is protected by a exclusive table name lock. - Instead of using LOCK_open mutex, which excludes all other threads, the lock is changed into exclusive table name locks instead. This prevents us from locking the server if a query cache invalidation would take a long time to complete. sql/sql_table.cc: - Instead of using LOCK_open mutex, which excludes all other threads, the lock is changed into exclusive table name locks instead. This prevents us from locking the server if a query cache invalidation would take a long time to complete. - Added new parameter to mysql_rm_table_part2 to control whether OPEN_lock mutex needs to be aquired or not. This is currently needed by the NDB implemenation. sql/sql_trigger.cc: - Table_triggers don't need to be protexted by LOCK_open mutex. This patch cancel this restriction. - Refactored comments to doxygen style. --- sql/mysql_priv.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'sql/mysql_priv.h') diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index f5d66696cab..3e6bdeb2775 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -820,10 +820,8 @@ void mysql_client_binlog_statement(THD *thd); bool mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists, my_bool drop_temporary); int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, - bool drop_temporary, bool drop_view, bool log_query); -int mysql_rm_table_part2_with_lock(THD *thd, TABLE_LIST *tables, - bool if_exists, bool drop_temporary, - bool log_query); + bool drop_temporary, bool drop_view, bool log_query, + bool need_lock_open); bool quick_rm_table(handlerton *base,const char *db, const char *table_name, uint flags); void close_cached_table(THD *thd, TABLE *table); @@ -1799,6 +1797,11 @@ bool wait_for_locked_table_names(THD *thd, TABLE_LIST *table_list); bool lock_table_names(THD *thd, TABLE_LIST *table_list); void unlock_table_names(THD *thd, TABLE_LIST *table_list, TABLE_LIST *last_table); +bool lock_table_names_exclusively(THD *thd, TABLE_LIST *table_list); +bool is_table_name_exclusively_locked_by_this_thread(THD *thd, + TABLE_LIST *table_list); +bool is_table_name_exclusively_locked_by_this_thread(THD *thd, uchar *key, + int key_length); /* old unireg functions */ -- cgit v1.2.1 From b16b2683e5a7e9b1eae9a59b477b8eb0517b6c68 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Jul 2007 17:17:58 +0500 Subject: Complementary fix for bug #29353: inserting a negative value to a csv table leads to the table corruption New Field::store() method implemented to explicitly set thd->count_cuted_fields before value storing, instead of (incorrectly) setting it in the CSV storage engine. Thread row counter now properly incremented during check and repair in the CSV engine. include/mysql/plugin.h: Complementary fix for bug #29353: inserting a negative value to a csv table leads to the table corruption - thd_inc_row_count() function prototype added, which allows a storage engine to increment thread row counter. mysql-test/r/csv.result: Complementary fix for bug #29353: inserting a negative value to a csv table leads to the table corruption - result adjusted. sql/field.cc: Complementary fix for bug #29353: inserting a negative value to a csv table leads to the table corruption - Field::store(const char *to, uint length, CHARSET_INFO *cs, enum_check_fields check_level) method introduced in order to explicitly set count_cuted_fields before a ::store call, then reset it back after. sql/field.h: Complementary fix for bug #29353: inserting a negative value to a csv table leads to the table corruption - Field::store(const char *to, uint length, CHARSET_INFO *cs, enum_check_fields check_level) method introduced in order to explicitly set count_cuted_fields before a ::store call, then reset it back after. sql/mysql_priv.h: Complementary fix for bug #29353: inserting a negative value to a csv table leads to the table corruption - enum enum_check_fields moved from sql/sql_class.h to sql/mysql_priv.h as it's used now in the field.h sql/sql_class.cc: Complementary fix for bug #29353: inserting a negative value to a csv table leads to the table corruption - implementation of the new thd_inc_row_count() function which increments thread row counter. sql/sql_class.h: Complementary fix for bug #29353: inserting a negative value to a csv table leads to the table corruption - enum enum_check_fields moved from sql/sql_class.h to sql/mysql_priv.h as it's used now in the field.h storage/csv/ha_tina.cc: Complementary fix for bug #29353: inserting a negative value to a csv table leads to the table corruption - removed #define MYSQL_SERVER 1 - "a storage engine should not need internals of the server" - removed thd->count_cuted_fields= CHECK_FIELD_WARN as we are not allowed to access internals of THD. - used new Field::store() method to explicitly set thd->count_cuted_fields to CHECK_FIELD_WARN - thd_inc_row_count() calls added to ha_tina::repair() and ha_tina::check() to get proper row count values. --- sql/mysql_priv.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sql/mysql_priv.h') diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 5a50b03282f..9264ca295d9 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -494,6 +494,13 @@ enum enum_parsing_place struct st_table; class THD; +enum enum_check_fields +{ + CHECK_FIELD_IGNORE, + CHECK_FIELD_WARN, + CHECK_FIELD_ERROR_FOR_NULL +}; + /* Struct to handle simple linked lists */ typedef struct st_sql_list { -- cgit v1.2.1 From bd8b9746bfbb620b0f37d030169e2ae459aec4de Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Jul 2007 01:05:47 +0200 Subject: WL#3914: Additonal accessors required to compile InnoDB as a plugin storage engine Add more accessors to MySQL internals in mysql/plugin.h, for storage engine plugins. Add some accessors specific to the InnoDB storage engine, to allow InnoDB to be compiled as a plugin (without MYSQL_SERVER). InnoDB has additional requirements, due to its foreign key support, etc. include/m_string.h: Add structure tag to LEX_STRING definition, so that it can be referred to by forward declarations. Allow struct st_mysql_lex_string to be defined here, or in mysql/plugin.h. include/my_global.h: Define INNODB_COMPATIBILITY_HOOKS unconditionally; it brackets some definitions needed for the InnoDB storage engine plugin which do not belong in our general plugin interface. include/mysql/plugin.h: Additional accessors for MySQL internals: - Full definition of MYSQL_LEX_STRING (identical to LEX_STRING from m_string.h) - Full definition of MYSQL_XID (binary compatible with XID from handler.h) - mysql_tmpfile(), creates a temporary file in mysqld's tmpdir - thd_killed(), to check killed state of connection - thd_alloc() and similar allocation functions - thd_get_xid(), to get XID of connection's transaction - mysql_query_cache_invalidate4, to invalidate a table's query cache entries sql/handler.h: Use MYSQL_XIDDATASIZE definition from mysql/plugin.h, to avoid redundant definitions sql/log.cc: Add definitions for two InnoDB compatibility hooks: - mysql_bin_log_file(), to get log filename - mysql_bin_log_file_pos, to get position in file These are defined only if INNODB_COMPATIBILITY_HOOKS is defined; they are needed by the InnoDB plugin, but aren't part of the general plugin interface. They are declared in ha_innodb.h for InnoDB's use. sql/mysql_priv.h: Expose some server internals when INNODB_COMPATIBILITY_HOOKS is defined, so that InnoDB can be built as a plugin when MYSQL_SERVER is not defined. Move make_lex_string inside THD class. sql/sql_cache.cc: Add definiton of mysql_query_cache_invalidate4(), a part of the plugin API (mysql/plugin.h). sql/sql_class.cc: Add definitions for several accessor functions which form part of the plugin API (mysql/plugin.h): - mysql_tmpfile() - thd_alloc() and friends - thd_make_lex_string() - thd_get_xid() Add definitons for accessor functions which InnoDB requires, but which are not part of the plugin interface: - thd_charset() - thd_query() - thd_slave_thread() - thd_non_transactional_update() - thd_binlog_format() Move definition of make_lex_string() from sql_show.cc into THD class sql/sql_class.h: Remove LEX_STRING_make(), and move make_lex_string() from sql_show.cc inside THD class. sql/sql_parse.cc: Use thd->make_lex_string() instead of thd->LEX_STRING_make() sql/sql_show.cc: Move make_lex_string() inside THD class storage/innobase/handler/ha_innodb.cc: Call thd_make_lex_string() instead of make_lex_string(). --- sql/mysql_priv.h | 54 ++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 46 insertions(+), 8 deletions(-) (limited to 'sql/mysql_priv.h') diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 98c06148313..d18dc9b90e9 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -1182,7 +1182,11 @@ bool mysqld_show_open_tables(THD *thd,const char *wild); bool mysqld_show_logs(THD *thd); void append_identifier(THD *thd, String *packet, const char *name, uint length); +#endif /* MYSQL_SERVER */ +#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS int get_quote_char_for_identifier(THD *thd, const char *name, uint length); +#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */ +#ifdef MYSQL_SERVER void mysqld_list_fields(THD *thd,TABLE_LIST *table, const char *wild); int mysqld_dump_create_info(THD *thd, TABLE_LIST *table_list, int fd); bool mysqld_show_create(THD *thd, TABLE_LIST *table_list); @@ -1211,9 +1215,6 @@ void reset_status_vars(); /* information schema */ extern LEX_STRING INFORMATION_SCHEMA_NAME; extern const LEX_STRING partition_keywords[]; -LEX_STRING *make_lex_string(THD *thd, LEX_STRING *lex_str, - const char* str, uint length, - bool allocate_lex_string); ST_SCHEMA_TABLE *find_schema_table(THD *thd, const char* table_name); ST_SCHEMA_TABLE *get_schema_table(enum enum_schema_tables schema_table_idx); int prepare_schema_table(THD *thd, LEX *lex, Table_ident *table_ident, @@ -1691,9 +1692,14 @@ extern int creating_table; // How many mysql_create_table() are running */ extern time_t server_start_time; +#endif /* MYSQL_SERVER */ +#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS extern uint mysql_data_home_len; extern char *mysql_data_home,server_version[SERVER_VERSION_LENGTH], - mysql_real_data_home[], *opt_mysql_tmpdir, mysql_charsets_dir[], + mysql_real_data_home[]; +#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */ +#ifdef MYSQL_SERVER +extern char *opt_mysql_tmpdir, mysql_charsets_dir[], def_ft_boolean_syntax[sizeof(ft_boolean_syntax)]; #define mysql_tmpdir (my_tmpdir(&mysql_tmpdir_list)) extern MY_TMPDIR mysql_tmpdir_list; @@ -1710,8 +1716,13 @@ extern Gt_creator gt_creator; extern Lt_creator lt_creator; extern Ge_creator ge_creator; extern Le_creator le_creator; -extern char language[FN_REFLEN], reg_ext[FN_EXTLEN]; +extern char language[FN_REFLEN]; +#endif /* MYSQL_SERVER */ +#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS +extern char reg_ext[FN_EXTLEN]; extern uint reg_ext_length; +#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */ +#ifdef MYSQL_SERVER extern char glob_hostname[FN_REFLEN], mysql_home[FN_REFLEN]; extern char pidfile_name[FN_REFLEN], system_time_zone[30], *opt_init_file; extern char log_error_file[FN_REFLEN], *opt_tc_log_file; @@ -1740,17 +1751,32 @@ extern ulong max_binlog_size, max_relay_log_size; extern ulong opt_binlog_rows_event_max_size; extern ulong rpl_recovery_rank, thread_cache_size, thread_pool_size; extern ulong back_log; -extern ulong specialflag, current_pid; +#endif /* MYSQL_SERVER */ +#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS +extern ulong specialflag; +#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */ +#ifdef MYSQL_SERVER +extern ulong current_pid; extern ulong expire_logs_days, sync_binlog_period, sync_binlog_counter; extern ulong opt_tc_log_size, tc_log_max_pages_used, tc_log_page_size; extern ulong tc_log_page_waits; extern my_bool relay_log_purge, opt_innodb_safe_binlog, opt_innodb; extern uint test_flags,select_errors,ha_open_options; extern uint protocol_version, mysqld_port, dropping_tables; -extern uint delay_key_write_options, lower_case_table_names; +extern uint delay_key_write_options; +#endif /* MYSQL_SERVER */ +#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS +extern uint lower_case_table_names; +#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */ +#ifdef MYSQL_SERVER extern bool opt_endinfo, using_udf_functions; extern my_bool locked_in_memory; -extern bool opt_using_transactions, mysqld_embedded; +extern bool opt_using_transactions; +#endif /* MYSQL_SERVER */ +#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS +extern bool mysqld_embedded; +#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */ +#ifdef MYSQL_SERVER extern bool using_update_log, opt_large_files, server_id_supplied; extern bool opt_update_log, opt_bin_log, opt_error_log; extern my_bool opt_log, opt_slow_log; @@ -1774,8 +1800,12 @@ extern uint opt_crash_binlog_innodb; extern char *shared_memory_base_name, *mysqld_unix_port; extern my_bool opt_enable_shared_memory; extern char *default_tz_name; +#endif /* MYSQL_SERVER */ +#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS extern my_bool opt_large_pages; extern uint opt_large_page_size; +#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */ +#ifdef MYSQL_SERVER extern char *opt_logname, *opt_slow_logname; extern const char *log_output_str; @@ -1811,7 +1841,11 @@ extern MY_BITMAP temp_pool; extern String my_empty_string; extern const String my_null_string; extern SHOW_VAR status_vars[]; +#endif /* MYSQL_SERVER */ +#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS extern struct system_variables global_system_variables; +#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */ +#ifdef MYSQL_SERVER extern struct system_variables max_system_variables; extern struct system_status_var global_status_var; extern struct rand_struct sql_rand; @@ -2009,10 +2043,14 @@ int wild_case_compare(CHARSET_INFO *cs, const char *str,const char *wildstr); char *fn_rext(char *name); /* Conversion functions */ +#endif /* MYSQL_SERVER */ +#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS uint strconvert(CHARSET_INFO *from_cs, const char *from, CHARSET_INFO *to_cs, char *to, uint to_length, uint *errors); uint filename_to_tablename(const char *from, char *to, uint to_length); uint tablename_to_filename(const char *from, char *to, uint to_length); +#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */ +#ifdef MYSQL_SERVER uint build_table_filename(char *buff, size_t bufflen, const char *db, const char *table, const char *ext, uint flags); -- cgit v1.2.1 From 360a5ebc378f514f824d585545459ebfab6dc06f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 6 Jul 2007 16:18:49 +0400 Subject: Remove typedef st_table_list TABLE_LIST and always use name 'TABLE_LIST'. The need arose when working on Bug 26141, where it became necessary to replace TABLE_LIST with its forward declaration in a few headers, and this involved a lot of s/TABLE_LIST/st_table_list/. Although other workarounds exist, this patch is in line with our general strategy of moving away from typedef-ed names. Sometime in future we might also rename TABLE_LIST to follow the coding style, but this is a huge change. sql/item.cc: st_table_list -> TABLE_LIST sql/item.h: st_table_list -> TABLE_LIST sql/mysql_priv.h: st_table_list -> TABLE_LIST sql/sql_base.cc: st_table_list -> TABLE_LIST sql/sql_lex.cc: st_table_list -> TABLE_LIST sql/sql_lex.h: st_table_list -> TABLE_LIST sql/sql_select.cc: st_table_list -> TABLE_LIST sql/sql_show.cc: st_table_list -> TABLE_LIST sql/sql_udf.h: Was not needed. sql/table.cc: st_table_list -> TABLE_LIST sql/table.h: st_table_list -> TABLE_LIST --- sql/mysql_priv.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sql/mysql_priv.h') diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 0aaa1744fe1..bbcf2ed8adf 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -455,9 +455,9 @@ void debug_sync_point(const char* lock_name, uint lock_timeout); #define SHOW_LOG_STATUS_FREE "FREE" #define SHOW_LOG_STATUS_INUSE "IN USE" -struct st_table_list; +struct TABLE_LIST; class String; -void view_store_options(THD *thd, st_table_list *table, String *buff); +void view_store_options(THD *thd, TABLE_LIST *table, String *buff); /* Options to add_table_to_list() */ #define TL_OPTION_UPDATING 1 @@ -1104,7 +1104,7 @@ bool close_thread_table(THD *thd, TABLE **table_ptr); void close_temporary_tables(THD *thd); void close_tables_for_reopen(THD *thd, TABLE_LIST **tables); TABLE_LIST *find_table_in_list(TABLE_LIST *table, - st_table_list *TABLE_LIST::*link, + TABLE_LIST *TABLE_LIST::*link, const char *db_name, const char *table_name); TABLE_LIST *unique_table(THD *thd, TABLE_LIST *table, TABLE_LIST *table_list, -- cgit v1.2.1 From a7e5f73abb9da35a1c199b89df84596cffe59901 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 13 Jul 2007 17:50:58 +0200 Subject: Bug#27198: Error returns from time() are ignored gettimeofday() can fail and presumably, so can time(). Keep an eye on it. Since we have no data on this at all so far, we just retry on failure (and log the event), assuming that this is just an intermittant failure. This might of course hang the threat until we succeed. Once we know more about these failures, an appropriate more clever scheme may be picked (only try so many times per thread, etc., if that fails, return last "good" time() we got or some such). Using sql_print_information() to log as this probably only occurs in high load scenarios where the debug- trace likely is disabled (or might interfere with testing the effect). No test-case as this is a non-deterministic issue. sql/mysql_priv.h: Bug#27198: Error returns from time() are ignored move declarations for log.cc to before inclusion of sql_class.h as we now use sql_print_information() in there. sql/sql_class.h: Bug#27198: Error returns from time() are ignored gettimeofday() can fail and presumably, so can time(). Keep an eye on it. --- sql/mysql_priv.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'sql/mysql_priv.h') diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 3972a01f7ba..173bfe678e8 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -302,6 +302,14 @@ inline THD *_current_thd(void) } #define current_thd _current_thd() +/* log.cc */ +void sql_perror(const char *message); + +void vprint_msg_to_log( enum loglevel level, const char *format, va_list args ); +void sql_print_error( const char *format, ... ); +void sql_print_warning( const char *format, ...); +void sql_print_information( const char *format, ...); + #include "sql_string.h" #include "sql_list.h" #include "sql_map.h" @@ -657,15 +665,6 @@ void key_unpack(String *to,TABLE *form,uint index); bool check_if_key_used(TABLE *table, uint idx, List &fields); void init_errmessage(void); -void sql_perror(const char *message); - -void vprint_msg_to_log( enum loglevel level, const char *format, va_list args ); -void sql_print_error( const char *format, ... ); -void sql_print_warning( const char *format, ...); -void sql_print_information( const char *format, ...); - - - bool fn_format_relative_to_data_home(my_string to, const char *name, const char *dir, const char *extension); bool open_log(MYSQL_LOG *log, const char *hostname, -- cgit v1.2.1 From 31ea7d042ba48bd34a457bba138d2189f844731d Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 14 Jul 2007 02:04:48 +0400 Subject: A follow up after the patch for Bug#21074 - even though we now have exclusive name lock on the table name in mysql_rm_table_part2, we still should keep LOCK_open - some storage engines are not ready for locking scope change and assume that LOCK_open is kept. Still, the binary logging and query cache invalidation calls moved out of LOCK_open scope. Fixes some of the broken 5.1-runtime tests (tests break on asserts). sql/ha_ndbcluster.cc: Do not lock LOCK_open for mysql_rm_table_part2 - it does that for us now. sql/mysql_priv.h: Remove an unused flag. sql/sql_class.h: Fix an unrelated compiler warning. sql/sql_db.cc: Adjust to the changed signature. sql/sql_table.cc: mysql_rm_table_part2: we need to keep LOCK_open while calling storage engine functions, even though now we have an exclusive lock on the table name. Some of them assume that it's kept and attempt to unlock it. --- sql/mysql_priv.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'sql/mysql_priv.h') diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index e0de89a5b74..8b00cfb5d24 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -901,8 +901,7 @@ void mysql_client_binlog_statement(THD *thd); bool mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists, my_bool drop_temporary); int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, - bool drop_temporary, bool drop_view, bool log_query, - bool need_lock_open); + bool drop_temporary, bool drop_view, bool log_query); bool quick_rm_table(handlerton *base,const char *db, const char *table_name, uint flags); void close_cached_table(THD *thd, TABLE *table); -- cgit v1.2.1