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 992aceaf71 Fix for bug#19403/12212 "Crash that happens during removing of database name
from cache" and #21216 "Simultaneous DROP TABLE and SHOW OPEN TABLES causes
server to crash".

Crash happened when one ran DROP DATABASE or SHOW OPEN TABLES statements
while concurrently doing DROP TABLE (or RENAME TABLE, CREATE TABLE LIKE
or any other command that takes name-lock) in other connection.

This problem was caused by the fact that table placeholders which were
added to table cache in order to obtain name-lock on table had
TABLE_SHARE::db and table_name set to 0. Therefore they broke assumption
that these members are non-0 for all tables in table cache on which some
of our code relies.

The fix sets these members for such placeholders to appropriate value making
this assumption true again. As attempt to avoid such problems in future
we introduce auxiliary TABLE_SHARE::set_table_cache_key() methods which
should be used when one wants to set TABLE_SHARE::table_cache_key and which
ensure that TABLE_SHARE::table_name/db are set properly.

Test cases for these bugs were added to 5.0 test-suite (with 5.0-specific
fix for bug #21216).


sql/lock.cc:
  Our code assumes that TABLE_SHARE::table_name/db for objects in table cache
  is set properly (and is non-NULL). For example look in list_open_tables()
  and remove_db_from_cache(). This was not true for table placeholders that
  were added to table cache for name-locking. Changed lock_table_name() to
  preserve this assumption (now it uses TABLE_SHARE::set_table_cache_key()
  to set all three table_cache_key/db/table_name members at once).
  Also now we use my_multi_malloc() to allocate memory for TABLE and
  TABLE_SHARE objects instead of using my_malloc() + summing sizes as
  it automatically provides proper alignment for memory allocated.
sql/sql_base.cc:
  Now we use TABLE_SHARE::set_table_cache_key() auxiliary methods to set
  TABLE_SHARE::table_cache_key/db/table_name members at once.
  We also use multi_alloc_root() instead of alloc_root() for allocating
  memory for several objects as it is less error prone.
  Finally, we also got rid of unused code in reopen_name_locked_table().
sql/sql_select.cc:
  Got rid of redundant code. TABLE_SHARE::db/table_cache_key are both set to
  empty string by the call to init_tmp_table_share() routine.
sql/table.cc:
  Now alloc_table_share() uses auxiliary TABLE_SHARE::set_table_cache_key()
  method to properly set TABLE_SHARE::table_cache_key/db/table_name members.
  Also now we use multi_alloc_root() instead of alloc_root() for allocating
  memory for several objects as it is more clear/less error-prone.
sql/table.h:
  Added comment about importance of apropriate setting of
  TABLE_SHARE::table_name/db/table_cache_key for tables in table cache.
  Introduced two auxiliary TABLE_SHARE::set_table_cache_key() methods which
  allow to set these three members at once.
2006-08-21 19:02:11 +04:00
BitKeeper Merge moonlight.intranet:/home/tomash/src/mysql_ab/tmp_merge 2006-08-10 16:11:55 +04:00
BUILD Merge bk-internal.mysql.com:/home/bk/mysql-5.1 2006-06-28 20:03:46 +03:00
client Manual merge 5.0->5.1. Post-merge fixes. 2006-08-14 13:27:11 +04:00
cmd-line-utils Merge neptunus.(none):/home/msvensson/mysql/bug16557/my50-bug16557 2006-02-21 08:58:19 +01:00
config/ac-macros compile-time definition of intptr type 2006-08-01 14:02:19 +02:00
dbug Windows build fix: declare _db_set_ before it's used. 2006-08-14 16:15:08 +04:00
Docs Remove old cruft from the tree: mysqltestmanager, mysql_test_run_new, 2006-04-11 18:54:24 -07:00
extra Merge bodhi.local:/opt/local/work/tmp_merge 2006-08-12 21:06:51 +04:00
include Merge bodhi.local:/opt/local/work/tmp_merge 2006-08-12 21:06:51 +04:00
libmysql Merge bodhi.local:/opt/local/work/tmp_merge 2006-08-12 21:06:51 +04:00
libmysql_r Re-apply missing changeset, orignally pushed by elliot 2006-06-06 14:21:07 +03:00
libmysqld Merge govinda.patg.net:/home/patg/mysql-build/mysql-5.0-holyfoot 2006-08-08 09:01:32 -07:00
man Makefile.am, configure.in: 2006-07-28 23:12:40 +02:00
mysql-test Merge mockturtle.local:/home/dlenev/src/mysql-5.0-bg21216-2 2006-08-21 12:28:35 +04:00
mysys Merge moonlight.intranet:/home/tomash/src/mysql_ab/tmp_merge 2006-08-10 16:11:55 +04:00
netware Merge mysql.com:/Users/kent/mysql/bk/mysql-4.0 2006-07-24 10:59:51 +02:00
plugin Remove compiler warnings 2006-06-23 02:49:19 +03:00
pstack Makefile.am, configure.in: 2005-09-24 15:51:45 +02:00
regex Merge mysql.com:/home/emurphy/src/bk-clean/tmp_merge 2006-06-23 17:27:54 -04:00
scripts scripts/make_binary_distribution.sh : Drop the "max" server from 5.1 packages. 2006-08-14 19:56:41 +02:00
server-tools Merge moonlight.intranet:/home/tomash/src/mysql_ab/tmp_merge 2006-08-09 13:37:20 +04:00
sql Fix for bug#19403/12212 "Crash that happens during removing of database name 2006-08-21 19:02:11 +04:00
sql-common Merge bodhi.local:/opt/local/work/tmp_merge 2006-08-12 21:06:51 +04:00
storage Merge bk-internal.mysql.com:/home/bk/mysql-5.1 2006-08-14 16:30:57 +04:00
strings Merge govinda.patg.net:/home/patg/mysql-build/mysql-5.0-holyfoot 2006-08-08 09:01:32 -07:00
support-files Merge moonlight.intranet:/home/tomash/src/mysql_ab/tmp_merge 2006-08-09 13:37:20 +04:00
tests Merge bodhi.local:/opt/local/work/tmp_merge 2006-08-12 21:06:51 +04:00
unittest Changed the number of test iterations since this makes test time 2006-06-30 11:31:43 +02:00
vio Re-apply missing changeset, orignally pushed by elliot 2006-06-06 14:21:07 +03:00
win Fixing false alarm errors on windows build from a clean clone. 2006-06-15 22:46:52 -04:00
zlib Rename cmakelists.txt -> CMakeLists.txt 2006-05-12 10:51:07 +02:00
.bzrignore Merge bodhi.local:/opt/local/work/tmp_merge 2006-08-12 21:06:51 +04:00
.cvsignore Import changeset 2000-07-31 21:29:14 +02:00
CMakeLists.txt performing a set of bk mv on each CMakeLists.txt file to try and restore the mixed case filenames since this seems to be required with Cmake 2.4 beta 1. 2006-05-11 11:29:08 -05:00
configure.in Merge bodhi.local:/opt/local/work/tmp_merge 2006-08-12 21:06:51 +04: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
Makefile.am change test targets to be more modular. include unit tests into make test 2006-06-14 09:12:37 +02:00
README README: 2006-04-01 04:13:33 +02: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.
- For commercial distributions, see the MySQLEULA.txt 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 Installation chapter.
- For future plans, see the TODO appendix.
- For the new features/bugfix history, see the News appendix.
- For the currently known bugs/misfeatures (known errors) see the problems
  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.