Commit graph

54702 commits

Author SHA1 Message Date
Guilhem Bichot
ade71b2522 Fix for BUG#39697 "Maria: hang when failing to insert due to UNIQUE (seen in pushbuild2 too)"
It was a forgotten rw_unlock(), due to the deadlock detector feature (so bug was only in 5.1-maria, not
6.0-maria).

mysql-test/suite/maria/r/maria3.result:
  result, all fine
mysql-test/suite/maria/t/maria3.test:
  Test of BUG#39697: two scenarios (transactional tables, and non-transactional table but dynamic row format so still taking the rwlock) where the hang happened.
  t2 added by this test was masked by a temporary table created earlier in the test, which we forgot to drop.
storage/maria/ha_maria.cc:
  use new macro
storage/maria/ma_blockrec.c:
  use new macro
storage/maria/ma_commit.c:
  use new macro
storage/maria/ma_init.c:
  putting address of dummy_transaction_object in --debug trace can be useful
storage/maria/ma_open.c:
  use new macro
storage/maria/ma_write.c:
  if local_lock_tree is true, we have acquired keyinfo->root_lock so need to release it before "goto err".
  A pair of assertions so that our usage of TrIDs is kept sensible.
storage/maria/maria_def.h:
  A macro so that changes of MARIA_HA::trn can be tracked with --debug. It helped to understand in what cases,
  in maria_write(), we could have !(info->dup_key_trid == info->trn->trid) && !share->now_transactional
  (answer: ALTER TABLE adding UNIQUE index on transactional table).
2008-10-09 22:03:54 +02:00
Sergei Golubchik
c0157e8aea compiler warnings on winx86 2008-10-07 20:14:50 +02:00
Sergei Golubchik
10a2bac777 workaround for gcc 4.1.0 strict-aliasing bug
mysys/lf_alloc-pin.c:
  workaround for gcc 4.1.0 strict-aliasing bug.
  and yes, I mean a *bug* - as union (in alloc_free) is a
  documented way to access type-punned pointers. and it helps in
  newer gcc, but fails in 4.1.0
2008-10-07 18:49:01 +02:00
Sergei Golubchik
cf4aa88993 merged 2008-10-01 23:20:07 +02:00
Sergei Golubchik
c7a304a264 Implement conditional building correctly.
automake *must* know all sources in advance, listing a file in EXTRA_DIST
doesn't make it a source, which breakes dependency tracking
(.Po files aren't included)
2008-10-01 22:55:23 +02:00
unknown
905003c535 Maria tests moved to separate suite. The suite made default for execution.
mysql-test/mysql-test-run.pl:
  The maria suite made default for execution.
mysql-test/suite/maria:
  Maria tests moved to separate suite.
mysql-test/suite/maria/r:
  Maria tests moved to separate suite.
mysql-test/suite/maria/r/maria-autozerofill.result:
  Maria tests moved to separate suite.
mysql-test/suite/maria/r/maria-big.result:
  Maria tests moved to separate suite.
mysql-test/suite/maria/r/maria-big2.result:
  Maria tests moved to separate suite.
mysql-test/suite/maria/r/maria-connect.result:
  Maria tests moved to separate suite.
mysql-test/suite/maria/r/maria-gis-rtree-dynamic.result:
  Maria tests moved to separate suite.
mysql-test/suite/maria/r/maria-gis-rtree-trans.result:
  Maria tests moved to separate suite.
mysql-test/suite/maria/r/maria-gis-rtree.result:
  Maria tests moved to separate suite.
mysql-test/suite/maria/r/maria-mvcc.result:
  Maria tests moved to separate suite.
mysql-test/suite/maria/r/maria-no-logging.result:
  Maria tests moved to separate suite.
mysql-test/suite/maria/r/maria-page-checksum.result:
  Maria tests moved to separate suite.
mysql-test/suite/maria/r/maria-preload.result:
  Maria tests moved to separate suite.
mysql-test/suite/maria/r/maria-purge.result:
  Maria tests moved to separate suite.
mysql-test/suite/maria/r/maria-recover.result:
  Maria tests moved to separate suite.
mysql-test/suite/maria/r/maria-recovery-big.result:
  Maria tests moved to separate suite.
mysql-test/suite/maria/r/maria-recovery-bitmap.result:
  Maria tests moved to separate suite.
mysql-test/suite/maria/r/maria-recovery-rtree-ft.result:
  Maria tests moved to separate suite.
mysql-test/suite/maria/r/maria-recovery.result:
  Maria tests moved to separate suite.
mysql-test/suite/maria/r/maria-recovery2.result:
  Maria tests moved to separate suite.
mysql-test/suite/maria/r/maria.result:
  Maria tests moved to separate suite.
mysql-test/suite/maria/r/maria2.result:
  Maria tests moved to separate suite.
mysql-test/suite/maria/r/maria3.result:
  Maria tests moved to separate suite.
mysql-test/suite/maria/r/maria_notembedded.result:
  Maria tests moved to separate suite.
mysql-test/suite/maria/r/ps_maria.result:
  Maria tests moved to separate suite.
mysql-test/suite/maria/t:
  Maria tests moved to separate suite.
mysql-test/suite/maria/t/maria-autozerofill.test:
  Maria tests moved to separate suite.
mysql-test/suite/maria/t/maria-big.test:
  Maria tests moved to separate suite.
mysql-test/suite/maria/t/maria-big2.test:
  Maria tests moved to separate suite.
mysql-test/suite/maria/t/maria-connect.test:
  Maria tests moved to separate suite.
mysql-test/suite/maria/t/maria-gis-rtree-dynamic.test:
  Maria tests moved to separate suite.
mysql-test/suite/maria/t/maria-gis-rtree-trans.test:
  Maria tests moved to separate suite.
mysql-test/suite/maria/t/maria-gis-rtree.test:
  Maria tests moved to separate suite.
mysql-test/suite/maria/t/maria-mvcc.test:
  Maria tests moved to separate suite.
mysql-test/suite/maria/t/maria-no-logging.test:
  Maria tests moved to separate suite.
mysql-test/suite/maria/t/maria-page-checksum.test:
  Maria tests moved to separate suite.
mysql-test/suite/maria/t/maria-preload.test:
  Maria tests moved to separate suite.
mysql-test/suite/maria/t/maria-purge.test:
  Maria tests moved to separate suite.
mysql-test/suite/maria/t/maria-recover-master.opt:
  Maria tests moved to separate suite.
mysql-test/suite/maria/t/maria-recover.test:
  Maria tests moved to separate suite.
mysql-test/suite/maria/t/maria-recovery-big-master.opt:
  Maria tests moved to separate suite.
mysql-test/suite/maria/t/maria-recovery-big.test:
  Maria tests moved to separate suite.
mysql-test/suite/maria/t/maria-recovery-bitmap-master.opt:
  Maria tests moved to separate suite.
mysql-test/suite/maria/t/maria-recovery-bitmap.test:
  Maria tests moved to separate suite.
mysql-test/suite/maria/t/maria-recovery-master.opt:
  Maria tests moved to separate suite.
mysql-test/suite/maria/t/maria-recovery-rtree-ft-master.opt:
  Maria tests moved to separate suite.
mysql-test/suite/maria/t/maria-recovery-rtree-ft.test:
  Maria tests moved to separate suite.
mysql-test/suite/maria/t/maria-recovery.test:
  Maria tests moved to separate suite.
mysql-test/suite/maria/t/maria-recovery2-master.opt:
  Maria tests moved to separate suite.
mysql-test/suite/maria/t/maria-recovery2.test:
  Maria tests moved to separate suite.
mysql-test/suite/maria/t/maria.test:
  Maria tests moved to separate suite.
mysql-test/suite/maria/t/maria2.test:
  Maria tests moved to separate suite.
mysql-test/suite/maria/t/maria3.test:
  Maria tests moved to separate suite.
mysql-test/suite/maria/t/maria_notembedded.test:
  Maria tests moved to separate suite.
mysql-test/suite/maria/t/ps_maria.test:
  Maria tests moved to separate suite.
2008-10-01 15:13:39 +03:00
unknown
51a92bbb03 Comparison of tables during altering fixed. (BUG#39399)
mysql-test/r/maria.result:
  Test suite of BUG#39399.
mysql-test/t/maria.test:
  Test suite of BUG#39399.
storage/maria/ha_maria.cc:
  Comparison of tables during altering fixed. (BUG#39399)
  Unused function parameter removed.
2008-09-28 21:32:59 +03:00
Michael Widenius
2a9d33f07d Fixed for Bug #39248 Maria: INSERT ON DUPLICATE KEY UPDATE gives error if using a view
The bug was that prepared statements didn't downgrade TL_WRITE_CONCURRENT properly

mysql-test/r/maria.result:
  Added test case
mysql-test/t/maria.test:
  Added test case
sql/mysql_priv.h:
  Make upgrade_lock_type() global
sql/sql_base.cc:
  Fixed indentation
sql/sql_insert.cc:
  Make upgrade_lock_type() global
sql/sql_prepare.cc:
  Call upgrade_lock_type_for_insert() to get right lock to use
sql/sql_view.cc:
  Indentation fix
2008-09-26 16:49:51 +03:00
Michael Widenius
be0b404266 Fix for Bug #39243 SELECT WHERE does not find row
Symptom was that records_in_range() found 0 matching keys which confused the optimizer to belive that there was no matching rows for the query

mysql-test/r/maria.result:
  New testcase
mysql-test/t/maria.test:
  New testcase
storage/maria/ma_search.c:
  Fix bug in skip_key for keys that starts with a CHAR/VARCHAR NULL key.
2008-09-26 11:16:35 +03:00
Sergei Golubchik
6484f5a11f merge 2008-09-11 15:26:36 +02:00
Sergei Golubchik
d3f29b0f6e Bug#39392: Maria: if INSERT in UNIQUE finds uncommitted same key, error instead of wait
increase the default value of deadlock_timeout_long

mysql-test/r/maria.result:
  no longer necessary
mysql-test/t/maria.test:
  no longer necessary
2008-09-11 15:16:44 +02:00
Michael Widenius
7f960da42b Automatic merge 2008-09-06 00:06:10 +03:00
Michael Widenius
d286751a68 Fixed bug in underflow handling of page during delete found by running sql_bench
storage/maria/ma_delete.c:
  Remove wrong optimization (first_key is not related to keypos value at this point)
storage/maria/maria_chk.c:
  Added printing of forgotten option
2008-09-05 16:52:21 +03:00
Sergei Golubchik
27dadbd895 wt: don't support a key as a union { ulonglong, void* }. Although convenient,
it forces the user to bzero a key before setting it as a pointer, otherwise
it'll have random content on architectures where
sizeof(void*) < sizeof(ulonglong).

Declaring a key as ulonglong only (not a union) makes this user mistake
impossible.

include/waiting_threads.h:
  WT_RESOURCE_ID::value is an ulonglong, not a union
mysys/waiting_threads.c:
  WT_RESOURCE_ID::value is an ulonglong, not a union
storage/maria/ma_write.c:
  WT_RESOURCE_ID::value is an ulonglong, not a union
storage/maria/trnman.c:
  WT_RESOURCE_ID::value is an ulonglong, not a union
unittest/mysys/waiting_threads-t.c:
  WT_RESOURCE_ID::value is an ulonglong, not a union
2008-09-01 21:43:11 +02:00
Sergei Golubchik
533deb0ac4 build lf-t and waiting_threads-t on windows 2008-09-01 19:27:49 +02:00
Sergei Golubchik
2f0afa60b2 more windows fixes
include/atomic/generic-msvc.h:
  explicit cast from volatile int32 * to volatile LONG *
2008-08-31 19:00:02 +02:00
Sergei Golubchik
b54ac0728d fixes for windows 2008-08-31 17:20:20 +02:00
Sergei Golubchik
8ccb262d05 remove useless #include's 2008-08-30 23:32:27 +02:00
Sergei Golubchik
8ba0216128 compiler warnings/errors 2008-08-30 21:34:41 +02:00
Sergei Golubchik
2b917502c1 added __attribute__((unused)) 2008-08-29 21:50:04 +02:00
Sergei Golubchik
49aa944ffb fixes for make distcheck 2008-08-29 20:51:02 +02:00
Sergei Golubchik
8a25482579 fix compilation failure 2008-08-29 06:41:19 +02:00
Sergei Golubchik
4be86917fe merge 2008-08-28 20:52:23 +02:00
Sergei Golubchik
942651ea6c wt: comments, OOM checks, test case for deadlock detection
include/waiting_threads.h:
  make wt_thd_dontwait private
mysql-test/r/maria.result:
  deadlock example
mysql-test/t/maria.test:
  deadlock example
mysys/waiting_threads.c:
  comments, OOM checks
sql/mysqld.cc:
  fix variables
sql/sql_class.cc:
  move wt_lazy_init to THD constructor
sql/sql_class.h:
  move wt_lazy_init to THD constructor
storage/maria/ha_maria.cc:
  backport from 6.0
storage/maria/ma_write.c:
  poset-review fixes, set thd->proc_info
storage/maria/trnman.c:
  bugfixing
storage/myisam/mi_check.c:
  warnings
storage/myisam/mi_page.c:
  warnings
storage/myisam/mi_search.c:
  warnings
storage/myisammrg/myrg_create.c:
  warnings
unittest/mysys/waiting_threads-t.c:
  fixes
2008-08-28 14:43:44 +02:00
Sergei Golubchik
ca23272e1e proc_info_hook, mysys access to thd->proc_info
include/my_global.h:
  move __func__ definition to my_global.h
include/my_sys.h:
  proc_info_hook
mysys/my_static.c:
  proc_info_hook
sql/mysqld.cc:
  proc_info_hook
sql/sql_class.cc:
  support thd==0 in set_thd_proc_info
sql/sql_profile.cc:
  move __func__ definition to my_global.h
sql/sql_profile.h:
  move __func__ definition to my_global.h
2008-08-27 14:15:06 +02:00
Michael Widenius
dd406c1e7e Fix for Bug#36499 Maria: potential deadlock
This was done by introducing another mutex for handling the key_del link
I also renamed all key_del variables to start with key_del prefix


storage/maria/ma_close.c:
  Rename of key_del variables
storage/maria/ma_key_recover.c:
  Changed key_del to be protexted by it's own mutex: key_del_lock
  Rename of key_del variables
  Removed comment for old bug
storage/maria/ma_key_recover.h:
  Rename of key_del variables
storage/maria/ma_open.c:
  Initialization for new key_del_lock mutex
  Renamed intern_cond to key_del_cond as it was only used for protection of key_del
storage/maria/ma_page.c:
  Rename of key_del variables
storage/maria/ma_write.c:
  Rename of key_del variables
storage/maria/maria_def.h:
  Rename of key_del variables
  Added key_del_lock
2008-08-26 15:34:57 +03:00
Michael Widenius
6629c7641a Fixed some wrong usage of my_bool
Fixed compiler warning
Ensure that pagecache returns correct error number


storage/maria/ma_pagecache.c:
  Ensure that block->error contain error code from my_errno (not return value from pread/pwrite)
  Went through usage of my_pread/my_pwrite and ensured that result was threated correctly
  Fixed some wrong usage of my_bool
2008-08-25 21:26:50 +03:00
Michael Widenius
43528b9d1a Automatic merge 2008-08-25 15:13:31 +03:00
Michael Widenius
1a5de5bc82 Changed all file names in maria to LEX_STRING and removed some calls to strlen()
Ensure that pagecache gives correct error number even if error for block happend


mysys/my_pread.c:
  Indentation fix
storage/maria/ha_maria.cc:
  filenames changed to be of type LEX_STRING
storage/maria/ma_check.c:
  filenames changed to be of type LEX_STRING
storage/maria/ma_checkpoint.c:
  filenames changed to be of type LEX_STRING
storage/maria/ma_create.c:
  filenames changed to be of type LEX_STRING
storage/maria/ma_dbug.c:
  filenames changed to be of type LEX_STRING
storage/maria/ma_delete.c:
  filenames changed to be of type LEX_STRING
storage/maria/ma_info.c:
  filenames changed to be of type LEX_STRING
storage/maria/ma_keycache.c:
  filenames changed to be of type LEX_STRING
storage/maria/ma_locking.c:
  filenames changed to be of type LEX_STRING
storage/maria/ma_loghandler.c:
  filenames changed to be of type LEX_STRING
storage/maria/ma_open.c:
  filenames changed to be of type LEX_STRING
storage/maria/ma_pagecache.c:
  Store error number for last failed operation in the page block
  This should fix some asserts() when errno was not properly set after failure to read block in another thread
storage/maria/ma_recovery.c:
  filenames changed to be of type LEX_STRING
storage/maria/ma_update.c:
  filenames changed to be of type LEX_STRING
storage/maria/ma_write.c:
  filenames changed to be of type LEX_STRING
storage/maria/maria_def.h:
  filenames changed to be of type LEX_STRING
storage/maria/maria_ftdump.c:
  filenames changed to be of type LEX_STRING
storage/maria/maria_pack.c:
  filenames changed to be of type LEX_STRING
2008-08-25 14:49:47 +03:00
Sergei Golubchik
4bdb308b9a BUG#38606: delete in lock write concurrent
(sanja's patch)
2008-08-25 10:35:25 +02:00
Michael Widenius
d145362edf Fix for bug#38484 DELETE causes crash or index corruption
There is no test cases as it's not trivial to do a test case for this.
The new code for Maria is however executed by the test case in the bug report.

mysql-test/mysql-test-run.pl:
  Avoid warnings when running with --extern
storage/maria/ha_maria.cc:
  Disable not complete assert until Sanja can push a proper fix
storage/maria/ma_delete.c:
  Fix that pageflag for page is calculated based on original values
storage/maria/ma_search.c:
  Ensure that prev_length structure variable is properly reset when not used
storage/myisam/mi_search.c:
  Ensure that prev_length structure variable is properly reset when not used
2008-08-24 16:29:34 +03:00
Michael Widenius
57e0bdb306 Automatic merge 2008-08-19 01:22:31 +03:00
Michael Widenius
ea31b1e6ec Fixes for Bug #38016 Maria: trying to access freed memory when committing a transaction
Don't write out states if they haven't changed

sql/sql_base.cc:
  Call extra(HA_EXTRA_PREPARE_FOR_DROP) before doing a drop of a table
  More DBUG
sql/sql_table.cc:
  Call extra(HA_EXTRA_PREPARE_FOR_RENAME) before renaming a table
storage/maria/ha_maria.cc:
  Ensure that file->trn is set when we call extra(HA_EXTRA_PREPARE_FOR_DROP/RENAME)
storage/maria/ma_close.c:
  When doing close, assert if we have pointers in trn->table_list that points to the MARIA_SHARE
storage/maria/ma_extra.c:
  Reset info->state_start in case of drop/rename. This fixes the problem of accessing freed memory in repair
  Don't write state changed if they haven't changed
storage/maria/ma_open.c:
  Reset share->changed after we have written out a state (speed optimization to not write states when they haven't changed)
storage/maria/ma_state.c:
  Decrement share->in_trans properly in DBUG_BINARY to ensure that the DBUG_ASSERT() in maria_close() works
  More DBUG
2008-08-19 01:21:22 +03:00
Sergei Golubchik
edb33da737 Bug#38466 maria: range query returns no data
storage/maria/ma_search.c:
  when we found a matching key on the node page and want to search in the left leaf
  we must use only SEARCH_FIND flag, and never SEARCH_BIGGER, SEARCH_SMALLER, or SEARCH_LAST
2008-08-16 11:49:28 +02:00
Sergei Golubchik
47a82ad552 Bug#38135 Assertion failed: save_errno, file .\ma_update.c, line 200
typo fixed.

mysql-test/r/maria.result:
  new test case
mysql-test/t/maria.test:
  new test case
sql/sql_select.cc:
  ctags friendly
storage/maria/ma_blockrec.c:
  typo fixed
2008-08-11 16:40:32 +02:00
Sergei Golubchik
e2219ec965 wt_thd_lazy_init(), per-thread deadlock search depths and timeouts
mysys/array.c:
  lazy alloc in dynamic array
sql-common/client.c:
  for dynamic array, specify init_alloc==alloc_increment explicitly
sql/mysqld.cc:
  per-thread deadlock search depths and timeouts
sql/set_var.cc:
  per-thread deadlock search depths and timeouts
sql/sql_class.h:
  per-thread deadlock search depths and timeouts
2008-08-08 13:11:27 +02:00
Sergei Golubchik
f8c1059cbf move wt* maintainance from maria to the server
include/waiting_threads.h:
  C_MODE_START/END
mysys/waiting_threads.c:
  relax the checks - auto init thd in will_wait_for,
  allow to destroy uninited thd (=noop),
  allow a "release" an unexistent resource (=noop),
sql/sql_class.cc:
  move wt* maintainance from maria to the server.
  do THD::cleanup after ha_close_connection() and plugin_thdvar_cleanup().
storage/maria/unittest/trnman-t.c:
  update to new prototype
2008-08-07 22:57:25 +02:00
Sergei Golubchik
5a4cdba544 fixes for failing test suite
storage/maria/ma_write.c:
  select ... group by ... - take temporary tables into account, they have TRN->pins == 0
storage/maria/trnman.c:
  one cannot modify TRN->trid, it's a key in the trid_to_trn
  hash, if trid is modified, TRN won't be found (and deleted in
  trnman_free_trn) from the hash.
2008-08-06 23:52:55 +02:00
Sergei Golubchik
3971e262e9 maria: deadlock detection when waiting on unique key (useless until we can rollback)
include/my_pthread.h:
  cleanup
include/waiting_threads.h:
  header guard
mysys/waiting_threads.c:
  bug - kill strategy were not applied to deadlocks of length 1.
  cast timeout to ulonglong.
storage/maria/ma_static.c:
  declare WT_RESOURCE_TYPE ma_rc_dup_unique
storage/maria/ma_write.c:
  deadlock detection when waiting on unique key (useless until we can rollback)
storage/maria/maria_def.h:
  deadlock detection when waiting on unique key (useless until we can rollback)
storage/maria/trnman.c:
  use deadlock detector.
  protect state transitions of a TRN with a mutex.
  trnman_trid_to_trn() function.
storage/maria/trnman.h:
  trnman_trid_to_trn() function
  protect state transitions of a TRN with a mutex
  use deadlock detector.
storage/maria/trnman_public.h:
  trnman_trid_to_trn()
2008-08-06 21:30:05 +02:00
Sergei Golubchik
7ca3fc4ff0 compiler warnings 2008-08-06 16:03:27 +02:00
Sergei Golubchik
651f61fc1f wt_thd_cond_timedwait() now allows the list of blockers to change after
wt_thd_will_wait_for() was called. That is a caller doesn't need to hold a
mutex all the time preventing blockers from releasing a resource.
2008-08-04 20:01:11 +02:00
Sergei Golubchik
8347290482 compiler warnings
trnman: remove old lockman code
trnman: replace trid_to_committed_trn hash with trid_to_trn

storage/maria/ma_blockrec.c:
  compiler warnings
storage/maria/ma_loghandler.c:
  compiler warnings
storage/maria/ma_write.c:
  compiler warnings
storage/maria/trnman.c:
  remove old lockman code
  replace trid_to_committed_trn hash with trid_to_trn
storage/maria/trnman.h:
  remove old lockman code
  replace trid_to_committed_trn hash with trid_to_trn
storage/maria/unittest/ma_test_loghandler-t.c:
  compiler warnings
storage/maria/unittest/ma_test_loghandler_multigroup-t.c:
  compiler warnings
storage/maria/unittest/ma_test_loghandler_multithread-t.c:
  compiler warnings
2008-08-04 18:57:41 +02:00
Sergei Golubchik
01ecf1f36b merged 2008-08-02 08:09:28 +02:00
Sergei Golubchik
6ba12f070c WL#3064 - waiting threads - wait-for graph and deadlock detection
client/mysqltest.c:
  compiler warnings
configure.in:
  remove old tests for unused programs
  disable the use of gcc built-ins if smp assembler atomics were selected explictily.
  add waiting_threads.o to THREAD_LOBJECTS
include/lf.h:
  replace the end-of-stack pointer with the pointer to the end-of-stack pointer.
  the latter could be stored in THD (mysys_vars) and updated in pool-of-threads
  scheduler.
  constructor/destructor in lf-alloc
include/my_pthread.h:
  shuffle set_timespec/set_timespec_nsec macros a bit to be able to fill
  several timeout structures with only one my_getsystime() call
include/waiting_threads.h:
  waiting threads - wait-for graph and deadlock detection
mysys/Makefile.am:
  add waiting_threads.c
mysys/lf_alloc-pin.c:
  replace the end-of-stack pointer with the pointer to the end-of-stack pointer.
  the latter could be stored in THD (mysys_vars) and updated in pool-of-threads
  scheduler.
  constructor/destructor in lf-alloc
mysys/lf_hash.c:
  constructor/destructor in lf-alloc
mysys/my_thr_init.c:
  remember end-of-stack pointer in the mysys_var
mysys/waiting_threads.c:
  waiting threads - wait-for graph and deadlock detection
storage/maria/ha_maria.cc:
  replace the end-of-stack pointer with the pointer to the end-of-stack pointer.
  the latter could be stored in THD (mysys_vars) and updated in pool-of-threads
  scheduler.
storage/maria/ma_commit.c:
  replace the end-of-stack pointer with the pointer to the end-of-stack pointer.
  the latter could be stored in THD (mysys_vars) and updated in pool-of-threads
  scheduler.
storage/maria/trnman.c:
  replace the end-of-stack pointer with the pointer to the end-of-stack pointer.
  the latter could be stored in THD (mysys_vars) and updated in pool-of-threads
  scheduler.
storage/maria/trnman_public.h:
  replace the end-of-stack pointer with the pointer to the end-of-stack pointer.
  the latter could be stored in THD (mysys_vars) and updated in pool-of-threads
  scheduler.
storage/maria/unittest/trnman-t.c:
  replace the end-of-stack pointer with the pointer to the end-of-stack pointer.
  the latter could be stored in THD (mysys_vars) and updated in pool-of-threads
  scheduler.
unittest/mysys/Makefile.am:
  add waiting_threads-t
unittest/mysys/lf-t.c:
  factor out the common code for multi-threaded stress unit tests
  move lf tests to a separate file
unittest/mysys/my_atomic-t.c:
  factor out the common code for multi-threaded stress unit tests
  move lf tests to a separate file
unittest/mysys/thr_template.c:
  factor out the common code for multi-threaded stress unit tests
unittest/mysys/waiting_threads-t.c:
  wt tests
2008-07-29 16:10:24 +02:00
Michael Widenius
9e7626532b Auto merge
mysql-test/r/maria2.result:
  Manual merge
2008-07-12 17:59:54 +03:00
Michael Widenius
50fa1eb8b5 Fixing bug when using alter table on locked maria table
Reset history when we reenable logging for transactional tables (safety fix)

mysql-test/r/maria2.result:
  New results
mysql-test/t/maria2.test:
  Added test case for alter table on locked maria table
mysql-test/valgrind.supp:
  Added suppression rules for warnings in libc / libld
storage/maria/ma_extra.c:
  Remove table from trnman list if we are going to drop or rename it; We don't want not existing shares in the list when we do commit!
storage/maria/ma_recovery.c:
  Ensure that info->state don't point to history event when we disable logging for a table;  This is needed as alter table will first do commit and then unlock, which would cause us to access a non existing object when we reenable logging.
  Reset history when we reenable logging (safety fix)
storage/maria/ma_state.c:
  Do less work when share->now_transactional is not set. (Safety fix)
  Added function to remove shares to be deleted from trnman->used_tables
  Added function to reset history to current context
storage/maria/ma_state.h:
  Prototypes for new function
2008-07-12 17:14:28 +03:00
Guilhem Bichot
6f8b889ae5 Fix for BUG#38018 INSERT SELECT ON DUPLICATE KEY UPDATE and LOAD DATA CONCURRENT REPLACE
used TL_WRITE_CONCURRENT_INSERT though they may update/delete a row. This could cause concurrent SELECTs
to see a changing table while the SELECT happens, or if the query was made of a group of SELECTs,
some SELECTs would see different versions of the table. And anyway versioning in Maria was so far coded
to support only insertions. REPLACE SELECT, INSERT VALUES ON DUPLICATE KEY UPDATE, LOAD DATA REPLACE
were ok.

mysql-test/r/maria2.result:
  result. Without the code fix, the assertion added to ha_maria::update_row() would fire twice.
mysql-test/t/maria2.test:
  test when INSERT ON DUPLICATE KEY UPDATE and LOAD DATA CONCURRENT REPLACE do update rows
storage/maria/ha_maria.cc:
  Assert that update_row and delete_row never see TL_WRITE_CONCURRENT_INSERT.
  INSERT SELECT ON DUPLICATE KEY UPDATE and LOAD DATA CONCURRENT REPLACE
  must upgrade TL_WRITE_CONCURRENT_INSERT to TL_WRITE because they may update/delete a row.
2008-07-11 16:33:47 +02:00
Guilhem Bichot
dddc6fd2ef Porting bugfix made by Serg (for bug37276_reduced_corruption.sql of BUG#37276 "Maria: various index corruption,
block format assertion failure") from 6.0-maria to 5.1-maria.
2008-07-10 16:51:59 +02:00
Guilhem Bichot
eb548dc32f missing DBUG_RETURN, was causing crashes when run with --default-storage-engine=maria in tests
main.func_misc main.grant_cache_no_prot main.lowercase_table_grant main.mysql_client_test main.query_cache
main.query_cache_notembedded main.query_cache_ps_no_prot

storage/maria/ha_maria.cc:
  missing DBUG_RETURN
2008-07-10 16:38:14 +02:00
Guilhem Bichot
8de480a278 Merge of latest mysql-maria 2008-07-09 23:02:18 +02:00