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.
  • MariaDB\ 71.8%
  • C++ 16.4%
  • C 10.4%
  • Shell 0.5%
  • Perl 0.4%
  • Other 0.3%
Find a file
unknown e5a397e28f Bug#32395 Alter table under a impending global read lock causes a server crash
The problem is that some DDL statements (ALTER TABLE, CREATE
TRIGGER, FLUSH TABLES, ...) when under LOCK TABLES need to
momentarily drop the lock, reopen the table and grab the write
lock again (using reopen_tables). When grabbing the lock again,
reopen_tables doesn't pass a flag to mysql_lock_tables in
order to ignore the impending global read lock, which causes a
assertion because LOCK_open is being hold. Also dropping the
lock must not signal to any threads that the table has been
relinquished (related to the locking/flushing protocol).

The solution is to correct the way the table is reopenned
and the locks grabbed. When reopening the table and under
LOCK TABLES, the table version should be set to 0 so other
threads have to wait for the table. When grabbing the lock,
any other flush should be ignored because it's theoretically
a atomic operation. The chosen solution also fixes a potential
discrepancy between binlog and GRL (global read lock) because
table placeholders were being ignored, now a FLUSH TABLES WITH
READ LOCK will properly for table with open placeholders.

It's also important to mention that this patch doesn't fix
a potential deadlock if one uses two GRLs under LOCK TABLES
concurrently.


mysql-test/r/lock_multi.result:
  Add test case result for Bug#32395
mysql-test/r/trigger_notembedded.result:
  Add test case result for Bug#32395
mysql-test/t/lock_multi.test:
  Add test case for Bug#32395
mysql-test/t/trigger_notembedded.test:
  Enable test case for Bug#32395
sql/ha_ndbcluster.cc:
  Update close_cached_tables usage.
sql/ha_ndbcluster_binlog.cc:
  Update close_cached_tables usage.
sql/mysql_priv.h:
  Update close_cache_tables prototype.
sql/set_var.cc:
  Update close_cached_tables usage and set flag to wait for
  tables with placeholders. This is one of the places where
  a GRL can be obtained.
sql/sql_base.cc:
  Preserve old version for write locked tables and ignore
  pending flushes and update close_cache_tables to take
  into account name locked tables.
sql/sql_parse.cc:
  Update close_cached_tables usage and pass flag so that
  name locked tables are waited for.
sql/sql_table.cc:
  Protect the table against a impending GRL if under LOCK TABLES.
2007-12-12 19:44:14 -02:00
BitKeeper Merge pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.0-build 2007-10-25 13:31:31 +02:00
BUILD autorun.sh: 2007-10-29 22:48:58 +01:00
client Bug#25146 Some warnings/errors not shown when using --show-warnings 2007-11-26 19:50:43 +01:00
cmd-line-utils Merge pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.0-build-work-18431 2007-11-19 14:55:15 +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/bug25205/mysql-5.0-build 2007-11-02 13:17:07 +01:00
extra Merge ramayana.hindu.god:/home/tsmith/m/bk/51 2007-10-10 14:15:09 -06:00
include Merge lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.1-base 2007-11-28 07:42:36 -07:00
libmysql Merge mysql.com:/Users/davi/mysql/bugs/29592-5.0 2007-11-26 16:10:26 -02:00
libmysql_r Makefile.am: 2007-09-26 19:41:46 +02:00
libmysqld Merge mysql.com:/Users/davi/mysql/bugs/29592-5.0 2007-11-26 16:10:26 -02:00
man my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
mysql-test Bug#32395 Alter table under a impending global read lock causes a server crash 2007-12-12 19:44:14 -02:00
mysys Merge stella.local:/home2/mydev/mysql-5.1-bug26379-8 2007-11-25 18:14:55 +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 Remove the --source-install option and instead make use of --srcdir 2007-11-08 13:43:40 +01:00
server-tools WL#4104: Deprecate the Instance Manager. 2007-10-22 23:02:05 +04:00
sql Bug#32395 Alter table under a impending global read lock causes a server crash 2007-12-12 19:44:14 -02:00
sql-bench Fixed compiler warnings 2007-02-23 13:13:55 +02:00
sql-common Merge lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.0-runtime 2007-11-28 09:08:31 -07:00
storage Merge stella.local:/home2/mydev/mysql-5.0-axmrg 2007-11-26 15:38:29 +01:00
strings Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.1 2007-11-21 21:15:33 +01:00
support-files Merge pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.0-build 2007-11-21 19:42:50 +01:00
tests Merge mysql.com:/home/gluh/MySQL/Merge/5.1 2007-11-14 17:30:16 +04: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 Merge mysql.com:/home/hf/work/31305/my50-31305 2007-11-12 13:07:30 +04:00
.cvsignore Import changeset 2000-07-31 21:29:14 +02:00
CMakeLists.txt Merge alf.(none):/src/bug31319/my50-bug31319 2007-11-02 15:17:37 -04:00
configure.in Raise version number after cloning 5.0.52 2007-11-20 11:26:16 +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
INSTALL-SOURCE Makefile.am: 2007-11-02 12:59:45 +01:00
INSTALL-WIN-SOURCE Makefile.am: 2007-11-02 12:59:45 +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.