Commit graph

14 commits

Author SHA1 Message Date
Matthias Leich
21f878e724 Fix for Bug#42308 Several server tests do not pass MTR's --check option
Details:
Most tests mentioned within the bug report were already fixed.
The test modified here failed in stability (high parallel load) tests.

Details:
1. Take care that disconnects are finished before the test terminates.
2. Correct wrong handling of send/reap in events_stress which caused
   random garbled output
3. Minor beautifying of script code
2009-05-15 12:15:56 +02:00
Sergey Glukhov
bf2e29d374 5.0-bugteam->5.1-bugteam merge 2009-04-17 13:46:27 +05:00
Davi Arnaut
da3c4375cf Clean up test case to not leave open connections.
mysql-test/include/handler.inc:
  Disconnect open connections once they are not being used.
2009-02-25 11:42:58 +01:00
Davi Arnaut
e4f4765391 Bug#41110: crash with handler command when used concurrently with alter table
Bug#41112: crash in mysql_ha_close_table/get_lock_data with alter table

The problem is that the server wasn't handling robustly failures
to re-open a table during a HANDLER .. READ statement. If the
table needed to be re-opened due to it's storage engine being
altered to one that doesn't support HANDLER, a reference (dangling
pointer) to a closed table could be left in place and accessed in
later attempts to fetch from the table using the handler. Also,
if the server failed to set a error message if the re-open
failed. These problems could lead to server crashes or hangs.

The solution is to remove any references to a closed table and
to set a error if reopening a table during a HANDLER .. READ
statement fails.

mysql-test/include/handler.inc:
  Add test case for Bug#41110 and Bug#41112
mysql-test/r/handler_innodb.result:
  Add test case result for Bug#41110 and Bug#41112
mysql-test/r/handler_myisam.result:
  Add test case result for Bug#41110 and Bug#41112
sql/sql_handler.cc:
  Remove redundant reopen check.
  Set errors even if reopening table.
  Reset TABLE_LIST::table reference when the table is closed.
2009-02-24 10:49:18 +01:00
unknown
4d6543a6f0 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.


mysql-test/include/handler.inc:
  Add test case for Bug#31397
mysql-test/r/handler_innodb.result:
  Add test case result for Bug#31397
mysql-test/r/handler_myisam.result:
  Add test case result for Bug#31397
sql/mysql_priv.h:
  Rename flush functions to better match the intent of the caller and
  update functions prototypes and remove unused flags.
sql/sql_base.cc:
  Rename flush functions to better match the intent of the caller.
sql/sql_class.cc:
  Rename the flush functions to better match the intent of the caller.
  The hash_free function is moved to the cleanup.
sql/sql_handler.cc:
  When dropping tables for a final close, scan the handler's hash table since
  the table might not be in the handlers open table list because the table was
  marked for reopen or because it's a temporary table.
sql/sql_rename.cc:
  Drop handlers associated with tables that are being renamed.
sql/sql_table.cc:
  Now that temporary tables are properly removed even when opened
  by a SQL HANDLER, enable the assert since this branch can't be taken
  outside of SF/trigger/prelocked mode.
2007-11-20 15:17:53 -02:00
unknown
611dbd0bb3 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).


mysql-test/include/handler.inc:
  Add test case for side effect of Bug#30882
mysql-test/r/handler_innodb.result:
  Add test case result for side effect of Bug#30882
mysql-test/r/handler_myisam.result:
  Add test case result for side effect of Bug#30882
mysql-test/r/sp-error.result:
  Add test case result for Bug#30882
mysql-test/t/sp-error.test:
  Add test case for Bug#30882
sql/event_db_repository.cc:
  Update close_thread_tables call, no more default values.
sql/mysql_priv.h:
  Remove implicit default parameters values of the close_thread_tables
  function as no callers are using it.
sql/slave.cc:
  Update close_thread_tables call, no more default values
sql/sp_head.cc:
  Update close_thread_tables call, no more default values
sql/sql_base.cc:
  Changed the approach to distinguishing currently unused temporary tables.
  Now we ensure that such tables always have TABLE::query_id set to 0 and
  use this fact to perform checks during opening and dropping of temporary
  tables. This means that we have to call close_thread_tables() even for
  statements which use only temporary tables. To make this call cheaper,
  we re-factored close_thread_tables() to not take LOCK_open unless there
  are open base tables.
sql/sql_handler.cc:
  Properly close temporary tables associated with a handler.
sql/sql_insert.cc:
  close_temporary_table is now merged into drop_temporary_table.
sql/sql_parse.cc:
  Now the condition doesn't cover all cases because close_thread_tables()
  must be called even for statements that use only temporary tables.
sql/sql_table.cc:
  Use drop_temporary_table which perform checks to verify if
  the table is not being used. Error path problem is due to
  a handler tables issue and is going to be addressed in bug
  31397.
sql/table.h:
  Rename previously unused clear_query_id and document the usage of
  query_id and open_by_handler.
2007-11-01 18:52:56 -02:00
unknown
27e2f30e05 Post-merge test case for Bug 31409
mysql-test/include/handler.inc:
  Add test case for Bug 31409
mysql-test/r/handler_innodb.result:
  Add test case result for InnoDB run of the handler test for Bug 31409
mysql-test/r/handler_myisam.result:
  Add test case result for MyISAM run of the handler test for Bug 31409
2007-10-10 21:39:22 -03:00
unknown
86cb5ae9bc Post-merge test case for Bug 21587
mysql-test/include/handler.inc:
  Add test case for Bug 21587
mysql-test/r/handler_innodb.result:
  Add test case result for InnoDB run of the handler test for Bug 21587
mysql-test/r/handler_myisam.result:
  Add test case result for MyISAM run of the handler test for Bug 21587
2007-10-10 19:06:53 -03:00
unknown
30678bc067 Merge moksha.local:/Users/davi/mysql/push/bugs/old/30632-5.0
into  moksha.local:/Users/davi/mysql/push/bugs/30632-5.1


sql/sql_handler.cc:
  Auto merged
mysql-test/include/handler.inc:
  Auto merged
mysql-test/r/handler_myisam.result:
  Auto merged
2007-08-29 18:32:19 -03:00
unknown
5f40dafcd3 Fixed 5.0 -> 5.1 merge 2007-08-20 17:50:42 -06:00
unknown
8d201090f4 Merge weblab.(none):/home/marcsql/TREE/mysql-5.0-runtime
into  weblab.(none):/home/marcsql/TREE/mysql-5.1-rt50-merge


mysql-test/r/handler_myisam.result:
  Auto merged
mysql-test/r/query_cache.result:
  Auto merged
mysql-test/t/query_cache.test:
  Auto merged
sql/lock.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
mysql-test/include/handler.inc:
  Auto merged
2007-08-20 16:13:54 -06:00
unknown
2b4b44b9a7 Merge chilla.local:/home/mydev/mysql-5.1--main
into  chilla.local:/home/mydev/mysql-5.1-toteam


mysql-test/t/disabled.def:
  Auto merged
BitKeeper/deleted/.del-index_merge_innodb.result:
  Auto merged
mysql-test/include/index_merge2.inc:
  Auto merged
mysql-test/include/mix1.inc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/handler.h:
  Auto merged
sql/opt_range.cc:
  Auto merged
storage/myisam/ha_myisam.cc:
  Auto merged
storage/myisam/ha_myisam.h:
  Auto merged
mysql-test/include/handler.inc:
  Manual merge 5.1 -> 5.1-engines
mysql-test/r/innodb_mysql.result:
  Manual merge 5.1 -> 5.1-engines
2006-09-14 21:44:17 +02:00
unknown
27990803f6 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


mysql-test/include/handler.inc:
  - Replace hardcoded MyISAM with assignments via variable
mysql-test/include/mix1.inc:
  - Replace hardcoded MyISAM with assignments via variable
  - Remove hardcoded InnoDB assignments (They were introduced by late push)
  - Remove trailing spaces
mysql-test/include/mix2.inc:
  - Replace hardcode MyISAM assignments
  - Remove trailing spaces
  - Engine assignments via variable refers to the use of the storage engine
    $other_non_trans_engine_type, $other_live_chcks_engine_type ...
mysql-test/include/read_many_rows.inc:
  Replace hardcoded MyISAM assignment
mysql-test/include/rowid_order.inc:
  remove trailing spaces
mysql-test/r/handler_innodb.result:
  Updated result
mysql-test/r/handler_myisam.result:
  Updated result
mysql-test/r/innodb_mysql.result:
  Updated result
mysql-test/r/mix2_myisam.result:
  Updated result
mysql-test/r/read_many_rows_innodb.result:
  Updated result
mysql-test/r/rowid_order_innodb.result:
  Updated result
mysql-test/t/handler_innodb.test:
  Introduce $variables
mysql-test/t/handler_myisam.test:
  Introduce $variables
mysql-test/t/mix2_myisam.test:
  Introduce $variables
mysql-test/t/read_many_rows_innodb.test:
  Introduce $variables
2006-08-16 19:29:49 +02:00
unknown
808237b083 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 ....


mysql-test/t/unsafe_binlog_innodb-master.opt:
  Rename: mysql-test/t/innodb_unsafe_binlog-master.opt -> mysql-test/t/unsafe_binlog_innodb-master.opt
mysql-test/r/read_many_rows_innodb.result:
  Rename: mysql-test/r/innodb-big.result -> mysql-test/r/read_many_rows_innodb.result
mysql-test/t/cache_innodb-master.opt:
  Rename: mysql-test/t/innodb_cache-master.opt -> mysql-test/t/cache_innodb-master.opt
mysql-test/t/concurrent_innodb-master.opt:
  Rename: mysql-test/t/innodb_concurrent-master.opt -> mysql-test/t/concurrent_innodb-master.opt
BitKeeper/deleted/.del-index_merge.result:
  Delete: mysql-test/r/index_merge.result
BitKeeper/deleted/.del-index_merge_innodb.result:
  Delete: mysql-test/r/index_merge_innodb.result
BitKeeper/deleted/.del-index_merge_innodb2.result:
  Delete: mysql-test/r/index_merge_innodb2.result
BitKeeper/deleted/.del-index_merge_ror.result:
  Delete: mysql-test/r/index_merge_ror.result
BitKeeper/deleted/.del-index_merge_ror_cpk.result:
  Delete: mysql-test/r/index_merge_ror_cpk.result
mysql-test/r/index_merge_innodb.result:
  BitKeeper file /home/matthias/Arbeit/mysql-5.1-engines/src-1/mysql-test/r/index_merge_innodb.result
mysql-test/t/index_merge_innodb.test:
  BitKeeper file /home/matthias/Arbeit/mysql-5.1-engines/src-1/mysql-test/t/index_merge_innodb.test
mysql-test/t/index_merge_myisam.test:
  BitKeeper file /home/matthias/Arbeit/mysql-5.1-engines/src-1/mysql-test/t/index_merge_myisam.test
mysql-test/include/concurrent.inc:
  1. This file contains now the main testing code of the former t/innodb_concurrent.test.
  2. It is now sourced by t/concurrent_innodb.test.
mysql-test/include/deadlock.inc:
  1. This file contains now the main testing code of the former t/innodb-deadlock.test
  2. It is now sourced by t/deadlock_innodb.test.
mysql-test/include/handler.inc:
  1. This file contains now the main testing code of the former t/innodb_handler.test + t/handler.test.
  2. It is now sourced by t/handler_myisam.test and t/handler_innodb.test.
mysql-test/include/index_merge1.inc:
  1. This file contains now the main testing code of the former t/index_merge.test.
  2. It is now sourced by t/index_merge_myisam.test.
mysql-test/include/index_merge2.inc:
  1. This file contains now the main code of t/index_merge_innodb.test.
  2. It is sourced by t/index_merge_myisam.test and t/index_merge_innodb.test.
mysql-test/include/index_merge_2sweeps.inc:
  1. This file contains now the main code of the former t/index_merge_innodb2.test.
  2. It is sourced by t/index_merge_myisam.test and t/index_merge_innodb.test.
mysql-test/include/index_merge_ror.inc:
  1. This file contains now the main code of the former t/index_merge_ror.test.
  2. It is sourced by t/index_merge_myisam.test.
mysql-test/include/index_merge_ror_cpk.inc:
  1. This file contains now the main testing code of the former t/index_merge_ror_cpk.test.
  2. It is now sourced by t/index_merge_myisam.test and t/index_merge_innodb.test.
mysql-test/include/mix1.inc:
  1. This file contains now the main testing code of the t/innodb_mysql.test
  2. The name mix1.inc was used because the test contains subtests for different fields.
  3. It is sourced by t/innodb_mysql.test.
  4. Fixes:
      - Assign $other_engine_type instead of hardcoded MyISAM.
      - improve comment
      - remove redundant subtest
      - analyze table t4 instead of wrong table t1
      - remove not needed "eval set storage_engine = $engine_type;"
mysql-test/include/mix2.inc:
  1. This file is a copy of the main testing code of the t/innodb.test
     A copy has to be used, because t/innodb.test is to be maintained by INNOBASE only.
  2. The name mix2.inc was used because the test contains subtests for different fields.
  3. It is sourced by t/mix2_myisam.test.
  4. Fixes:
      - improved comment
      - additional "eval SET SESSION STORAGE_ENGINE = $other_engine_type;" at beginning of tests
      - assign $other_engine_type instead of hardcoded MyISAM or HEAP
      - assign $other_engine_type where it is needed to preserve test logics
      - correct logical bugs
      - improve(extend) "checksum table" test
mysql-test/include/query_cache.inc:
  1. This file contains now the main testing code of the former t/innodb_cache.test.
  2. It is now sourced by t/cache_innodb.test
mysql-test/include/read_many_rows.inc:
  1. This file contains now the main testing code of the former t/innodb_big.test.
  2. It is now sourced by t/read_many_rows_innodb.test.
mysql-test/include/rowid_order.inc:
  1. This file contains now the main testing code of t/rowid_order_innodb.test.
  2. It is now sourced by t/rowid_order_innodb.test.
mysql-test/include/unsafe_binlog.inc:
  1. This file contains now the main testing code of the former t/innodb_unsafe_binlog.test.
  2. It is now sourced by t/unsafe_binlog_innodb.test.
mysql-test/r/cache_innodb.result:
  Updated result
mysql-test/r/concurrent_innodb.result:
  Updated result
mysql-test/r/deadlock_innodb.result:
  Updated result
mysql-test/r/handler_innodb.result:
  Updated result
mysql-test/r/handler_myisam.result:
  Updated result
mysql-test/r/index_merge_myisam.result:
  Updated result
mysql-test/r/innodb_mysql.result:
  Updated result
mysql-test/r/mix2_myisam.result:
  Updated result
mysql-test/r/rowid_order_innodb.result:
  Updated result
mysql-test/r/unsafe_binlog_innodb.result:
  Updated result
mysql-test/t/cache_innodb.test:
  1. Renaming of t/innodb_cache.test to t/cache_innodb.test
  2. Main code is now sourced from include/query_cache.inc.
mysql-test/t/concurrent_innodb.test:
  1. Renaming of t/innodb_concurrent.test to t/concurrent_innodb.test
  2. Main code is now sourced from include/concurrent.inc.
     Attention: This test fails even in the old version. (BUG#21579).
                --> added to t/disabled.def
mysql-test/t/deadlock_innodb.test:
  1. Renaming of t/innodb_deadlock.test to t/deadlock_innodb.test
  2. Main code is now sourced from include/deadlock.inc.
mysql-test/t/disabled.def:
  Add the test concurrent_innodb because of 
  BUG#21579 2006-08-11 mleich innodb_concurrent random failures with varying differences
mysql-test/t/handler_innodb.test:
  1. Renaming of t/innodb_handler.test to t/handler_innodb.test
  2. Main code is now sourced from include/handler.inc.
     include/handler.inc = united code of former t/handler.test and t/innodb_handler.test
mysql-test/t/handler_myisam.test:
  1. Renaming of t/handler.test to t/handler_myisam.test
  2. Main code is now sourced from include/handler.inc.
     include/handler.inc = united code of former t/handler.test and t/handler_innodb.test.
mysql-test/t/innodb_mysql.test:
  1. Main code is now sourced from include/mix1.inc.
  2. Test was not renamed because t/innodb.test refers to it.
mysql-test/t/mix2_myisam.test:
  New test: MyISAM variant of mix2 ( = t/innodb.test)
mysql-test/t/read_many_rows_innodb.test:
  1. Renaming of t/innodb_big.test to t/read_many_rows_innodb.test
  2. Main code is now sourced from include/read_many_rows.inc.
mysql-test/t/rowid_order_innodb.test:
  Main code is now sourced from t/rowid_order.inc.
mysql-test/t/unsafe_binlog_innodb.test:
  1. Renaming of t/innodb_unsafe_binlog.test to t/unsafe_binlog_innodb.test
  2. Main code is now sourced from include/unsafe_binlog.inc.
2006-08-16 14:58:49 +02:00
Renamed from mysql-test/t/handler.test (Browse further)