Commit graph

9604 commits

Author SHA1 Message Date
Olivier Bertrand
3a69c854c5 - Modifies the way indexed UPDATE/DELETE are sorted in order to execute
them sorted by file position. Firstly a new value is stored in indexes
  to know if they are sorted, preventing to do the sorting when it is not
  needed. Secondly, almost all in now done in connect instead of being
  done by the different file access method classes. This pepares the future
  use of temporary files for all table types and also fix the bug that was
  occuring when partially using a multi-column index because of false MRR
  like call of position followed by unsorted rnd_pos no more using indexing.
modified:
  storage/connect/connect.cc
  storage/connect/filamap.cpp
  storage/connect/filamap.h
  storage/connect/filamdbf.cpp
  storage/connect/filamdbf.h
  storage/connect/filamfix.cpp
  storage/connect/filamfix.h
  storage/connect/filamtxt.cpp
  storage/connect/filamtxt.h
  storage/connect/filamvct.cpp
  storage/connect/filamvct.h
  storage/connect/tabdos.cpp
  storage/connect/tabdos.h
  storage/connect/tabfix.h
  storage/connect/tabfmt.cpp
  storage/connect/tabfmt.h
  storage/connect/xindex.cpp
  storage/connect/xindex.h
  storage/connect/xtable.h
2014-08-16 16:46:35 +02:00
Rich Prohaska
65547f32a0 DB-506 add a session variable to enable/disable bulk fetch default enabled 2014-08-14 15:18:56 -04:00
Rich Prohaska
b16b461d25 DB-506 add a session variable to enable/disable bulk fetch default enabled 2014-08-14 15:18:27 -04:00
Rich Prohaska
880fac82e2 #272 set tokudb product name 2014-08-12 14:41:35 -04:00
Rich Prohaska
0b72d47cef #272 set TokuDB product name 2014-08-12 12:56:15 -04:00
Sergei Golubchik
fd8da99119 disable still racy tokudb tests 2014-08-12 17:12:08 +02:00
Rich Prohaska
6a92fe510a #271 turn off FT debug flags by default. can be overridden by cmake arguments 2014-08-11 16:47:36 -04:00
Olivier Bertrand
78b1bdd2ba - Update part_file.result to match the test change
modified:
  storage/connect/mysql-test/connect/r/part_file.result
2014-08-08 19:53:44 +02:00
Olivier Bertrand
61c2e7b27d - Fix MDEV-6502
modified:
  storage/connect/ha_connect.cc

- Apply Sergei's fixes
modified:
  storage/connect/filamtxt.cpp
  storage/connect/mysql-test/connect/t/part_file.test
2014-08-08 19:46:02 +02:00
Sergei Golubchik
4105cbf4a2 after-merge fixes for 10.0-connect 2014-08-08 17:58:45 +02:00
Sergei Golubchik
2894758961 10.0-connect merge 2014-08-08 16:15:29 +02:00
Sergei Golubchik
9fffe990c4 buildbot found failures
config.h.cmake:
  define NOMINMAX, otherwise Windows system headers define min() and max() macros
sql/slave.cc:
  mi->report() has one more argument in MariaDB
storage/xtradb/buf/buf0flu.cc:
  xtradb fixes for windows, again
2014-08-08 13:53:43 +02:00
Olivier Bertrand
f835588cc2 - Commiting merge files 2014-08-07 19:12:45 +02:00
Sergei Golubchik
6fb17a0601 5.5.39 merge 2014-08-07 18:06:56 +02:00
Olivier Bertrand
0219ac1e98 This is a major update that fixes most of the issues and bugs that
have been created by the last addition of new CONNECT features.
The version previous to this one is a preliminary test version and
should not be distributed.

- Handle indexed UPDATE/DELETE. Previously this was just tested and
  an error message send when it could not be done. Now CONNECT can
  do it in all the cases. It is done by a MRR like tchnique by making
  a list of all update or delete to do, sort them, then execute them.
modified:
  storage/connect/array.cpp
  storage/connect/array.h
  storage/connect/filamap.cpp
  storage/connect/filamap.h
  storage/connect/filamdbf.cpp
  storage/connect/filamfix.cpp
  storage/connect/filamfix.h
  storage/connect/filamtxt.cpp
  storage/connect/filamtxt.h
  storage/connect/filamvct.cpp
  storage/connect/filamvct.h
  storage/connect/filamzip.cpp
  storage/connect/filamzip.h
  storage/connect/global.h
  storage/connect/ha_connect.cc
  storage/connect/ha_connect.h

- Differenciate Cardinality that returns a true or estimated table size
  and GetMaxSize that return a value equal or greater than the table
  row number. This fixes the errors of non matching opt files.
modified:
  storage/connect/connect.cc
  storage/connect/tabdos.cpp
  storage/connect/tabdos.h
  storage/connect/tabfix.cpp
  storage/connect/table.cpp
  storage/connect/tabmac.h
  storage/connect/tabmysql.cpp
  storage/connect/tabmysql.h
  storage/connect/tabodbc.cpp
  storage/connect/tabodbc.h
  storage/connect/tabpivot.h
  storage/connect/tabtbl.cpp
  storage/connect/tabtbl.h
  storage/connect/tabutil.cpp
  storage/connect/tabutil.h
  storage/connect/tabwmi.h
  storage/connect/xtable.h

- Fix some errors and issues when making index and opt files.
  Erase opt and index files for void tables.
  Fix wrong calculation of Block and Last in MakeBlockValues.
  Invalidate indexes before making opt file.
  Fully handle blocked variable tables. Make opt file for blocked
  variable tables even when they have no optimised colums.
modified:
  storage/connect/tabdos.cpp
  storage/connect/xindex.h

- Fix some errors making index
  Return an error when the allocation is too small (should not
  really occur now that GetMaxSize is sure)
  Don't use XXROW index for DBF tables because of soft deleted lines.
modified:
  storage/connect/xindex.cpp

- Typo
modified:
  storage/connect/macutil.cpp
  storage/connect/tabdos.h
  storage/connect/tabsys.cpp
  storage/connect/tabsys.h
2014-08-07 17:59:21 +02:00
Sergei Golubchik
2023fac281 innodb-5.6.19 2014-08-06 20:05:10 +02:00
Sergei Golubchik
a7f39aacd5 xtradb-5.6.19-67.0 2014-08-06 19:57:06 +02:00
Sergei Golubchik
098a9c602d perfschema 5.6.20 2014-08-06 19:41:33 +02:00
Sergei Golubchik
75af0fcc00 mysql-5.6.20 2014-08-06 19:29:02 +02:00
Sergei Golubchik
be253829d7 compilation failure on labrador 2014-08-06 10:11:08 +02:00
unknown
07668e6751 Remove unstable test case innodb_bug18942294, approved by Jimmy over IM. 2014-08-06 09:51:20 +08:00
Sergei Golubchik
68d72f9167 fix tokudb version 2014-08-05 20:22:57 +02:00
Sergei Golubchik
a4ab2431a2 fix tokudb version 2014-08-05 20:22:57 +02:00
Sergei Golubchik
761ed3d466 change Aria engine maturity to STABLE 2014-08-05 18:35:20 +02:00
Olivier Bertrand
b81b6d3f83 - Fix failing tests. part_file.test failure was due to a new alter flag that
were not taken in acount in check_if_supported_inplace_alter. mysql.test
  failure is strange, the suppressed warning should not be made anyway.
modified:
  storage/connect/ha_connect.cc
  storage/connect/mysql-test/connect/r/mysql.result
2014-08-05 17:01:41 +02:00
Rich Prohaska
ba4cc58dea #271 turn off FT debug flags by default. can be overridden by cmake arguments 2014-08-04 15:49:28 -04:00
Alexander Barkov
089938cd43 Merge 10.0->10.0-connect 2014-08-04 18:17:56 +04:00
Sergey Vojtovich
82ce2a2503 MDEV-6450 - MariaDB crash on Power8 when built with advance
tool chain

Reverted addition to the original patch:
InterlockedExchangeAcquire and InterlockedAndRelease are
supported only on Itanium-based systems.
2014-08-04 11:55:38 +04:00
Sergei Golubchik
c722e5f25f MDEV-6507 tokudb release builds compiled with debug code on
disable tokudb paranoid asserts
2014-08-03 13:38:54 +02:00
Sergei Golubchik
359d764b79 fix xtradb on windows (again) 2014-08-03 07:38:41 +02:00
Sergei Golubchik
1c6ad62a26 mysql-5.5.39 merge
~40% bugfixed(*) applied
~40$ bugfixed reverted (incorrect or we're not buggy)
~20% bugfixed applied, despite us being not buggy
(*) only changes in the server code, e.g. not cmakefiles
2014-08-02 21:26:16 +02:00
Sergei Golubchik
14200dfa43 tokudb-7.1.7 2014-08-01 17:04:15 +02:00
Sergei Golubchik
4b4de01fae 5.3 merge 2014-08-01 16:51:12 +02:00
Jan Lindström
27d23c020a Merged percona-server-5.5.38-35.2. 2014-08-01 12:54:56 +03:00
Rich Prohaska
ed9a5d5d38 #269 use bulk fetch for replace select 2014-07-31 12:24:04 -04:00
Rich Prohaska
0b49d864f9 #269 use bulk fetch for replace select 2014-07-31 12:23:23 -04:00
Sergey Vojtovich
53360fd45f MDEV-6450 - MariaDB crash on Power8 when built with advance
tool chain

This is an addition to the original patch. On Windows
InterlockedExchange implies full memory barrier, whereas
only acquire/release barriers required.
2014-07-31 14:31:05 +04:00
Michael Widenius
37ba4f37ac Fixed memory overflow 2014-07-31 13:13:33 +03:00
Jan Lindström
c39a501cbe Try to fix compiler error seen on Labrador. 2014-07-31 14:43:35 +03:00
Sergei Golubchik
3e9d4541d5 MDEV-6340 Mariadb 10.0.12 fatal "Lost connection" error w/ GCC 4.9 'Release' build; workaround ~ CFLAGS="-fno-delete-null-pointer-checks"
don't use attribute nonnull for arguments that can be null
2014-07-31 09:51:05 +02:00
Jan Lindström
c2536764d8 MDEV-6506: InnoDB: Assertion failure in thread 2810182464 in file
buf0flu.cc line 549.

Analysis: If buf_page_get_state(bpage) == BUF_BLOCK_REMOVE_HASH then
buf_page_in_file(bpage) might not be true. 

Fix: ut_a(buf_page_in_file(bpage) || buf_page_get_state(bpage) == BUF_BLOCK_REMOVE_HASH);
2014-07-31 10:32:52 +03:00
Michael Widenius
f9eeeae3c9 Fixed failing testcase 2014-07-30 23:16:49 +03:00
Michael Widenius
1a3d33c5f7 Automatic merge 2014-07-30 22:05:47 +03:00
Michael Widenius
5364315229 Fix for MDEV-6493: Assertion `table->file->stats.records > 0 || error' failure, or 'Invalid write' valgrind warnings, or crash on scenario with Aria table, view, LOCK TABLES
This bug only happens in case of paritioned tables used in LOCK TABLES and implicit_commit() was called
(as part of trying to execute a CREATE TABLE withing lock tables)

The problem was that Aria could not move the tables from one transaction to the new one, as thd->open_tables contained
a partitioned tables and not an Aria table.

Fix:
- Store a list of all open tables that are part of a share in share->open_tables
- In maria::implict_commit() use transaction->used_tables & share->open_tables to find out which tables
  was part of the current transaction instead of using thd->open_tables, which may contain partitioned tables.


mysql-test/suite/maria/maria_partition.result:
  Added test case
mysql-test/suite/maria/maria_partition.test:
  Added test case
storage/maria/ha_maria.cc:
  Use trn->used tables and share->open_tables to find out which tables was part of the current transaction instead of using thd->open_tables.
storage/maria/ma_close.c:
  Remove closed table from share->open_list
storage/maria/ma_open.c:
  Add table to share->open_list
storage/maria/ma_state.c:
  Added comment
storage/maria/maria_def.h:
  Added share->open_list, a list of all tables that is using this share.
2014-07-30 13:27:52 +03:00
Michael Widenius
a1c1700b89 Fixed some compiler warnings 2014-07-30 10:05:01 +03:00
Sergei Golubchik
6ef139780d MDEV-6497 InnoDB deadlocks on UNINSTALL PLUGIN
Free the trx of the current thd (if any) in innobase_end()
2014-07-29 09:09:52 +02:00
Jan Lindström
2936bfd220 Merge revision 4244 from 5.5. Fix compiler error on sparc. 2014-07-27 08:47:37 +03:00
Jan Lindström
42b9758814 Fix compiler error on sparc. 2014-07-27 08:44:45 +03:00
Jan Lindström
8ae267400c Fix InnoDB: Assertion failure in thread 2868898624 in file buf0lru.c line 1000
InnoDB: Failing assertion: mutex_own(&buf_pool->LRU_list_mutex)

and

InnoDB: Assertion failure in thread 2868898624 in file buf0lru.c line 1077
InnoDB: Failing assertion: mutex_own(&buf_pool->LRU_list_mutex)

Analysis: Function buf_LRU_free_block might release LRU_list_mutex on
same cases to avoid mutex order problems, we need to take it back 
before accessing list.
2014-07-26 21:14:21 +03:00
Jan Lindström
476feba941 Fix unnecessary printout of same writer thread more than once. Fixed
also a compiler warning.
2014-07-26 20:17:59 +03:00
Olivier Bertrand
4d0587c331 - Fix an error pointed out by Valgrind due to uninitialised Correlated
variable. This variable is not to be used by CONNECT.
modified:
  storage/connect/array.cpp
  storage/connect/array.h
2014-07-25 11:37:07 +02:00
Jan Lindström
a3acd72570 Merge InnoDB fixes from 5.5 revisions 4229, 4230, 4233, 4237 and 4238 i.e.
4229: MDEV-5670: Assertion failure in file buf0lru.c line 2355
      Add more status information if repeatable.

4230: MDEV-5673: Crash while parallel dropping multiple tables under heavy load
      Improve long semaphore wait output to include all semaphore waits
      and try to find out if there is a sequence of waiters.

4233: Fix compiler errors on product build.

4237: Fix too agressive long semaphore wait output and add guard against introducing
      compression failures on insert buffer.

4238: Fix test failure caused by simulated compression failure on
      IBUF_DUMMY table.
2014-07-25 10:30:16 +03:00
Sergey Vojtovich
6192f0bffa MDEV-6483 - Deadlock around rw_lock_debug_mutex on PPC64
This problem affects only debug builds on PPC64.

There are at least two race conditions around
rw_lock_debug_mutex_enter and rw_lock_debug_mutex_exit:

- rw_lock_debug_waiters was loaded/stored without setting
  appropriate locks/memory barriers.
- there is a gap between calls to os_event_reset() and
  os_event_wait() and in such case we're supposed to pass
  return value of the former to the latter.

Fixed by replacing self-cooked spinlocks with system mutexes.
These days system mutexes offer much better performance. OTOH
performance is not that critical for debug builds.
2014-07-24 18:12:32 +04:00
Olivier Bertrand
de3ee460da - Try to fix some test failure
modified:
  storage/connect/mysql-test/connect/t/part_table.test
2014-07-24 15:50:29 +02:00
Jan Lindström
c104965746 Fix test failure caused by simulated compression failure on
IBUF_DUMMY table.
2014-07-25 09:34:05 +03:00
Jan Lindström
7bf45bec54 Fix too agressive long semaphore wait output and add guard against introducing
compression failures on insert buffer.
2014-07-24 14:35:09 +03:00
Jan Lindström
be00265557 Fix compiler errors on product build. 2014-07-23 13:52:17 +03:00
Olivier Bertrand
c1d1dc25dd - Modif avglen calculation and add AVG_ROW_LENGTH option to test
This is to get same test results on Linux and Windows
modified:
  storage/connect/mysql-test/connect/r/part_file.result
  storage/connect/mysql-test/connect/r/part_table.result
  storage/connect/mysql-test/connect/t/part_file.test
  storage/connect/mysql-test/connect/t/part_table.test
  storage/connect/tabdos.cpp
2014-07-22 19:45:25 +02:00
Jan Lindström
a1e41e3258 MDEV-6470: Restrict number of error messages about persistent statictic tables not found
If mysql.innodb_table_stats or mysql.innodb_index_stats is not found or has
unexpected structure output that error only once and no other error for
every table trying to use them. If they do exists, then print fetch or
recalculation errors only once / table or index.
2014-07-22 19:31:45 +03:00
Olivier Bertrand
decc23cbc2 - Fix bugs in handling of remote index when updating and deleting
modified:
  storage/connect/ha_connect.cc
  storage/connect/tabdos.cpp
  storage/connect/tabfmt.cpp
  storage/connect/tabmysql.cpp

- add AVG_REC_LENGTH option to avoid result mismatch between
  Windows and Linux
modified:
  storage/connect/mysql-test/connect/r/part_file.result
  storage/connect/mysql-test/connect/r/part_table.result
  storage/connect/mysql-test/connect/t/part_file.test
2014-07-22 15:51:21 +02:00
Jan Lindström
ef67c3a239 MDEV-6443: Server crashed with assertaion failure in file ha_innodb.cc
line 8473

In case InnoDB index is not found, print the MySQL and InnoDB index
name we were trying to find and all MySQL and InnoDB index names there
is for this table.
2014-07-22 13:17:16 +03:00
Jan Lindström
fe3859cc9d MDEV-6443: Server crashed with assertaion failure in file
ha_innodb.cc line 8473

If index is not found from InnoDB make sure we print what we
were trying to find and all mysql and InnoDB index names there
is for this table.
2014-07-22 13:08:32 +03:00
Jan Lindström
0bb0230e3a MDEV-6426: Maria DB crashes randomly on creating indexes
Improve OS error messages on Windows.
2014-07-22 10:10:56 +03:00
Olivier Bertrand
26e4b69ffd - FIX errors and some gcc warnings
modified:
  storage/connect/array.cpp
  storage/connect/array.h
  storage/connect/blkfil.cpp
  storage/connect/blkfil.h
  storage/connect/filter.cpp
  storage/connect/filter.h
  storage/connect/ha_connect.cc
  storage/connect/tabdos.cpp
  
- FIX problems of DIR table on LINUX:
  The order of the result is not the same than the one on Windows
  An error occurs when no file match the pattern
  Also the row numbers may also be different (not fixed yet)
modified:
  storage/connect/mysql-test/connect/r/part_file.result
  storage/connect/mysql-test/connect/r/part_table.result
  storage/connect/mysql-test/connect/t/part_file.test
2014-07-20 20:39:17 +02:00
Olivier Bertrand
4b2092ebea This is a new version of the CONNECT storage engine. It was developed in
a sub-branch of this one and merged by pushing all the changes from it.
This version adds the following to CONNECT:

- MRR support (similar to the MyISAM one)
- Block, Remote and dynamic indexing
- Partitioning support (using the PARTITION engine)

Here is a list of the commited changes made in the sub-branch:
========================================================================

------------------------------------------------------------
revno: 4009
committer: Olivier Bertrand <bertrandop@gmail.com>
branch nick: 10.0-connect
timestamp: Thu 2014-07-17 18:13:51 +0200
message:
  This commit brings many changes, in particular two important ones:
  1) Support of partitioning by connect. A table can be partitioned
     by files, this is an enhanced MULTIPLE table. It can be also
     partitioned by sub-tables like TBL and this enables table sharding.
  2) Handling a CONNECT bug that causes in some cases extraneous rows
     to remain in the table after an UPDATE or DELETE when the command
     uses indexing (for not fixed file tables). Until a real fix is
     done, CONNECT tries to ignore indexing and if it cannot do it
     abort the command with an error message.

  - Add tests on partitioning
  added:
    storage/connect/mysql-test/connect/r/part_file.result
    storage/connect/mysql-test/connect/r/part_table.result
    storage/connect/mysql-test/connect/t/part_file.test
    storage/connect/mysql-test/connect/t/part_table.test

  - Temporary fix
  modified:
    sql/sql_partition.cc

  - Add partition support
  modified:
    storage/connect/ha_connect.cc
    storage/connect/ha_connect.h
    storage/connect/reldef.cpp
    storage/connect/reldef.h
    storage/connect/tabdos.cpp

  - Add functions ha_connect::IsUnique and ha_connect::CheckColumnList
  modified:
    storage/connect/ha_connect.cc
    storage/connect/ha_connect.h

  - Prevent updating a partition table column that is part of
    the partition function (outward tables only)
  modified:
    storage/connect/ha_connect.cc

  - Support INSERT/UPDATE/DELETE for PROXY tables
  modified:
    storage/connect/tabutil.cpp

  - Handle the bug on updating rows via indexing. Waiting for a real fix,
    Don't use indexing when possible else raise an error and abort.
  modified:
    storage/connect/ha_connect.cc

  - dbuserp->UseTemp set to TMP_AUTO
  modified:
    storage/connect/connect.cc

  - Add members nox, abort and only
  modified:
    storage/connect/ha_connect.cc
    storage/connect/ha_connect.h

  - Add arguments nox and abort to CntCloseTable
  modified:
    storage/connect/connect.cc
    storage/connect/connect.h
    storage/connect/filamap.cpp
    storage/connect/filamap.h
    storage/connect/filamdbf.cpp
    storage/connect/filamdbf.h
    storage/connect/filamfix.cpp
    storage/connect/filamfix.h
    storage/connect/filamtxt.cpp
    storage/connect/filamtxt.h
    storage/connect/filamvct.cpp
    storage/connect/filamvct.h
    storage/connect/filamzip.cpp
    storage/connect/filamzip.h
    storage/connect/ha_connect.cc

  - Add arguments abort to CloseTableFile and RenameTempFile
  modified:
    storage/connect/filamap.cpp
    storage/connect/filamap.h
    storage/connect/filamdbf.cpp
    storage/connect/filamdbf.h
    storage/connect/filamfix.cpp
    storage/connect/filamfix.h
    storage/connect/filamtxt.cpp
    storage/connect/filamtxt.h
    storage/connect/filamvct.cpp
    storage/connect/filamvct.h
    storage/connect/filamzip.cpp
    storage/connect/filamzip.h
    storage/connect/tabdos.cpp
    storage/connect/tabdos.h
    storage/connect/tabvct.cpp
    storage/connect/xtable.h

  - Fix info->records when file does not exists
  modified:
    storage/connect/connect.cc

  - Close XML table when opened for info
  modified:
    storage/connect/connect.cc

  - Add function VCTFAM::GetFileLength
  modified:
    storage/connect/filamvct.cpp
    storage/connect/filamvct.h

  - Column option DISTRIB -> ENUM
  modified:
    storage/connect/ha_connect.cc

  - Options connect, query_string and partname allways available
  modified:
    storage/connect/ha_connect.cc

  - Add function MYSQLC::GetTableSize
  modified:
    storage/connect/myconn.cpp
    storage/connect/myconn.h

  - Add new special columns (PARTNAME, FNAME, FPATH, FTYPE and FDISK)
  modified:
    storage/connect/colblk.cpp
    storage/connect/colblk.h
    storage/connect/plgdbsem.h
    storage/connect/table.cpp

  - Add function ExtractFromPath
  modified:
    storage/connect/colblk.cpp
    storage/connect/plgdbsem.h
    storage/connect/plgdbutl.cpp

  - Enhance Cardinality for some table types
  modified:
    storage/connect/tabdos.cpp
    storage/connect/tabmysql.cpp
    storage/connect/tabmysql.h
    storage/connect/tabodbc.cpp
    storage/connect/tabodbc.h
    storage/connect/tabsys.cpp
    storage/connect/tabsys.h
    storage/connect/xindex.cpp
    storage/connect/xindex.h
    storage/connect/xtable.h

  - Add test on special column
  modified:
    storage/connect/tabfmt.cpp

  - Add new files (added for block indexing)
  modified:
    storage/connect/CMakeLists.txt
------------------------------------------------------------
revno: 4007 [merge]
committer: Olivier Bertrand <bertrandop@gmail.com>
branch nick: 10.0-connect
timestamp: Sat 2014-05-31 12:31:26 +0200
message:
  - Begin adding support of partition tables
  modified:
    storage/connect/ha_connect.cc
    storage/connect/ha_connect.h
    storage/connect/reldef.cpp

  - Add INSERT/UPDATE support to PROXY tables
  modified:
    storage/connect/tabutil.cpp
    storage/connect/tabutil.h

  - Take care of SPECIAL columns
  modified:
    storage/connect/filamdbf.cpp
    storage/connect/reldef.h
    storage/connect/tabfmt.cpp

  -Typo and misc
  modified:
    storage/connect/odbconn.cpp
    storage/connect/tabfix.cpp
    storage/connect/xindex.cpp
------------------------------------------------------------
revno: 4006
committer: Olivier Bertrand <bertrandop@gmail.com>
branch nick: 10.0-connect
timestamp: Sat 2014-05-10 12:21:08 +0200
message:
  - FIX some MAP and XMAP errors (such as mapped indexes not closed)
    Do not put version in XML files header
    Remove HTON_NO_PARTITION for testing
    Fix a wrong return (instead of DBUG_RETURN) in index_init
    Plus a few typos
  modified:
    storage/connect/connect.cc
    storage/connect/filter.cpp
    storage/connect/ha_connect.cc
    storage/connect/maputil.cpp
    storage/connect/mysql-test/connect/r/alter_xml.result
    storage/connect/mysql-test/connect/r/xml.result
    storage/connect/table.cpp
    storage/connect/tabxml.cpp
    storage/connect/xindex.cpp
    storage/connect/xindex.h
    storage/connect/xtable.h
------------------------------------------------------------
revno: 4005
committer: Olivier Bertrand <bertrandop@gmail.com>
branch nick: 10.0-connect
timestamp: Fri 2014-05-02 15:55:45 +0200
message:
  - Adding fetched columns to Dynamic index key (unique only)
    Fix two bugs concerning added KXYCOL's:
    1 - Not set during reading
    2 - Val_K not set in FastFind
  modified:
    storage/connect/connect.cc
    storage/connect/filamtxt.h
    storage/connect/tabdos.cpp
    storage/connect/tabfix.cpp
    storage/connect/table.cpp
    storage/connect/valblk.h
    storage/connect/xindex.cpp
    storage/connect/xindex.h
    storage/connect/xtable.h
------------------------------------------------------------
revno: 4003
committer: Olivier Bertrand <bertrandop@gmail.com>
branch nick: 10.0-connect
timestamp: Wed 2014-04-30 10:48:29 +0200
message:
  - Implementation of adding selected columns to dynamic indexes.
  modified:
    storage/connect/connect.cc
    storage/connect/ha_connect.cc
    storage/connect/ha_connect.h
    storage/connect/tabdos.cpp
    storage/connect/tabdos.h
    storage/connect/tabvct.cpp
    storage/connect/tabvct.h
    storage/connect/xindex.cpp
    storage/connect/xindex.h
------------------------------------------------------------
revno: 4001
committer: Olivier Bertrand <bertrandop@gmail.com>
branch nick: 10.0-connect
timestamp: Sat 2014-04-26 00:17:26 +0200
message:
  - Implement dynamic indexing
  modified:
    storage/connect/connect.cc
    storage/connect/filter.cpp
    storage/connect/filter.h
    storage/connect/ha_connect.cc
    storage/connect/ha_connect.h
    storage/connect/tabdos.cpp
    storage/connect/tabdos.h
    storage/connect/table.cpp
    storage/connect/xindex.cpp
    storage/connect/xindex.h
    storage/connect/xtable.h
------------------------------------------------------------
revno: 3995
committer: Olivier Bertrand <bertrandop@gmail.com>
branch nick: 10.0-connect
timestamp: Sun 2014-03-23 18:49:19 +0100
message:
  - Work in progress
  modified:
    storage/connect/filter.h
    storage/connect/ha_connect.cc
    storage/connect/ha_connect.h
    storage/connect/mysql-test/connect/r/alter.result
    storage/connect/mysql-test/connect/r/xml.result
------------------------------------------------------------
revno: 3991
committer: Olivier Bertrand <bertrandop@gmail.com>
branch nick: 10.0-connect
timestamp: Mon 2014-03-10 18:59:36 +0100
message:
  - Adding files needed for block indexing
  added:
    storage/connect/array.cpp
    storage/connect/array.h
    storage/connect/blkfil.cpp
    storage/connect/blkfil.h
    storage/connect/filter.cpp
    storage/connect/filter.h
========================================================================
This commit of the main branch adds:

- A change needed to have the engine function check_if_supported_inplace_alter
  called for partition tables (was done manually in the sub-branch) by adding
  the preparser define: PARTITION_SUPPORTS_INPLACE_ALTER
modified:
  sql/CMakeLists.txt

- A fix concerning the FileExists function. It was needed to force the function
  table_flags to return the same flags for all partitions. This is tested by
  the partition engine and raises an error if flags are not equal.
  The way file name, table name and connection string are retrieved has been
  modified to cope with it.
modified:
  storage/connect/ha_connect.cc
  storage/connect/ha_connect.h
  storage/connect/reldef.cpp

- A few typos, such as the version string.
modified:
  storage/connect/ha_connect.cc

- Updating some test result files because some warnings are no more raised.
modified:
  storage/connect/mysql-test/connect/r/occur.result
  storage/connect/mysql-test/connect/r/part_file.result
  storage/connect/mysql-test/connect/r/pivot.result
2014-07-20 12:31:42 +02:00
Michael Widenius
f0f2072d1f Fixed problem with very slow shutdown when using 100,000 MyISAM tables with delay_key_write
Reason for the problem was that the hash of changed files in the key cache was too small (was 128). Fixed by making the hash size larger and changeable.

- Introduced key-cache-file-hash-size (default 512) for MyISAM and aria_pagecache_file_hash_size (default 512) for Aria.
- Added new status variable "Feature_delay_key_write" which counts number of tables opened that are using delay_key_write


mysql-test/r/features.result:
  Added test of Feature_delay_key_write
mysql-test/r/key_cache.result:
  Updated tests as the number of blocks has changed
mysql-test/r/mysqld--help.result:
  Updated result
mysql-test/suite/maria/maria3.result:
  Updated result
mysql-test/suite/sys_vars/r/key_cache_file_hash_size_basic.result:
  Test new variable
mysql-test/suite/sys_vars/t/aria_pagecache_file_hash_size_basic.test:
  Test new variable
mysql-test/suite/sys_vars/t/key_cache_file_hash_size_basic.test:
  Test new variable
mysql-test/t/features.test:
  Added test of Feature_delay_key_write
mysql-test/t/key_cache.test:
  Updated tests as the number of blocks has changed
mysys/mf_keycache.c:
  Made CHANGED_BLOCKS_HASH dynamic
sql/handler.cc:
  Updated call to init_key_cache()
sql/mysqld.cc:
  Added "Feature_delay_key_write"
  Added support for key-cache-file-hash-size
sql/mysqld.h:
  Added support for key-cache-file-hash-size
sql/sql_class.h:
  Added feature_files_opened_with_delayed_keys
sql/sys_vars.cc:
  Added key_cache_file_hash_size
storage/maria/ha_maria.cc:
  Added pagecache_file_hash_size
  Added counting of files with delay_key_write
storage/maria/ma_checkpoint.c:
  Fixed compiler warning
storage/maria/ma_pagecache.c:
  Made PAGECACHE_CHANGED_BLOCKS_HASH into a variable
storage/maria/ma_pagecache.h:
  Made PAGECACHE_CHANGED_BLOCKS_HASH into a variable
storage/maria/ma_rt_test.c:
  Updated parameters for init_pagecache()
storage/maria/ma_test1.c:
  Updated parameters for init_pagecache()
storage/maria/ma_test2.c:
  Updated parameters for init_pagecache()
storage/maria/ma_test3.c:
  Updated parameters for init_pagecache()
storage/maria/maria_chk.c:
  Updated parameters for init_pagecache()
storage/maria/maria_ftdump.c:
  Updated parameters for init_pagecache()
storage/maria/maria_pack.c:
  Updated parameters for init_pagecache()
storage/maria/maria_read_log.c:
  Updated parameters for init_pagecache()
storage/maria/unittest/ma_pagecache_consist.c:
  Updated parameters for init_pagecache()
storage/maria/unittest/ma_pagecache_rwconsist.c:
  Updated parameters for init_pagecache()
storage/maria/unittest/ma_pagecache_rwconsist2.c:
  Updated parameters for init_pagecache()
storage/maria/unittest/ma_pagecache_single.c:
  Updated parameters for init_pagecache()
storage/maria/unittest/ma_test_loghandler-t.c:
  Updated parameters for init_pagecache()
storage/maria/unittest/ma_test_loghandler_first_lsn-t.c:
  Updated parameters for init_pagecache()
storage/maria/unittest/ma_test_loghandler_max_lsn-t.c:
  Updated parameters for init_pagecache()
storage/maria/unittest/ma_test_loghandler_multigroup-t.c:
  Updated parameters for init_pagecache()
storage/maria/unittest/ma_test_loghandler_multithread-t.c:
  Updated parameters for init_pagecache()
storage/maria/unittest/ma_test_loghandler_noflush-t.c:
  Updated parameters for init_pagecache()
storage/maria/unittest/ma_test_loghandler_nologs-t.c:
  Updated parameters for init_pagecache()
storage/maria/unittest/ma_test_loghandler_pagecache-t.c:
  Updated parameters for init_pagecache()
storage/maria/unittest/ma_test_loghandler_purge-t.c:
  Updated parameters for init_pagecache()
storage/myisam/ha_myisam.cc:
  Added counting of files with delay_key_write
storage/myisam/mi_check.c:
  Updated call to init_key_cache()
storage/myisam/mi_test1.c:
  Updated call to init_key_cache()
storage/myisam/mi_test2.c:
  Updated call to init_key_cache()
storage/myisam/mi_test3.c:
  Updated call to init_key_cache()
storage/myisam/mi_test_all.sh:
  Fixed broken test
storage/myisam/myisam_ftdump.c:
  Updated call to init_key_cache()
storage/myisam/myisamchk.c:
  Updated call to init_key_cache()
storage/myisam/myisamlog.c:
  Updated call to init_key_cache()
2014-07-19 17:46:08 +03:00
Sergey Vojtovich
c0ebb3f388 MDEV-6450 - MariaDB crash on Power8 when built with advance tool
chain

InnoDB mutex_exit() function calls __sync_test_and_set() to release
the lock. According to manual this function is supposed to create
"acquire" memory barrier whereas in fact we need "release" memory
barrier at mutex_exit().

The problem isn't repeatable with gcc because it creates
"acquire-release" memory barrier for __sync_test_and_set().
ATC creates just "acquire" barrier.

Fixed by creating proper barrier at mutex_exit() by using
__sync_lock_release() instead of __sync_test_and_set().
2014-07-18 15:16:25 +04:00
Rich Prohaska
79608786fb #261 auto detect index scans to fix perf problem with partitions 2014-07-18 06:40:52 -04:00
Rich Prohaska
444af9c8e7 #261 debug prelocking for index scans 2014-07-18 06:40:10 -04:00
Rich Prohaska
030487487c #261 auto detect index scans to fix perf problem with partitions 2014-07-18 06:39:07 -04:00
Olivier Bertrand
6c8fbe61ea Commit merged files.
- Fix result length mismatch because an error message was modified.
modified:
  storage/connect/mysql-test/connect/r/alter.result
2014-07-17 19:28:28 +02:00
Olivier Bertrand
1904284361 This commit brings many changes, in particular two important ones:
1) Support of partitioning by connect. A table can be partitioned
   by files, this is an enhanced MULTIPLE table. It can be also
   partitioned by sub-tables like TBL and this enables table sharding.
2) Handling a CONNECT bug that causes in some cases extraneous rows
   to remain in the table after an UPDATE or DELETE when the command
   uses indexing (for not fixed file tables). Until a real fix is
   done, CONNECT tries to ignore indexing and if it cannot do it
   abort the command with an error message.

- Add tests on partitioning
added:
  storage/connect/mysql-test/connect/r/part_file.result
  storage/connect/mysql-test/connect/r/part_table.result
  storage/connect/mysql-test/connect/t/part_file.test
  storage/connect/mysql-test/connect/t/part_table.test

- Temporary fix
modified:
  sql/sql_partition.cc

- Add partition support
modified:
  storage/connect/ha_connect.cc
  storage/connect/ha_connect.h
  storage/connect/reldef.cpp
  storage/connect/reldef.h
  storage/connect/tabdos.cpp

- Add functions ha_connect::IsUnique and ha_connect::CheckColumnList
modified:
  storage/connect/ha_connect.cc
  storage/connect/ha_connect.h

- Prevent updating a partition table column that is part of
  the partition function (outward tables only)
modified:
  storage/connect/ha_connect.cc

- Support INSERT/UPDATE/DELETE for PROXY tables
modified:
  storage/connect/tabutil.cpp

- Handle the bug on updating rows via indexing. Waiting for a real fix,
  Don't use indexing when possible else raise an error and abort.
modified:
  storage/connect/ha_connect.cc

- dbuserp->UseTemp set to TMP_AUTO
modified:
  storage/connect/connect.cc

- Add members nox, abort and only
modified:
  storage/connect/ha_connect.cc
  storage/connect/ha_connect.h

- Add arguments nox and abort to CntCloseTable
modified:
  storage/connect/connect.cc
  storage/connect/connect.h
  storage/connect/filamap.cpp
  storage/connect/filamap.h
  storage/connect/filamdbf.cpp
  storage/connect/filamdbf.h
  storage/connect/filamfix.cpp
  storage/connect/filamfix.h
  storage/connect/filamtxt.cpp
  storage/connect/filamtxt.h
  storage/connect/filamvct.cpp
  storage/connect/filamvct.h
  storage/connect/filamzip.cpp
  storage/connect/filamzip.h
  storage/connect/ha_connect.cc

- Add arguments abort to CloseTableFile and RenameTempFile
modified:
  storage/connect/filamap.cpp
  storage/connect/filamap.h
  storage/connect/filamdbf.cpp
  storage/connect/filamdbf.h
  storage/connect/filamfix.cpp
  storage/connect/filamfix.h
  storage/connect/filamtxt.cpp
  storage/connect/filamtxt.h
  storage/connect/filamvct.cpp
  storage/connect/filamvct.h
  storage/connect/filamzip.cpp
  storage/connect/filamzip.h
  storage/connect/tabdos.cpp
  storage/connect/tabdos.h
  storage/connect/tabvct.cpp
  storage/connect/xtable.h

- Fix info->records when file does not exists
modified:
  storage/connect/connect.cc

- Close XML table when opened for info
modified:
  storage/connect/connect.cc

- Add function VCTFAM::GetFileLength
modified:
  storage/connect/filamvct.cpp
  storage/connect/filamvct.h

- Column option DISTRIB -> ENUM
modified:
  storage/connect/ha_connect.cc

- Options connect, query_string and partname allways available
modified:
  storage/connect/ha_connect.cc

- Add function MYSQLC::GetTableSize
modified:
  storage/connect/myconn.cpp
  storage/connect/myconn.h

- Add new special columns (PARTNAME, FNAME, FPATH, FTYPE and FDISK)
modified:
  storage/connect/colblk.cpp
  storage/connect/colblk.h
  storage/connect/plgdbsem.h
  storage/connect/table.cpp

- Add function ExtractFromPath
modified:
  storage/connect/colblk.cpp
  storage/connect/plgdbsem.h
  storage/connect/plgdbutl.cpp

- Enhance Cardinality for some table types
modified:
  storage/connect/tabdos.cpp
  storage/connect/tabmysql.cpp
  storage/connect/tabmysql.h
  storage/connect/tabodbc.cpp
  storage/connect/tabodbc.h
  storage/connect/tabsys.cpp
  storage/connect/tabsys.h
  storage/connect/xindex.cpp
  storage/connect/xindex.h
  storage/connect/xtable.h

- Add test on special column
modified:
  storage/connect/tabfmt.cpp

- Add new files (added for block indexing)
modified:
  storage/connect/CMakeLists.txt
2014-07-17 18:13:51 +02:00
Rich Prohaska
e543cf162b #263 enable bulk fetch for insert select sql commands 2014-07-16 10:13:37 -04:00
Rich Prohaska
871dbcf60a #262 enable bulk fetch for create select sql commands 2014-07-16 10:13:16 -04:00
Rich Prohaska
862d17b361 #261 debug prelocking for index scans 2014-07-16 10:03:00 -04:00
Rich Prohaska
53231b1341 #263 enable bulk fetch for insert select sql commands 2014-07-15 15:45:48 -04:00
Rich Prohaska
79411796ce #262 enable bulk fetch for create select sql commands 2014-07-15 13:13:30 -04:00
Kristian Nielsen
501c56ef1e MDEV-5262, MDEV-5914, MDEV-5941, MDEV-6020: Deadlocks during parallel replication causing replication to fail.
Merge the patches into MariaDB 10.0 main.

With this patch, parallel replication will now automatically retry a
transaction that fails due to deadlock or other temporary error, same as
single-threaded replication.

We catch deadlocks with InnoDB transactions due to enforced commit order. If
T1 must commit before T2 in parallel replication and T1 ends up waiting for T2
inside InnoDB, we kill T2 and retry it later to resolve the deadlock
automatically.
2014-07-11 12:06:47 +02:00
Rich Prohaska
c5e9952458 #258 support deferred XA recovery with discard of prepared txns and dirty shutdown of the FT environment 2014-07-10 16:30:40 -04:00
Kristian Nielsen
5b75891b7b Fix compile failure in non-debug build. 2014-07-10 14:24:53 +02:00
Sergey Vojtovich
afbb2e2901 Coding style fixes: remove trailing spaces. 2014-07-10 12:44:20 +04:00
Rich Prohaska
48a6883b34 #258 support deferred XA recovery with discard of prepared txns and dirty shutdown of the FT environment 2014-07-09 15:50:15 -04:00
Kristian Nielsen
45f6262f54 MDEV-5262, MDEV-5914, MDEV-5941, MDEV-6020: Deadlocks during parallel replication causing replication to fail.
After-review changes. Fix InnoDB coding style issues.
2014-07-09 13:02:52 +02:00
Kristian Nielsen
92577cc0eb MDEV-5262, MDEV-5914, MDEV-5941, MDEV-6020: Deadlocks during parallel replication causing replication to fail.
Fix small (but nasty) typo.
2014-07-08 14:54:53 +02:00
Kristian Nielsen
98fc5b3af8 MDEV-5262, MDEV-5914, MDEV-5941, MDEV-6020: Deadlocks during parallel replication causing replication to fail.
After-review changes.

For this patch in 10.0, we do not introduce a new public storage engine API,
we just fix the InnoDB/XtraDB issues. In 10.1, we will make a better public
API that can be used for all storage engines (MDEV-6429).

Eliminate the background thread that did deadlock kills asynchroneously.
Instead, we ensure that the InnoDB/XtraDB code can handle doing the kill from
inside the deadlock detection code (when thd_report_wait_for() needs to kill a
later thread to resolve a deadlock).

(We preserve the part of the original patch that introduces dedicated mutex
and condition for the slave init thread, to remove the abuse of
LOCK_thread_count for start/stop synchronisation of the slave init thread).
2014-07-08 12:54:47 +02:00
unknown
de0c78c019 BUG#18942294 - SEGV IN DICT_FIND_TABLE_BY_SPACE TRYING TO MARK SPACE CORRUPT
IN RECOVERY

During redo log processing, the data dictionary is not available. We should
check it in dict_find_table_by_space() to prevent SEGV error.

rb#5678, approved by Jimmy.
2014-07-08 15:10:15 +08:00
Rich Prohaska
28833bd162 #257 disable missing field initializer warning 2014-07-03 08:44:51 -04:00
Rich Prohaska
4df66169f2 #256 only force MDL X for certain alter table operations 2014-07-03 08:44:40 -04:00
Annamalai Gurusami
301032d20a Bug #19140907 DUPLICATES IN UNIQUE SECONDARY INDEX BECAUSE OF FIX OF BUG#68021
Problem:

When a unique secondary index is scanned for duplicate checking, gap locks
were not taken if the transaction had isolation level <= READ COMMITTED. 
This change was done while fixing Bug #16133801 UNEXPLAINABLE INNODB UNIQUE
INDEX LOCKS ON DELETE + INSERT WITH SAME VALUES (rb#2035). Because of this
the duplicate check logic failed, and resulted in duplicate values in unique
secondary index.

Solution:

When a unique secondary index is scanned for duplicate checking, gap locks
must be taken irrespective of the transaction isolation level.  This is
achieved by reverting rb#2035.

rb#5910 approved by Jimmy
2014-07-03 10:13:29 +05:30
Rich Prohaska
3a030fac86 #257 disable missing field initializer warning 2014-07-02 13:27:37 -04:00
Michael Widenius
bd2117d154 Automatic merge from 5.5
Fixed 2 failing tests by replacing result files
2014-08-19 21:35:14 +03:00
Michael Widenius
258ecf5538 Added Innobase .ic and errmsg-utf8.txt to tagged files
Fixed compiler warning

storage/connect/tabdos.cpp:
  Fixed compiler warning
support-files/build-tags:
  Added Innobase .ic and errmsg-utf8.txt to tagged files
  Speed up script
2014-08-14 15:36:48 +03:00
Rich Prohaska
ca032f3e82 #256 only force MDL X for certain alter table operations 2014-06-26 15:24:47 -04:00
Arun Kuruvila
76d3e3bccb Bug#18463911 : SERVER CRASHES ON CREATING A TEMP TABLE WITH
CERTAIN MAX_HEAP_TABLE_SIZE VALUES

Followup patch to fix failure on Window machine.
2014-06-26 10:08:55 +05:30
Jan Lindström
e005734058 MDEV-6424: Mariadb server crashes with assertion failure in file ha_innodb.cc
Analysis: For some reason table stats for a table pointed from a index 
is not initialized. Added additional warning output on this situation
and table stats initialization. This is better than asserting.
2014-07-08 21:05:18 +03:00
Sergei Golubchik
086a81986b MDEV-5867 ALTER TABLE t1 ENGINE=InnoDB keeps bad options when t1 ENGINE is CONNECT
Comment out unknown options in SHOW CREATE TABLE unless IGNORE_BAD_TABLE_OPTIONS is used
2014-07-08 19:39:27 +02:00
Jan Lindström
648fb98eb6 MDEV-6348: mariadb crash signal 11
Analysis: sync array output function, should make sure that all
used pointers are valid before using them.

Merge revision 4225 from lp:maria/5.5.
2014-07-08 18:51:34 +03:00
Jan Lindström
d2098b964d MDEV-6318: MariaDB with XtraDB uses times more of IO events
than with InnoDB plugin

Fix: os0file.h in XtraDB had OS_AIO_N_PENDING_IOS_PER_THREAD 256
when on InnoDB it is OS_AIO_N_PENDING_IOS_PER_THREAD 32. Changed
XtraDB also to use 32.
2014-07-04 08:09:27 +03:00
Jan Lindström
43c851435f MDEV-6288: Innodb causes server crash after disk full,
then can't ALTER TABLE any more.

Fix for InnoDB storage engine.
2014-07-04 06:31:48 +03:00
Jan Lindström
6bd2f900b2 MDEV-6288: Innodb causes server crash after disk full, then can't
ALTER TABLE any more.
2014-07-03 14:55:03 +03:00
Arun Kuruvila
1177d3402d Bug #18463911 : SERVER CRASHES ON CREATING A TEMP TABLE
WITH CERTAIN MAX_HEAP_TABLE_SIZE VALUES

Description:
When the  system variable 'max_heap_table_size'
is set to 20GB, the server crashes on creation of a
temporary tables or tables using MEMORY storage engine.

Analysis:
The variable 'max_record' determines the amount heap
allocated for the records of the table. This value
is determined using the 'max_heap_table_size' variable.
'records_in_block' in turn uses the max_records to
determine the number of records per block.

When the 'max_heap_table_size' is set to 20GB, then
the 'records_in_block' is calculated to a value of
2^28.

The size of the block determined by multiplying the
'records_in_block' and 'recbuffer' results in overflow
and hence the value becomes zero. As a result, zero bytes
of the heap is allocated for the table. This will
result in a server crash when the table is accessed.

Fix:
The variables 'records_in_block' and 'recbuffer' are
typecasted to 'unsigned long' while calculating the
size of the block.
2014-06-25 11:42:41 +05:30
Gopal Shankar
119984db0c Bug#18776592 INNODB: FAILING ASSERTION: PRIMARY_KEY_NO == -1 ||
PRIMARY_KEY_NO == 0 

This bug is a backport of the following revision of 5.6 source tree:
# committer: Gopal Shankar <gopal.shankar@oracle.com>
# branch nick: priKey56
# timestamp: Wed 2013-05-29 11:11:46 +0530
# message:
#   Bug#16368875 INNODB: FAILING ASSERTION:
2014-06-25 09:50:17 +05:30
Olivier Bertrand
43752dbf49 - Fix a bug of MYSQL table type. When (REMOTE) indexed, local indexing was
wrongly used for UPDATE and DELETE.
modified:
  storage/connect/ha_connect.cc
  storage/connect/tabmysql.cpp
2014-06-21 16:02:50 +02:00
Jan Lindström
ebf3437810 MDEV-5673: Crash while parallel dropping multiple tables under heavy load
Improve long semaphore wait output to include all semaphore waits
and try to find out if there is a sequence of waiters.
2014-07-23 09:04:59 +03:00
Jan Lindström
67eb6f33a9 MDEV-5670: Assertion failure in file buf0lru.c line 2355
Add more status information if repeatable.
2014-07-22 22:08:06 +03:00
unknown
71a596b90c Makes innodb/xtradb compilable in 5.5 2014-07-15 12:37:34 +03:00
Jan Lindström
970163d0be MDEV-6348: mariadb crash signal 11
Analysis: sync array output function, should make sure that all 
used pointers are valid before using them.
2014-07-08 17:21:13 +03:00
Jan Lindström
8d8c456dbb MDEV-5621: Server random crash on ALTER TABLE
This is not a real fix, instead try to gather additional information
at the point when dictionary content is not what we expect it to be.
2014-07-04 12:25:32 +03:00
Jan Lindström
c922048368 MDEV-6191: row_search_for_mysql comment and code consistency about isolation level
and gap locks
2014-07-04 08:42:59 +03:00
Jan Lindström
838977e54d MDEV-6318: MariaDB with XtraDB uses times more of IO events
than with InnoDB plugin
  
  Fix: os0file.h in XtraDB had OS_AIO_N_PENDING_IOS_PER_THREAD 256
  when on InnoDB it is OS_AIO_N_PENDING_IOS_PER_THREAD 32. Changed
  XtraDB also to use 32.
2014-07-04 08:16:45 +03:00
Jan Lindström
6cc5e00586 MDEV-6225: Idle replication slave keeps crashing.
Analysis: Based on crashed the buffer pool instance identifier is
  not correct on block to be freed. Add LRU list mutex holding
  on functions calling free and add additional safety checks.
2014-06-30 14:06:28 +03:00
Sergei Golubchik
315a4efb91 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=751805 typo fixed
use ascii 'x' not utf8 '×' for hex numbers
2014-06-16 22:11:54 +02:00
Olivier Bertrand
70160c22f0 - Fix calculating the number of fields of CSV and FMT tables. Could be wrong
on UPDATE and INSERT if the table had special columns.
modified:
  storage/connect/tabfmt.cpp
2014-06-15 17:01:58 +02:00
Rich Prohaska
e8f1ef3975 #252 fix the MDEV-6324 fix 2014-06-13 14:46:38 -04:00
Rich Prohaska
4a993fc93f #252 fix the MDEV-6324 fix 2014-06-13 14:43:36 -04:00
Rich Prohaska
eb00a1221e #250 reset thd proc info in end_bulk_insert to fix invalid proc info pointer inside of a deleted ha_tokudb object 2014-06-13 12:06:05 -04:00
Rich Prohaska
814f0dd173 #250 reset thd proc info in end_bulk_insert to fix invalid proc info pointer inside of a deleted ha_tokudb object 2014-06-13 12:05:36 -04:00
Rich Prohaska
8a1406b4e3 #252 fix MDEV-6324 uninit var in discover3 2014-06-10 18:56:29 -04:00
Rich Prohaska
f16b3122ab #252 fix MDEV-6324 uninit var in discover3 2014-06-10 18:55:57 -04:00
Sergei Golubchik
55b010233a promote server_audit and sequence plugins to stable 2014-06-13 13:25:32 +02:00
unknown
bd4153a8c2 MDEV-5262, MDEV-5914, MDEV-5941, MDEV-6020: Deadlocks during parallel
replication causing replication to fail.

Remove the temporary fix for MDEV-5914, which used READ COMMITTED for parallel
replication worker threads. Replace it with a better, more selective solution.

The issue is with certain edge cases of InnoDB gap locks, for example between
INSERT and ranged DELETE. It is possible for the gap lock set by the DELETE to
block the INSERT, if the DELETE runs first, while the record lock set by
INSERT does not block the DELETE, if the INSERT runs first. This can cause a
conflict between the two in parallel replication on the slave even though they
ran without conflicts on the master.

With this patch, InnoDB will ask the server layer about the two involved
transactions before blocking on a gap lock. If the server layer tells InnoDB
that the transactions are already fixed wrt. commit order, as they are in
parallel replication, InnoDB will ignore the gap lock and allow the two
transactions to proceed in parallel, avoiding the conflict.

Improve the fix for MDEV-6020. When InnoDB itself detects a deadlock, it now
asks the server layer for any preferences about which transaction to roll
back. In case of parallel replication with two transactions T1 and T2 fixed to
commit T1 before T2, the server layer will ask InnoDB to roll back T2 as the
deadlock victim, not T1. This helps in some cases to avoid excessive deadlock
rollback, as T2 will in any case need to wait for T1 to complete before it can
itself commit.

Also some misc. fixes found during development and testing:

 - Remove thd_rpl_is_parallel(), it is not used or needed.

 - Use KILL_CONNECTION instead of KILL_QUERY when a parallel replication
   worker thread is killed to resolve a deadlock with fixed commit
   ordering. There are some cases, eg. in sql/sql_parse.cc, where a KILL_QUERY
   can be ignored if the query otherwise completed successfully, and this
   could cause the deadlock kill to be lost, so that the deadlock was not
   correctly resolved.

 - Fix random test failure due to missing wait_for_binlog_checkpoint.inc.

 - Make sure that deadlock or other temporary errors during parallel
   replication are not printed to the the error log; there were some places
   around the replication code with extra error logging. These conditions can
   occur occasionally and are handled automatically without breaking
   replication, so they should not pollute the error log.

 - Fix handling of rgi->gtid_sub_id. We need to be able to access this also at
   the end of a transaction, to be able to detect and resolve deadlocks due to
   commit ordering. But this value was also used as a flag to mark whether
   record_gtid() had been called, by being set to zero, losing the value. Now,
   introduce a separate flag rgi->gtid_pending, so rgi->gtid_sub_id remains
   valid for the entire duration of the transaction.

 - Fix one place where the code to handle ignored errors called reset_killed()
   unconditionally, even if no error was caught that should be ignored. This
   could cause loss of a deadlock kill signal, breaking deadlock detection and
   resolution.

 - Fix a couple of missing mysql_reset_thd_for_next_command(). This could
   cause a prior error condition to remain for the next event executed,
   causing assertions about errors already being set and possibly giving
   incorrect error handling for following event executions.

 - Fix code that cleared thd->rgi_slave in the parallel replication worker
   threads after each event execution; this caused the deadlock detection and
   handling code to not be able to correctly process the associated
   transactions as belonging to replication worker threads.

 - Remove useless error code in slave_background_kill_request().

 - Fix bug where wfc->wakeup_error was not cleared at
   wait_for_commit::unregister_wait_for_prior_commit(). This could cause the
   error condition to wrongly propagate to a later wait_for_prior_commit(),
   causing spurious ER_PRIOR_COMMIT_FAILED errors.

 - Do not put the binlog background thread into the processlist. It causes
   too many result differences in mtr, but also it probably is not useful
   for users to pollute the process list with a system thread that does not
   really perform any user-visible tasks...
2014-06-10 10:13:15 +02:00
Annamalai Gurusami
b5299f3559 Bug #18806829 OPENING INNODB TABLES WITH MANY FOREIGN KEY REFERENCES IS
SLOW/CRASHES SEMAPHORE

Problem:

There are 2 lakh tables - fk_000001, fk_000002 ... fk_200000.  All of them
are related to the same parent_table through a foreign key constraint.
When the parent_table is loaded into the dictionary cache, all the child table
will also be loaded.  This is taking lot of time.  Since this operation happens
when the dictionary latch is taken, the scenario leads to "long semaphore wait"
situation and the server gets killed.

Analysis:

A simple performance analysis showed that the slowness is because of the
dict_foreign_find() function.  It does a linear search on two linked list
table->foreign_list and table->referenced_list, looking for a particular
foreign key object based on foreign->id as the key.  This is called two
times for each foreign key object.

Solution:

Introduce a rb tree in table->foreign_rbt and table->referenced_rbt, which
are some sort of index on table->foreign_list and table->referenced_list
respectively, using foreign->id as the key.  These rbt structures will be
solely used by dict_foreign_find().  

rb#5599 approved by Vasil
2014-06-10 09:35:50 +05:30
Sergei Golubchik
dc9b2a95bf MDEV-6249 mark P_S STABLE and disable it by default 2014-06-09 20:00:23 +02:00
Sergey Vojtovich
0aef90d65e Merge spider fixes. 2014-06-09 22:11:24 +04:00
Kentoku SHIBA
69a7022d59 fix wrong result for Spider test 2014-06-10 02:50:33 +09:00
Kentoku SHIBA
de4441619c fix for Spider build error by abort_loop on windows 2014-06-10 02:25:58 +09:00
Sergei Golubchik
094b01d4f5 10.0-connect 2014-06-09 18:00:53 +02:00
Sergei Golubchik
e6a2d95ac9 MDEV-6320 - disable spider.spider_fixes 2014-06-09 16:36:27 +02:00
unknown
b1886e2bff merge of MDEV-6047 2014-06-09 13:47:20 +03:00
unknown
4cd676cbd9 MDEV-6047: Make exists_to_in optimization ON by default 2014-06-09 13:42:21 +03:00
Kentoku SHIBA
29cf8fb348 merge Spider 3.2.4 2014-06-08 19:52:11 +09:00
Sergey Petrunya
ee6f400fe1 MDEV-5976: TokuDB: Wrong query result using mrr=on
- Key_value_records_iterator::get_next() should pass pointer to the key 
  to handler->ha_index_next_same().  Because of a typo bug, pointer-to-pointer
  was passed instead in certain cases.
2014-06-06 21:28:42 +04:00
Sergei Golubchik
d8edb88cb1 revert tokudb changes that caused crashes 2014-06-06 00:09:17 +02:00
Sergei Golubchik
e27c338634 5.5.38 merge 2014-06-06 00:07:27 +02:00
Sergei Golubchik
59cea2e1bf MDEV-6258 MariaDB 10.0 performance schema timestamps relative to epoch
don't use the interval timer when absolute time values are needed
2014-06-05 09:03:55 +02:00
Rich Prohaska
280cac9fe1 #250 restore proc info to valid pointers in commit, abort, analyze, and optimize 2014-06-04 12:08:43 -04:00
Rich Prohaska
2f948975f6 #250 restore proc info to valid pointers in commit, abort, analyze, and optimize 2014-06-04 10:44:15 -04:00
Michael Widenius
414e8388bf Fixed compiler warnings
mysys/psi_noop.c:
  Fixed wrong prototype
sql/rpl_gtid.cc:
  Added #ifndef to hide not used variable
storage/connect/connect.cc:
  Added volatile to avoid compiler warning in gcc 4.8.1
storage/connect/filamvct.cpp:
  Added volatile to avoid compiler warning in gcc 4.8.1
storage/maria/ma_checkpoint.c:
  Removed cast to avoid compiler warning
storage/myisam/mi_delete_table.c:
  Added attribute to avoid compiler warning
storage/tokudb/ha_tokudb.cc:
  Use LINT_INIT_STRUCT to avoid compiler warnings
storage/tokudb/hatoku_hton.cc:
  Use LINT_INIT_STRUCT to avoid compiler warnings
storage/tokudb/tokudb_card.h:
  Use LINT_INIT_STRUCT to avoid compiler warnings
storage/tokudb/tokudb_status.h:
  Use LINT_INIT_STRUCT to avoid compiler warnings
2014-06-04 13:23:00 +03:00
Sergei Golubchik
67bf16a48b fix the code to compile without P_S 2014-06-04 09:14:38 +02:00
Sergey Vojtovich
23a5b2eb6d MDEV-6103 - Adding/removing non-materialized virtual column triggers
table recreation

Relaxed InnoDB/XtraDB checks to allow online add/drop of
non-materialized virtual columns.
2014-06-03 16:57:29 +04:00
Sergei Golubchik
2673910654 mark tokudb in 5.5 as MariaDB_PLUGIN_MATURITY_GAMMA, not MariaDB_PLUGIN_MATURITY_ALPHA. 2014-06-03 10:58:03 +02:00
Sergei Golubchik
77ec219d58 cmake: mark AIO_LIBRARY, EVENT_LIBRARY, GROFF, NROFF as advanced;
use -ggdb3 if supported
2014-06-03 10:57:57 +02:00
unknown
629b822913 MDEV-5262, MDEV-5914, MDEV-5941, MDEV-6020: Deadlocks during parallel
replication causing replication to fail.

In parallel replication, we run transactions from the master in parallel, but
force them to commit in the same order they did on the master. If we force T1
to commit before T2, but T2 holds eg. a row lock that is needed by T1, we get
a deadlock when T2 waits until T1 has committed.

Usually, we do not run T1 and T2 in parallel if there is a chance that they
can have conflicting locks like this, but there are certain edge cases where
it can occasionally happen (eg. MDEV-5914, MDEV-5941, MDEV-6020). The bug was
that this would cause replication to hang, eventually getting a lock timeout
and causing the slave to stop with error.

With this patch, InnoDB will report back to the upper layer whenever a
transactions T1 is about to do a lock wait on T2. If T1 and T2 are parallel
replication transactions, and T2 needs to commit later than T1, we can thus
detect the deadlock; we then kill T2, setting a flag that causes it to catch
the kill and convert it to a deadlock error; this error will then cause T2 to
roll back and release its locks (so that T1 can commit), and later T2 will be
re-tried and eventually also committed.

The kill happens asynchroneously in a slave background thread; this is
necessary, as the reporting from InnoDB about lock waits happen deep inside
the locking code, at a point where it is not possible to directly call
THD::awake() due to mutexes held.

Deadlock is assumed to be (very) rarely occuring, so this patch tries to
minimise the performance impact on the normal case where no deadlocks occur,
rather than optimise the handling of the occasional deadlock.

Also fix transaction retry due to deadlock when it happens after a transaction
already signalled to later transactions that it started to commit. In this
case we need to undo this signalling (and later redo it when we commit again
during retry), so following transactions will not start too early.

Also add a missing thd->send_kill_message() that got triggered during testing
(this corrects an incorrect fix for MySQL Bug#58933).
2014-06-03 10:31:11 +02:00
Sergei Golubchik
5d16592d44 mysql-5.5.38 merge 2014-06-03 09:55:08 +02:00
Sergei Golubchik
2d687cad5d merge with XtraDB 5.5.37-35.0 2014-06-03 09:53:10 +02:00
Rich Prohaska
768b7b41cb #225 fix tokudb store lock to fix lock tables crash 2014-06-01 16:57:53 -04:00
Rich Prohaska
39ef408165 #225 fix tokudb store lock to fix lock tables crash 2014-06-01 12:48:53 -04:00
Rich Prohaska
083764f033 #225 hot optimize for 5.6 and 10.0 using alter recreate 2014-06-01 07:50:32 -04:00
Rich Prohaska
454e974ce4 #225 hot optimize for 5.6 and 10.0 using alter recreate 2014-06-01 07:49:28 -04:00
Rich Prohaska
676c38a886 #245 use row estimate parameter to start_bulk_insert to decide if a loader is used 2014-05-31 12:16:56 -04:00