An error occurred fetching the project authors.
- 31 Mar, 2011 1 commit
-
-
Michael Widenius authored
Fixed memory leak from HEAP tables that was not deleted properly BUILD/compile-alpha-ccc: Use g++ instead of gcc for linking BUILD/compile-alpha-debug: Use g++ instead of gcc for linking BUILD/compile-pentium-pgcc: Use g++ instead of gcc for linking BUILD/compile-solaris-sparc: Use g++ instead of gcc for linking BUILD/compile-solaris-sparc-debug: Use g++ instead of gcc for linking BUILD/compile-solaris-sparc-purify: Use g++ instead of gcc for linking sql/item.cc: Safety fixes for expr_cache Call Item_result:field::cleanup() in Item_cache_wrapper::cleanup() More DBUG_PRINT sql/sql_base.cc: Simple optimization for setup_wild More DBUG_PRINT sql/sql_expression_cache.cc: Added header Removed not needed initialization sql/sql_lex.cc: More DBUG_PRINT sql/sql_select.cc: More DBUG_PRINT Fixed memory leak from HEAP tables that was not deleted properly storage/heap/hp_create.c: More DBUG_PRINT
-
- 28 Feb, 2011 1 commit
-
-
Michael Widenius authored
Changed some String.ptr() -> String.c_ptr() for String that are not guaranteed to end with \0 Removed some c_ptr() usage from parameters to functions that takes ptr & length Use preallocate buffers to avoid calling malloc() for most operations. sql/event_db_repository.cc: alias is now a String sql/event_scheduler.cc: c_ptr -> c_ptr_safe() to avoid warnings from valgrind. sql/events.cc: c_ptr -> c_ptr_safe() to avoid warnings from valgrind. c_ptr -> ptr() as function takes ptr & length sql/field.cc: alias is now a String sql/field.h: alias is now a String sql/ha_partition.cc: alias is now a String sql/handler.cc: alias is now a String ptr() -> c_ptr() as string is not guaranteed to be \0 terminated sql/item.cc: Store error parameter in separarte buffer to ensure correct error message sql/item_func.cc: ptr() -> c_ptr_safe() as string is not guaranteed to be \0 terminated sql/item_sum.h: Use my_strtod() instead of my_atof() to not have to make string \0 terminated sql/lock.cc: alias is now a String sql/log.cc: c_ptr() -> ptr() as function takes ptr & length sql/log_event.cc: c_ptr_quick() -> ptr() as we only want to get the pointer to String buffer sql/opt_range.cc: ptr() -> c_ptr() as string is not guaranteed to be \0 terminated sql/opt_table_elimination.cc: alias is now a String sql/set_var.cc: ptr() -> c_ptr() as string is not guaranteed to be \0 terminated c_ptr() -> c_ptr_safe() to avoid warnings from valgrind. c_ptr() -> ptr() as function takes ptr & length Simplify some code. sql/sp.cc: c_ptr() -> ptr() as function takes ptr & length sql/sp_rcontext.cc: alias is now a String sql/sql_base.cc: alias is now a String. Here we win a realloc() for most alias usage. sql/sql_class.cc: Use size descriptor for printf() to avoid accessing bytes outside of buffer sql/sql_insert.cc: Change allocation of TABLE as it's now contains a String _ptr() -> ptr() as function takes ptr & length sql/sql_load.cc: Use preallocate buffers to avoid calling malloc() for most operations. sql/sql_parse.cc: Use c_ptr_safe() to ensure string is \0 terminated. sql/sql_plugin.cc: c_ptr_quick() -> ptr() as function takes ptr & length sql/sql_select.cc: alias is now a String sql/sql_show.cc: alias is now a String sql/sql_string.h: Added move() function to change who owns the string (owner does the free) sql/sql_table.cc: alias is now a String c_ptr() -> c_ptr_safe() to avoid warnings from valgrind. sql/sql_test.cc: c_ptr() -> c_ptr_safe() to avoid warnings from valgrind. alias is now a String sql/sql_trigger.cc: c_ptr() -> c_ptr_safe() to avoid warnings from valgrind. Use field->init() to setup pointers to alias. sql/sql_update.cc: alias is now a String sql/sql_view.cc: ptr() -> c_ptr_safe() as string is not guaranteed to be \0 terminated sql/sql_yacc.yy: r() -> c_ptr() as string is not guaranteed to be \0 terminated sql/table.cc: alias is now a String sql/table.h: alias is now a String storage/federatedx/ha_federatedx.cc: Remove extra 1 byte alloc that is automaticly done by strmake() Ensure that error message ends with \0 storage/maria/ha_maria.cc: alias is now a String storage/myisam/ha_myisam.cc: alias is now a String
-
- 25 Jan, 2011 1 commit
-
-
Karen Langford authored
-
- 24 Jan, 2011 1 commit
-
-
unknown authored
sql/sql_base.cc: fill_record should be used for only one table (no need list).
-
- 11 Jan, 2011 1 commit
-
-
Jan Wedvik authored
to crash mysqld". handler::pushed_cond was not always properly reset when table objects where recycled via the table cache. handler::pushed_cond is now set to NULL in handler::ha_reset(). This should prevent pushed conditions from (incorrectly) re-apperaring in later queries.
-
- 03 Jan, 2011 1 commit
-
-
Michael Widenius authored
It includes speed optimizations for HANDLER READ by caching as much as possible in HANDLER OPEN Other things: - Added mysqld option --disable-thr-alarm to be able to benchmark things without thr_alarm - Changed 'Locked' state to 'System lock' and 'Table lock' (these where used in the code but never shown to end user) - Better error message if mysql_install_db.sh fails - Moved handler function prototypes to sql_handler.h - Remove not anymore used 'thd->locked' member include/thr_alarm.h: Added my_disable_thr_alarm include/thr_lock.h: Add new member to THR_LOCK_DATA to remember original lock type state. This is needed as thr_unlock() resets type to TL_UNLOCK. mysql-test/include/check_no_concurrent_insert.inc: Locked -> Table lock mysql-test/include/handler.inc: Locked -> Table lock mysql-test/r/handler_innodb.result: Updated results for new tests mysql-test/r/handler_myisam.result: Updated results for new tests mysql-test/r/sp-threads.result: Locked -> Table lock mysql-test/suite/binlog/t/binlog_stm_row.test: Locked -> Table lock mysql-test/suite/funcs_1/datadict/processlist_val.inc: Locked -> Table lock mysql-test/suite/pbxt/t/lock_multi.test: Locked -> Table lock mysql-test/suite/sys_vars/r/concurrent_insert_func.result: Locked -> Table lock mysql-test/suite/sys_vars/t/concurrent_insert_func.test: Locked -> Table lock mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test: Locked -> Table lock mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_func.test: Locked -> Table lock mysql-test/suite/sys_vars/t/sql_low_priority_updates_func.test: Locked -> Table lock mysql-test/t/insert_notembedded.test: Locked -> Table lock mysql-test/t/lock_multi.test: Locked -> Table lock mysql-test/t/merge-big.test: Locked -> Table lock mysql-test/t/multi_update.test: Locked -> Table lock mysql-test/t/query_cache_28249.test: Locked -> Table lock mysql-test/t/sp_notembedded.test: Locked -> Table lock mysql-test/t/sp_sync.test: Locked -> Table lock mysql-test/t/status.test: Locked -> Table lock mysql-test/t/trigger_notembedded.test: Locked -> Table lock mysys/thr_alarm.c: Added option to disable thr_alarm mysys/thr_lock.c: Detect loops scripts/mysql_install_db.sh: Give better error message if something goes wrong sql/Makefile.am: Added sql_handler.h sql/lock.cc: Split functions to allow one to cache value if store_lock() (for HANDLER functions). - Split mysql_lock_tables() into two functions, where first one allocates MYSQL_LOCK and other other one uses it. - Made get_lock_data() an external function. - Added argument to mysql_unlock_tables() to not free sql_lock. - Added argument to reset_lock_data() to reset lock structure to initial state (as after get_lock_data()) sql/mysql_priv.h: Moved handler function prototypes to sql_handler.h Added new lock functions. sql/mysqld.cc: Added --thread-alarm startup option sql/net_serv.cc: Don't call vio_blocking() if not needed sql/sql_base.cc: include sql_handler.h sql/sql_class.cc: include sql_handler.h Remove not anymore used 'thd->locked' member sql/sql_class.h: Remove not anymore used 'thd->locked' member sql/sql_db.cc: include sql_handler.h sql/sql_delete.cc: include sql_handler.h sql/sql_handler.cc: Rewrote all code to use SQL_HANDLER instead of TABLE_LIST (original interface) Rewrote mysql_ha_open() to cache all things from TABLE_LIST and items for field list, where etc. In mysql_ha_open() also cache MYSQL_LOCK structure from get_lock_data(). Split functions into smaller sub functions (needed to be able to implement mysql_ha_read_prepare()) Added mysql_ha_read_prepare() to allow one to prepare HANDLER READ. sql/sql_handler.h: Interface to sql_handler.cc sql/sql_parse.cc: include sql_handler.h sql/sql_prepare.cc: Added mysql_test_handler_read(), prepare for HANDLER READ sql/sql_rename.cc: include sql_handler.h sql/sql_show.cc: Removed usage of thd->locked sql/sql_table.cc: include sql_handler.h sql/sql_trigger.cc: include sql_handler.h
-
- 28 Dec, 2010 1 commit
-
-
Kent Boortz authored
- Removed files specific to compiling on OS/2 - Removed files specific to SCO Unix packaging - Removed "libmysqld/copyright", text is included in documentation - Removed LaTeX headers for NDB Doxygen documentation - Removed obsolete NDB files - Removed "mkisofs" binaries - Removed the "cvs2cl.pl" script - Changed a few GPL texts to use "program" instead of "library"
-
- 15 Dec, 2010 1 commit
-
-
Alexander Nozdrin authored
The user-visible problem was that changes to column-level privileges, happened in between of PREPARE and EXECUTE of a prepared statement, were neglected. I.e. a prepared statement could be executed with the column-level privileges as of PREPARE-time. The problem existed for column-level privileges only. A similar problem existed for stored programs: the changes between executions didn't have an effect. Technically the thing is that table references are cached in Prepared_statement::prepare() call. In subsequent Prepared_statement::execute() calls those cached values are used. There are two functions to get a field by name: find_field_in_table() and find_field_in_table_ref(). On prepare-phase find_field_in_table_ref() is called, on execute-phase -- find_field_in_table() because the table is cached. find_field_in_table() does not check column-level privileges and expects the caller to do that. The problem was that this check was forgotten. The fix is to check them there as it happens in find_field_in_table_ref().
-
- 27 Nov, 2010 1 commit
-
-
Michael Widenius authored
- Changed Cached_item_field not copy data for fields with NULL value - In key_copy() and key_restore() don't copy data for fields with NULL value Fixed code to avoid valgrind warnings - Use c_ptr_safe instead of c_ptr() Removed "QQ" from comments (QQ was ment to be used for internal comments that should be removed before pushing) Fixed wrong alias used (from previous patch) sql/event_db_repository.cc: Update testing if event table is valid (to avoid valgrind errors) sql/ha_partition.cc: m_ordered_scan_ongoing was not initialized Reset null bits in record to avoid valgrind errors sql/handler.h: Added flag if storage engine will write row verbatim and the row contains varchar or null fields (in which case we must clear the row to avoid valgrind warnings) sql/item_buff.cc: Changed Cached_item_field not copy data for fields with NULL value (Optimization and avoids valgrind warnings) sql/item_func.cc: c_ptr() -> c_ptr_safe() sql/key.cc: In key_copy() and key_restore() don't copy data for fields with NULL value sql/opt_range.cc: c_ptr() -> c_ptr_safe() sql/sql_base.cc: Added TRASH() to table->record[0] to find out if we access not initialzed data. Initialize null_bytes to: - Get consistent tests - Ensure we don't get valgrind warnings for null fields (as we may only update a couple of bits in a byte) sql/sql_class.cc: Removed "QQ" from comments sql/sql_insert.cc: Initialize row to default values if we are using valgrind and row will be copied verbatim to disk in storage engine. sql/sql_load.cc: QQ -> TODO sql/sql_parse.cc: Removed old not used code marked QQ and withing "#ifdef REMOVED" sql/sql_select.cc: QQ -> TODO Initialize some variables that was used uninitialized Added DBUG_ASSERT() to find out if thd was not properly initialized for sub queries sql/sql_test.cc: Fixed format for printing to DBUG file Fixed wrong alias used (from previous patch) sql/sql_trigger.h: QQ -> TODO sql/table.cc: QQ -> TODO storage/maria/ha_maria.cc: Mark table with HA_RECORD_MUST_BE_CLEAN_ON_WRITE, if row is written verbatim to disk and contains varchar or null fields. storage/maria/ma_open.c: Added flags if table has varchar or null fields storage/maria/maria_def.h: Added flags if table has varchar or null fields storage/myisam/ha_myisam.cc: Mark table with HA_RECORD_MUST_BE_CLEAN_ON_WRITE, if row is written verbatim to disk and contains varchar or null fields. storage/myisam/mi_open.c: Fixed memory overrun bug when using fulltext keys storage/xtradb/row/row0sel.c: Removed initialization of null bits. (not needed anymore)
-
- 23 Nov, 2010 1 commit
-
-
Michael Widenius authored
- Changed TABLE->alias to String to get fewer reallocs when alias are used. - Preallocate some buffers Changed some String->c_ptr() -> String->ptr() when \0 is not needed. Fixed wrong usage of String->ptr() when we need a \0 terminated string. Use my_strtod() instead of my_atof() to avoid having to add \0 to string. c_ptr() -> c_ptr_safe() to avoid warnings from valgrind. zr sql/event_db_repository.cc: Update usage of TABLE->alias sql/event_scheduler.cc: c_ptr() -> c_ptr_safe() sql/events.cc: c_ptr() -> ptr() as \0 was not needed sql/field.cc: Update usage of TABLE->alias sql/field.h: Update usage of TABLE->alias sql/ha_partition.cc: Update usage of TABLE->alias sql/handler.cc: Update usage of TABLE->alias Fixed wrong usage of str.ptr() sql/item.cc: Fixed error where code wrongly assumed string was \0 terminated. sql/item_func.cc: c_ptr() -> c_ptr_safe() Update usage of TABLE->alias sql/item_sum.h: Use my_strtod() instead of my_atof() to avoid having to add \0 to string sql/lock.cc: Update usage of TABLE->alias sql/log.cc: c_ptr() -> ptr() as \0 was not needed sql/log_event.cc: c_ptr_quick() -> ptr() as \0 was not needed sql/opt_range.cc: ptr() -> c_ptr() as \0 is needed sql/opt_subselect.cc: Update usage of TABLE->alias sql/opt_table_elimination.cc: Update usage of TABLE->alias sql/set_var.cc: ptr() -> c_ptr() as \0 is needed c_ptr() -> c_ptr_safe() sql/sp.cc: c_ptr() -> ptr() as \0 was not needed sql/sp_rcontext.cc: Update usage of TABLE->alias sql/sql_base.cc: Preallocate buffers Update usage of TABLE->alias sql/sql_class.cc: Fix arguments to sprintf() to work even if string is not \0 terminated sql/sql_insert.cc: Update usage of TABLE->alias c_ptr() -> ptr() as \0 was not needed sql/sql_load.cc: Preallocate buffers Trivial optimizations sql/sql_parse.cc: Trivial optimization sql/sql_plugin.cc: c_ptr() -> ptr() as \0 was not needed sql/sql_select.cc: Update usage of TABLE->alias sql/sql_show.cc: Update usage of TABLE->alias sql/sql_string.h: Added move() function to move allocated memory from one object to another. sql/sql_table.cc: Update usage of TABLE->alias c_ptr() -> c_ptr_safe() sql/sql_test.cc: ptr() -> c_ptr_safe() sql/sql_trigger.cc: Update usage of TABLE->alias c_ptr() -> c_ptr_safe() sql/sql_update.cc: Update usage of TABLE->alias sql/sql_view.cc: ptr() -> c_ptr_safe() sql/sql_yacc.yy: ptr() -> c_ptr() sql/table.cc: Update usage of TABLE->alias sql/table.h: Changed TABLE->alias to String to get fewer reallocs when alias are used. storage/federatedx/ha_federatedx.cc: Use c_ptr_safe() to ensure strings are \0 terminated. storage/maria/ha_maria.cc: Update usage of TABLE->alias storage/myisam/ha_myisam.cc: Update usage of TABLE->alias storage/xtradb/row/row0sel.c: Ensure that null bits in record are properly reset. (Old code didn't work as row_search_for_mysql() can be called twice while reading fields from one row.
-
- 03 Nov, 2010 1 commit
-
-
Michael Widenius authored
Fixed a bug in Aria when two threads was inserting into the same table and row page and one thread did an abort becasue of duplicate key. mysys/thr_lock.c: Fixed valgrind warning sql/sql_base.cc: Remove not used variable storage/maria/ma_bitmap.c: Added ma_bitmap_lock() & ma_bitmap_unlock() to protect against two threads using the bitmap at the same time. More DBUG_PRINT() storage/maria/ma_blockrec.c: Fixed a bug in Aria when two threads was inserting into the same table and row page and one thread did an abort becasue of duplicate key. Fix was that we block other threads to modify the bitmap while we are removing the row with a duplicate key. storage/maria/ma_blockrec.h: Added ma_bitmap_lock() & ma_bitmap_unlock() to protect against two threads using the bitmap at the same time. storage/maria/maria_def.h: Changed flush_all_requested to be a counter. storage/myisam/mi_locking.c: Fixed compiler error on windows (typo).
-
- 02 Nov, 2010 1 commit
-
-
Michael Widenius authored
Added locking of lock mutex when updating status in external_unlock() for Aria and MyISAM tables. Fixed that 'source' command doesn't cause mysql command line tool to exit on error. DEBUG_EXECUTE() and DEBUG_EVALUATE_IF() should not execute things based on wildcards. (Allows one to run --debug with mysql-test-run scripts that uses @debug) Fixed several core dump, deadlock and crashed table bugs in handling of LOCK TABLE with MERGE tables: - Added priority of locks to avoid crashes with MERGE tables. - Added thr_lock_merge() to allow one to merge two results of thr_lock(). Fixed 'not found row' bug in REPLACE with Aria tables. Mark MyISAM tables that are part of MERGE with HA_OPEN_MERGE_TABLE and set the locks to have priority THR_LOCK_MERGE_PRIV. - By sorting MERGE tables last in thr_multi_unlock() it's safer to release and relock them many times (can happen when TRIGGERS are created) Avoid printing (null) in debug file (to easier find out wrong NULL pointer usage with %s). client/mysql.cc: Fixed that 'source' command doesn't cause mysql command line tool to exit on error. client/mysqltest.cc: Don't send NULL to fn_format(). (Can cause crash on Solaris when using --debug) dbug/dbug.c: DEBUG_EXECUTE() and DEBUG_EVALUATE_IF() should not execute things based on wildcards. include/my_base.h: Added flag to signal if one opens a MERGE table. Added extra() command to signal that one is not part of a MERGE table anymore. include/thr_lock.h: Added priority for locks (needed to fix bug in thr_lock when using MERGE tables) Added option to thr_unlock() if get_status() should be called. Added prototype for thr_merge_locks(). mysql-test/mysql-test-run.pl: Ignore crashed table warnings for tables named 'crashed'. mysql-test/r/merge.result: Renamed triggers to make debugging easier. Added some CHECK TABLES to catch errors earlier. Additional tests. mysql-test/r/merge_debug.result: Test of error handling when reopening MERGE tables. mysql-test/r/udf_query_cache.result: Added missing flush status mysql-test/suite/parts/r/partition_repair_myisam.result: Update results mysql-test/t/merge.test: Renamed triggers to make debugging easier. Added some CHECK TABLES to catch errors earlier. Additional tests. mysql-test/t/merge_debug.test: Test of error handling when reopening MERGE tables. mysql-test/t/udf_query_cache.test: Added missing flush status mysys/my_getopt.c: Removed not used variable mysys/my_symlink2.c: Changed (null) to (NULL) to make it easier to find NULL arguments to DBUG_PRINT() functions. (On linux, NULL to sprintf is printed 'null') mysys/thr_lock.c: Added priority of locks to avoid crashes with MERGE tables. Added thr_lock_merge() to allow one to merge two results of thr_lock(). - This is needed for MyISAM as all locked table must share the same status. If not, you will not see newly inserted rows in other instances of the table. If calling thr_unlock() with THR_UNLOCK_UPDATE_STATUS, call update_status() and restore_status() for the locks. This is needed in some rare cases where we call thr_unlock() followed by thr_lock() without calling external_unlock/external_lock in between. Simplify loop in thr_multi_lock(). Added 'start_trans', which is called at end of thr_multi_lock() when all locks are taken. - This was needed by Aria to ensure that transaction is started when we got all locks, not at get_status(). Without this, some rows could not be visible when we lock two tables at the same time, causing REPLACE using two tables to fail unexpectedly. sql/handler.cc: Add an assert() in handler::print_error() for "impossible errors" (like table is crashed) when --debug-assert-if-crashed-table is used. sql/lock.cc: Simplify mysql_lock_tables() code if get_lock_data() returns 0 locks. Added new parameter to thr_multi_unlock() In mysql_unlock_read_tables(), call first externa_unlock(), then thr_multi_unlock(); This is same order as we do in mysql_unlock_tables(). Don't abort locks in mysql_lock_abort() for merged tables when a MERGE table is deleted; Would cause a spin lock. Added call to thr_merge_locks() in mysql_lock_merge() to ensure consistency in thr_locks(). - New locks of same type and table is stored after the old lock to ensure that we get the status from the original lock. sql/mysql_priv.h: Added debug_assert_if_crashed_table sql/mysqld.cc: Added --debug-assert-if-crashed-table sql/parse_file.cc: Don't print '(null)' in DBUG_PRINT of no dir given sql/set_var.cc: Increase default size of buffer for @debug variable. sql/sql_base.cc: In case of error from reopen_table() in reopen_tables(), call unlock_open_table() and restart loop. - This fixed bug when we twice deleted same table from open_cache. Don't take name lock for already name locked table in open_unireg_entry(). - Fixed bug when doing repair in reopen_table(). - In detach_merge_children(), always detach if 'clear_refs' is given. We can't trust parent->children_attached as this function can be called twice, first time with clear_refs set to 0. sql/sql_class.cc: Changed printing of (null) to "" in set_thd_proc_info() sql/sql_parse.cc: Added DBUG sql/sql_trigger.cc: Don't call unlink_open_table() if reopen_table() fails as the table may already be freed. storage/maria/ma_bitmap.c: Fixed DBUG_ASSERT() in allocate_tail() storage/maria/ma_blockrec.c: Fixed wrong calculation of row length for very small rows in undo_row_update(). - Fixes ASSERT() when doing undo. storage/maria/ma_blockrec.h: Added _ma_block_start_trans() and _ma_block_start_trans_no_versioning() storage/maria/ma_locking.c: Call _ma_update_status_with_lock() when releasing write locks. - Fixes potential problem with updating status without the proper lock. storage/maria/ma_open.c: Changed to use start_trans() instead of get_status() to ensure that we see all rows in all locked tables when we got the locks. - Fixed 'not found row' bug in REPLACE with Aria tables. storage/maria/ma_state.c: Added _ma_update_status_with_lock() and _ma_block_start_trans(). This is to ensure that we see all rows in all locked tables when we got the locks. storage/maria/ma_state.h: Added _ma_update_status_with_lock() storage/maria/ma_write.c: More DBUG_PRINT storage/myisam/mi_check.c: Fixed error message storage/myisam/mi_extra.c: Added HA_EXTRA_DETACH_CHILD: - Detach MyISAM table to not be part of MERGE table (remove flag & lock priority). storage/myisam/mi_locking.c: Call mi_update_status_with_lock() when releasing write locks. - Fixes potential problem with updating status without the proper lock. Change to use new HA_OPEN_MERGE_TABLE flag to test if MERGE table. Added mi_fix_status(), called by thr_merge(). storage/myisam/mi_open.c: Added marker if part of MERGE table. Call mi_fix_status() in thr_lock() for transactional tables. storage/myisam/myisamdef.h: Change my_once_flag to uint, as it stored different values than just 0/1 Added 'open_flag' to store state given to mi_open() storage/myisammrg/ha_myisammrg.cc: Add THR_LOCK_MERGE_PRIV to THR_LOCK_DATA to get MERGE locks sorted after other types of locks. storage/myisammrg/myrg_locking.c: Remove windows specific code. storage/myisammrg/myrg_open.c: Use HA_OPEN_MERGE_TABLE to mi_open(). Set HA_OPEN_MERGE_TABLE for linked MyISAM tables. storage/xtradb/buf/buf0buf.c: Fixed compiler warning storage/xtradb/buf/buf0lru.c: Initialize variable that could be used not initialized.
-
- 11 Oct, 2010 1 commit
-
-
unknown authored
After ALTER TABLE which changed only table's metadata, row-based binlog sometimes got corrupted since the tablemap was unexpectedly set to 0 for subsequent updates to the same table. ALTER TABLE which changed only table's metadata always reset table_map_id for the table share to 0. Despite the fact that 0 is a valid value for table_map_id, this step caused problems as it could have created situation in which we had more than one table share with table_map_id equal 0. If more than one table with table_map_id are 0 were updated in the same statement, updates to these different tables were written into the same rows event. This caused slave server to crash. This bug happens only on 5.1. It doesn't affect 5.5+. This patch solves this problem by ensuring that ALTER TABLE statements which change metadata only never reset table_map_id to 0. To do this it changes reopen_table() to correctly use refreshed table_map_id value instead of using the old one/ resetting it. mysql-test/suite/rpl/r/rpl_alter.result: Add test for BUG#56226 mysql-test/suite/rpl/t/rpl_alter.test: Add test for BUG#56226
-
- 23 Sep, 2010 1 commit
-
-
Michael Widenius authored
Change some my_bool in C++ classes and a few functions to bool to detect wrong usage of bool/my_bool. Fix some bugs where we stored values other than 0 or 1 in my_bool Fixed some compiler warnings client/mysql.cc: Changed interrupted_query from my_bool to int, as we stored 2 in it. client/mysqladmin.cc: Changed return variable type to same type as function value type client/mysqltest.cc: Changed 'found' to int as we store other values than 0 or 1 into it Changed type for parameter of set_reconnect() to match usage. extra/libevent/evbuffer.c: Added __attribute__((unused)) extra/libevent/event.c: Added __attribute__((unused)) extra/libevent/signal.c: Added __attribute__((unused)) sql/event_data_objects.h: my_bool -> bool sql/event_db_repository.cc: my_bool -> bool sql/event_db_repository.h: my_bool -> bool sql/event_parse_data.h: my_bool -> bool sql/events.cc: my_bool -> bool sql/events.h: my_bool -> bool sql/field.cc: my_bool -> bool sql/field.h: my_bool -> bool sql/hash_filo.h: my_bool -> bool sql/item.cc: my_bool -> bool sql/item.h: my_bool -> bool sql/item_cmpfunc.h: my_bool -> bool Changed result_for_null_param from my_bool to int as we stored -1 in it. sql/item_func.cc: my_bool -> bool Modified udf wrapper functions so that the UDF functions would continue to use my_bool. (To keep compatibility with UDF:s) sql/item_func.h: my_bool -> bool sql/item_subselect.h: my_bool -> bool sql/item_sum.cc: Modified udf wrapper functions so that the UDF functions would continue to use my_bool. (To keep compatibility with UDF:s) sql/parse_file.h: my_bool -> bool sql/rpl_mi.h: my_bool -> bool sql/sp_rcontext.h: my_bool -> bool sql/sql_analyse.h: my_bool -> bool sql/sql_base.cc: Change some assignments so that we don't initialize bool variables with int's. sql/sql_bitmap.h: my_bool -> bool sql/sql_cache.cc: my_bool -> bool sql/sql_cache.h: my_bool -> bool sql/sql_class.h: my_bool -> bool sql/sql_insert.cc: Change some assignments so that we don't initialize bool variables with int's. sql/sql_prepare.cc: my_bool -> bool sql/table.h: my_bool -> bool storage/maria/ma_check.c: Removed duplicate assignment strings/decimal.c: Fixed wrong variable usage. Don't do complex arithmetic on bool when simple works.
-
- 03 Sep, 2010 1 commit
-
-
Michael Widenius authored
Fall back to use ALTER TABLE for engines that doesn't support REPAIR when doing repair for upgrade. Nicer output from mysql_upgrade and mysql_check Updated all arrays that used NAME_LEN to use SAFE_NAME_LEN to ensure that we don't break things accidently as names can now have a #mysql50# prefix. client/mysql_upgrade.c: If we are using verbose, also run mysqlcheck in verbose mode. client/mysqlcheck.c: Add more information if running in verbose mode Print 'Needs upgrade' instead of complex error if table needs to be upgraded Don't write connect information if verbose is not 2 or above mysql-test/r/drop.result: Updated test and results as we now support full table names mysql-test/r/grant.result: Now you get a correct error message if using #mysql with paths mysql-test/r/show_check.result: Update results as table names can temporarly be bigger than NAME_LEN (during upgrade) mysql-test/r/upgrade.result: Test upgrade for long table names. mysql-test/suite/funcs_1/r/is_tables_is.result: Updated old test result (had note been updated in a while) mysql-test/t/drop.test: Updated test and results as we now support full table names mysql-test/t/grant.test: Now you get a correct error message if using #mysql with paths mysql-test/t/upgrade.test: Test upgrade for long table names. sql/ha_partition.cc: NAME_LEN -> SAFE_NAME_LEN sql/item.cc: NAME_LEN -> SAFE_NAME_LEN sql/log_event.cc: NAME_LEN -> SAFE_NAME_LEN sql/mysql_priv.h: Added SAFE_NAME_LEN sql/rpl_filter.cc: NAME_LEN -> SAFE_NAME_LEN sql/sp.cc: NAME_LEN -> SAFE_NAME_LEN sql/sp_head.cc: NAME_LEN -> SAFE_NAME_LEN sql/sql_acl.cc: NAME_LEN -> SAFE_NAME_LEN sql/sql_base.cc: NAME_LEN -> SAFE_NAME_LEN sql/sql_connect.cc: NAME_LEN -> SAFE_NAME_LEN sql/sql_parse.cc: NAME_LEN -> SAFE_NAME_LEN sql/sql_prepare.cc: NAME_LEN -> SAFE_NAME_LEN sql/sql_select.cc: NAME_LEN -> SAFE_NAME_LEN sql/sql_show.cc: NAME_LEN -> SAFE_NAME_LEN Enlarge table names for SHOW TABLES to also include optional #mysql50# sql/sql_table.cc: Fall back to use ALTER TABLE for engines that doesn't support REPAIR when doing repair for upgrade. sql/sql_trigger.cc: NAME_LEN -> SAFE_NAME_LEN sql/sql_udf.cc: NAME_LEN -> SAFE_NAME_LEN sql/sql_view.cc: NAME_LEN -> SAFE_NAME_LEN sql/table.cc: Fixed check_table_name() to not count #mysql50# as part of name If #mysql50# is part of the name, don't allow path characters in name.
-
- 20 Jul, 2010 1 commit
-
-
Davi Arnaut authored
Fix warnings flagged by the new warning option -Wunused-but-set-variable that was added to GCC 4.6 and that is enabled by -Wunused and -Wall. The option causes a warning whenever a local variable is assigned to but is later unused. It also warns about meaningless pointer dereferences. client/mysql.cc: Meaningless pointer dereferences. client/mysql_upgrade.c: Check whether reading from the file succeeded. extra/comp_err.c: Unused. extra/yassl/src/yassl_imp.cpp: Skip instead of reading data that is discarded. include/my_pthread.h: Variable is only used in debug builds. include/mysys_err.h: Add new error messages. mysys/errors.c: Add new error message for permission related functions. mysys/mf_iocache.c: Variable is only checked under THREAD. mysys/my_copy.c: Raise a error if chmod or chown fails. mysys/my_redel.c: Raise a error if chmod or chown fails. regex/engine.c: Use a equivalent variable for the assert. server-tools/instance-manager/instance_options.cc: Unused. sql/field.cc: Unused. sql/item.cc: Unused. sql/log.cc: Do not ignore the return value of freopen: only set buffer if reopening succeeds. Adjust doxygen comment to the right function. Pass message lenght to log function. sql/mysqld.cc: Do not ignore the return value of freopen: only set buffer if reopening succeeds. sql/partition_info.cc: Unused. sql/slave.cc: No need to set pointer to the address of '\0'. sql/spatial.cc: Unused. Left for historical purposes. sql/sql_acl.cc: Unused. sql/sql_base.cc: Pointers are always set to the same variables. sql/sql_parse.cc: End statement if reading fails. Store the buffer after it has actually been updated. sql/sql_repl.cc: No need to set pointer to the address of '\0'. sql/sql_show.cc: Put variable under the same ifdef block. sql/udf_example.c: Set null pointer flag appropriately. storage/csv/ha_tina.cc: Meaningless dereferences. storage/example/ha_example.cc: Return the error since it's available. storage/myisam/mi_locking.c: Remove unused and dead code.
-
- 17 Jul, 2010 1 commit
-
-
Igor Babaev authored
If the expression for a virtual column of table contained datetime comparison then the execution of the second query that used this virtual column caused a crash. It happened because the execution of the first query that used this virtual column inserted a cached item into the expression tree. The cached tree was allocated in the statement memory while the expression tree was allocated in the table memory. Now the cached items that are inserted into expressions for virtual columns with datetime comparisons are always allocated in the same mem_root as the expressions for virtual columns. So now the inserted cached items are valid for any queries that use these virtual columns.
-
- 15 Jul, 2010 1 commit
-
-
Igor Babaev authored
There were two problems that caused wrong results reported with this bug. 1. In some cases stored(persistent) virtual columns were not marked in the write_set and in the vcol_set bitmaps. 2. If the list of fields in an insert command was empty then the values of the stored virtual columns were set to default. To fix the first problem the function st_table::mark_virtual_columns_for_write was modified. Now the function has a parameter that says whether the virtual columns are to be marked for insert or for update. To fix the second problem a special handling of empty insert lists is added in the function fill_record().
-
- 10 Jul, 2010 1 commit
-
-
unknown authored
libmysqld/Makefile.am: The new file added. mysql-test/r/index_merge_myisam.result: subquery_cache optimization option added. mysql-test/r/myisam_mrr.result: subquery_cache optimization option added. mysql-test/r/subquery_cache.result: The subquery cache tests added. mysql-test/r/subselect3.result: Subquery cache switched off to avoid changing read statistics. mysql-test/r/subselect3_jcl6.result: Subquery cache switched off to avoid changing read statistics. mysql-test/r/subselect_no_mat.result: subquery_cache optimization option added. mysql-test/r/subselect_no_opts.result: subquery_cache optimization option added. mysql-test/r/subselect_no_semijoin.result: subquery_cache optimization option added. mysql-test/r/subselect_sj.result: subquery_cache optimization option added. mysql-test/r/subselect_sj_jcl6.result: subquery_cache optimization option added. mysql-test/t/subquery_cache.test: The subquery cache tests added. mysql-test/t/subselect3.test: Subquery cache switched off to avoid changing read statistics. sql/CMakeLists.txt: The new file added. sql/Makefile.am: The new files added. sql/item.cc: Expression cache item (Item_cache_wrapper) added. Item_ref and Item_field fixed for correct usage of result field and fast resolwing in SP. sql/item.h: Expression cache item (Item_cache_wrapper) added. Item_ref and Item_field fixed for correct usage of result field and fast resolwing in SP. sql/item_cmpfunc.cc: Subquery cache added. sql/item_cmpfunc.h: Subquery cache added. sql/item_subselect.cc: Subquery cache added. sql/item_subselect.h: Subquery cache added. sql/item_sum.cc: Registration of subquery parameters added. sql/mysql_priv.h: subquery_cache optimization option added. sql/mysqld.cc: subquery_cache optimization option added. sql/opt_range.cc: Fix due to subquery cache. sql/opt_subselect.cc: Parameters of the function cahnged. sql/procedure.h: .h file guard added. sql/sql_base.cc: Registration of subquery parameters added. sql/sql_class.cc: Option to allow add indeces to temporary table. sql/sql_class.h: Item iterators added. Option to allow add indeces to temporary table. sql/sql_expression_cache.cc: Expression cache for caching subqueries added. sql/sql_expression_cache.h: Expression cache for caching subqueries added. sql/sql_lex.cc: Registration of subquery parameters added. sql/sql_lex.h: Registration of subqueries and subquery parameters added. sql/sql_select.cc: Subquery cache added. sql/sql_select.h: Subquery cache added. sql/sql_union.cc: A new parameter to the function added. sql/sql_update.cc: A new parameter to the function added. sql/table.cc: Procedures to manage temporarty tables index added. sql/table.h: Procedures to manage temporarty tables index added. storage/maria/ha_maria.cc: Fix of handler to allow destoy a table in case of error during the table creation. storage/maria/ha_maria.h: .h file guard added. storage/myisam/ha_myisam.cc: Fix of handler to allow destoy a table in case of error during the table creation.
-
- 02 Jul, 2010 1 commit
-
-
Davi Arnaut authored
Apart strict-aliasing warnings, fix the remaining warnings generated by GCC 4.4.4 -Wall and -Wextra flags. One major source of warnings was the in-house function my_bcmp which (unconventionally) took pointers to unsigned characters as the byte sequences to be compared. Since my_bcmp and bcmp are deprecated functions whose only difference with memcmp is the return value, every use of the function is replaced with memcmp as the special return value wasn't actually being used by any caller. There were also various other warnings, mostly due to type mismatches, missing return values, missing prototypes, dead code (unreachable) and ignored return values. BUILD/SETUP.sh: Remove flags that are implied by -Wall and -Wextra. Do not warn about unused parameters in C++. BUILD/check-cpu: Print only the compiler version instead of verbose banner. Although the option is gcc specific, the check was only being used for GCC specific checks anyway. client/mysql.cc: bcmp is no longer defined. client/mysqltest.cc: Pass a string to function expecting a format string. Replace use of bcmp with memcmp. cmd-line-utils/readline/Makefile.am: Always define _GNU_SOURCE when compiling GNU readline. Required to make certain prototypes visible. cmd-line-utils/readline/input.c: Condition for the code to be meaningful. configure.in: Remove check for bcmp. extra/comp_err.c: Use appropriate type. extra/replace.c: Replace use of bcmp with memcmp. extra/yassl/src/crypto_wrapper.cpp: Do not ignore the return value of fgets. Retrieve the file position if fgets succeed -- if it fails, the function will bail out and return a error. extra/yassl/taocrypt/include/blowfish.hpp: Use a single array instead of accessing positions of the sbox_ through a subscript to pbox_. extra/yassl/taocrypt/include/runtime.hpp: One definition of such functions is enough. extra/yassl/taocrypt/src/aes.cpp: Avoid potentially ambiguous conditions. extra/yassl/taocrypt/src/algebra.cpp: Rename arguments to avoid shadowing related warnings. extra/yassl/taocrypt/src/blowfish.cpp: Avoid potentially ambiguous conditions. extra/yassl/taocrypt/src/integer.cpp: Do not define type within a anonymous union. Use a variable to return a value instead of leaving the result in a register -- compiler does not know the logic inside the asm. extra/yassl/taocrypt/src/misc.cpp: Define handler for pure virtual functions. Remove unused code. extra/yassl/taocrypt/src/twofish.cpp: Avoid potentially ambiguous conditions. extra/yassl/testsuite/test.hpp: Function must have C language linkage. include/m_string.h: Remove check which relied on bcmp being defined -- they weren't being used as bcmp is only visible when _BSD_SOURCE is defined. include/my_bitmap.h: Remove bogus helpers which were used only in a few files and were causing warnings about dead code. include/my_global.h: Due to G++ bug, always silence false-positive uninitialized variables warnings when compiling C++ code with G++. Remove bogus helper. libmysql/Makefile.shared: Remove built-in implementation of bcmp. mysql-test/lib/My/SafeProcess/safe_process.cc: Cast pid to largest possible type for a process identifier. mysys/mf_loadpath.c: Leave space of the ending nul. mysys/mf_pack.c: Replace bcmp with memcmp. mysys/my_bitmap.c: Dead code removal. mysys/my_gethwaddr.c: Remove unused variable. mysys/my_getopt.c: Silence bogus uninitialized variable warning. Do not cast away the constant qualifier. mysys/safemalloc.c: Cast to expected type. mysys/thr_lock.c: Silence bogus uninitialized variable warning. sql/field.cc: Replace bogus helper with a more appropriate logic which is used throughout the code. sql/item.cc: Remove bogus logical condition which always evaluates to TRUE. sql/item_create.cc: Simplify code to avoid signedness related warnings. sql/log_event.cc: Replace use of bcmp with memcmp. No need to use helpers for simple bit operations. sql/log_event_old.cc: Replace bmove_align with memcpy. sql/mysqld.cc: Move use declaration of variable to the ifdef block where it is used. Remove now-unnecessary casts and arguments. sql/set_var.cc: Replace bogus helpers with simple and classic bit operations. sql/slave.cc: Cast to expected type and silence bogus warning. sql/sql_class.h: Don't use enum values as bit flags, the supposed type safety is bogus as the combined bit flags are not a value in the enumeration. sql/udf_example.c: Only declare variable when necessary. sql/unireg.h: Replace use of bmove_align with memcpy. storage/innobase/os/os0file.c: Silence bogus warning. storage/myisam/mi_open.c: Remove bogus cast, DBUG_DUMP expects a pointer to unsigned char. storage/myisam/mi_page.c: Remove bogus cast, DBUG_DUMP expects a pointer to unsigned char. strings/bcmp.c: Remove built-in bcmp. strings/ctype-ucs2.c: Silence bogus warning. tests/mysql_client_test.c: Use a appropriate type as expected by simple_command().
-
- 27 May, 2010 1 commit
-
-
Dmitry Lenev authored
without FOR UPDATE is causing a lock". SELECT statements with subqueries referencing InnoDB tables were acquiring shared locks on rows in these tables when they were executed in REPEATABLE-READ mode and with statement or mixed mode binary logging turned on. This was a regression which were introduced when fixing bug 39843. The problem was that for tables belonging to subqueries parser set TL_READ_DEFAULT as a lock type. In cases when statement/mixed binary logging at open_tables() time this type of lock was converted to TL_READ_NO_INSERT lock at open_tables() time and caused InnoDB engine to acquire shared locks on reads from these tables. Although in some cases such behavior was correct (e.g. for subqueries in DELETE) in case of SELECT it has caused unnecessary locking. This patch implements minimal version of the fix for the specific problem described in the bug-report which supposed to be not too risky for pushing into 5.1 tree. The 5.5 tree already contains a more appropriate solution which also addresses other related issues like bug 53921 "Wrong locks for SELECTs used stored functions may lead to broken SBR". This patch tries to solve the problem by ensuring that TL_READ_DEFAULT lock which is set in the parser for tables participating in subqueries at open_tables() time is interpreted as TL_READ_NO_INSERT or TL_READ. TL_READ is used only if we know that this is a SELECT and that this particular table is not used by a stored function. Test coverage is added for both InnoDB and MyISAM. This patch introduces an "incompatible" change in locking scheme for subqueries used in SELECT ... FOR UPDATE and SELECT .. IN SHARE MODE. In 4.1 (as well as in 5.0 and 5.1 before fix for bug 39843) the server would use a snapshot InnoDB read for subqueries in SELECT FOR UPDATE and SELECT .. IN SHARE MODE statements, regardless of whether the binary log is on or off. If the user required a different type of read (i.e. locking read), he/she could request so explicitly by providing FOR UPDATE/IN SHARE MODE clause for each individual subquery. The patch for bug 39843 broke this behaviour (which was not documented or tested), and started to use locking reads for all subqueries in SELECT ... FOR UPDATE/IN SHARE MODE. This patch restores 4.1 behaviour. This patch should be mostly null-merged into 5.5 tree. mysql-test/include/check_concurrent_insert.inc: Added auxiliary script which allows to check if statement reading table allows concurrent inserts in it. mysql-test/include/check_no_concurrent_insert.inc: Added auxiliary script which allows to check that statement reading table doesn't allow concurrent inserts in it. mysql-test/include/check_no_row_lock.inc: Added auxiliary script which allows to check if statement reading table doesn't take locks on its rows. mysql-test/include/check_shared_row_lock.inc: Added auxiliary script which allows to check if statement reading table takes shared locks on some of its rows. mysql-test/r/bug39022.result: After bug #46947 'Embedded SELECT without FOR UPDATE is causing a lock' was fixed test case for bug 39022 has to be adjusted in order to trigger execution path on which original problem was encountered. mysql-test/r/innodb_mysql_lock2.result: Added coverage for handling of locking in various cases when we read data from InnoDB tables (includes test case for bug #46947 'Embedded SELECT without FOR UPDATE is causing a lock'). mysql-test/r/lock_sync.result: Added coverage for handling of locking in various cases when we read data from MyISAM tables. mysql-test/t/bug39022.test: After bug #46947 'Embedded SELECT without FOR UPDATE is causing a lock' was fixed test case for bug 39022 has to be adjusted in order to trigger execution path on which original problem was encountered. mysql-test/t/innodb_mysql_lock2.test: Added coverage for handling of locking in various cases when we read data from InnoDB tables (includes test case for bug #46947 'Embedded SELECT without FOR UPDATE is causing a lock'). mysql-test/t/lock_sync.test: Added coverage for handling of locking in various cases when we read data from MyISAM tables. sql/mysql_priv.h: Function read_lock_type_for_table() now takes pointers to LEX and TABLE_LIST elements as its arguments since to correctly determine lock type it needs to know what statement is being performed and whether table element for which lock type to be determined belongs to prelocking list. sql/sql_base.cc: Changed read_lock_type_for_table() to return a weak TL_READ type of lock in cases when we are executing SELECT (and so won't update tables directly) and table doesn't belong to statement's prelocking list and thus can't be used by a stored function. It is OK to do so since in this case table won't be used by statement or function call which will be written to the binary log, so serializability requirements for it can be relaxed. One of results from this change is that SELECTs on InnoDB tables no longer takes shared row locks for tables which are used in subqueries (i.e. bug #46947 is fixed). Another result is that for similar SELECTs on MyISAM tables concurrent inserts are allowed. In order to implement this change signature of read_lock_type_for_table() function was changed to take pointers to LEX and TABLE_LIST objects. sql/sql_update.cc: Function read_lock_type_for_table() now takes pointers to LEX and TABLE_LIST elements as its arguments since to correctly determine lock type it needs to know what statement is being performed and whether table element for which lock type to be determined belongs to prelocking list.
-
- 16 May, 2010 1 commit
-
-
Alfranio Correia authored
mode Post-push fix after backporting the patch to 5.1-bugteam: 1 - changed the name of some variables to be equivalent to pe. 2 - fixed that patch to mark a statement as unsafe when both a self-logging eng. and regular eng. are accessed and one of them is updated.
-
- 09 May, 2010 1 commit
-
-
Alfranio Correia authored
Backport of the patch for 5.1-bugteam.
-
- 29 Apr, 2010 1 commit
-
-
unknown authored
Fix missing bounds check in string conversion. Bump version number for security fix release.
-
- 28 Apr, 2010 1 commit
-
-
Kristian Nielsen authored
sql/sql_base.cc: Replace strmov() with strnmov() to remove the possibility for buffer overflow. sql/sql_parse.cc: Reject COM_FIELD_LIST with too-big table or wildcard argument. (libmysqlclient doesn't allow sending too long arguments anyway, but we need this to protect against buffer overflow exploits).
-
- 25 Mar, 2010 1 commit
-
-
Michael Widenius authored
- Avoid full inline of mark_trx_read_write() for many functions - Avoid somewhat expensive tests for every write/update/delete row sql/handler.h: Adde ha_start_of_new_statement() to reset internal variables as part of the code in "open_table" that resets TABLE object for the new statement Faster mark_trx_read_write_part() sql/sql_base.cc: Don't manipulate table->file internal structs directly
-
- 18 Mar, 2010 1 commit
-
-
Mattias Jonsson authored
due to DBUG_ASSERT. (added in bug#50561) sql/sql_base.cc: DEBUG_SYNC asserts that thd->debug_sync_control is set.
-
- 17 Mar, 2010 1 commit
-
-
Mattias Jonsson authored
concurrent I_S query There were two problem: 1) MYSQL_LOCK_IGNORE_FLUSH also ignored name locks 2) there was a race between abort_and_upgrade_locks and alter_close_tables (i.e. remove_table_from_cache and close_data_files_and_morph_locks) Which allowed the table to be opened with MYSQL_LOCK_IGNORE_FLUSH flag resulting in renaming a partition that was already in use, which could cause the table to be unusable. Solution was to not allow IGNORE_FLUSH to skip waiting for a named locked table. And to not release the LOCK_open mutex between the calls to remove_table_from_cache and close_data_files_and_morph_locks by merging the functions abort_and_upgrade_locks and alter_close_tables. mysql-test/suite/parts/r/partition_debug_sync_innodb.result: Bug#50561: ALTER PARTITIONS does not have adequate lock, breaks with concurrent I_S query Added test result mysql-test/suite/parts/t/partition_debug_sync_innodb-master.opt: Bug#50561: ALTER PARTITIONS does not have adequate lock, breaks with concurrent I_S query Added test option mysql-test/suite/parts/t/partition_debug_sync_innodb.test: Bug#50561: ALTER PARTITIONS does not have adequate lock, breaks with concurrent I_S query Added test file sql/authors.h: Bug#50561: ALTER PARTITIONS does not have adequate lock, breaks with concurrent I_S query Time to be acknowledged :) sql/ha_partition.cc: Bug#50561: ALTER PARTITIONS does not have adequate lock, breaks with concurrent I_S query Added DEBUG_SYNC for deterministic testing sql/mysql_priv.h: Bug#50561: ALTER PARTITIONS does not have adequate lock, breaks with concurrent I_S query Renamed function since merging alter_close_tables into abort_and_upgrade_lock. sql/sql_base.cc: Bug#50561: ALTER PARTITIONS does not have adequate lock, breaks with concurrent I_S query Changed MYSQL_LOCK_IGNORE_FLUSH to not ignore name locks (open_placeholder). Merged alter_close_tables into abort_and_upgrade_locks (and added _and_close_table to the name) to not release LOCK_open between remove_table_from_cache and close_data_files_and_morph_locks. Added DEBUG_SYNC for deterministic testing. sql/sql_partition.cc: Bug#50561: ALTER PARTITIONS does not have adequate lock, breaks with concurrent I_S query Removed alter_close_tables, (merged it into abort_and_upgrad_lock) so that LOCK_open never is released between remove_table_from_cache and close_data_files_and_morph_locks. sql/sql_show.cc: Bug#50561: ALTER PARTITIONS does not have adequate lock, breaks with concurrent I_S query Added DEBUG_SYNC for deterministic testing
-
- 03 Mar, 2010 1 commit
-
-
Luis Soares authored
+ failing statements Implicit DROP event for temporary table is not getting LOG_EVENT_THREAD_SPECIFIC_F flag, because, in the previous executed statement in the same thread, which might even be a failed statement, the thread_specific_used flag is set to FALSE (in mysql_reset_thd_for_next_command) and not set to TRUE before connection is shutdown. This means that implicit DROP event will take the FALSE value from thread_specific_used and will not set LOG_EVENT_THREAD_SPECIFIC_F in the event header. As a consequence, mysqlbinlog will not print the pseudo_thread_id from the DROP event, because one of the requirements for the printout is that this flag is set to TRUE. We fix this by setting thread_specific_used whenever we are binlogging a DROP in close_temporary_tables, and resetting it to its previous value afterward.
-
- 10 Feb, 2010 1 commit
-
-
Michael Widenius authored
When one does a drop table, the indexes are not flushed to disk before drop anymore (with MyISAM/Maria) myisam-recover options changed from OFF to 'DEFAULT' to get less change of data loss when using MyISAM. (The disadvantage is that changed MyISAM tables will be checked at access time; Use --myisam-recover=OFF for old behavior) Don't call extra(HA_EXTRA_FORCE_REOPEN) in ALTER TABLE if table is locked as this will mark table as crashed! Added assert to detect if we accidently would use MyISAM versioning in MySQL include/my_base.h: Mark NOT_USED as USED, as we now use this as a flag to not call extra() mysql-test/mysql-test-run.pl: Don't write all options when there is something wrong with the arguments mysql-test/r/sp-destruct.result: Add missing flush of mysql.proc (as the test copied live tables) mysql-test/r/variables.result: myisam-recover options changed to 'default' mysql-test/r/view.result: Don't show create time in result mysql-test/suite/maria/t/maria-recovery2-master.opt: Don't run test with myisam-recover (as this produces extra warnings during simulated death) mysql-test/t/sp-destruct.test: Add missing flush of mysql.proc (as the test copied live tables) mysql-test/t/view.test: Don't show create time in result sql/lock.cc: Added marker if table was deleted to argument list sql/mysql_priv.h: Added marker if table was deleted to argument list sql/mysqld.cc: myisam-recover options changed from OFF to 'DEFAULT' to get less change of data loss when using MyISAM Allow one to specify OFF as argument to myisam-recover (was default before but one couldn't specify it) sql/sql_base.cc: Mark if table is going to be deleted sql/sql_delete.cc: Mark if table is going to be deleted sql/sql_table.cc: Mark if table is going to be deleted Don't call extra(HA_EXTRA_FORCE_REOPEN) in ALTER TABLE if table is locked as this will mark table as crashed! sql/table.cc: Signal to handler if table is getting deleted as part of getting droped from table cache. sql/table.h: Added marker if table is going to be deleted. storage/maria/ha_maria.cc: Don't search for transaction handler if file is not transactional or outside of transaction (Fixed possible core dump) storage/maria/ma_blockrec.c: Don't write changed information if table is going to be deleted. storage/maria/ma_close.c: Don't write changed information if table is going to be deleted. storage/maria/ma_extra.c: Mark tables that are deleted as crased, to ensure good behavior on restart if we suddenly crash. storage/maria/ma_locking.c: Cleanup storage/maria/ma_recovery.c: We need trnman to be inited during redo phase (to be able to open tables checked with maria_chk) storage/maria/maria_def.h: Added marker if table is going to be deleted. storage/myisam/mi_close.c: Don't write changed information if table is going to be deleted. storage/myisam/mi_extra.c: Mark tables that are deleted as crased, to ensure good behavior on restart if we suddenly crash. storage/myisam/mi_open.c: Added assert to detect if we accidently would use MyISAM versioning in MySQL storage/myisam/myisamdef.h: Added marker if table is going to be deleted.
-
- 03 Feb, 2010 2 commits
-
-
MySQL Build Team authored
> ------------------------------------------------------------ > revno: 2818.1.40 [merge] > revision-id: epotemkin@mysql.com-20091202134712-4muwnr152xqkcwm7 > parent: gshchepa@mysql.com-20091201102444-yw166t3audrojo9s > parent: epotemkin@mysql.com-20091201182845-aw0uawt6c6gwi98c > committer: Evgeny Potemkin <epotemkin@mysql.com> > branch nick: mysql-5.0-bugteam > timestamp: Wed 2009-12-02 16:47:12 +0300 > message: > Auto-merged fix for the bug#48508. > ------------------------------------------------------------ > Use --include-merges or -n0 to see merged revisions.
-
MySQL Build Team authored
> ------------------------------------------------------------ > revno: 2818.1.18 > revision-id: li-bing.song@sun.com-20091103090041-zj7nedx6ok5jgges > parent: davi.arnaut@sun.com-20091102201021-1brn7cjb1kvqg9gr > committer: <Li-Bing.Song@sun.com> > branch nick: mysql-5.0-bugteam > timestamp: Tue 2009-11-03 17:00:41 +0800 > message: > BUG#48216 Replication fails on all slaves after upgrade to 5.0.86 on master > > When a sessione is closed, all temporary tables of the session are automatically > dropped and are binlogged. But it will be binlogged with wrong database names when > the length of the temporary tables' database names are greater than the > length of the current database name or the current database is not set. > > Query_log_event's db_len is forgot to set when Query_log_event's db is set. > This patch wrote code to set db_len immediately after db has set.
-
- 01 Feb, 2010 1 commit
-
-
Mattias Jonsson authored
There was two problems: The first was the symptom, caused by bad error handling in ha_partition. It did not handle print_error etc. when having no partitions (when used by dummy handler). The second was the real problem that when dropping tables it reused the table type (storage engine) from when the lock was asked for, not the table type that it had when gaining the exclusive name lock. So that it tried to delete tables from wrong storage engines. Solutions for the first problem was to accept some handler calls to the partitioning handler even if it was not setup with any partitions, and also if possible fallback to use the base handler's default functions. Solution for the second problem was to remove the optimization to reuse the definition from the cache, instead always check the frm-file when holding the LOCK_open mutex (updated with a fix for a debug print crash and better comments as required by reviewer, and removed optimization to avoid reading the frm-file). mysql-test/r/partition_debug_sync.result: Bug#42438: Crash ha_partition::change_table_ptr New result file using DEBUG_SYNC for deterministic results. mysql-test/t/partition_debug_sync.test: Bug#42438: Crash ha_partition::change_table_ptr New test file using DEBUG_SYNC for deterministic results. sql/ha_partition.cc: Bug#42438: Crash ha_partition::change_table_ptr allow some handler calls, used by error handling, even when no partitions are setup. Fallback to default handling if possible. sql/sql_base.cc: Bug#42438: Crash ha_partition::change_table_ptr Added DEBUG_SYNC point for deterministic test cases. sql/sql_table.cc: Bug#42438: Crash ha_partition::change_table_ptr Always use the table type written in the .frm-file (i.e. the current table type) when deleting a table. Moved the check for log-table to not depend of the cache. Added DEBUG_SYNC points for deterministic test cases.
-
- 27 Jan, 2010 1 commit
-
-
Davi Arnaut authored
The problem was that a failure to open a view wasn't being properly handled. When opening a view with unknown definer, the open procedure would be treated as successful and would later crash when attempting to lock the view (which wasn't opened to begin with). The solution is to skip further processing when opening a table if it fails with a fatal error. mysql-test/r/view.result: Add test case result for Bug#47734. mysql-test/t/view.test: Add test case for Bug#47734. sql/sql_base.cc: Skip further processing if opening a table failed due to a fatal error (for the statement).
-
- 24 Jan, 2010 1 commit
-
-
He Zhenxing authored
-
- 17 Jan, 2010 1 commit
-
-
Sergey Petrunya authored
There are still test failures because of: - Wrong query results in outer join + semi join - EXPLAIN output differences
-
- 01 Jan, 2010 1 commit
-
-
Sergey Petrunya authored
-
- 04 Dec, 2009 1 commit
-
-
Michael Widenius authored
Fixed coredump in sql_plugin.cc:intern_plugin_lock() on mysqld start with PBXT sql/mysqld.cc: Fixed coredump in sql_plugin.cc:intern_plugin_lock() on mysqld start with PBXT sql/share/errmsg.txt: Row numbers are always positive sql/sql_base.cc: Fixed race condition in lock tables when killing insert_delayed thread. This fixes Bug#47017 rpl_timezone fails on PB-2 with mismatch error (Note that the patch only adds a continue; The rest is (required) indentation changes) sql/sql_class.cc: Fixed wrong output for high end machines in outfile_loaddata. (Problem was that ER_TRUNCATED_WRONG_VALUE_FOR_FIELD expects ulong, not ulonglong) sql/sql_insert.cc: Ensure that if we get a lock problem with delayed_insert, the error is logged.
-
- 01 Dec, 2009 1 commit
-
-
Evgeny Potemkin authored
Actually there is two different bugs. The first one caused crash on queries with WHERE condition over views containing WHERE condition. A wrong check for prepared statement phase led to items for view fields being allocated in the execution memory and freed at the end of execution. Thus the optimized WHERE condition refers to unallocated memory on the second execution and server crashed. The second one caused by the Item_cond::compile function not saving changes it made to the item tree. Thus on the next execution changes weren't reverted and server crashed on dereferencing of unallocated space. The new helper function called is_stmt_prepare_or_first_stmt_execute is added to the Query_arena class. The find_field_in_view function now uses is_stmt_prepare_or_first_stmt_execute() to check whether newly created view items should be freed at the end of the query execution. The Item_cond::compile function now saves changes it makes to item tree. mysql-test/r/ps.result: Added a test case for the bug#48508. mysql-test/t/ps.test: Added a test case for the bug#48508. sql/item_cmpfunc.cc: Bug#48508: Crash on prepared statement re-execution. The Item_cond::compile function now saves changes it makes to item tree. sql/sql_base.cc: Bug#48508: Crash on prepared statement re-execution. The find_field_in_view function now uses is_stmt_prepare_or_first_stmt_execute() to check whether newly created view items should be freed at the end of the query execution. sql/sql_class.h: Bug#48508: Crash on prepared statement re-execution. The Query_arena::is_stmt_prepare_or_first_sp_execute function now correctly do its check.
-
- 29 Nov, 2009 1 commit
-
-
Michael Widenius authored
Don't use static link by default (in compile-pentium) as some new systems doesn't have all static libraries available Change type for functions in plugin.h:str_mysql_ftparser_param() to const unsigned char and string lengths to size_t. One effect of the above change is that one needs to include mysql_global.h or define size_t before including plugin.h This fixes a case where mysql_client_test failed with newer gcc that enables strict-aliasing by default BUILD/compile-pentium: Don't use static link by default as some new systems doesn't have all static libraries available client/mysql_upgrade.c: Remove not used variable cmd-line-utils/readline/config_readline.h: Define some constants to get rid of compiler warnings on Linux cmd-line-utils/readline/display.c: Get rid of compiler warnings cmd-line-utils/readline/history.c: Got rid of compiler warnings: - Defining some strings as const - Added cast cmd-line-utils/readline/rlmbutil.h: Added cast to get rid of compiler warnings cmd-line-utils/readline/text.c: Remove not needed initialization to get rid of compiler warnings cmd-line-utils/readline/xmalloc.c: Changed types to 'const char* to get rid of compiler warnings configure.in: Ensure that we use MariaDB as suffix include/mysql/plugin.h: Changed types to 'const unsigned char* to get rid of compiler warnings (in other parts of the code) Change length for not \0 terminated string to size_t include/mysql/plugin.h.pp: Update related to plugin.h libmysql/libmysql.c: Fixed bug that caused core dump with newer gcc when strict aliasing is not turned off mysql-test/t/information_schema.test: Test is depending on innodb mysql-test/t/not_partition.test: Fixed wrong directory name (Not noticed before as we don't ususally run this test) mysys/lf_hash.c: Got rid of compiler warnings from -Wstrict-aliasing mysys/my_redel.c: Removed not used variable regex/engine.c: Changed types to 'const char* to get rid of compiler warnings regex/engine.ih: Changed types to 'const char* to get rid of compiler warnings sql/sp_head.cc: Got rid of compiler warning from -Wstrict-aliasing sql/sql_base.cc: Got rid of compiler warnings from -Wstrict-aliasing (The original code was probably wrong as nj_col->table_field was sql/sql_builtin.cc.in: plugin.h needs to have size_t defined sql/sql_parse.cc: Remove used variable sql/sql_select.cc: Got rid of compiler warnings from -Wstrict-aliasing sql/sql_show.cc: Added #ifdef to get rid of compiler warning when not using partition engine sql/table.cc: Got rid of compiler warning from -Wstrict-aliasing storage/maria/ha_maria.cc: Got rid of compiler warnings from -Wstrict-aliasing: - Use the thd_killed() API function storage/maria/lockman.c: Got rid of compiler warnings from -Wstrict-aliasing storage/maria/ma_check.c: Got rid of compiler warnings from -Wstrict-aliasing Change to use new version of _ma_killed_ptr; Don't call it as often as before storage/maria/ma_check_standalone.h: Update to compatible _ma_killed_ptr() from ha_maria.cc storage/maria/ma_ft_boolean_search.c: Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts) storage/maria/ma_ft_nlq_search.c: Got rid of compiler warnings from -Wstrict-aliasing Ensure that 'subkeys' is 32 bit storage/maria/ma_ft_parser.c: Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts) storage/maria/ma_ftdefs.h: Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts) storage/maria/ma_sort.c: Change to use new version of _ma_killed_ptr; Don't call it as often as before storage/maria/ma_state.c: Got rid of compiler warnings from -Wstrict-aliasing storage/maria/maria_def.h: Redefine ma_killed_ptr() storage/maria/maria_ftdump.c: Got rid of compiler warnings from -Wstrict-aliasing storage/maria/trnman.c: Got rid of compiler warnings from -Wstrict-aliasing storage/myisam/ft_boolean_search.c: Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts) storage/myisam/ft_nlq_search.c: Got rid of compiler warnings from -Wstrict-aliasing storage/myisam/ft_parser.c: Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts) storage/myisam/ft_stopwords.c: Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts) storage/myisam/ftdefs.h: Changed pointers from char -> const char* and length to size_t (to get rid of compiler warnings and casts) storage/myisam/ha_myisam.cc: Got rid of compiler warnings from -Wstrict-aliasing: - Use the thd_killed() API function storage/myisam/mi_check.c: Use new killed_ptr() function storage/myisam/myisam_ftdump.c: Got rid of compiler warnings from -Wstrict-aliasing storage/myisam/myisamchk.c: Update to compatible killed_ptr() from ha_myisam.cc storage/myisam/myisamdef.h: Redefine killed_ptr() storage/myisam/myisamlog.c: Got rid of compiler warnings from -Wstrict-aliasing storage/myisam/sort.c: Change to use new version of killed_ptr; Don't call it as often as before storage/xtradb/fil/fil0fil.c: Fixedc ompiler warning storage/xtradb/trx/trx0i_s.c: Include mysql_plugin.h later to ensure that size_t is defined
-