Commit graph

10 commits

Author SHA1 Message Date
davi@endora.local
94e6e4ff44 Bug#31397 Inconsistent drop table behavior of handler tables.
The problem is that DROP TABLE and other DDL statements failed to
automatically close handlers associated with tables that were marked
for reopen (FLUSH TABLES).

The current implementation fails to properly discard handlers of
dropped tables (that were marked for reopen) because it searches
on the open handler tables list and using the current alias of the
table being dropped. The problem is that it must not use the open
handler tables list to search because the table might have been
closed (marked for reopen) by a flush tables command and also it
must not use the current table alias at all since multiple different
aliases may be associated with a single table. This is specially
visible when a user has two open handlers (using alias) of a same
table and a flush tables command is issued before the table is
dropped (see test case). Scanning the handler table list is also
useless for dropping handlers associated with temporary tables,
because temporary tables are not kept in the THD::handler_tables
list.

The solution is to simple scan the handlers hash table searching
for, and deleting all handlers with matching table names if the
reopen flag is not passed to the flush function, indicating that
the handlers should be deleted. All matching handlers are deleted
even if the associated the table is not open.
2007-11-20 15:17:53 -02:00
davi@endora.local
cc007acb78 Bug#30882 Dropping a temporary table inside a stored function may cause a server crash
If a stored function that contains a drop temporary table statement
is invoked by a create temporary table of the same name may cause
a server crash. The problem is that when dropping a table no check
is done to ensure that table is not being used by some outer query
(or outer statement), potentially leaving the outer query with a
reference to a stale (freed) table.

The solution is when dropping a temporary table, always check if
the table is being used by some outer statement as a temporary
table can be dropped inside stored procedures.

The check is performed by looking at the TABLE::query_id value for
temporary tables. To simplify this check and to solve a bug related
to handling of temporary tables in prelocked mode, this patch changes
the way in which this member is used to track the fact that table is
used/unused. Now we ensure that TABLE::query_id is zero for unused
temporary tables (which means that all temporary tables which were
used by a statement should be marked as free for reuse after it's
execution has been completed).
2007-11-01 18:52:56 -02:00
davi@moksha.com.br
4515ccf7c0 Post-merge test case for Bug 31409 2007-10-10 21:39:22 -03:00
davi@moksha.com.br
ae462f3e77 Post-merge test case for Bug 21587 2007-10-10 19:06:53 -03:00
davi@moksha.local
a2a5104de7 Post-merge fixes for Bug#30632 2007-08-29 19:00:49 -03:00
davi@moksha.local
68047f7f88 Merge moksha.local:/Users/davi/mysql/push/bugs/old/30632-5.0
into  moksha.local:/Users/davi/mysql/push/bugs/30632-5.1
2007-08-29 18:32:19 -03:00
malff/marcsql@weblab.(none)
a01da34f72 Merge weblab.(none):/home/marcsql/TREE/mysql-5.0-runtime
into  weblab.(none):/home/marcsql/TREE/mysql-5.1-rt50-merge
2007-08-20 16:13:54 -06:00
msvensson@neptunus.(none)
8929b7a03b Merge neptunus.(none):/home/msvensson/mysql/same_tools/my50-same_tools
into  neptunus.(none):/home/msvensson/mysql/same_tools/my51-same_tools
2006-10-04 16:35:40 +02:00
mleich@three.local.lan
1a8c9130db This changeset belongs to
WL#3397 Refactoring storage engine test cases (for falcon)
      It contains fixes according to second code review.
- Remove any occurence of hardcoded assignments of storage engines
- Use variable names exact telling what it is used for
- Updated comments
- remove trailing spaces
2006-08-16 19:29:49 +02:00
mleich@three.local.lan
aaa9ed3eff This changeset belongs to
WL#3397 Refactoring storage engine test cases (for falcon)
    It contains also fixes according to code review.
    Contents: Testcases which were in history dedicated to InnoDB or MyISAM only.
    Modifications:
    1. Shift the main testing code into include/<testing field>.inc
       Introduce $variables which can be used to omit tests for features which are not supported by
       certain storage engines.
    2. The storage engine to be tested is assigned within the toplevel script (t/<whatever>_<engine>.test)
       via variable $engine_type and the the main testing code is sourced from 
       include/<testing field>.inc
    3. Some toplevel testscripts have to be renamed to
       - avoid immediate or future namespace clashes
       - show via filename which storage engine is tested
    4. Minor code cleanup like remove trailing spaces, some additional comments ....
2006-08-16 14:58:49 +02:00