MariaDB server is a community developed fork of MySQL server. Started by core members of the original MySQL team, MariaDB actively works with outside developers to deliver the most featureful, stable, and sanely licensed open SQL server in the industry.
Find a file
istruewing@stella.local 0605274155 Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
corrupts a MERGE table
Bug 26867 - LOCK TABLES + REPAIR + merge table result in
            memory/cpu hogging
Bug 26377 - Deadlock with MERGE and FLUSH TABLE
Bug 25038 - Waiting TRUNCATE
Bug 25700 - merge base tables get corrupted by
            optimize/analyze/repair table
Bug 30275 - Merge tables: flush tables or unlock tables
            causes server to crash
Bug 19627 - temporary merge table locking
Bug 27660 - Falcon: merge table possible
Bug 30273 - merge tables: Can't lock file (errno: 155)

The problems were:

Bug 26379 - Combination of FLUSH TABLE and REPAIR TABLE
                corrupts a MERGE table

  1. A thread trying to lock a MERGE table performs busy waiting while
     REPAIR TABLE or a similar table administration task is ongoing on
     one or more of its MyISAM tables.
  
  2. A thread trying to lock a MERGE table performs busy waiting until all
     threads that did REPAIR TABLE or similar table administration tasks
     on one or more of its MyISAM tables in LOCK TABLES segments do UNLOCK
     TABLES. The difference against problem #1 is that the busy waiting
     takes place *after* the administration task. It is terminated by
     UNLOCK TABLES only.
  
  3. Two FLUSH TABLES within a LOCK TABLES segment can invalidate the
     lock. This does *not* require a MERGE table. The first FLUSH TABLES
     can be replaced by any statement that requires other threads to
     reopen the table. In 5.0 and 5.1 a single FLUSH TABLES can provoke
     the problem.

Bug 26867 - LOCK TABLES + REPAIR + merge table result in
            memory/cpu hogging

  Trying DML on a MERGE table, which has a child locked and
  repaired by another thread, made an infinite loop in the server.

Bug 26377 - Deadlock with MERGE and FLUSH TABLE

  Locking a MERGE table and its children in parent-child order
  and flushing the child deadlocked the server.

Bug 25038 - Waiting TRUNCATE

  Truncating a MERGE child, while the MERGE table was in use,
  let the truncate fail instead of waiting for the table to
  become free.

Bug 25700 - merge base tables get corrupted by
            optimize/analyze/repair table

  Repairing a child of an open MERGE table corrupted the child.
  It was necessary to FLUSH the child first.

Bug 30275 - Merge tables: flush tables or unlock tables
            causes server to crash

  Flushing and optimizing locked MERGE children crashed the server.

Bug 19627 - temporary merge table locking

  Use of a temporary MERGE table with non-temporary children
  could corrupt the children.

  Temporary tables are never locked. So we do now prohibit
  non-temporary chidlren of a temporary MERGE table.

Bug 27660 - Falcon: merge table possible

  It was possible to create a MERGE table with non-MyISAM children.

Bug 30273 - merge tables: Can't lock file (errno: 155)

  This was a Windows-only bug. Table administration statements
  sometimes failed with "Can't lock file (errno: 155)".

These bugs are fixed by a new implementation of MERGE table open.

When opening a MERGE table in open_tables() we do now add the
child tables to the list of tables to be opened by open_tables()
(the "query_list"). The children are not opened in the handler at
this stage.

After opening the parent, open_tables() opens each child from the
now extended query_list. When the last child is opened, we remove
the children from the query_list again and attach the children to
the parent. This behaves similar to the old open. However it does
not open the MyISAM tables directly, but grabs them from the already
open children.

When closing a MERGE table in close_thread_table() we detach the
children only. Closing of the children is done implicitly because
they are in thd->open_tables.

For more detail see the comment at the top of ha_myisammrg.cc.

Changed from open_ltable() to open_and_lock_tables() in all places
that can be relevant for MERGE tables. The latter can handle tables
added to the list on the fly. When open_ltable() was used in a loop
over a list of tables, the list must be temporarily terminated
after every table for open_and_lock_tables().
table_list->required_type is set to FRMTYPE_TABLE to avoid open of
special tables. Handling of derived tables is suppressed.
These details are handled by the new function
open_n_lock_single_table(), which has nearly the same signature as
open_ltable() and can replace it in most cases.

In reopen_tables() some of the tables open by a thread can be
closed and reopened. When a MERGE child is affected, the parent
must be closed and reopened too. Closing of the parent is forced
before the first child is closed. Reopen happens in the order of
thd->open_tables. MERGE parents do not attach their children
automatically at open. This is done after all tables are reopened.
So all children are open when attaching them.

Special lock handling like mysql_lock_abort() or mysql_lock_remove()
needs to be suppressed for MERGE children or forwarded to the parent.
This depends on the situation. In loops over all open tables one
suppresses child lock handling. When a single table is touched,
forwarding is done.

Behavioral changes:
===================

This patch changes the behavior of temporary MERGE tables.
Temporary MERGE must have temporary children.
The old behavior was wrong. A temporary table is not locked. Hence
even non-temporary children were not locked. See
Bug 19627 - temporary merge table locking.

You cannot change the union list of a non-temporary MERGE table
when LOCK TABLES is in effect. The following does *not* work:
CREATE TABLE m1 ... ENGINE=MRG_MYISAM ...;
LOCK TABLES t1 WRITE, t2 WRITE, m1 WRITE;
ALTER TABLE m1 ... UNION=(t1,t2) ...;
However, you can do this with a temporary MERGE table.

You cannot create a MERGE table with CREATE ... SELECT, neither
as a temporary MERGE table, nor as a non-temporary MERGE table.
CREATE TABLE m1 ... ENGINE=MRG_MYISAM ... SELECT ...;
Gives error message: table is not BASE TABLE.
2007-11-15 20:25:43 +01:00
BitKeeper Merge pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.0-build-work 2007-10-30 15:24:17 +01:00
BUILD autorun.sh: 2007-10-29 22:48:58 +01:00
client Merge mysql.com:/home/gluh/MySQL/Merge/5.1 2007-10-23 19:08:21 +05:00
cmd-line-utils Merge mysql.com:/home/kent/bk/bug24809/mysql-5.0-build 2007-10-31 10:52:18 +01:00
config/ac-macros Bug#30296 2007-10-25 21:19:28 -07:00
dbug Bug #27099: system_mysql fail in pushbuild windows 2007-10-15 19:56:24 +03:00
Docs Merge mysql.com:/home/kent/bk/tmp/mysql-5.0-build 2007-03-22 19:44:14 +01:00
extra Merge ramayana.hindu.god:/home/tsmith/m/bk/51 2007-10-10 14:15:09 -06:00
include Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE 2007-11-15 20:25:43 +01:00
libmysql Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime 2007-10-31 17:30:46 +03:00
libmysql_r Makefile.am: 2007-09-26 19:41:46 +02:00
libmysqld Merge bk-internal.mysql.com:/home/bk/mysql-5.1-engines 2007-11-13 10:33:50 +01:00
man my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
mysql-test Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE 2007-11-15 20:25:43 +01:00
mysys Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE 2007-11-15 20:25:43 +01:00
netware Minor Makefile fixes: 2007-10-30 20:06:49 +01:00
plugin Makefile.am: 2007-09-26 18:47:55 +02:00
pstack Makefile.am, configure.in: 2007-09-27 21:39:23 +02:00
regex Merge bk-internal.mysql.com:/home/bk/mysql-5.1-marvel 2007-08-16 18:21:47 +02:00
scripts Merge trift2.:/MySQL/M51/mysql-5.1 2007-10-29 12:56:48 +01:00
server-tools WL#4104: Deprecate the Instance Manager. 2007-10-22 23:02:05 +04:00
sql Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE 2007-11-15 20:25:43 +01:00
sql-bench Fixed compiler warnings 2007-02-23 13:13:55 +02:00
sql-common BUG#29083 - test suite times out on OS X 64bit - also in older releases 2007-11-09 16:05:01 +04:00
storage Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE 2007-11-15 20:25:43 +01:00
strings Merge mysql.com:/home/gluh/MySQL/Merge/5.1 2007-10-23 19:08:21 +05:00
support-files Removing 7 year old 3.23 crufty debian dir that is not in use, so as not to cause confusion. 2007-10-12 13:07:39 -07:00
tests Post merge fix for bug 31669. 2007-10-31 13:54:53 -02:00
unittest Fixes Bug#30127: --debug-info no longer prints memory usage in mysql 2007-08-01 22:59:05 +03:00
vio Merge pilot.(none):/data/msvensson/mysql/mysql-5.0-maint 2007-08-28 11:36:10 +02:00
win Merge ramayana.hindu.god:/home/tsmith/m/bk/51 2007-09-28 10:55:28 -06:00
zlib CMakeLists.txt, README, configure.js 2007-08-03 21:51:37 +02:00
.bzrignore disable tests 2007-11-01 12:02:41 +01:00
.cvsignore Import changeset 2000-07-31 21:29:14 +02:00
CMakeLists.txt Merge alf.(none):/src/bug31289/my50-bug31289 2007-10-08 13:01:06 -04:00
configure.in Merge stella.local:/home2/mydev/mysql-5.1-amain 2007-11-02 10:53:20 +01:00
COPYING - manual.texi will be replaced with a manual written in DocBook/XML. This ChangeSet removes all 2005-04-13 11:51:38 +02:00
EXCEPTIONS-CLIENT EXCEPTIONS-CLIENT: 2007-03-14 18:28:16 +01:00
Makefile.am Minor Makefile fixes: 2007-10-30 20:06:49 +01:00
README make_binary_distribution.sh: 2006-11-07 22:26:37 +01:00

This is a release of MySQL, a dual-license SQL database server.
MySQL is brought to you by the MySQL team at MySQL AB.

License information can be found in these files:
- For GPL (free) distributions, see the COPYING file and
  the EXCEPTIONS-CLIENT file.
- For commercial distributions, see the LICENSE.mysql file.


For further information about MySQL or additional documentation, see:
- The latest information about MySQL: http://www.mysql.com
- The current MySQL documentation: http://dev.mysql.com/doc

Some manual sections of special interest:

- If you are migrating from an older version of MySQL, please read the
  "Upgrading from..." section first!
- To see what MySQL can do, take a look at the features section.
- For installation instructions, see the Installing and Upgrading chapter.
- For the new features/bugfix history, see the Change History appendix.
- For the currently known bugs/misfeatures (known errors) see the Problems
  and Common Errors appendix.
- For a list of developers and other contributors, see the Credits
  appendix.

A local copy of the MySQL Reference Manual can be found in the Docs
directory in GNU Info format.  You can also browse the manual online or
download it in any of several formats at the URL given earlier in this
file.

************************************************************

IMPORTANT:

Bug or error reports should be sent to http://bugs.mysql.com.