Commit graph

149 commits

Author SHA1 Message Date
klemens
7be541f281 spelling fixes 2017-03-07 13:38:06 +04:00
Sergei Golubchik
530a6e7481 Merge branch '10.0' into 10.1
referenced_by_foreign_key2(), needed for InnoDB to compile,
was taken from 10.0-galera
2015-09-03 12:58:41 +02:00
Sergey Vojtovich
d897015d74 MDEV-8399 - [PATCH] Missing Sanity Checks for memory allocation in MariaDB
- since param is quite small store it on stack
- fixed a few memory leaks
2015-07-23 14:33:22 +04:00
Monty
7332af49e4 - Renaming variables so that they don't shadow others (After this patch one can compile with -Wshadow and get much fewer warnings)
- Changed ER(ER_...) to ER_THD(thd, ER_...) when thd was known or if there was many calls to current_thd in the same function.
- Changed ER(ER_..) to ER_THD_OR_DEFAULT(current_thd, ER...) in some places where current_thd is not necessary defined.
- Removing calls to current_thd when we have access to thd

Part of this is optimization (not calling current_thd when not needed),
but part is bug fixing for error condition when current_thd is not defined
(For example on startup and end of mysqld)

Notable renames done as otherwise a lot of functions would have to be changed:
- In JOIN structure renamed:
   examined_rows -> join_examined_rows
   record_count -> join_record_count
- In Field, renamed new_field() to make_new_field()

Other things:
- Added DBUG_ASSERT(thd == tmp_thd) in Item_singlerow_subselect() just to be safe.
- Removed old 'tab' prefix in JOIN_TAB::save_explain_data() and use members directly
- Added 'thd' as argument to a few functions to avoid calling current_thd.
2015-07-06 20:24:14 +03:00
Sergei Golubchik
4b21cd21fe Merge branch '10.0' into merge-wip 2015-01-31 21:48:47 +01:00
Sergei Golubchik
d9c01e4b4a 5.5 merge 2015-01-21 12:03:02 +01:00
Michael Widenius
7cb4a1c61f Fixed MDEV-7314: Deadlock when doing insert-select with Aria
mysql-test/suite/maria/insert_select.result:
  Added test case
mysql-test/suite/maria/insert_select.test:
  Added test case
mysys/thr_lock.c:
  Ensure we don't allow concurrent_insert when a read_no_write lock is in use
2015-01-18 20:38:07 +02:00
Michael Widenius
10ab3e6887 MDEV-4010 Deadlock on concurrent INSERT .. SELECT into an Aria table with statement binary logging
There was a bug in lock handling when mixing INSERT ... SELECT on the same table.


mysql-test/suite/maria/insert_select.result:
  Test case for MDEV_4010
mysql-test/suite/maria/insert_select.test:
  Test case for MDEV_4010
mysys/thr_lock.c:
  We wrongly alldoed TL_WRITE_CONCURRENT_INSERT when there was a TL_READ_NO_INSERT lock
2014-12-15 14:49:23 +02:00
Sergei Golubchik
03ec3511a8 cleanup: galera misc cleanups
also disable galera-specific output in mysql_tzinfo_to_sql,
it'll be enabled later.
2014-10-10 22:27:36 +02:00
Sergei Golubchik
fe0ff58000 compiler warnings 2014-10-01 23:38:26 +02:00
Jan Lindström
df4dd593f2 MDEV-6247: Merge 10.0-galera to 10.1.
Merged lp:maria/maria-10.0-galera up to revision 3879.

Added a new functions to handler API to forcefully abort_transaction,
producing fake_trx_id, get_checkpoint and set_checkpoint for XA. These
were added for future possiblity to add more storage engines that
could use galera replication.
2014-08-26 15:43:46 +03:00
Sergei Golubchik
474fe6d9d9 fixes for test failures
and small collateral changes

mysql-test/lib/My/Test.pm:
  somehow with "print" we get truncated writes sometimes
mysql-test/suite/perfschema/r/digest_table_full.result:
  md5 hashes of statement digests differ, because yacc token codes are different in mariadb
mysql-test/suite/perfschema/r/dml_handler.result:
  host table is not ported over yet
mysql-test/suite/perfschema/r/information_schema.result:
  host table is not ported over yet
mysql-test/suite/perfschema/r/nesting.result:
  this differs, because we don't rewrite general log queries, and multi-statement
  packets are logged as a one entry. this result file is identical to what mysql-5.6.5
  produces with the --log-raw option.
mysql-test/suite/perfschema/r/relaylog.result:
  MariaDB modifies the binlog index file directly, while MySQL 5.6 has a feature "crash-safe binlog index" and modifies a special "crash-safe" shadow copy of the index file and then moves it over. That's why this test shows "NONE" index file writes in MySQL and "MANY" in MariaDB.
mysql-test/suite/perfschema/r/server_init.result:
  MariaDB initializes the "manager" resources from the "manager" thread, and starts this thread only when --flush-time is not 0. MySQL 5.6 initializes "manager" resources unconditionally on server startup.
mysql-test/suite/perfschema/r/stage_mdl_global.result:
  this differs, because MariaDB disables query cache when query_cache_size=0. MySQL does not
  do that, and this causes useless mutex locks and waits.
mysql-test/suite/perfschema/r/statement_digest.result:
  md5 hashes of statement digests differ, because yacc token codes are different in mariadb
mysql-test/suite/perfschema/r/statement_digest_consumers.result:
  md5 hashes of statement digests differ, because yacc token codes are different in mariadb
mysql-test/suite/perfschema/r/statement_digest_long_query.result:
  md5 hashes of statement digests differ, because yacc token codes are different in mariadb
mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result:
  will be updated to match 5.6 when alfranio.correia@oracle.com-20110512172919-c1b5kmum4h52g0ni and anders.song@greatopensource.com-20110105052107-zoab0bsf5a6xxk2y are merged
mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result:
  will be updated to match 5.6 when anders.song@greatopensource.com-20110105052107-zoab0bsf5a6xxk2y is merged
2012-09-27 20:09:46 +02:00
Sergei Golubchik
867296c3ed 5.3 merge 2012-03-28 20:25:31 +02:00
Michael Widenius
9ef537ac61 Fixed lp:963603 "Assertion `lock_type != TL_UNLOCK && (lock_type == TL_IGNORE || file->lock.type == TL_UNLOCK)' failed in ha_maria::store_lock with DML, triggers, views"
mysys/thr_lock.c:
  Ensure that all locks are marked as TL_UNLOCK in case of error (Safety fix)
sql/lock.cc:
  Ensure that all locks are marked as TL_UNLOCK in case of error
  (This is the real fix for lp:963603)
2012-03-26 13:29:45 +03:00
Michael Widenius
2b625ac3e0 Fixed lp:933719, "Assertion open_tables == 0 ... " in THD::restore_backup_open_tables_state.
This also fixes a (not likely) crashing bug when forcing a thread that was doing a table lock to re-open it's files, for example by creating a trigger.


mysys/thr_lock.c:
  Added more checking to find wrong locks.
  Removed one, not needed, parameter to thr_lock
sql/lock.cc:
  Fixed mysql_lock_tables() to retry with new sql_lock if lock fails. This was needed as table may be closed and reopened between retry's and then the old sql_lock will point to stale data.
sql/mysql_priv.h:
  Updated prototype
sql/sql_base.cc:
  Ensure that all tables are closed if opening of system table failes; This fixes the assert in THD::restore_backup_open_tables_state
sql/sql_handler.cc:
  Updated variable type
2012-02-23 16:43:35 +02:00
Vladislav Vaintroub
62dcaf8c29 merge 5.5 2012-02-27 19:32:44 +01:00
Sergei Golubchik
3f28115e0e 5.3 merge 2012-02-24 14:37:00 +01:00
Vladislav Vaintroub
cfa56f900a address second round review comments 2012-02-16 16:59:04 +01:00
Vladislav Vaintroub
b7cf6abe52 merge 2012-01-24 01:59:03 +01:00
Sergei Golubchik
4f435bddfd 5.3 merge 2012-01-13 15:50:02 +01:00
Vladislav Vaintroub
67cfb8a5c5 MDEV-82 : Fix place in thr_lock.c where wait-end callback was called without corresponding wait-begin 2012-01-10 16:58:30 +01:00
Vladislav Vaintroub
0cd5cce7a8 Fix compile error 2011-12-27 20:54:29 +01:00
Michael Widenius
e6f5fc1c02 Fixed lp:909051 Options --debug and --disable-debug are known but ambiguous in RelWithDebInfo build
Fixed memory leak printing when doing 'mysqld --version', 'mysqld --debug --help' and 'mysqld --debug --help --verbose'


mysys/my_init.c:
  Moved checking if we should call DBUG_END() before my_thread_end() as otherwise we will not free DBUG variables and files.
mysys/thr_lock.c:
  Fixed compiler warning
sql/mysqld.cc:
  Fixed memory leaks when using mysqld --help and mysqld --version
  Added --debug as an option that works for all builds. For non debug builds we now get a warning.
strings/dtoa.c:
  Fixed valgrind warning (c could contain data outside of the given string)
2011-12-27 20:55:21 +02:00
Michael Widenius
6d4224a31c Merge with 5.2.
no_error handling for select (used by INSERT ... SELECT) still needs to be fixed, but I will do that in a separate commit
2011-12-11 11:34:44 +02:00
Michael Widenius
ffab2a90dc Patch to get MariaDB to compile on CYGWIN; By Guenter Knauf
Increased number of locks in thr_lock (used only when testing)


include/my_global.h:
  Patch for CYGWIN
mysys/my_getsystime.c:
  Patch for CYGWIN
mysys/thr_lock.c:
  Increase number of locks for testing
2011-12-02 00:24:58 +02:00
Michael Widenius
6920457142 Merge with MariaDB 5.1 2011-11-24 18:48:58 +02:00
Michael Widenius
a8d03ab235 Initail merge with MySQL 5.1 (XtraDB still needs to be merged)
Fixed up copyright messages.
2011-11-21 19:13:14 +02:00
Sergei Golubchik
0e007344ea mysql-5.5.18 merge 2011-11-03 19:17:05 +01:00
Sergei Golubchik
76f0b94bb0 merge with 5.3
sql/sql_insert.cc:
  CREATE ... IF NOT EXISTS may do nothing, but
  it is still not a failure. don't forget to my_ok it.
  ******
  CREATE ... IF NOT EXISTS may do nothing, but
  it is still not a failure. don't forget to my_ok it.
sql/sql_table.cc:
  small cleanup
  ******
  small cleanup
2011-10-19 21:45:18 +02:00
Sergei Golubchik
b4a0b2c2f8 post-merge fixes.
most tests pass.
5.3 merge is next
2011-07-02 22:12:12 +02:00
Sergei Golubchik
9809f05199 5.5-merge 2011-07-02 22:08:51 +02:00
Kent Boortz
68f00a5686 Updated/added copyright headers 2011-06-30 17:37:13 +02:00
Kent Boortz
44135d4725 Updated/added copyright headers 2011-06-30 17:31:31 +02:00
Michael Widenius
29af1aefe9 Merge with 5.2 to get bug fixes for thr_lock 2011-06-06 19:37:33 +03:00
Michael Widenius
6ae42b75b8 Fixed lock sorting and lock check issues with thr_lock that caused warnings when running test suite.
Safety check that could cause core dump when doing create table with virtual column.

mysql-test/mysql-test-run.pl:
  Show also warnings from thr_lock (which starts with just Warning, not Warning:)
mysql-test/r/lock.result:
  Added test that showed not relevant warning when using table locks.
mysql-test/t/lock.test:
  Added test that showed not relevant warning when using table locks.
mysys/thr_lock.c:
  Fixed sorting of locks.
  (Old sort code didn't handle case where TL_WRITE_CONCURRENT_INSERT must be sorted before TL_WRITE)
  Added more information to check_locks warning output.
  Fixed wrong testing of multiple different write locks for same table.
sql/item_cmpfunc.cc:
  Safety check that could cause core dump when doing create table with virtual column.
2011-06-06 16:39:06 +03:00
Kent Boortz
02e07e3b51 Updated/added copyright headers 2011-06-30 17:46:53 +02:00
Sergei Golubchik
0accbd0364 lots of post-merge changes 2011-04-25 17:22:25 +02:00
Michael Widenius
139a2b64bf Merge with 5.2 2011-03-09 15:47:59 +02:00
Michael Widenius
69fe020f01 Fixed bugs found by buildbot:
- Use -Wno-uninitialized if -DFORCE_INIT_OF_VARS is not used, to avoid warnings about not initialized variables.
- Fixed compiler warnings
- Added a name for each thr_lock to get better error messages (This is needed to find out why 'archive.test' sometimes fails)


BUILD/SETUP.sh:
  Use -Wno-uninitialized if -DFORCE_INIT_OF_VARS is not used, to avoid warnings about not initialized variables.
BUILD/build_mccge.sh:
  Use -Wno-uninitialized if -DFORCE_INIT_OF_VARS is not used, to avoid warnings about not initialized variables.
client/mysqltest.cc:
  Fixed bug in remove_files_wildcards (the orignal code never removed anything)
extra/libevent/devpoll.c:
  Fixed compiler warning
include/thr_lock.h:
  Added a name for each thr_lock to get better error messages.
mysql-test/suite/maria/t/maria3.test:
  Speed up test.
mysys/thr_lock.c:
  Added a name for each thr_lock to get better error messages.
  Added a second 'check_locks' to find if something goes wrong in 'wake_up_waiters'.
sql/lock.cc:
  Added a name for each thr_lock to get better error messages.
storage/xtradb/fil/fil0fil.c:
  Fixed compiler warning
2011-01-26 15:17:46 +02:00
Michael Widenius
050c004f5e Merge with 5.1
Fixes to get Aria handler tests to work.
Fixes LP#697597 "HANDLER + Aria asserts in maria-5.3-handler"
2011-01-11 15:36:41 +02:00
Magne Mahre
8ede0759c3 Remove configuration preprocessor symbols 'THREAD'
and 'THREAD_SAFE_CLIENT'.
  
As of MySQL 5.5, we no longer support non-threaded
builds.   This patch removes all references to the
obsolete THREAD and THREAD_SAFE_CLIENT preprocessor
symbols.  These were used to distinguish between
threaded and non-threaded builds.
2011-01-11 10:07:37 +01:00
Michael Widenius
e63b5546c5 Implementation of MWL#172: Add support for prepared statements to HANDLER READ
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
2011-01-04 00:55:41 +02:00
Michael Widenius
0b20943e9d Fixed typo that caused compile failure in thr_lock.c
mysys/thr_lock.c:
  Fixed typo that caused compile failure
2010-12-13 15:27:13 +02:00
Michael Widenius
84edaac4f1 Better warning message if lock test fails
Made archive.test a bit more safe



mysql-test/r/archive.result:
  Added removal of files to make rerun of failed test work
mysql-test/t/archive.test:
  Added removal of files to make rerun of failed test work
mysys/thr_lock.c:
  Better warning message if lock test fails
2010-12-10 17:04:09 +02:00
Sergei Golubchik
65ca700def merge.
checkpoint.
does not compile.
2010-11-25 18:17:28 +01:00
Michael Widenius
5b3159dbc7 Fixed compiler & valgrind warnings from my previous push.
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).
2010-11-03 14:14:02 +02:00
Michael Widenius
20acfbf30d Fix for: LP #634955: Assert in _ma_update_at_original_place()
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.
2010-11-02 17:22:57 +02:00
Alexander Nozdrin
f0fe6e4dac Auto-merge from mysql-5.5-merge. 2010-08-30 18:07:40 +04:00
Michael Widenius
ad6d95d3cb Merge with MySQL 5.1.50
- Changed to still use bcmp() in certain cases becasue
  - Faster for short unaligneed strings than memcmp()
  - Bettern when using valgrind
- Changed to use my_sprintf() instead of sprintf() to get higher portability for old systems
- Changed code to use MariaDB version of select->skip_record()
- Removed -%::SCCS/s.% from Makefile.am:s to remove automake warnings
2010-08-27 17:12:44 +03:00
Mats Kindahl
b0836bd309 Merging with mysql-5.5-stage. 2010-08-16 14:50:27 +02:00