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
unknown 0936976e8d A fix and a test case for Bug#24918 drop table and lock / inconsistent
between perm and temp tables. Review fixes.

The original bug report complains that if we locked a temporary table
with LOCK TABLES statement, we would not leave LOCK TABLES mode
when this temporary table is dropped.

Additionally, the bug was escalated when it was discovered than
when a temporary transactional table that was previously
locked with LOCK TABLES statement was dropped, futher actions with
this table, such as UNLOCK TABLES, would lead to a crash.

The problem originates from incomplete support of transactional temporary
tables. When we added calls to handler::store_lock()/handler::external_lock()
to operations that work with such tables, we only covered the normal
server code flow and did not cover LOCK TABLES mode. 
In LOCK TABLES mode, ::external_lock(LOCK) would sometimes be called without
matching ::external_lock(UNLOCK), e.g. when a transactional temporary table
was dropped. Additionally, this table would be left in the list of LOCKed 
TABLES.

The patch aims to address this inadequacy. Now, whenever an instance
of 'handler' is destroyed, we assert that it was priorly
external_lock(UNLOCK)-ed. All the places that violate this assert
were fixed.

This patch introduces no changes in behavior -- the discrepancy in
behavior will be fixed when we start calling ::store_lock()/::external_lock()
for all tables, regardless whether they are transactional or not, 
temporary or not.


mysql-test/r/innodb_mysql.result:
  Update test results (Bug#24918)
mysql-test/t/innodb_mysql.test:
  Add a test case for Bug#24918
sql/handler.h:
  Make handler::external_lock() a protected method. Backport from 5.1 its
  public wrapper handler::ha_external_lock().
  Assert that the handler is not closed if it is still locked.
sql/lock.cc:
  In mysql_lock_tables only call lock_external() for the list of tables that
  we called store_lock() for. 
  E.g. get_lock_data() does not add non-transactional temporary tables to the
  lock list, so lock_external() should not be called for them.
  
  Use handler::ha_external_lock() instead of handler::external_lock().
  
  Add comments for mysql_lock_remove(), parameterize one strange
  side effect that it has. At least in one place where mysql_lock_remove
  is used, this side effect is not desired (DROP TABLE). The parameter
  will be dropped in 5.1, along with the side effect.
sql/mysql_priv.h:
  Update declaration of mysql_lock_remove().
sql/opt_range.cc:
  Deploy handler::ha_external_lock() instead of handler::external_lock()
sql/sql_base.cc:
  When closing a temporary table, remove the table from the list of LOCKed 
  TABLES of this thread, in case it's there. 
  It's there if it is a transactional temporary table.
  Use a new declaration of mysql_lock_remove().
sql/sql_class.h:
  Extend the comment for THD::temporary_tables.
sql/sql_table.cc:
  Deploy handler::ha_external_lock() instead of handler::external_lock()
2007-07-27 16:37:29 +04:00
bdb
BitKeeper
BUILD Bug #29543 GCov information not written in case of crash. 2007-07-07 07:46:17 +02:00
client Patch inspired by BUG#10491: Server returns data as charset 2007-07-25 19:46:50 +04:00
cmd-line-utils
config/ac-macros
dbug
debian
Docs
extra Minor fixes for test failures and compiler warnings for Bug #29579. 2007-07-13 00:45:54 -04:00
heap
include Merge kboortz@bk-internal.mysql.com:/home/bk/mysql-5.0 2007-07-21 01:53:19 +02:00
innobase NULL MERGE UP to 5.1. 2007-07-10 08:16:51 -06:00
libmysql Bug #29687 mysql_stmt_store_result memory leak in libmysqld 2007-07-16 19:08:07 +05:00
libmysql_r
libmysqld
man
myisam fixed uninitialized variable introduced by the fix for bug 29325 2007-07-11 12:37:47 +03:00
myisammrg
mysql-test A fix and a test case for Bug#24918 drop table and lock / inconsistent 2007-07-27 16:37:29 +04:00
mysys Merge kboortz@bk-internal.mysql.com:/home/bk/mysql-5.0 2007-07-21 01:53:19 +02:00
ndb Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0-ndb-bj 2007-07-13 15:53:58 +02:00
netware
os2 Avoid the name conflict between the system-provided "md5.h" and the MySQL one 2007-07-19 14:14:03 +02:00
pstack
regex
scripts Merge pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.0.46 2007-07-20 09:20:48 +02:00
server-tools
sql A fix and a test case for Bug#24918 drop table and lock / inconsistent 2007-07-27 16:37:29 +04:00
sql-bench
sql-common
SSL
strings Merge olga.mysql.com:/home/igor/mysql-5.0-rpl 2007-07-13 19:05:30 -07:00
support-files Handle "support-files/mysqld_multi.server.sh" like other shell scripts. 2007-07-17 19:27:31 +02:00
tests
tools Avoid the name conflict between the system-provided "md5.h" and the MySQL one 2007-07-19 14:14:03 +02:00
VC++Files
vio Bug #29579 Clients using SSL can hang the server 2007-07-12 22:06:33 -04:00
win CMakeLists.txt, configure.js: 2007-07-18 15:42:36 +02:00
zlib
.bzrignore
.cvsignore
CMakeLists.txt BUG#20815 Errno 12 on Windows after 197 connections 2007-07-19 23:06:34 +02:00
configure.in Merge pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.0.44 2007-07-19 23:30:26 +02:00
COPYING
EXCEPTIONS-CLIENT
Makefile.am
README

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.