MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Tatiana A. Nurnberg Date:September 29 2009 3:20pm
Subject:bzr commit into mysql-pe branch (azundris:3608)
View as plain text  
#At file:///Users/tnurnberg/forest/43746f/60-43746f/ based on revid:azundris@stripped

 3608 Tatiana A. Nurnberg	2009-09-29 [merge]
      auto-merge

    removed:
      mysql-test/suite/innodb/
      mysql-test/suite/innodb/include/
      mysql-test/suite/innodb/include/have_innodb_plugin.inc
      mysql-test/suite/innodb/include/innodb-index.inc
      mysql-test/suite/innodb/r/
      mysql-test/suite/innodb/r/innodb-analyze.result
      mysql-test/suite/innodb/r/innodb-index.result
      mysql-test/suite/innodb/r/innodb-index_ucs2.result
      mysql-test/suite/innodb/r/innodb-timeout.result
      mysql-test/suite/innodb/r/innodb-use-sys-malloc.result
      mysql-test/suite/innodb/r/innodb-zip.result
      mysql-test/suite/innodb/r/innodb_bug36169.result
      mysql-test/suite/innodb/r/innodb_bug36172.result
      mysql-test/suite/innodb/r/innodb_bug40360.result
      mysql-test/suite/innodb/r/innodb_bug41904.result
      mysql-test/suite/innodb/r/innodb_bug44032.result
      mysql-test/suite/innodb/r/innodb_file_format.result
      mysql-test/suite/innodb/r/innodb_information_schema.result
      mysql-test/suite/innodb/t/
      mysql-test/suite/innodb/t/disabled.def
      mysql-test/suite/innodb/t/innodb-analyze.test
      mysql-test/suite/innodb/t/innodb-index.test
      mysql-test/suite/innodb/t/innodb-index_ucs2.test
      mysql-test/suite/innodb/t/innodb-timeout.test
      mysql-test/suite/innodb/t/innodb-use-sys-malloc-master.opt
      mysql-test/suite/innodb/t/innodb-use-sys-malloc.test
      mysql-test/suite/innodb/t/innodb-zip.test
      mysql-test/suite/innodb/t/innodb_bug36169.test
      mysql-test/suite/innodb/t/innodb_bug36172.test
      mysql-test/suite/innodb/t/innodb_bug40360.test
      mysql-test/suite/innodb/t/innodb_bug41904.test
      mysql-test/suite/innodb/t/innodb_bug44032.test
      mysql-test/suite/innodb/t/innodb_file_format.test
      mysql-test/suite/innodb/t/innodb_information_schema.test
    added:
      mysql-test/collections/mysql-next-mr.push
      mysql-test/collections/mysql-trunk.push
      mysql-test/r/innodb_mysql_sync.result
      mysql-test/r/partition_sync.result
      mysql-test/t/innodb_mysql_sync.test
      mysql-test/t/partition_sync.test
    renamed:
      mysql-test/collections/mysql-next.push => mysql-test/collections/mysql-6.0-codebase.push
    modified:
      .bzrignore
      Makefile.am
      mysql-test/Makefile.am
      mysql-test/collections/default.experimental
      mysql-test/extra/scripts/monitor_disabled_tests/comments.txt
      mysql-test/extra/scripts/monitor_disabled_tests/disabled_tags.txt
      mysql-test/include/default_mysqld.cnf
      mysql-test/include/locktrans.inc
      mysql-test/include/master-slave.inc
      mysql-test/include/mtr_warnings.sql
      mysql-test/lib/mtr_cases.pm
      mysql-test/mysql-test-run.pl
      mysql-test/r/delayed.result
      mysql-test/r/explain.result
      mysql-test/r/func_math.result
      mysql-test/r/information_schema_db.result
      mysql-test/r/innodb.result
      mysql-test/r/join_cache.result
      mysql-test/r/lock_multi.result
      mysql-test/r/locktrans_innodb.result
      mysql-test/r/merge.result
      mysql-test/r/merge_recover.result
      mysql-test/r/select.result
      mysql-test/r/select_jcl6.result
      mysql-test/r/sp-error.result
      mysql-test/r/subselect3.result
      mysql-test/r/subselect3_jcl6.result
      mysql-test/r/view.result
      mysql-test/r/view_grant.result
      mysql-test/suite/backup/t/backup_no_data.test
      mysql-test/suite/parts/t/disabled.def
      mysql-test/suite/rpl/r/rpl_backup_shutdown.result
      mysql-test/suite/rpl/r/rpl_locktrans_innodb.result
      mysql-test/suite/rpl/r/rpl_log_pos.result
      mysql-test/suite/rpl/r/rpl_packet.result
      mysql-test/suite/rpl/t/disabled.def
      mysql-test/suite/rpl/t/rpl_backup_multi.test
      mysql-test/suite/rpl/t/rpl_backup_shutdown.test
      mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test
      mysql-test/suite/rpl/t/rpl_log_pos.test
      mysql-test/suite/rpl/t/rpl_packet.test
      mysql-test/suite/rpl/t/rpl_row_colSize.test
      mysql-test/suite/rpl/t/rpl_row_create_table.test
      mysql-test/suite/rpl/t/rpl_stm_log.test
      mysql-test/suite/rpl/t/rpl_temporary.test
      mysql-test/suite/rpl/t/rpl_truncate_3innodb.test
      mysql-test/t/delayed.test
      mysql-test/t/disabled.def
      mysql-test/t/explain.test
      mysql-test/t/func_math.test
      mysql-test/t/information_schema_db.test
      mysql-test/t/join_cache.test
      mysql-test/t/lock_multi.test
      mysql-test/t/locktrans_innodb.test
      mysql-test/t/mdl_sync.test
      mysql-test/t/merge.test
      mysql-test/t/merge_recover.test
      mysql-test/t/select.test
      mysql-test/t/sp-error.test
      mysql-test/t/view.test
      mysql-test/t/view_grant.test
      sql/authors.h
      sql/item_sum.cc
      sql/lex.h
      sql/lock.cc
      sql/mdl.cc
      sql/mdl.h
      sql/mysql_priv.h
      sql/protocol.cc
      sql/si_objects.cc
      sql/sp.cc
      sql/sp.h
      sql/sp_head.cc
      sql/sp_head.h
      sql/sql_acl.cc
      sql/sql_base.cc
      sql/sql_delete.cc
      sql/sql_handler.cc
      sql/sql_insert.cc
      sql/sql_lex.h
      sql/sql_parse.cc
      sql/sql_partition.cc
      sql/sql_repl.cc
      sql/sql_select.cc
      sql/sql_select.h
      sql/sql_show.cc
      sql/sql_table.cc
      sql/sql_trigger.cc
      sql/sql_view.cc
      sql/sql_yacc.yy
      sql/table.cc
      sql/table.h
      storage/innobase/handler/ha_innodb.cc
      storage/innobase/handler/ha_innodb.h
      storage/myisammrg/ha_myisammrg.cc
=== modified file '.bzrignore'
--- a/.bzrignore	2009-09-21 18:33:08 +0000
+++ b/.bzrignore	2009-09-25 14:29:56 +0000
@@ -2023,3 +2023,4 @@ libmysqld/examples/mysqltest.cc
 libmysqld/bml.cc
 mysql-test/mysql-test-lcov
 libmysqld/examples/mysqltest.cc
+libmysqld/sql_signal.cc

=== modified file 'Makefile.am'
--- a/Makefile.am	2009-09-16 05:54:22 +0000
+++ b/Makefile.am	2009-09-18 06:20:33 +0000
@@ -123,7 +123,7 @@ test-reprepare:
 	    @PERL@ ./mysql-test-run.pl $(force) $(mem) --ps-protocol \
 		--mysqld=--debug=+d,reprepare_each_statement
 
-test:	test-ns test-pr
+test:	test-unit test-ns test-pr
 
 smoke:
 	cd mysql-test ; \

=== modified file 'mysql-test/Makefile.am'
--- a/mysql-test/Makefile.am	2009-09-21 18:33:08 +0000
+++ b/mysql-test/Makefile.am	2009-09-23 19:39:45 +0000
@@ -111,8 +111,7 @@ TEST_DIRS = t r include std_data std_dat
 	suite/ndb_binlog suite/ndb_binlog/t suite/ndb_binlog/r \
 	suite/ndb_team suite/ndb_team/t suite/ndb_team/r \
 	suite/rpl_ndb suite/rpl_ndb/t suite/rpl_ndb/r \
-	suite/rpl_ndb_big suite/rpl_ndb_big/t suite/rpl_ndb_big/r \
-	suite/innodb suite/innodb/t suite/innodb/r suite/innodb/include
+	suite/rpl_ndb_big suite/rpl_ndb_big/t suite/rpl_ndb_big/r
 
 # Used by dist-hook and install-data-local to copy all
 # test files into either dist or install directory

=== modified file 'mysql-test/collections/default.experimental'
--- a/mysql-test/collections/default.experimental	2009-09-23 08:41:13 +0000
+++ b/mysql-test/collections/default.experimental	2009-09-29 15:03:12 +0000
@@ -1,16 +1,39 @@
+# For easier human reading (MTR doesn't care), please keep entries
+# in alphabetical order. This also helps with merge conflict resolution.
+
+backup.backup_datatypes  @darwin         # Bug#46934 2009-08-26 alik backup_datatypes fails on Mac OS X
+backup.backup_dbname_lctn2  @windows  @darwin   # Bug#46933 2009-08-26 alik backup_*_lctn2 tests fail on windows
+backup.backup_events                     # Bug#47211 2009-09-25 alik backup_events.test fails randomly
 backup.backup_external_non_win*          # BUG#45877
-backup.backup_dbname_lctn2  @windows     # Bug#46933 2009-08-26 alik backup_*_lctn2 tests fail on windows
+backup.backup_objects_dependency         # Bug#43549 2009-09-25 alik The backup_objects_dependency test is non-deterministic
 backup.backup_xpfm_compat_backup_lctn2 @windows # Bug#46933 2009-08-26 alik backup_*_lctn2 tests fail on windows
-backup.backup_datatypes  @darwin         # Bug#46934 2009-08-26 alik backup_datatypes fails on Mac OS X
 
-binlog.binlog_tmp_table*                 # Bug#45578 2009-07-10 alik Test binlog_tmp_table fails ramdonly on PB2: Unknown table 't2'
+binlog.binlog_tmp_table*                 # Bug#45578:2009-07-10 alik Test binlog_tmp_table fails ramdonly on PB2: Unknown table 't2'
 
 funcs_1.charset_collation_1              # depends on compile-time decisions
-main.plugin_load  @solaris               # Bug#42144
+
+innodb.innodb_information_schema         # Bug#47449 2009-09-19 alik main.information_schema and innodb.innodb_information_schema fail sporadically
+
+main.archive                             # Bug#47660 2009-09-27 alik main.archive fails sporadically
+main.ctype_gbk_binlog  @solaris          # Bug#46010: main.ctype_gbk_binlog fails sporadically : Table 't2' already exists
+main.information_schema                  # Bug#47449 2009-09-19 alik main.information_schema and innodb.innodb_information_schema fail sporadically
+main.innodb-autoinc                      # Bug#44030 2009-09-24 alik Marking innodb-autoinc experimental while waiting for the patch to be merged
+main.merge                               # Bug#47648 2009-09-25 alik main.merge fails sporadically
+main.lock_multi_bug38499                 # Bug#47448 2009-09-19 alik main.lock_multi_bug38499 times out sporadically
+main.plugin                              # Bug#47146 Linking problem with example plugin when dtrace enabled
+main.plugin_load                         # Bug#47146
+main.plugin_notembedded                  # Bug#47662 2009-09-27 alik main.plugin_notembedded fails sporadically in pb2
 main.truncate_coverage                   # Bug#46785 2009-08-18 alik main.truncate_coverage fails sporadically
 
-rpl.rpl_backup_multi*                    # BUG#45284
+ndb.ndb_restore                          # Bug#37778 2009-07-30 alik ndb.ndb_restore fails randomly
+ndb.ndb_restore_print                    # Bug#37778 2009-07-30 alik ndb.ndb_restore fails randomly
 
+rpl.rpl_get_master_version_and_clock*    # Bug#46931 2009-08-26 alik rpl.rpl_get_master_version_and_clock fails on hpux11.31
+rpl.rpl_innodb_bug28430* @solaris        # Bug#46029
+rpl.rpl_innodb_bug30888* @solaris        # Bug#47646 2009-09-25 alik rpl.rpl_innodb_bug30888 fails sporadically on Solaris
+rpl.rpl_killed_ddl*                      # Bug#45520 2009-07-10 alik rpl_killed_ddl fails sporadically in pb2
+rpl.rpl_plugin_load*  @solaris           # Bug#47146
+rpl.rpl_backup_multi*                    # BUG#45284
 rpl.rpl_killed_ddl*                      # Bug#45520 2009-07-10 alik rpl_killed_ddl fails sporadically in pb2
 rpl.rpl_row_create_table*                # Bug#45576 2009-07-10 alik rpl_row_create_table fails on PB2
 innodb.innodb_information_schema         # Bug#47449 2009-09-19 alik main.information_schema and innodb.innodb_information_schema fail sporadically
@@ -19,6 +42,10 @@ main.lock_multi_bug38499                
 main.information_schema                  # Bug#47449 2009-09-19 alik main.information_schema and innodb.innodb_information_schema fail sporadically
 
 rpl.rpl_row_create_table*                # Bug#45576: rpl_row_create_table fails on PB2
+rpl.rpl_semi_sync fails                  # Bug#47566 2009-09-23 alik rpl.rpl_semi_sync fails sporadically
+rpl.rpl_spec_variables                   # Bug#47661 2009-09-27 alik rpl.rpl_spec_variables fails sporadically in pb2
+rpl.rpl_trigger*                         # Bug#46656 2009-09-25 alik InnoDB plugin: memory leaks (Valgrind)
+
 rpl_ndb.rpl_ndb_log                      # Bug#38998
 rpl.rpl_innodb_bug28430* @solaris        # Bug#46029
 main.plugin_load  @solaris               # Bug#47146
@@ -30,3 +57,50 @@ rpl.rpl_plugin_load*  @solaris          
 
 ndb.n*                                   # Consider all NDB tests experimental.
 rpl_ndb.r*                               # Consider all NDB tests experimental.
+
+# Declare all NDB-tests in other test suites experimental.
+
+stress.ddl_ndb
+
+sys_vars.ndb_log_update_as_write_basic
+sys_vars.have_ndbcluster_basic
+sys_vars.ndb_log_updated_only_basic
+
+funcs_1.ndb_storedproc_10
+funcs_1.ndb_bitdata
+funcs_1.ndb_trig_03
+funcs_1.ndb_trig_0102
+funcs_1.is_tables_ndb
+funcs_1.is_columns_ndb
+funcs_1.ndb_trig_0407
+funcs_1.ndb_trig_1011ext
+funcs_1.ndb_storedproc_06
+funcs_1.ndb_views
+funcs_1.is_cml_ndb
+funcs_1.ndb_storedproc_02
+funcs_1.ndb_storedproc_03
+funcs_1.ndb_trig_03e
+funcs_1.is_engines_ndb
+funcs_1.ndb_trig_08
+funcs_1.ndb_storedproc_07
+funcs_1.ndb_storedproc_08
+funcs_1.ndb_func_view
+funcs_1.ndb_trig_09
+funcs_1.ndb_cursors
+
+funcs_2.ndb_charset
+
+parts.partition_engine_ndb
+parts.ndb_dd_backuprestore
+parts.partition_value_ndb
+parts.partition_mgm_lc2_ndb
+parts.partition_alter1_2_ndb
+parts.partition_alter1_1_ndb
+parts.part_supported_sql_func_ndb
+parts.partition_int_ndb
+parts.partition_mgm_lc1_ndb
+parts.partition_auto_increment_ndb
+parts.partition_syntax_ndb
+parts.partition_alter1_1_2_ndb
+parts.partition_basic_ndb
+parts.partition_mgm_lc0_ndb

=== renamed file 'mysql-test/collections/mysql-next.push' => 'mysql-test/collections/mysql-6.0-codebase.push'
=== added file 'mysql-test/collections/mysql-next-mr.push'
--- a/mysql-test/collections/mysql-next-mr.push	1970-01-01 00:00:00 +0000
+++ b/mysql-test/collections/mysql-next-mr.push	2009-09-24 12:40:09 +0000
@@ -0,0 +1,5 @@
+perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=n_mix --mysqld=--binlog-format=mixed --suite=main,binlog,innodb,federated,rpl
+perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=ps_row --ps-protocol --mysqld=--binlog-format=row --suite=main,binlog,innodb,federated,rpl
+perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=embedded --embedded --suite=main,binlog,innodb,federated,rpl
+perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=rpl_binlog_row --mysqld=--binlog-format=row --suite=rpl,binlog
+perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=funcs_1 --suite=funcs_1

=== added file 'mysql-test/collections/mysql-trunk.push'
--- a/mysql-test/collections/mysql-trunk.push	1970-01-01 00:00:00 +0000
+++ b/mysql-test/collections/mysql-trunk.push	2009-09-24 12:30:13 +0000
@@ -0,0 +1,5 @@
+perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=n_mix --mysqld=--binlog-format=mixed --suite=main,binlog,innodb,federated,rpl
+perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=ps_row --ps-protocol --mysqld=--binlog-format=row --suite=main,binlog,innodb,federated,rpl
+perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=embedded --embedded --suite=main,binlog,innodb,federated,rpl
+perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=rpl_binlog_row --mysqld=--binlog-format=row --suite=rpl,binlog
+perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=funcs_1 --suite=funcs_1

=== modified file 'mysql-test/extra/scripts/monitor_disabled_tests/comments.txt'
--- a/mysql-test/extra/scripts/monitor_disabled_tests/comments.txt	2009-07-23 10:22:21 +0000
+++ b/mysql-test/extra/scripts/monitor_disabled_tests/comments.txt	2009-09-23 19:32:57 +0000
@@ -1,3 +1,56 @@
+t/truncate_coverage.test:#
+t/truncate_coverage.test:# Code coverage testing of TRUNCATE TABLE.
+t/truncate_coverage.test:#
+t/truncate_coverage.test:# Ingo Struewing, 2009-07-20
+t/truncate_coverage.test:#
+t/truncate_coverage.test:########
+t/truncate_coverage.test:# Attack wait_while_table_is_used(). Kill query while trying to
+t/truncate_coverage.test:# upgrade MDL.
+t/truncate_coverage.test:#
+t/truncate_coverage.test:#
+t/truncate_coverage.test:# Start a transaction and execute a DML in it. Since 5.4.4 this leaves
+t/truncate_coverage.test:# a shared meta data lock (MDL) behind. TRUNCATE shall block on it.
+t/truncate_coverage.test:#
+t/truncate_coverage.test:#
+t/truncate_coverage.test:# Get connection id of default connection.
+t/truncate_coverage.test:# Lock the table and start TRUNCATE, which will block on MDL upgrade.
+t/truncate_coverage.test:#
+t/truncate_coverage.test:#
+t/truncate_coverage.test:# Get the default connection ID into a variable in an invisible statement.
+t/truncate_coverage.test:# Kill the TRUNCATE query. This shall result in an error return
+t/truncate_coverage.test:# from wait_while_table_is_used().
+t/truncate_coverage.test:#
+t/truncate_coverage.test:########
+t/truncate_coverage.test:# Attack reopen_tables(). Remove form file.
+t/truncate_coverage.test:#
+t/truncate_coverage.test:#
+t/truncate_coverage.test:# Start a transaction and execute a DML in it. Since 5.4.4 this leaves
+t/truncate_coverage.test:# a shared meta data lock (MDL) behind. TRUNCATE shall block on it.
+t/truncate_coverage.test:#
+t/truncate_coverage.test:#
+t/truncate_coverage.test:# Lock the table and start TRUNCATE, which will block on MDL upgrade.
+t/truncate_coverage.test:#
+t/truncate_coverage.test:#
+t/truncate_coverage.test:# Remove datafile.
+t/truncate_coverage.test:# Commit to let TRUNCATE continue.
+t/truncate_coverage.test:#
+t/truncate_coverage.test:########
+t/truncate_coverage.test:# Attack acquire_exclusive_locks(). Hold a global read lock.
+t/truncate_coverage.test:# Non-LOCK TABLE case.
+t/truncate_coverage.test:#
+t/truncate_coverage.test:#
+t/truncate_coverage.test:# Start a transaction and execute a DML in it. Since 5.4.4 this leaves
+t/truncate_coverage.test:# a shared meta data lock (MDL) behind. TRUNCATE shall block on it.
+t/truncate_coverage.test:#
+t/truncate_coverage.test:#
+t/truncate_coverage.test:# Get connection id of default connection.
+t/truncate_coverage.test:# Start TRUNCATE, which will block on acquire_exclusive_locks().
+t/truncate_coverage.test:#
+t/truncate_coverage.test:#
+t/truncate_coverage.test:# Get the default connection ID into a variable in an invisible statement.
+t/truncate_coverage.test:# Kill the TRUNCATE query. This shall result in an error return
+t/truncate_coverage.test:# from wait_while_table_is_used().
+t/truncate_coverage.test:#
 t/func_test.test:#
 t/func_test.test:# Testing of comparison functions
 t/func_test.test:#
@@ -2031,6 +2084,7 @@ t/mysqltest.test:# Source a nonexisting 
 t/mysqltest.test:# Too many source
 t/mysqltest.test:# Source a file with error
 t/mysqltest.test:# Test execution of source in a while loop
+t/mysqltest.test:# Test source in an if in a while which is false on 1st iteration
 t/mysqltest.test:# Test execution of source in a while loop
 t/mysqltest.test:# Sourcing of a file within while loop, sourced file will
 t/mysqltest.test:# source other file
@@ -2157,6 +2211,7 @@ t/mysqltest.test:# write to already exis
 t/mysqltest.test:# ----------------------------------------------------------------------------
 t/mysqltest.test:# test for append_file
 t/mysqltest.test:# ----------------------------------------------------------------------------
+t/mysqltest.test:# Test append_file within while
 t/mysqltest.test:# ----------------------------------------------------------------------------
 t/mysqltest.test:# test for cat_file
 t/mysqltest.test:# ----------------------------------------------------------------------------
@@ -2164,13 +2219,8 @@ t/mysqltest.test:# ---------------------
 t/mysqltest.test:# test for diff_files
 t/mysqltest.test:# ----------------------------------------------------------------------------
 t/mysqltest.test:# Compare equal files
-t/mysqltest.test:# Write the below commands to a intermediary file and execute them with
-t/mysqltest.test:# mysqltest in --exec, since the output will vary depending on what "diff"
-t/mysqltest.test:# is available it is sent to /dev/null
 t/mysqltest.test:# Compare files that differ in size
 t/mysqltest.test:# Compare files that differ only in content
-t/mysqltest.test:# Execute the above diffs, and send their output to /dev/null - only
-t/mysqltest.test:# interesting to see that it returns correct error codes
 t/mysqltest.test:# Compare equal files, again...
 t/mysqltest.test:# ----------------------------------------------------------------------------
 t/mysqltest.test:# test for file_exist
@@ -2305,9 +2355,12 @@ t/mysqlslap.test:# to test the actual ou
 t/mysqlslap.test:# Now we will test to make sure we can destory the data if it happens to be
 t/mysqlslap.test:# in our way.
 t/mysqlslap.test:#
-t/not_partition.test:# Run this tets only when mysqld don't has partitioning
+t/not_partition.test:# Run this test only when mysqld don't has partitioning (not compiled with)
 t/not_partition.test:# the statements are not expected to work, just check that we
 t/not_partition.test:# can't crash the server
+t/not_partition.test:#
+t/not_partition.test:# Bug#39893: Crash if select on a partitioned table,
+t/not_partition.test:#            when partitioning is disabled
 t/not_partition.test:# Create a table without partitions to test "EXPLAIN PARTITIONS"
 t/index_merge_innodb.test:# t/index_merge_innodb.test
 t/index_merge_innodb.test:#
@@ -2732,6 +2785,10 @@ t/create.test:#
 t/create.test:# Bug#40104 regression with table names?
 t/create.test:#
 t/create.test:###########################################################################
+t/create.test:#
+t/create.test:# Bug#45829 CREATE TABLE TRANSACTIONAL PAGE_CHECKSUM ROW_FORMAT=PAGE accepted, does nothing
+t/create.test:#
+t/create.test:###########################################################################
 t/create.test:#--disable_abort_on_error
 t/ctype_big5.test:#
 t/ctype_big5.test:# Tests with the big5 character set
@@ -3881,8 +3938,8 @@ t/partition_csv.test:# Bug#19307: Partit
 t/partition_csv.test:#            = CSV engine crashes
 t/partition_csv.test:#
 t/partition_csv.test:#
-t/partition_csv.test:# Bug#27816: Log tables ran with partitions crashes the server when logging
-t/partition_csv.test:#            is enabled.
+t/partition_csv.test:# Bug #27816: Log tables ran with partitions crashes the server when logging
+t/partition_csv.test:#             is enabled.
 t/partition_csv.test:#
 t/gcc296.test:#try to crash gcc 2.96
 t/gcc296.test:# End of 4.1 tests
@@ -4949,6 +5006,10 @@ t/show_check.test:#
 t/show_check.test:#
 t/show_check.test:# Bug#32710 SHOW INNODB STATUS requires SUPER
 t/show_check.test:#
+t/show_check.test:#
+t/show_check.test:# Maria removal: check that deadlock% variables are not present in the SHOW
+t/show_check.test:# VARIABLES output.
+t/show_check.test:#
 t/show_check.test:# Wait till all disconnects are completed
 t/auto_increment.test:#
 t/auto_increment.test:# Test of auto_increment;  The test for BDB tables is in bdb.test
@@ -5340,6 +5401,9 @@ t/loadxml.test:# Running the $MYSQL_DUMP
 t/loadxml.test:#
 t/loadxml.test:# Clean up
 t/loadxml.test:#
+t/loadxml.test:#
+t/loadxml.test:# Bug #36750    LOAD XML doesn't understand new line (feed) characters in multi line text fields
+t/loadxml.test:#
 t/grant4.test:# Setup database, tables and user accounts
 t/grant4.test:########################################################################
 t/grant4.test:#########################################################################
@@ -5582,6 +5646,12 @@ t/archive.test:# BUG#31833 -  ORDER BY l
 t/archive.test:#              cache is full
 t/archive.test:#
 t/archive.test:#
+t/archive.test:# BUG#29203 - archive tables have weird values in show table status
+t/archive.test:#
+t/archive.test:#
+t/archive.test:# BUG#46961 - archive engine loses rows during self joining select!
+t/archive.test:#
+t/archive.test:#
 t/archive.test:# BUG#40677 - Archive tables joined on primary return no result
 t/archive.test:#
 t/myisam.test:#
@@ -5826,8 +5896,6 @@ t/myisam.test:# With bug present, this s
 t/myisam.test:#
 t/myisam.test:# Bug#29182 - MyISAMCHK reports wrong character set
 t/myisam.test:#
-t/myisam.test:# Test warnings with transactional=1 with MyISAM
-t/myisam.test:#
 t/myisam.test:#
 t/myisam.test:# Test of BUG#35570 CHECKSUM TABLE unreliable if LINESTRING field
 t/myisam.test:# (same content / differen checksum)
@@ -5954,12 +6022,15 @@ t/multi_update2.test:## Try deleting man
 t/mdl_sync.test:#
 t/mdl_sync.test:# We need the Debug Sync Facility.
 t/mdl_sync.test:#
+t/mdl_sync.test:# Save the initial number of concurrent sessions.
 t/mdl_sync.test:# Clean up resources used in this test case.
 t/mdl_sync.test:#
 t/mdl_sync.test:# Test the case of when a exclusive lock request waits for a
 t/mdl_sync.test:# shared lock being upgraded to a exclusive lock.
 t/mdl_sync.test:#
 t/mdl_sync.test:# Clean up resources used in this test case.
+t/mdl_sync.test:# Check that all connections opened by test cases in this file are really
+t/mdl_sync.test:# gone so execution of other tests won't be affected by their presence.
 t/ddl_i18n_koi8r.test:# Objects to test:
 t/ddl_i18n_koi8r.test:#   - stored procedures/functions;
 t/ddl_i18n_koi8r.test:#   - triggers;
@@ -6337,6 +6408,15 @@ t/partition_pruning.test:# Partition pru
 t/partition_pruning.test:# prune, so the test is EXPLAINs.
 t/partition_pruning.test:#
 t/partition_pruning.test:#
+t/partition_pruning.test:# Bug#20577: Partitions: use of to_days() function leads to selection failures
+t/partition_pruning.test:#
+t/partition_pruning.test:#
+t/partition_pruning.test:# Bug#46362: Endpoint should be set to false for TO_DAYS(DATE)
+t/partition_pruning.test:# There is a problem when comparing DATE with DATETIME.
+t/partition_pruning.test:# In pruning it is converted into the field type
+t/partition_pruning.test:# and in row evaluation it is converted to longlong
+t/partition_pruning.test:# (like a DATETIME).
+t/partition_pruning.test:#
 t/partition_pruning.test:# Bug#40972: some sql execution lead the whole database crashing
 t/partition_pruning.test:#
 t/partition_pruning.test:# Setup so the start is at partition pX and end is at p1
@@ -8899,6 +8979,16 @@ t/truncate.test:# when it'll be fixed, t
 t/truncate.test:# (test.v1' is not BASE TABLE)
 t/truncate.test:#
 t/truncate.test:# End of 5.0 tests
+t/truncate.test:#
+t/truncate.test:#
+t/truncate.test:#
+t/truncate.test:#
+t/truncate.test:#
+t/truncate.test:#
+t/truncate.test:#
+t/truncate.test:#
+t/truncate.test:#
+t/truncate.test:# Cleanup
 t/type_bit.test:#
 t/type_bit.test:# testing of the BIT column type
 t/type_bit.test:#
@@ -9025,6 +9115,8 @@ t/information_schema_part.test:#
 t/information_schema_part.test:#
 t/information_schema_part.test:# Bug#38909 CREATE_OPTIONS in information_schema produces wrong results
 t/information_schema_part.test:#
+t/lowercase_mixed_tmpdir_innodb-master.sh:# This test requires a non-lowercase tmpdir directory on a case-sensitive
+t/lowercase_mixed_tmpdir_innodb-master.sh:# filesystem.
 t/subselect_mat.test:#
 t/subselect_mat.test:# Hash semi-join regression tests
 t/subselect_mat.test:# (WL#1110: Subquery optimization: materialization)
@@ -9465,6 +9557,8 @@ t/exampledb.test:# Taken fromm the selec
 t/exampledb.test:#
 t/exampledb.test:# Clean up if event's test fails
 t/exampledb.test:# End of 4.1 tests
+t/outfile_loaddata.test:###########################################################################
+t/outfile_loaddata.test:###########################################################################
 t/lowercase_fs_off.test:#
 t/lowercase_fs_off.test:# Specific tests for case sensitive file systems
 t/lowercase_fs_off.test:# i.e. lower_case_filesystem=OFF
@@ -12656,6 +12750,7 @@ t/drop.test:# Bug#26703: DROP DATABASE f
 t/drop.test:#
 t/drop.test:###########################################################################
 t/drop.test:###########################################################################
+t/drop.test:###########################################################################
 t/mysql.test:# This test should work in embedded server after we fix mysqltest
 t/mysql.test:#
 t/mysql.test:# Testing the MySQL command line client(mysql)
@@ -12786,6 +12881,9 @@ t/mysql.test:#
 t/mysql.test:#
 t/mysql.test:# Bug #27884: mysql --html does not quote HTML special characters in output
 t/mysql.test:# 
+t/mysql.test:#
+t/mysql.test:# Bug #27884: mysql client + null byte
+t/mysql.test:# 
 t/sp-threads.test:# This test should work in embedded server after mysqltest is fixed
 t/sp-threads.test:#
 t/sp-threads.test:# Testing stored procedures with multiple connections,
@@ -13121,6 +13219,9 @@ t/func_str.test:#
 t/func_str.test:# Bug #41868: crash or memory overrun with concat + upper, date_format functions
 t/func_str.test:#
 t/func_str.test:#
+t/func_str.test:# Bug#46815 CONCAT_WS returning wrong data
+t/func_str.test:#
+t/func_str.test:#
 t/func_str.test:# Bug#44358 valgrind errors with decode() function
 t/func_str.test:#
 t/func_str.test:#
@@ -13153,6 +13254,9 @@ t/explain.test:#
 t/explain.test:#
 t/explain.test:# Bug #43354: Use key hint can crash server in explain extended query
 t/explain.test:#
+t/explain.test:#
+t/explain.test:# Bug#45989 memory leak after explain encounters an error in the query
+t/explain.test:#
 t/sp-vars.test:###########################################################################
 t/sp-vars.test:#
 t/sp-vars.test:# Cleanup.
@@ -13626,8 +13730,6 @@ t/mysqldump.test:# Check new --replace o
 t/mysqldump.test:#
 t/mysqldump.test:# Added for use-thread option
 t/mysqldump.test:#
-t/mysqldump.test:# -- [DISABLED Bug#32991]
-t/mysqldump.test:# THIS PART OF THE TEST IS DISABLED UNTIL Bug#32991 IS FIXED
 t/mysqldump.test:# The first load tests the pausing code
 t/mysqldump.test:# Now we test with multiple threads!
 t/mysqldump.test:# Now we test with multiple threads, but less threads than files.
@@ -13642,8 +13744,9 @@ t/mysqldump.test:#
 t/mysqldump.test:###########################################################################
 t/mysqldump.test:###########################################################################
 t/mysqldump.test:###########################################################################
-t/mysqldump.test:# We reset concurrent_inserts value to whatever it was at the start of the test
-t/mysqldump.test:# This line must be executed _after_ all test cases.
+t/mysqldump.test:# We reset concurrent_inserts value to whatever it was at the start of the
+t/mysqldump.test:# test This line must be executed _after_ all test cases.
+t/mysqldump.test:###########################################################################
 t/mysqldump.test:###########################################################################
 t/mysqldump.test:###########################################################################
 t/mysqldump.test:# Wait till we reached the initial number of concurrent sessions
@@ -14042,6 +14145,7 @@ t/innodb_notembedded.test:#
 t/innodb_notembedded.test:# BUG#11238 - in prelocking mode SELECT .. FOR UPDATE is changed to
 t/innodb_notembedded.test:# non-blocking SELECT
 t/innodb_notembedded.test:#
+t/innodb_notembedded.test:# Cleanup
 t/type_blob.test:# This test can't be run with running server (--extern) as this uses
 t/type_blob.test:# load_file() on a file in the tree.
 t/type_blob.test:#
@@ -14176,6 +14280,9 @@ t/analyse.test:#
 t/analyse.test:#
 t/analyse.test:# Bug #20305 PROCEDURE ANALYSE() returns wrong M for FLOAT(M, D) and DOUBLE(M, D)
 t/analyse.test:#
+t/analyse.test:#
+t/analyse.test:# Bug#46184 Crash, SELECT ... FROM derived table procedure analyze
+t/analyse.test:#
 t/tablelock.test:#
 t/tablelock.test:# Test of lock tables
 t/tablelock.test:#
@@ -14778,6 +14885,10 @@ t/partition_error.test:# Simple test for
 t/partition_error.test:# partition storage engine
 t/partition_error.test:#
 t/partition_error.test:#
+t/partition_error.test:# Bug#44108: Assertion bitmap_is_set in ha_partition::end_bulk_insert
+t/partition_error.test:#
+t/partition_error.test:#
+t/partition_error.test:#
 t/partition_error.test:# Bug#38719: Partitioning returns a different error code for a
 t/partition_error.test:# duplicate key error
 t/partition_error.test:#
@@ -16123,9 +16234,6 @@ t/variables_debug.test:#
 t/variables_debug.test:#
 t/variables_debug.test:# Bug#38054: "SET SESSION debug" modifies @@global.debug variable
 t/variables_debug.test:#
-t/row-checksum-old.test:#
-t/row-checksum-old.test:# Run row-checksum.test with old mode
-t/row-checksum-old.test:#
 t/log_tables.test:# this test needs multithreaded mysqltest
 t/log_tables.test:#
 t/log_tables.test:# Basic log tables test
@@ -16701,7 +16809,10 @@ t/derived.test:#
 t/derived.test:#
 t/derived.test:# Bug#10586 - query works with 4.1.8, but not with 4.1.11
 t/derived.test:#
-t/derived.test:# End of 4.1 tests
+t/derived.test:#
+t/derived.test:# Bug #41156: List of derived tables acts like a chain of
+t/derived.test:#             mutually-nested subqueries
+t/derived.test:#
 t/sp_stress_case.test:#
 t/sp_stress_case.test:# Bug#19194 (Right recursion in parser for CASE causes excessive stack
 t/sp_stress_case.test:#   usage, limitation)
@@ -16805,6 +16916,9 @@ t/insert_select.test:#
 t/insert_select.test:# Bug #29095: incorrect pushing of LIMIT into the temporary
 t/insert_select.test:# table ignoring ORDER BY clause
 t/insert_select.test:#
+t/insert_select.test:# To force MyISAM temp. table in the following INSERT ... SELECT.
+t/insert_select.test:# To overflow the temp. table.
+t/insert_select.test:# Cleanup
 t/type_newdecimal.test:#
 t/type_newdecimal.test:# constant IN function test
 t/type_newdecimal.test:#
@@ -18856,6 +18970,13 @@ t/innodb_mysql.test:# index on c3 will b
 t/innodb_mysql.test:# if we force the primary key, we can see the estimate is 1 
 t/innodb_mysql.test:# SHOULD use the pk.
 t/innodb_mysql.test:# if we switch it from a primary key to a regular index, it works correctly as well
+t/partition_disabled.test:# Run this test only when mysqld has partitioning, but it is disabled.
+t/partition_disabled.test:# The statements are not expected to work, just check that we
+t/partition_disabled.test:# can't crash the server.
+t/partition_disabled.test:#
+t/partition_disabled.test:# Bug#39893: Crash if select on a partitioned table,
+t/partition_disabled.test:#            when partitioning is disabled
+t/partition_disabled.test:# Create a table without partitions to test "EXPLAIN PARTITIONS"
 t/myisamlog_coverage.test:#
 t/myisamlog_coverage.test:# Coverage testing of MyISAM logical logging and the myisamlog utility
 t/myisamlog_coverage.test:#
@@ -18918,6 +19039,9 @@ t/myisamlog_coverage.test:#
 t/myisamlog_coverage.test:#
 t/myisamlog_coverage.test:#
 t/myisamlog_coverage.test:# Cleanup.
+t/innodb_mysql_lock.test:# Save the initial number of concurrent sessions.
+t/innodb_mysql_lock.test:# Check that all connections opened by test cases in this file are really
+t/innodb_mysql_lock.test:# gone so execution of other tests won't be affected by their presence.
 t/kill.test:# This test doesn't work with the embedded version as this code
 t/kill.test:# assumes that one query is running while we are doing queries on
 t/kill.test:# a second connection.
@@ -19337,6 +19461,9 @@ t/signal_demo2.test:# the but cleanup co
 t/signal_demo2.test:#
 t/ctype_cp932_binlog_row.test:# This is a wrapper for binlog.test so that the same test case can be used 
 t/ctype_cp932_binlog_row.test:# For both statement and row based bin logs 11/07/2005 [jbm]
+t/partition_truncate.test:#
+t/partition_truncate.test:# Simple tests to verify truncate partition syntax
+t/partition_truncate.test:#
 t/strict_autoinc_3heap.test:#
 t/strict_autoinc_3heap.test:# Bug#20573 Strict mode auto-increment
 t/strict_autoinc_3heap.test:#
@@ -20250,6 +20377,7 @@ t/system_mysql_db_refs.test:# 'Db' field
 t/system_mysql_db_refs.test:# 'User' field must be the same for all the tables:
 t/system_mysql_db_refs.test:# 'Table_name' field must be the same for all the tables:
 t/system_mysql_db_refs.test:# End of 4.1 tests
+t/subselect4.test:# General purpose bug fix tests go here : subselect.test too large
 t/deadlock_innodb.test:# t/deadlock_innodb.test
 t/deadlock_innodb.test:#
 t/deadlock_innodb.test:#
@@ -20941,6 +21069,9 @@ t/merge.test:#
 t/merge.test:#Bug #44040   MySQL allows creating a MERGE table upon VIEWs but crashes 
 t/merge.test:#when using it
 t/merge.test:#
+t/merge.test:# Open the MERGE table and allocate buffers based on children's definition.
+t/merge.test:# Change the child table definition.
+t/merge.test:# Check that old buffers are not reused
 t/merge.test:#
 t/merge.test:# WL#4144 - Lock MERGE engine children
 t/merge.test:#
@@ -21230,6 +21361,9 @@ t/windows.test:#
 t/windows.test:# Bug #33813: Schema names are case-sensitive in DROP FUNCTION
 t/windows.test:#
 t/windows.test:#
+t/windows.test:# Bug #42173: "named_pipes" system variable not properly defined on Windows
+t/windows.test:#
+t/windows.test:#
 t/windows.test:# Bug #20665: All commands supported in Stored Procedures should work in
 t/windows.test:# Prepared Statements
 t/windows.test:#
@@ -21305,6 +21439,21 @@ t/partition.test:#                      
 t/partition.test:#                    - Minor cleanup
 t/partition.test:#
 t/partition.test:#
+t/partition.test:# Bug#46639: 1030 (HY000): Got error 124 from storage engine on
+t/partition.test:# INSERT ... SELECT ...
+t/partition.test:#
+t/partition.test:# Bug#46478: timestamp field incorrectly defaulted when partition is reorganized
+t/partition.test:#
+t/partition.test:#
+t/partition.test:# Bug#45904: Error when CHARSET=utf8 and subpartitioning
+t/partition.test:#
+t/partition.test:#
+t/partition.test:# Bug#44059: rec_per_key on empty partition gives weird optimiser results
+t/partition.test:#
+t/partition.test:#
+t/partition.test:# Bug#40181: hang if create index
+t/partition.test:#
+t/partition.test:#
 t/partition.test:# Bug#36001: Partitions: spelling and using some error messages
 t/partition.test:#
 t/partition.test:#
@@ -21481,6 +21630,9 @@ t/partition.test:#
 t/partition.test:# BUG 15407 Crash with subpartition
 t/partition.test:#
 t/partition.test:#
+t/partition.test:# Bug 46354 Crash with subpartition
+t/partition.test:#
+t/partition.test:#
 t/partition.test:# BUG 15961 No error when subpartition defined without subpartition by clause
 t/partition.test:#
 t/partition.test:#
@@ -21596,10 +21748,6 @@ t/partition.test:#
 t/partition.test:# Bug #30484: Partitions: crash with self-referencing trigger
 t/partition.test:#
 t/partition.test:#
-t/partition.test:# Bug #27816: Log tables ran with partitions crashes the server when logging
-t/partition.test:# is enabled.
-t/partition.test:#
-t/partition.test:#
 t/partition.test:# Bug #27084 partitioning by list seems failing when using case 
 t/partition.test:# BUG #18198: Case no longer supported, test case removed
 t/partition.test:#
@@ -21634,6 +21782,34 @@ t/partition.test:#
 t/partition.test:#
 t/partition.test:# Bug#44821: select distinct on partitioned table returns wrong results
 t/partition.test:#
+t/partition.test:# This testcase is commented due to the Bug #46853
+t/partition.test:# Should be uncommented after fixing Bug #46853
+t/partition.test:#--echo #
+t/partition.test:#--echo # BUG#45816 - assertion failure with index containing double 
+t/partition.test:#--echo #             column on partitioned table
+t/partition.test:#--echo #
+t/partition.test:#
+t/partition.test:#CREATE TABLE t1 (
+t/partition.test:#  a INT DEFAULT NULL,
+t/partition.test:#  b DOUBLE DEFAULT NULL,
+t/partition.test:#  c INT DEFAULT NULL,
+t/partition.test:#  KEY idx2(b,a)
+t/partition.test:#) PARTITION BY HASH(c) PARTITIONS 3;
+t/partition.test:#
+t/partition.test:#INSERT INTO t1 VALUES (6,8,9);
+t/partition.test:#INSERT INTO t1 VALUES (6,8,10);
+t/partition.test:#
+t/partition.test:#SELECT  1 FROM t1 JOIN t1 AS t2 USING (a) FOR UPDATE;
+t/partition.test:#
+t/partition.test:#DROP TABLE t1;
+t/partition.test:#
+t/partition.test:# Case 1.
+t/partition.test:#
+t/partition.test:# The SELECT below used to hang in tdc_wait_for_old_versions().
+t/partition.test:#
+t/partition.test:# Case 2.
+t/partition.test:#
+t/partition.test:# The SELECT below used to hang in tdc_wait_for_old_versions().
 t/dirty_close.test:# Save the initial number of concurrent sessions
 t/dirty_close.test:# End of 4.1 tests
 t/dirty_close.test:#
@@ -22112,6 +22288,14 @@ t/temp_table.test:#
 t/mysql_upgrade.test:# Can't run test of external client with embedded server
 t/mysql_upgrade.test:# Only run test if "mysql_upgrade" is found
 t/mysql_upgrade.test:#
+t/mysql_upgrade.test:# Hack:
+t/mysql_upgrade.test:#
+t/mysql_upgrade.test:# If running with Valgrind ($VALGRIND_TEST <> 0) then the resource
+t/mysql_upgrade.test:# consumption (CPU) for upgrading a large log table will be intense.
+t/mysql_upgrade.test:# Therefore, truncate the log table in advance and issue a statement
+t/mysql_upgrade.test:# that should be logged.
+t/mysql_upgrade.test:#
+t/mysql_upgrade.test:#
 t/mysql_upgrade.test:# Basic test that we can run mysql_upgrde and that it finds the
 t/mysql_upgrade.test:# expected binaries it uses.
 t/mysql_upgrade.test:#
@@ -22303,7 +22487,7 @@ t/backup_disabled.test:# This tests that
 t/backup_disabled.test:# server by default.
 t/backup_disabled.test:#
 t/backup_disabled.test:# Note: All backup tests and suites will run as normal using the 
-t/backup_disabled.test:#       --new server startup option
+t/backup_disabled.test:#       --mysql-backup server startup option
 t/backup_disabled.test:#
 t/ps.test:#
 t/ps.test:# SQL Syntax for Prepared Statements test
@@ -23260,6 +23444,7 @@ t/ps_1general.test:#     Matthias
 t/ps_1general.test:# End of 4.1 tests
 t/ps_not_windows.test:# doesn't work with embedded server
 t/ps_not_windows.test:# Non-windows specific ps tests.
+t/ps_not_windows.test:# requires dynamic loading
 t/ps_not_windows.test:#
 t/ps_not_windows.test:# Bug #20665: All commands supported in Stored Procedures should work in
 t/ps_not_windows.test:# Prepared Statements
@@ -23749,6 +23934,8 @@ t/subselect.test:#
 t/subselect.test:# Bug#36011 Server crash with explain extended on query with dependent
 t/subselect.test:#           subqueries
 t/subselect.test:#
+t/subselect.test:# should have "impossible where"
+t/subselect.test:# should not crash
 t/subselect.test:#
 t/subselect.test:# Test [NOT] IN truth table (both as top-level and general predicate).
 t/subselect.test:#
@@ -23923,12 +24110,23 @@ t/lowercase_table_grant.test:#
 t/lowercase_table_grant.test:# can't use REVOKE because of the mixed-case database name
 t/lowercase_table_grant.test:# End of 4.1 tests
 t/partition_innodb.test:#
+t/partition_innodb.test:# Bug#47029: Crash when reorganize partition with subpartition
+t/partition_innodb.test:#
+t/partition_innodb.test:#
 t/partition_innodb.test:# Bug#40595: Non-matching rows not released with READ-COMMITTED on tables
 t/partition_innodb.test:#            with partitions
+t/partition_innodb.test:# SHOW ENGINE InnoDB STATUS does not show transaction info in
+t/partition_innodb.test:# PERFORMANCE-VERSION
 t/partition_innodb.test:# grouping/referencing in replace_regex is very slow on long strings,
 t/partition_innodb.test:# removing all before/after the interesting row before grouping/referencing
+t/partition_innodb.test:#--replace_regex /.*---TRANSACTION [0-9]+ [0-9]+, .*, OS thread id [0-9]+// /MySQL thread id [0-9]+, query id [0-9]+ .*// /.*([0-9]+) lock struct\(s\), heap size [0-9]+, ([0-9]+) row lock\(s\).*/\1 lock struct(s) \2 row lock(s)/
+t/partition_innodb.test:#SHOW ENGINE InnoDB STATUS;
+t/partition_innodb.test:# SHOW ENGINE InnoDB STATUS does not show transaction info in
+t/partition_innodb.test:# PERFORMANCE-VERSION
 t/partition_innodb.test:# grouping/referencing in replace_regex is very slow on long strings,
 t/partition_innodb.test:# removing all before/after the interesting row before grouping/referencing
+t/partition_innodb.test:#--replace_regex /.*---TRANSACTION [0-9]+ [0-9]+, .*, OS thread id [0-9]+// /MySQL thread id [0-9]+, query id [0-9]+ .*// /.*([0-9]+ lock struct\(s\)), heap size [0-9]+, ([0-9]+ row lock\(s\)).*/\1 \2/
+t/partition_innodb.test:#SHOW ENGINE InnoDB STATUS;
 t/partition_innodb.test:#
 t/partition_innodb.test:# Bug37721: ORDER BY when WHERE contains non-partitioned index column
 t/partition_innodb.test:# wrong order since it did not use pk as second compare
@@ -23959,6 +24157,11 @@ t/partition_innodb.test:#
 t/partition_innodb.test:#
 t/partition_innodb.test:# Bug #31893 Partitions: crash if subpartitions and engine change
 t/partition_innodb.test:#
+t/partition_innodb.test:#
+t/partition_innodb.test:# BUG#46483 - drop table of partitioned table may leave extraneous file
+t/partition_innodb.test:# Note: was only repeatable with InnoDB plugin
+t/partition_innodb.test:#
+t/partition_innodb.test:# Before the fix it should show extra file like #sql-2405_2.par
 t/grant2.test:# Grant tests not performed with embedded server
 t/grant2.test:# Save the initial number of concurrent sessions
 t/grant2.test:#
@@ -24235,6 +24438,9 @@ t/order_by.test:#
 t/order_by.test:#
 t/order_by.test:# Bug#35844: Covering index for ref access not compatible with ORDER BY list
 t/order_by.test:#
+t/order_by.test:#
+t/order_by.test:# Bug#46454: MySQL wrong index optimisation leads to incorrect result & crashes 
+t/order_by.test:#
 t/func_encrypt_nossl.test:#
 t/func_encrypt_nossl.test:# Test output from des_encrypt and des_decrypt when server is
 t/func_encrypt_nossl.test:# compiled without openssl suuport
@@ -24263,6 +24469,21 @@ t/empty_table.test:#
 t/empty_table.test:# Some special cases with empty tables
 t/empty_table.test:#
 t/empty_table.test:# End of 4.1 tests
+t/partition_rename_longfilename.test:#
+t/partition_rename_longfilename.test:# Bug#30102: rename table does corrupt tables with partition files on failure
+t/partition_rename_longfilename.test:# This test case renames the table such that the partition file name 
+t/partition_rename_longfilename.test:# is 255 chars long. Due the restriction of 260 char path name (including drive label)
+t/partition_rename_longfilename.test:# this will fail in windows.
+t/partition_rename_longfilename.test:# Other tests related to this bug can be found in partition_not_embedded.test
+t/partition_rename_longfilename.test:#
+t/partition_rename_longfilename.test:# partition p1 is 't1#P#p1' + @002e * 20 = 107 characters + file ending
+t/partition_rename_longfilename.test:# total path lenght of './test/t1#P#p1@002e@002e<...>@002e.MY[ID]' is 118 chars
+t/partition_rename_longfilename.test:#                      1234567890123456789012345678
+t/partition_rename_longfilename.test:# t2_ + end
+t/partition_rename_longfilename.test:#     .MY[ID] or .frm
+t/partition_rename_longfilename.test:#         #P#p[012]
+t/partition_rename_longfilename.test:#             28 * @002e
+t/partition_rename_longfilename.test:# 6 + 4 + 5 + 28 * 5 = 155
 t/log_tables-big.test:# this test needs multithreaded mysqltest
 t/log_tables-big.test:# Test sleeps for long times
 t/log_tables-big.test:# check that CSV engine was compiled in
@@ -24376,6 +24597,26 @@ t/distinct.test:#
 t/distinct.test:#
 t/distinct.test:# Bug #34928: Confusion by having Primary Key and Index
 t/distinct.test:#
+t/distinct.test:# Set max_heap_table_size to the minimum value so that GROUP BY table in the
+t/distinct.test:# SELECT query below gets converted to MyISAM
+t/distinct.test:# Set sort_buffer_size to the mininum value so that remove_duplicates() calls
+t/distinct.test:# remove_dup_with_compare()
+t/distinct.test:# Now we just need to pad the table with random data so we have enough unique
+t/distinct.test:# values to force conversion of the GROUP BY table to MyISAM
+t/distinct.test:# First rows of the GROUP BY table that will be processed by 
+t/distinct.test:# remove_dup_with_compare()
+t/distinct.test:# The actual test case
+t/distinct.test:# Cleanup
+t/partition_not_embedded.test:#
+t/partition_not_embedded.test:# Bug#30102: rename table does corrupt tables with partition files on failure
+t/partition_not_embedded.test:#
+t/partition_not_embedded.test:# partition p1 is 't1#P#p1' + @002e * 20 = 107 characters + file ending
+t/partition_not_embedded.test:# total path lenght of './test/t1#P#p1@002e@002e<...>@002e.MY[ID]' is 118 chars
+t/partition_not_embedded.test:# 7,7 avoids the error message, which is not deterministic.
+t/partition_not_embedded.test:#                         1234567890123456789012345678901234567890123456
+t/partition_not_embedded.test:# 7,7 avoids the error message, which is not deterministic.
+t/partition_not_embedded.test:#                      1234567890123456789012345678
+t/partition_not_embedded.test:# 7 + 4 + 5 + 28 * 5 = 16 + 140 = 156
 t/parser_not_embedded.test:###########################################################################
 t/myisam_mrr.test:#
 t/myisam_mrr.test:# MRR/MyISAM tests.
@@ -25305,6 +25546,155 @@ t/mysqlshow.test:#
 t/mysqlshow.test:#
 t/mysqlshow.test:# Bug #19147: mysqlshow INFORMATION_SCHEMA does not work
 t/mysqlshow.test:#
+suite/innodb/t/innodb_file_format.test:#
+suite/innodb/t/innodb_file_format.test:# restore environment to the state it was before this test execution
+suite/innodb/t/innodb_file_format.test:#
+suite/innodb/t/innodb_bug40360.test:#
+suite/innodb/t/innodb_bug40360.test:# Make sure http://bugs.mysql.com/40360 remains fixed.
+suite/innodb/t/innodb_bug40360.test:#
+suite/innodb/t/innodb_bug40360.test:# This is the default since MySQL 5.1.29 SET BINLOG_FORMAT='STATEMENT';
+suite/innodb/t/innodb_bug41904.test:#
+suite/innodb/t/innodb_bug41904.test:# Make sure http://bugs.mysql.com/41904 remains fixed.
+suite/innodb/t/innodb_bug41904.test:#
+suite/innodb/t/innodb-zip.test:# The following should fail even in non-strict mode.
+suite/innodb/t/innodb-zip.test:#
+suite/innodb/t/innodb-zip.test:# Test blob column inheritance (mantis issue#36)
+suite/innodb/t/innodb-zip.test:#
+suite/innodb/t/innodb-zip.test:# one blob column which is unchanged in update and part of PK
+suite/innodb/t/innodb-zip.test:# one blob column which is changed and part of of PK
+suite/innodb/t/innodb-zip.test:# one blob column which is not part of PK and is unchanged
+suite/innodb/t/innodb-zip.test:#
+suite/innodb/t/innodb-zip.test:#
+suite/innodb/t/innodb-zip.test:# Test innodb_file_format
+suite/innodb/t/innodb-zip.test:#
+suite/innodb/t/innodb-zip.test:#test strict mode.
+suite/innodb/t/innodb-zip.test:# this does not work anymore, has been removed from mysqltest
+suite/innodb/t/innodb-zip.test:# -- enable_errors
+suite/innodb/t/innodb-zip.test:#set strict_mode
+suite/innodb/t/innodb-zip.test:#Test different values of KEY_BLOCK_SIZE
+suite/innodb/t/innodb-zip.test:#check various ROW_FORMAT values.
+suite/innodb/t/innodb-zip.test:#test different values of ROW_FORMAT with KEY_BLOCK_SIZE
+suite/innodb/t/innodb-zip.test:#test multiple errors
+suite/innodb/t/innodb-zip.test:#test valid values with innodb_file_per_table unset
+suite/innodb/t/innodb-zip.test:#test valid values with innodb_file_format unset
+suite/innodb/t/innodb-zip.test:#
+suite/innodb/t/innodb-zip.test:# Testing of tablespace tagging
+suite/innodb/t/innodb-zip.test:#
+suite/innodb/t/innodb-zip.test:#
+suite/innodb/t/innodb-zip.test:# restore environment to the state it was before this test execution
+suite/innodb/t/innodb-zip.test:#
+suite/innodb/t/innodb_bug36169.test:#
+suite/innodb/t/innodb_bug36169.test:# Bug#36169 create innodb compressed table with too large row size crashed
+suite/innodb/t/innodb_bug36169.test:# http://bugs.mysql.com/36169
+suite/innodb/t/innodb_bug36169.test:#
+suite/innodb/t/innodb_bug36169.test:#
+suite/innodb/t/innodb_bug36169.test:# The following is copied from http://bugs.mysql.com/36169
+suite/innodb/t/innodb_bug36169.test:# (http://bugs.mysql.com/file.php?id=9121)
+suite/innodb/t/innodb_bug36169.test:# Probably it can be simplified but that is not obvious.
+suite/innodb/t/innodb_bug36169.test:#
+suite/innodb/t/innodb_bug36169.test:# we care only that the following SQL commands do produce errors
+suite/innodb/t/innodb_bug36169.test:# as expected and do not crash the server
+suite/innodb/t/innodb_bug36169.test:# Generating 10 tables
+suite/innodb/t/innodb_bug36169.test:# Creating a table with 94 columns and 24 indexes
+suite/innodb/t/innodb_bug36169.test:# Creating a table with 10 columns and 32 indexes
+suite/innodb/t/innodb_bug36169.test:# Creating a table with 141 columns and 18 indexes
+suite/innodb/t/innodb_bug36169.test:# Creating a table with 199 columns and 1 indexes
+suite/innodb/t/innodb_bug36169.test:# Creating a table with 133 columns and 16 indexes
+suite/innodb/t/innodb_bug36169.test:# Creating a table with 176 columns and 13 indexes
+suite/innodb/t/innodb_bug36169.test:# Creating a table with 179 columns and 46 indexes
+suite/innodb/t/innodb_bug44032.test:# Bug44032 no update-in-place of UTF-8 columns in ROW_FORMAT=REDUNDANT
+suite/innodb/t/innodb_bug44032.test:# (btr_cur_update_in_place not invoked when updating from/to NULL;
+suite/innodb/t/innodb_bug44032.test:# the update is performed by delete and insert instead)
+suite/innodb/t/innodb_information_schema.test:# 
+suite/innodb/t/innodb_information_schema.test:# Test that user data is correctly "visualized" in
+suite/innodb/t/innodb_information_schema.test:# INFORMATION_SCHEMA.innodb_locks.lock_data
+suite/innodb/t/innodb_information_schema.test:#
+suite/innodb/t/innodb_information_schema.test:# Give time to the above 2 queries to execute before continuing.
+suite/innodb/t/innodb_information_schema.test:# Without this sleep it sometimes happens that the SELECT from innodb_locks
+suite/innodb/t/innodb_information_schema.test:# executes before some of them, resulting in less than expected number
+suite/innodb/t/innodb_information_schema.test:# of rows being selected from innodb_locks.
+suite/innodb/t/innodb-index.test:# Check how existing tables interfere with temporary tables.
+suite/innodb/t/innodb-index.test:# Apparently, the following makes mysql_alter_table() drop index d.
+suite/innodb/t/innodb-index.test:# This should preserve the foreign key constraints.
+suite/innodb/t/innodb-index.test:# a foreign key 'test/dc' already exists
+suite/innodb/t/innodb-index.test:# there is no foreign key dc on t3
+suite/innodb/t/innodb-index.test:# r2667 The following test is disabled because MySQL behavior changed.
+suite/innodb/t/innodb-index.test:# r2667 The test was added with this comment:
+suite/innodb/t/innodb-index.test:# r2667 
+suite/innodb/t/innodb-index.test:# r2667 ------------------------------------------------------------------------
+suite/innodb/t/innodb-index.test:# r2667 r1699 | marko | 2007-08-10 19:53:19 +0300 (Fri, 10 Aug 2007) | 5 lines
+suite/innodb/t/innodb-index.test:# r2667 
+suite/innodb/t/innodb-index.test:# r2667 branches/zip: Add changes that accidentally omitted from r1698:
+suite/innodb/t/innodb-index.test:# r2667 
+suite/innodb/t/innodb-index.test:# r2667 innodb-index.test, innodb-index.result: Add a test for creating
+suite/innodb/t/innodb-index.test:# r2667 a PRIMARY KEY on a column that contains a NULL value.
+suite/innodb/t/innodb-index.test:# r2667 ------------------------------------------------------------------------
+suite/innodb/t/innodb-index.test:# r2667 
+suite/innodb/t/innodb-index.test:# r2667 but in BZR-r2667:
+suite/innodb/t/innodb-index.test:# r2667 http://bazaar.launchpad.net/~mysql/mysql-server/mysql-5.1/revision/davi%40mysql.com-20080617141221-8yre8ys9j4uw3xx5?start_revid=joerg%40mysql.com-20080630105418-7qoe5ehomgrcdb89
+suite/innodb/t/innodb-index.test:# r2667 MySQL changed the behavior to do full table copy when creating PRIMARY INDEX
+suite/innodb/t/innodb-index.test:# r2667 on a non-NULL column instead of calling ::add_index() which would fail (and
+suite/innodb/t/innodb-index.test:# r2667 this is what we were testing here). Before r2667 the code execution path was
+suite/innodb/t/innodb-index.test:# r2667 like this (when adding PRIMARY INDEX on a non-NULL column with ALTER TABLE):
+suite/innodb/t/innodb-index.test:# r2667 
+suite/innodb/t/innodb-index.test:# r2667 mysql_alter_table()
+suite/innodb/t/innodb-index.test:# r2667   compare_tables()  // would return ALTER_TABLE_INDEX_CHANGED
+suite/innodb/t/innodb-index.test:# r2667   ::add_index()  // would fail with "primary index cannot contain NULL"
+suite/innodb/t/innodb-index.test:# r2667 
+suite/innodb/t/innodb-index.test:# r2667 after r2667 the code execution path is the following:
+suite/innodb/t/innodb-index.test:# r2667 
+suite/innodb/t/innodb-index.test:# r2667 mysql_alter_table()
+suite/innodb/t/innodb-index.test:# r2667   compare_tables()  // returns ALTER_TABLE_DATA_CHANGED
+suite/innodb/t/innodb-index.test:# r2667   full copy is done, without calling ::add_index()
+suite/innodb/t/innodb-index.test:# r2667 
+suite/innodb/t/innodb-index.test:# r2667 To enable, remove "# r2667: " below.
+suite/innodb/t/innodb-index.test:# r2667 
+suite/innodb/t/innodb-index.test:# r2667: insert into t1 values (null,null,null,'null');
+suite/innodb/t/innodb-index.test:# r2667: --error ER_PRIMARY_CANT_HAVE_NULL
+suite/innodb/t/innodb-index.test:# r2667: alter table t1 add primary key (a), add key (b(20));
+suite/innodb/t/innodb-index.test:# r2667: delete from t1 where d='null';
+suite/innodb/t/innodb-index.test:#
+suite/innodb/t/innodb-index.test:# Test locking
+suite/innodb/t/innodb-index.test:#
+suite/innodb/t/innodb-index.test:# Obtain an IX lock on the table
+suite/innodb/t/innodb-index.test:# This would require an S lock on the table, conflicting with the IX lock.
+suite/innodb/t/innodb-index.test:# Obtain an IS lock on the table
+suite/innodb/t/innodb-index.test:# This will require an S lock on the table.  No conflict with the IS lock.
+suite/innodb/t/innodb-index.test:# This would require an X lock on the table, conflicting with the IS lock.
+suite/innodb/t/innodb-index.test:# The following DROP INDEX will succeed, altough the SELECT above has
+suite/innodb/t/innodb-index.test:# opened a read view.  However, during the execution of the SELECT,
+suite/innodb/t/innodb-index.test:# MySQL should hold a table lock that should block the execution
+suite/innodb/t/innodb-index.test:# of the DROP INDEX below.
+suite/innodb/t/innodb-index.test:# After the index was dropped, subsequent SELECTs will use the same
+suite/innodb/t/innodb-index.test:# read view, but they should not be accessing the dropped index any more.
+suite/innodb/t/innodb-index.test:# Test creating a table that could lead to undo log overflow.
+suite/innodb/t/innodb-index.test:# In the undo log, we write a 768-byte prefix (REC_MAX_INDEX_COL_LEN)
+suite/innodb/t/innodb-index.test:# of each externally stored column that appears as a column prefix in an index.
+suite/innodb/t/innodb-index.test:# For this test case, it would suffice to write 1 byte, though.
+suite/innodb/t/innodb-index.test:#
+suite/innodb/t/innodb-index.test:# Test to check whether CREATE INDEX handles implicit foreign key
+suite/innodb/t/innodb-index.test:# constraint modifications (Issue #70, Bug #38786)
+suite/innodb/t/innodb-index.test:#
+suite/innodb/t/innodb-use-sys-malloc.test:#display current value of innodb_use_sys_malloc
+suite/innodb/t/innodb-use-sys-malloc.test:#try changing it. Should fail.
+suite/innodb/t/innodb-use-sys-malloc.test:#do some stuff to see if it works.
+suite/innodb/t/innodb-use-sys-malloc.test:#display current value of innodb_use_sys_malloc
+suite/innodb/t/innodb-use-sys-malloc.test:#try changing it. Should fail.
+suite/innodb/t/innodb-use-sys-malloc.test:#do some stuff to see if it works.
+suite/innodb/t/innodb_bug36172.test:#
+suite/innodb/t/innodb_bug36172.test:# Test case for bug 36172
+suite/innodb/t/innodb_bug36172.test:#
+suite/innodb/t/innodb_bug36172.test:# we do not really care about what gets printed, we are only
+suite/innodb/t/innodb_bug36172.test:# interested in getting success or failure according to our
+suite/innodb/t/innodb_bug36172.test:# expectations
+suite/innodb/t/innodb-analyze.test:#
+suite/innodb/t/innodb-analyze.test:# Test that mysqld does not crash when running ANALYZE TABLE with
+suite/innodb/t/innodb-analyze.test:# different values of the parameter innodb_stats_sample_pages.
+suite/innodb/t/innodb-analyze.test:#
+suite/innodb/t/innodb-analyze.test:# we care only that the following SQL commands do not produce errors
+suite/innodb/t/innodb-analyze.test:# and do not crash the server
+suite/innodb/t/innodb-analyze.test:# check that the value has been adjusted to 1
+suite/innodb/t/innodb-analyze.test:# test with empty table
 suite/stress/t/ddl_memory.test:######## t/ddl_memory.test ######
 suite/stress/t/ddl_memory.test:#
 suite/stress/t/ddl_memory.test:# Stress the storage engine MEMORY with CREATE/DROP TABLE/INDEX
@@ -29459,7 +29849,7 @@ suite/sys_vars/t/table_definition_cache_
 suite/sys_vars/t/table_definition_cache_basic.test:# Scope: GLOBAL                                                                #
 suite/sys_vars/t/table_definition_cache_basic.test:# Access Type: Dynamic                                                         #
 suite/sys_vars/t/table_definition_cache_basic.test:# Data Type: Numeric                                                           #
-suite/sys_vars/t/table_definition_cache_basic.test:# Default Value: 128                                                           #
+suite/sys_vars/t/table_definition_cache_basic.test:# Default Value: 400                                                           #
 suite/sys_vars/t/table_definition_cache_basic.test:# Range: 1 - 524288                                                            #
 suite/sys_vars/t/table_definition_cache_basic.test:#                                                                              #
 suite/sys_vars/t/table_definition_cache_basic.test:#                                                                              #
@@ -35174,7 +35564,7 @@ suite/sys_vars/t/innodb_thread_concurren
 suite/sys_vars/t/innodb_thread_concurrency_basic.test:# Scope: GLOBAL                                                               #
 suite/sys_vars/t/innodb_thread_concurrency_basic.test:# Access Type: Dynamic                                                        #
 suite/sys_vars/t/innodb_thread_concurrency_basic.test:# Data Type: Numeric                                                          #
-suite/sys_vars/t/innodb_thread_concurrency_basic.test:# Default Value: 8                                                            #
+suite/sys_vars/t/innodb_thread_concurrency_basic.test:# Default Value: 0                                                            #
 suite/sys_vars/t/innodb_thread_concurrency_basic.test:# Range: 0-1000                                                               #
 suite/sys_vars/t/innodb_thread_concurrency_basic.test:#                                                                             #
 suite/sys_vars/t/innodb_thread_concurrency_basic.test:#                                                                             #
@@ -35541,8 +35931,8 @@ suite/sys_vars/t/table_open_cache_basic.
 suite/sys_vars/t/table_open_cache_basic.test:# Scope: GLOBAL                                                               #
 suite/sys_vars/t/table_open_cache_basic.test:# Access Type: Dynamic                                                        #
 suite/sys_vars/t/table_open_cache_basic.test:# Data Type: numeric                                                          #
-suite/sys_vars/t/table_open_cache_basic.test:# Default Value: 64                                                           #
-suite/sys_vars/t/table_open_cache_basic.test:# Range: 1-524288                                                             #
+suite/sys_vars/t/table_open_cache_basic.test:# Default Value: 400                                                         #
+suite/sys_vars/t/table_open_cache_basic.test:# Range: 64-524288                                                             #
 suite/sys_vars/t/table_open_cache_basic.test:#                                                                             #
 suite/sys_vars/t/table_open_cache_basic.test:#                                                                             #
 suite/sys_vars/t/table_open_cache_basic.test:# Creation Date: 2008-02-13                                                   #
@@ -36640,7 +37030,8 @@ suite/sys_vars/t/innodb_file_io_threads_
 suite/sys_vars/t/innodb_file_io_threads_basic.test:#  Check if accessing variable with and without GLOBAL point to same variable  #
 suite/sys_vars/t/innodb_file_io_threads_basic.test:################################################################################
 suite/sys_vars/t/innodb_file_io_threads_basic.test:################################################################################
-suite/sys_vars/t/innodb_file_io_threads_basic.test:#   Check if innodb_file_io_threads can be accessed with and without @@ sign   #
+suite/sys_vars/t/innodb_file_io_threads_basic.test:#   Check if innodb_read_io_threads can be accessed with and without @@ sign   #
+suite/sys_vars/t/innodb_file_io_threads_basic.test:#   Check if innodb_write_io_threads can be accessed with and without @@ sign  #
 suite/sys_vars/t/innodb_file_io_threads_basic.test:################################################################################
 suite/sys_vars/t/innodb_open_files_basic.test:################## mysql-test\t\innodb_open_files_basic.test ##################
 suite/sys_vars/t/innodb_open_files_basic.test:#                                                                             #
@@ -53946,6 +54337,19 @@ suite/backup_extra/t/backup_object_cover
 suite/backup_extra/t/backup_object_coverage.test:# Disable fkey constraint checks which can be violated when objects are
 suite/backup_extra/t/backup_object_coverage.test:# dropped.
 suite/backup_extra/t/backup_object_coverage.test:#
+suite/backup_extra/t/backup_interop.test:# This test file is for WL#4732 (Interoperability testing).
+suite/backup_extra/t/backup_interop.test:# The objects for database db1 will be created in the RQG grammar file 
+suite/backup_extra/t/backup_interop.test:# backup_obj.yy. The server operations will be executed by grammar file 
+suite/backup_extra/t/backup_interop.test:# backup_interop.yy. Backup and Restore operations will be executed
+suite/backup_extra/t/backup_interop.test:# periodically from the reporter file. These RQG test files will be embedded
+suite/backup_extra/t/backup_interop.test:# with MTR. The intention of mysql test file is to create database, tables 
+suite/backup_extra/t/backup_interop.test:# and load some data before the objects are created from grammar file. 
+suite/backup_extra/t/backup_interop.test:# This way BACKUP will take some time to complete while concurrent server 
+suite/backup_extra/t/backup_interop.test:# operations are executed.
+suite/backup_extra/t/backup_interop.test:#
+suite/backup_extra/t/backup_interop.test:# Set the RQG_HOME variable before executing the test. Environment variable 
+suite/backup_extra/t/backup_interop.test:# RQG_HOME should point to RQG installation.
+suite/backup_extra/t/backup_interop.test:#
 suite/backup_extra/include/objects.grammar:############################################################################
 suite/backup_extra/include/objects.grammar:# This is a grammar for the Random Query Generator (RQG). It is used in
 suite/backup_extra/include/objects.grammar:# backup_object_coverage.test to generate statements which create and set
@@ -55198,6 +55602,38 @@ suite/rpl/t/rpl_binlog_max_cache_size.te
 suite/rpl/t/rpl_extraColmaster_myisam.test:#############################################################
 suite/rpl/t/rpl_extraColmaster_myisam.test:# Purpose: To test having extra columns on the master WL#3915
 suite/rpl/t/rpl_extraColmaster_myisam.test:#############################################################
+suite/rpl/t/rpl_create_if_not_exists.test:# BUG#45574:
+suite/rpl/t/rpl_create_if_not_exists.test:# SP: CREATE DATABASE|TABLE IF NOT EXISTS not binlogged if routine exists.
+suite/rpl/t/rpl_create_if_not_exists.test:#
+suite/rpl/t/rpl_create_if_not_exists.test:#   There is an inconsistency with DROP DATABASE|TABLE|EVENT IF EXISTS and
+suite/rpl/t/rpl_create_if_not_exists.test:#   CREATE DATABASE|TABLE|EVENT IF NOT EXISTS. DROP IF EXISTS statements are
+suite/rpl/t/rpl_create_if_not_exists.test:#   binlogged even if either the DB, TABLE or EVENT does not exist. In
+suite/rpl/t/rpl_create_if_not_exists.test:#   contrast, Only the CREATE EVENT IF NOT EXISTS is binlogged when the EVENT
+suite/rpl/t/rpl_create_if_not_exists.test:#   exists.  
+suite/rpl/t/rpl_create_if_not_exists.test:#
+suite/rpl/t/rpl_create_if_not_exists.test:#   This problem caused some of the tests to fail randomly on PB or PB2.
+suite/rpl/t/rpl_create_if_not_exists.test:#
+suite/rpl/t/rpl_create_if_not_exists.test:# Description: 
+suite/rpl/t/rpl_create_if_not_exists.test:#   Fixed this bug by adding calls to write_bin_log in: 
+suite/rpl/t/rpl_create_if_not_exists.test:#   mysql_create_db 
+suite/rpl/t/rpl_create_if_not_exists.test:#   mysql_create_table_no_lock 
+suite/rpl/t/rpl_create_if_not_exists.test:#   mysql_create_like_table 
+suite/rpl/t/rpl_create_if_not_exists.test:#   create_table_from_items 
+suite/rpl/t/rpl_create_if_not_exists.test:#
+suite/rpl/t/rpl_create_if_not_exists.test:#   Test is implemented as follows: 
+suite/rpl/t/rpl_create_if_not_exists.test:#   i) test each "CREATE IF NOT EXISTS" (DDL), found in MySQL 5.1 manual
+suite/rpl/t/rpl_create_if_not_exists.test:#   exclude CREATE TEMPORARY TABLE, on existent objects; 
+suite/rpl/t/rpl_create_if_not_exists.test:#
+suite/rpl/t/rpl_create_if_not_exists.test:#  Note: 
+suite/rpl/t/rpl_create_if_not_exists.test:#  rpl_create_tmp_table_if_not_exists.test tests CREATE TEMPORARY TABLE cases.
+suite/rpl/t/rpl_create_if_not_exists.test:#
+suite/rpl/t/rpl_create_if_not_exists.test:#  References:
+suite/rpl/t/rpl_create_if_not_exists.test:#  http://dev.mysql.com/doc/refman/5.1/en/sql-syntax-data-definition.html
+suite/rpl/t/rpl_create_if_not_exists.test:#
+suite/rpl/t/rpl_create_if_not_exists.test:#DROP database from slave.
+suite/rpl/t/rpl_create_if_not_exists.test:#The database and all tables can be recreated in slave 
+suite/rpl/t/rpl_create_if_not_exists.test:#if binlog of the second CREATE command is recorded and sent from master to slave.
+suite/rpl/t/rpl_create_if_not_exists.test:#Execution time changes in each run. So we disregard it by calling replace_column.
 suite/rpl/t/rpl_create_database.test:#
 suite/rpl/t/rpl_create_database.test:# Tests for replication of statements that manipulate databases.
 suite/rpl/t/rpl_create_database.test:#
@@ -55482,98 +55918,9 @@ suite/rpl/t/rpl_backup_block.test:#   Ca
 suite/rpl/t/rpl_backup_block.test:#   Case 4 - Verify slaves can connect after restore
 suite/rpl/t/rpl_backup_block.test:#
 suite/rpl/t/rpl_backup_block.test:# Must mask command because dir in evaluation of $MYSQL... is not deterministic
-suite/rpl/t/rpl_backup_block.test:#
-suite/rpl/t/rpl_backup_block.test:# BUG#44830 : SLAVE START no longer results in error if RESTORE is running on master
-suite/rpl/t/rpl_backup_block.test:#
-suite/rpl/t/rpl_backup_block.test:#--echo #
-suite/rpl/t/rpl_backup_block.test:#--echo # Case 2 - Verify a new slave cannot connect
-suite/rpl/t/rpl_backup_block.test:#--echo #
-suite/rpl/t/rpl_backup_block.test:#
-suite/rpl/t/rpl_backup_block.test:#connect (slave2,localhost,root,,test,$SLAVE_MYPORT2,$SLAVE_MYSOCK2);
-suite/rpl/t/rpl_backup_block.test:#
-suite/rpl/t/rpl_backup_block.test:#--echo # Connecting to slave 2...
-suite/rpl/t/rpl_backup_block.test:#connection slave2;
-suite/rpl/t/rpl_backup_block.test:#
-suite/rpl/t/rpl_backup_block.test:#--echo # Capture slave 2's backupdir.
-suite/rpl/t/rpl_backup_block.test:#let $MYSQLD_S2_BACKUPDIR= `select @@datadir`;
-suite/rpl/t/rpl_backup_block.test:#SET @@global.backupdir = @@global.datadir;
-suite/rpl/t/rpl_backup_block.test:#
-suite/rpl/t/rpl_backup_block.test:#--replace_result $MASTER_MYPORT MASTER_A_PORT $_binlog_file MASTER_A_LOG_FILE $master_before_pos MASTER_A_LOG_POS
-suite/rpl/t/rpl_backup_block.test:#--eval CHANGE MASTER TO master_host='127.0.0.1',master_port=$MASTER_MYPORT,master_user='root',master_log_file='$_binlog_file',master_log_pos=$master_before_pos
-suite/rpl/t/rpl_backup_block.test:#
-suite/rpl/t/rpl_backup_block.test:#--echo # Now verify slave cannot start.
-suite/rpl/t/rpl_backup_block.test:#--error ER_RESTORE_CANNOT_START_SLAVE
-suite/rpl/t/rpl_backup_block.test:#START SLAVE;
-suite/rpl/t/rpl_backup_block.test:#
-suite/rpl/t/rpl_backup_block.test:#--echo #
-suite/rpl/t/rpl_backup_block.test:#--echo # Case 3 - Verify connected slave cannot reestablish replication
-suite/rpl/t/rpl_backup_block.test:#--echo #
-suite/rpl/t/rpl_backup_block.test:#
-suite/rpl/t/rpl_backup_block.test:#--echo # Connecting to slave 1...
-suite/rpl/t/rpl_backup_block.test:#connection slave;
-suite/rpl/t/rpl_backup_block.test:#
-suite/rpl/t/rpl_backup_block.test:#START SLAVE SQL_THREAD;
-suite/rpl/t/rpl_backup_block.test:#source include/wait_for_slave_sql_to_start.inc;
-suite/rpl/t/rpl_backup_block.test:#
-suite/rpl/t/rpl_backup_block.test:#--echo # Show the slave stopped with an error.
-suite/rpl/t/rpl_backup_block.test:#LET $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
-suite/rpl/t/rpl_backup_block.test:#--disable_query_log
-suite/rpl/t/rpl_backup_block.test:#eval SELECT "$last_error" AS Last_SQL_Error;
-suite/rpl/t/rpl_backup_block.test:#--enable_query_log
-suite/rpl/t/rpl_backup_block.test:#
 suite/rpl/t/rpl_backup_block.test:# Must mask command because dir in evaluation of $MYSQL... is not deterministic
 suite/rpl/t/rpl_backup_block.test:# Sync with master to ensure nothing is replicated after incident event.
-suite/rpl/t/rpl_backup_block.test:#--echo # Showing tables on slave.
-suite/rpl/t/rpl_backup_block.test:#SHOW FULL TABLES FROM rpl_backup_block;
-suite/rpl/t/rpl_backup_block.test:#
-suite/rpl/t/rpl_backup_block.test:#--replace_result $MASTER_MYPORT MASTER_PORT
-suite/rpl/t/rpl_backup_block.test:#--replace_column 1 # 6 # 7 # 8 # 9 # 10 # 16 # 21 # 22 # 23 # 33 # 35 # 36 #
-suite/rpl/t/rpl_backup_block.test:#--query_vertical SHOW SLAVE STATUS
-suite/rpl/t/rpl_backup_block.test:#
-suite/rpl/t/rpl_backup_block.test:#--echo # Show the slave started without an error.
-suite/rpl/t/rpl_backup_block.test:#LET $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
-suite/rpl/t/rpl_backup_block.test:#--disable_query_log
-suite/rpl/t/rpl_backup_block.test:#eval SELECT "$last_error" AS Last_SQL_Error;
-suite/rpl/t/rpl_backup_block.test:#--enable_query_log
-suite/rpl/t/rpl_backup_block.test:#
-suite/rpl/t/rpl_backup_block.test:#SELECT * FROM rpl_backup_block.t1;
-suite/rpl/t/rpl_backup_block.test:#
-suite/rpl/t/rpl_backup_block.test:# BUG#44830 : SLAVE START no longer results in error if RESTORE is running on master
-suite/rpl/t/rpl_backup_block.test:#
-suite/rpl/t/rpl_backup_block.test:#--echo # Connecting to slave 2...
-suite/rpl/t/rpl_backup_block.test:#connection slave2;
-suite/rpl/t/rpl_backup_block.test:#
-suite/rpl/t/rpl_backup_block.test:#--source include/wait_for_slave_to_stop.inc
-suite/rpl/t/rpl_backup_block.test:#
-suite/rpl/t/rpl_backup_block.test:#SET global sql_slave_skip_counter=1;
-suite/rpl/t/rpl_backup_block.test:#
-suite/rpl/t/rpl_backup_block.test:#START SLAVE;
-suite/rpl/t/rpl_backup_block.test:#--source include/wait_for_slave_to_start.inc
-suite/rpl/t/rpl_backup_block.test:#
-suite/rpl/t/rpl_backup_block.test:## Sync with master to ensure nothing is replicated after incident event.
-suite/rpl/t/rpl_backup_block.test:#sync_with_master;
-suite/rpl/t/rpl_backup_block.test:#
-suite/rpl/t/rpl_backup_block.test:#--replace_result $MASTER_MYPORT MASTER_PORT
-suite/rpl/t/rpl_backup_block.test:#--replace_column 1 # 6 # 7 # 8 # 9 # 10 # 16 # 21 # 22 # 23 # 33 # 35 # 36 #
-suite/rpl/t/rpl_backup_block.test:#--query_vertical SHOW SLAVE STATUS
-suite/rpl/t/rpl_backup_block.test:#
-suite/rpl/t/rpl_backup_block.test:#--echo # Show the slave started without an error.
-suite/rpl/t/rpl_backup_block.test:#LET $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
-suite/rpl/t/rpl_backup_block.test:#--disable_query_log
-suite/rpl/t/rpl_backup_block.test:#eval SELECT "$last_error" AS Last_SQL_Error;
-suite/rpl/t/rpl_backup_block.test:#--enable_query_log
-suite/rpl/t/rpl_backup_block.test:#
-suite/rpl/t/rpl_backup_block.test:# BUG#44830 : SLAVE START no longer results in error if RESTORE is running on master
-suite/rpl/t/rpl_backup_block.test:#
-suite/rpl/t/rpl_backup_block.test:#--echo # Connecting to slave 2...
-suite/rpl/t/rpl_backup_block.test:#connection slave2;
-suite/rpl/t/rpl_backup_block.test:#
-suite/rpl/t/rpl_backup_block.test:#--echo # Now stop the slave.
-suite/rpl/t/rpl_backup_block.test:#SLAVE STOP;
-suite/rpl/t/rpl_backup_block.test:#--source include/wait_for_slave_to_stop.inc
-suite/rpl/t/rpl_backup_block.test:#
-suite/rpl/t/rpl_backup_block.test:#--echo # Reset slave 2's backupdir.
-suite/rpl/t/rpl_backup_block.test:#SET @@global.backupdir = DEFAULT;
+suite/rpl/t/rpl_backup_block.test:# Sync with master to ensure nothing is replicated after incident event.
 suite/rpl/t/rpl_read_only.test:# Test case for BUG #11733
 suite/rpl/t/rpl_read_only.test:# Create a test and replicate it to slave
 suite/rpl/t/rpl_read_only.test:# Setting the master readonly :
@@ -55687,6 +56034,54 @@ suite/rpl/t/rpl_temp_table_mix_row.test:
 suite/rpl/t/rpl_temp_table_mix_row.test:#   4: sync to slave and check the number of temp tables on slave.
 suite/rpl/t/rpl_temp_table_mix_row.test:#
 suite/rpl/t/rpl_temp_table_mix_row.test:# waiting DROP TEMPORARY TABLE event to be written into binlog
+suite/rpl/t/rpl_temp_table_mix_row.test:#
+suite/rpl/t/rpl_temp_table_mix_row.test:# BUG#43046: mixed mode switch to row format with temp table lead to wrong
+suite/rpl/t/rpl_temp_table_mix_row.test:# result
+suite/rpl/t/rpl_temp_table_mix_row.test:#
+suite/rpl/t/rpl_temp_table_mix_row.test:# NOTES
+suite/rpl/t/rpl_temp_table_mix_row.test:# =====
+suite/rpl/t/rpl_temp_table_mix_row.test:#  
+suite/rpl/t/rpl_temp_table_mix_row.test:#  1. Temporary tables cannot be logged using the row-based
+suite/rpl/t/rpl_temp_table_mix_row.test:#     format. Thus, once row-based logging is used, all subsequent
+suite/rpl/t/rpl_temp_table_mix_row.test:#     statements using that table are unsafe, and we approximate this
+suite/rpl/t/rpl_temp_table_mix_row.test:#     condition by treating all statements made by that client as
+suite/rpl/t/rpl_temp_table_mix_row.test:#     unsafe until the client no longer holds any temporary tables.
+suite/rpl/t/rpl_temp_table_mix_row.test:#
+suite/rpl/t/rpl_temp_table_mix_row.test:#  2. Two different connections can use the same temporary table
+suite/rpl/t/rpl_temp_table_mix_row.test:#     name without conflicting with each other or with an
+suite/rpl/t/rpl_temp_table_mix_row.test:#     existing non-TEMPORARY table of the same name.
+suite/rpl/t/rpl_temp_table_mix_row.test:#
+suite/rpl/t/rpl_temp_table_mix_row.test:# DESCRIPTION
+suite/rpl/t/rpl_temp_table_mix_row.test:# ===========
+suite/rpl/t/rpl_temp_table_mix_row.test:#  
+suite/rpl/t/rpl_temp_table_mix_row.test:#   The test is implemented as follows:
+suite/rpl/t/rpl_temp_table_mix_row.test:#     1. create regular tables 
+suite/rpl/t/rpl_temp_table_mix_row.test:#     2. create a temporary table t1_tmp: should be logged as statement
+suite/rpl/t/rpl_temp_table_mix_row.test:#     3. issue an alter table: should be logged as statement
+suite/rpl/t/rpl_temp_table_mix_row.test:#     4. issue statement that forces switch to RBR
+suite/rpl/t/rpl_temp_table_mix_row.test:#     5. create another temporary table t2_tmp: should not be logged
+suite/rpl/t/rpl_temp_table_mix_row.test:#     6. issue alter table on t1_tmp: should not be logged
+suite/rpl/t/rpl_temp_table_mix_row.test:#     7. drop t1_tmp and regular table on same statement: should log both in
+suite/rpl/t/rpl_temp_table_mix_row.test:#        statement format (but different statements)
+suite/rpl/t/rpl_temp_table_mix_row.test:#     8. issue deterministic insert: logged as row (because t2_tmp still
+suite/rpl/t/rpl_temp_table_mix_row.test:#        exists).
+suite/rpl/t/rpl_temp_table_mix_row.test:#     9. drop t2_tmp and issue deterministic statement: should log drop and
+suite/rpl/t/rpl_temp_table_mix_row.test:#        query in statement format (show switch back to STATEMENT format)
+suite/rpl/t/rpl_temp_table_mix_row.test:#    10. in the end the slave should not have open temp tables.
+suite/rpl/t/rpl_temp_table_mix_row.test:#  
+suite/rpl/t/rpl_temp_table_mix_row.test:# action: setup environment
+suite/rpl/t/rpl_temp_table_mix_row.test:# assertion: assert that CREATE is logged as STATEMENT
+suite/rpl/t/rpl_temp_table_mix_row.test:# assertion: assert that ALTER TABLE is logged as STATEMENT
+suite/rpl/t/rpl_temp_table_mix_row.test:# action: force switch to RBR
+suite/rpl/t/rpl_temp_table_mix_row.test:# assertion: assert that t2_tmp will not make into the binlog (RBR logging atm)
+suite/rpl/t/rpl_temp_table_mix_row.test:# assertion: assert that ALTER TABLE on t1_tmp will not make into the binlog
+suite/rpl/t/rpl_temp_table_mix_row.test:# assertion: assert that both drops are logged
+suite/rpl/t/rpl_temp_table_mix_row.test:# assertion: assert that statement is logged as row (master still has one
+suite/rpl/t/rpl_temp_table_mix_row.test:#            opened temporary table - t2_tmp.
+suite/rpl/t/rpl_temp_table_mix_row.test:# assertion: assert that DROP TABLE *is* logged despite CREATE is not.
+suite/rpl/t/rpl_temp_table_mix_row.test:# assertion: assert that statement is now logged as STMT (mixed mode switches
+suite/rpl/t/rpl_temp_table_mix_row.test:#            back to STATEMENT).
+suite/rpl/t/rpl_temp_table_mix_row.test:# action: drop remaining tables
 suite/rpl/t/rpl_row_sp009.test:#############################################################################
 suite/rpl/t/rpl_row_sp009.test:# Original Author: JBM                                                      #
 suite/rpl/t/rpl_row_sp009.test:# Original Date: Aug/18/2005                                                #
@@ -56259,6 +56654,27 @@ suite/rpl/t/rpl_row_func002.test:# will 
 suite/rpl/t/rpl_row_func002.test:# the files your self to see what is not matching :-). The files are located
 suite/rpl/t/rpl_row_func002.test:# in mysql-test/var/tmp
 suite/rpl/t/rpl_row_func002.test:# End of 5.0 test case
+suite/rpl/t/rpl_get_master_version_and_clock.test:#
+suite/rpl/t/rpl_get_master_version_and_clock.test:# BUG#45214 
+suite/rpl/t/rpl_get_master_version_and_clock.test:# This test verifies if the slave I/O tread tries to reconnect to
+suite/rpl/t/rpl_get_master_version_and_clock.test:# master when it tries to get the values of the UNIX_TIMESTAMP, SERVER_ID,
+suite/rpl/t/rpl_get_master_version_and_clock.test:# COLLATION_SERVER and TIME_ZONE from master under network disconnection.
+suite/rpl/t/rpl_get_master_version_and_clock.test:# The COLLATION_SERVER and TIME_ZONE are got only on master server version 4.
+suite/rpl/t/rpl_get_master_version_and_clock.test:# So they can't be verified by test case here.
+suite/rpl/t/rpl_get_master_version_and_clock.test:# Finish the following tests by calling its common test script:  
+suite/rpl/t/rpl_get_master_version_and_clock.test:# extra/rpl_tests/rpl_get_master_version_and_clock.test. 
+suite/rpl/t/rpl_get_master_version_and_clock.test:# And meanwhile this test checks that the slave I/O thread refuses to start if slave
+suite/rpl/t/rpl_get_master_version_and_clock.test:# and master have the same server id (because this is a useless setup,
+suite/rpl/t/rpl_get_master_version_and_clock.test:# and otherwise SHOW SLAVE STATUS shows progress but all queries are
+suite/rpl/t/rpl_get_master_version_and_clock.test:# ignored, which has caught our customers), unless
+suite/rpl/t/rpl_get_master_version_and_clock.test:# --replicate-same-server-id.
+suite/rpl/t/rpl_get_master_version_and_clock.test:#
+suite/rpl/t/rpl_get_master_version_and_clock.test:#Test case 1: Try to get the value of the UNIX_TIMESTAMP from master under network disconnection
+suite/rpl/t/rpl_get_master_version_and_clock.test:#Test case 2: Try to get the value of the SERVER_ID from master under network disconnection
+suite/rpl/t/rpl_get_master_version_and_clock.test:#Test case 3: This test checks that the slave I/O thread refuses to start
+suite/rpl/t/rpl_get_master_version_and_clock.test:#if slave and master have the same server id.
+suite/rpl/t/rpl_get_master_version_and_clock.test:# replicate ourselves
+suite/rpl/t/rpl_get_master_version_and_clock.test:# End of tests
 suite/rpl/t/rpl_relayspace.test:# The slave is started with relay_log_space_limit=10 bytes,
 suite/rpl/t/rpl_relayspace.test:# to force the deadlock after one event.
 suite/rpl/t/rpl_relayspace.test:# This will generate a master's binlog > 10 bytes
@@ -56491,7 +56907,6 @@ suite/rpl/t/rpl_drop_temp.test:# Change:
 suite/rpl/t/rpl_drop_temp.test:# Purpose: According to TU in 16552 This is how
 suite/rpl/t/rpl_drop_temp.test:# to work around NDB's issue with temp tables
 suite/rpl/t/rpl_drop_temp.test:##############################################
-suite/rpl/t/rpl_drop_temp.test:# Wait until drop of temp tables appears in binlog
 suite/rpl/t/rpl_drop_temp.test:# Cleanup
 suite/rpl/t/rpl_drop_temp.test:# End of 4.1 tests
 suite/rpl/t/rpl_stm_flsh_tbls.test:# depends on the binlog output
@@ -57548,6 +57963,7 @@ suite/rpl/t/rpl_rewrt_db.test:#   Option
 suite/rpl/t/rpl_rewrt_db.test:#
 suite/rpl/t/rpl_rewrt_db.test:# The empty line last comes from the end line field in the file
 suite/rpl/t/rpl_rewrt_db.test:# End of 4.1 tests
+suite/rpl/t/rpl_rewrt_db.test:# end of 5.0 tests
 suite/rpl/t/rpl_user_variables.test:###################################
 suite/rpl/t/rpl_user_variables.test:#
 suite/rpl/t/rpl_user_variables.test:# Test of replicating user variables
@@ -57631,8 +58047,12 @@ suite/rpl/t/rpl_events.test:# Embedded s
 suite/rpl/t/rpl_events.test:#
 suite/rpl/t/rpl_events.test:# Bug #28953  	Using events in a replication let the slave crash.
 suite/rpl/t/rpl_events.test:#
-suite/rpl/t/rpl_events.test:# Doing cleanup of the table referred to in the event to guarantee
-suite/rpl/t/rpl_events.test:# that there is no bad timing cauing it to try to access the table.
+suite/rpl/t/rpl_events.test:#
+suite/rpl/t/rpl_events.test:# BUG#44331
+suite/rpl/t/rpl_events.test:# This test verifies if the definer is consistent between master and slave,
+suite/rpl/t/rpl_events.test:# when the event is created without the DEFINER clause set explicitly or the 
+suite/rpl/t/rpl_events.test:# DEFINER is set to CURRENT_USER
+suite/rpl/t/rpl_events.test:#
 suite/rpl/t/rpl_begin_commit_rollback.test:# Note: the master_log_pos is set to be the position of the BEGIN + 1,
 suite/rpl/t/rpl_begin_commit_rollback.test:# so before fix of BUG#43263 if the BEGIN is ignored, then all the
 suite/rpl/t/rpl_begin_commit_rollback.test:# INSERTS in p1 will be replicated in AUTOCOMMIT=1 mode and the slave
@@ -57660,11 +58080,25 @@ suite/rpl/t/rpl_row_4_bytes.test:# in 4 
 suite/rpl/t/rpl_row_4_bytes.test:# flags at the place where there actually is data, so the test should
 suite/rpl/t/rpl_row_4_bytes.test:# fail.
 suite/rpl/t/rpl_sf.test:# Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
+suite/rpl/t/rpl_sf.test:# BUG#41166 stored function requires "deterministic" if binlog_format is "statement"
 suite/rpl/t/rpl_sf.test:# save status
 suite/rpl/t/rpl_sf.test:# fail *on definition*
 suite/rpl/t/rpl_sf.test:# force in definition, so we can see whether we fail on call
 suite/rpl/t/rpl_sf.test:# allow funcall in RBR
 suite/rpl/t/rpl_sf.test:# fail funcall in SBR
+suite/rpl/t/rpl_sf.test:# clean
+suite/rpl/t/rpl_sf.test:# success in definition with deterministic
+suite/rpl/t/rpl_sf.test:# allow funcall in RBR
+suite/rpl/t/rpl_sf.test:# allow funcall in SBR
+suite/rpl/t/rpl_sf.test:# clean
+suite/rpl/t/rpl_sf.test:# success in definition with NO SQL
+suite/rpl/t/rpl_sf.test:# allow funcall in RBR
+suite/rpl/t/rpl_sf.test:# allow funcall in SBR
+suite/rpl/t/rpl_sf.test:# clean
+suite/rpl/t/rpl_sf.test:# success in definition with reads sql data
+suite/rpl/t/rpl_sf.test:# allow funcall in RBR
+suite/rpl/t/rpl_sf.test:# allow funcall in SBR
+suite/rpl/t/rpl_sf.test:# clean
 suite/rpl/t/rpl_sf.test:# restore status
 suite/rpl/t/rpl_multi_update4.test:# Let's verify that multi-update is not always skipped by slave if
 suite/rpl/t/rpl_multi_update4.test:# some replicate-* rules exist.
@@ -58422,6 +58856,31 @@ suite/rpl/t/rpl_row_create_table.test:# 
 suite/rpl/t/rpl_row_create_table.test:#
 suite/rpl/t/rpl_row_create_table.test:# BUG#34707: Row based replication: slave creates table within wrong database
 suite/rpl/t/rpl_row_create_table.test:#
+suite/rpl/t/rpl_create_tmp_table_if_not_exists.test:# BUG#45574: 
+suite/rpl/t/rpl_create_tmp_table_if_not_exists.test:# SP: CREATE DATABASE|TABLE IF NOT EXISTS not binlogged if routine exists.
+suite/rpl/t/rpl_create_tmp_table_if_not_exists.test:#
+suite/rpl/t/rpl_create_tmp_table_if_not_exists.test:#   There is an inconsistency with DROP DATABASE|TABLE|EVENT IF EXISTS and
+suite/rpl/t/rpl_create_tmp_table_if_not_exists.test:#   CREATE DATABASE|TABLE|EVENT IF NOT EXISTS. DROP IF EXISTS statements are
+suite/rpl/t/rpl_create_tmp_table_if_not_exists.test:#   binlogged even if either the DB, TABLE or EVENT does not exist. In
+suite/rpl/t/rpl_create_tmp_table_if_not_exists.test:#   contrast, Only the CREATE EVENT IF NOT EXISTS is binlogged when the EVENT
+suite/rpl/t/rpl_create_tmp_table_if_not_exists.test:#   exists.  
+suite/rpl/t/rpl_create_tmp_table_if_not_exists.test:#
+suite/rpl/t/rpl_create_tmp_table_if_not_exists.test:#   This problem caused some of the tests to fail randomly on PB or PB2.
+suite/rpl/t/rpl_create_tmp_table_if_not_exists.test:#
+suite/rpl/t/rpl_create_tmp_table_if_not_exists.test:#   Test is implemented as follows:
+suite/rpl/t/rpl_create_tmp_table_if_not_exists.test:#
+suite/rpl/t/rpl_create_tmp_table_if_not_exists.test:#       i) test each "CREATE TEMPORARY TABLE IF EXISTS" (DDL), found in MySQL
+suite/rpl/t/rpl_create_tmp_table_if_not_exists.test:#       5.1 manual, on existent objects; 
+suite/rpl/t/rpl_create_tmp_table_if_not_exists.test:#       ii) show binlog events; 
+suite/rpl/t/rpl_create_tmp_table_if_not_exists.test:#
+suite/rpl/t/rpl_create_tmp_table_if_not_exists.test:#  Note: 
+suite/rpl/t/rpl_create_tmp_table_if_not_exists.test:#  rpl_create_if_not_exists.test tests other cases.
+suite/rpl/t/rpl_create_tmp_table_if_not_exists.test:#
+suite/rpl/t/rpl_create_tmp_table_if_not_exists.test:#  References:
+suite/rpl/t/rpl_create_tmp_table_if_not_exists.test:#  http://dev.mysql.com/doc/refman/5.1/en/sql-syntax-data-definition.html
+suite/rpl/t/rpl_create_tmp_table_if_not_exists.test:#
+suite/rpl/t/rpl_create_tmp_table_if_not_exists.test:#CREATE TEMPORARY TABLE statements are not binlogged in row mode,
+suite/rpl/t/rpl_create_tmp_table_if_not_exists.test:#So it must be test by itself.
 suite/rpl/t/rpl_insert_id_pk.test:#################################
 suite/rpl/t/rpl_insert_id_pk.test:# Wrapper for rpl_insert_id.test#
 suite/rpl/t/rpl_insert_id_pk.test:#################################
@@ -58683,6 +59142,18 @@ suite/rpl/t/rpl_packet.test:# Change the
 suite/rpl/t/rpl_packet.test:# Restart slave for new setting to take effect
 suite/rpl/t/rpl_packet.test:# Reconnect to master for new setting to take effect
 suite/rpl/t/rpl_packet.test:# The slave I/O thread must stop after trying to read the above event
+suite/rpl/t/rpl_packet.test:#
+suite/rpl/t/rpl_packet.test:# Bug#42914: The slave I/O thread must stop after trying to read the above
+suite/rpl/t/rpl_packet.test:# event, However there is no Last_IO_Error report.
+suite/rpl/t/rpl_packet.test:#
+suite/rpl/t/rpl_packet.test:#
+suite/rpl/t/rpl_packet.test:# Bug#42914: On the master, if a binary log event is larger than
+suite/rpl/t/rpl_packet.test:# max_allowed_packet, the error message ER_MASTER_FATAL_ERROR_READING_BINLOG
+suite/rpl/t/rpl_packet.test:# is sent to a slave when it requests a dump from the master, thus leading the
+suite/rpl/t/rpl_packet.test:# I/O thread to stop. However, there is no Last_IO_Error reported.
+suite/rpl/t/rpl_packet.test:#
+suite/rpl/t/rpl_packet.test:# The slave I/O thread must stop after receiving
+suite/rpl/t/rpl_packet.test:# ER_MASTER_FATAL_ERROR_READING_BINLOG error message from master.
 suite/rpl/t/rpl_packet.test:# slave is stopped
 suite/rpl/t/rpl_packet.test:# End of tests
 suite/rpl/t/rpl_row_inexist_tbl.test:# ==== Purpose ====
@@ -59129,6 +59600,7 @@ suite/rpl/t/rpl_spec_variables.test:#
 suite/rpl/t/rpl_spec_variables.test:# SQL_MODE
 suite/rpl/t/rpl_spec_variables.test:#
 suite/rpl/t/rpl_spec_variables.test:# Clean up
+suite/rpl/t/rpl_spec_variables.test:# Put at the end since the test otherwise emptied the table.
 suite/rpl/t/rpl_spec_variables.test:# End of 5.1 test 
 suite/rpl/t/rpl_insert_select.test:# Testcase for BUG#10456 - INSERT INTO ... SELECT violating a primary key
 suite/rpl/t/rpl_insert_select.test:# breaks replication
@@ -59139,6 +59611,14 @@ suite/rpl/t/rpl_loaddata_charset.test:#
 suite/rpl/t/rpl_loaddata_charset.test:# Bug#15126 character_set_database is not replicated
 suite/rpl/t/rpl_loaddata_charset.test:# (LOAD DATA INFILE need it)
 suite/rpl/t/rpl_loaddata_charset.test:#
+suite/rpl/t/rpl_loaddata_charset.test:#
+suite/rpl/t/rpl_loaddata_charset.test:# Bug#45516 
+suite/rpl/t/rpl_loaddata_charset.test:#   When slave SQL thread executing LOAD DATA command, the
+suite/rpl/t/rpl_loaddata_charset.test:#   thd->variables.collation_database was not set properly to the default
+suite/rpl/t/rpl_loaddata_charset.test:#   database charset
+suite/rpl/t/rpl_loaddata_charset.test:#
+suite/rpl/t/rpl_loaddata_charset.test:# LOAD DATA INFILE
+suite/rpl/t/rpl_loaddata_charset.test:# LOAD DATA LOCAL INFILE
 suite/rpl/t/rpl_loaddatalocal.test:# See if "LOAD DATA LOCAL INFILE" is well replicated
 suite/rpl/t/rpl_loaddatalocal.test:# (LOAD DATA LOCAL INFILE is not written to the binlog
 suite/rpl/t/rpl_loaddatalocal.test:# the same way as LOAD DATA INFILE : Append_blocks are smaller).
@@ -59984,6 +60464,24 @@ suite/backup/t/backup_xpfm_compat_restor
 suite/backup/t/backup_xpfm_compat_restore_lctn1.test:#
 suite/backup/t/backup_xpfm_compat_restore_lctn1.test:#
 suite/backup/t/backup_xpfm_compat_restore_lctn1.test:#
+suite/backup/t/backup_events.test:#
+suite/backup/t/backup_events.test:# This test is created to verify that object events works properly with backup
+suite/backup/t/backup_events.test:# and restore. We will be including simple tests to test the functionality. 
+suite/backup/t/backup_events.test:# There are other complicated tests in backup suite that executes triggers and 
+suite/backup/t/backup_events.test:# events together with BACKUP and RESTORE features which uses debug 
+suite/backup/t/backup_events.test:# synchronization points.
+suite/backup/t/backup_events.test:#
+suite/backup/t/backup_events.test:# We will be executing following test cases:
+suite/backup/t/backup_events.test:# 1. Create simple recurring event and check if event fires in tables properly
+suite/backup/t/backup_events.test:#    before backup and after restore.
+suite/backup/t/backup_events.test:# 2. Rename the event and perform backup / restore
+suite/backup/t/backup_events.test:# 3. Create event with definer clause
+suite/backup/t/backup_events.test:# 4. Change the sql_mode, cset and coll before restore and verify
+suite/backup/t/backup_events.test:#    event functions properly.
+suite/backup/t/backup_events.test:#
+suite/backup/t/backup_events.test:# From the above we can see that events executes properly before backup and 
+suite/backup/t/backup_events.test:# after restore.
+suite/backup/t/backup_events.test:# Note that table will contain columns with a='kk'
 suite/backup/t/backup_nodata_driver.test:#
 suite/backup/t/backup_nodata_driver.test:# This test tests the backup using no data engines.
 suite/backup/t/backup_nodata_driver.test:# These are engines which tables don't contain data.
@@ -60321,6 +60819,22 @@ suite/backup/t/backup_lock_conflict.test
 suite/backup/t/backup_lock_conflict.test:# The goal of this test is to verify that RESTORE is correctly blocked
 suite/backup/t/backup_lock_conflict.test:# by concurrent transactions that operate on a database being restored.
 suite/backup/t/backup_lock_conflict.test:#
+suite/backup/t/backup_security_check.test:#
+suite/backup/t/backup_security_check.test:# This test includes tests for all of the security-related tasks in 
+suite/backup/t/backup_security_check.test:# MySQL Backup. This test was created to demonstrate that the problem
+suite/backup/t/backup_security_check.test:# of skipped objects has been solved by BUG#45889. Specifically, the
+suite/backup/t/backup_security_check.test:# BACKUP DATABASE command should include all objects or fail with an error.
+suite/backup/t/backup_security_check.test:# This file includes the following test cases:
+suite/backup/t/backup_security_check.test:#
+suite/backup/t/backup_security_check.test:# 1) Minimum set of privileges for "empty" backup of list
+suite/backup/t/backup_security_check.test:# 2) Minimum set of specific privileges for "full" backup of list
+suite/backup/t/backup_security_check.test:# 3) Minimum set of db-level privileges for "full" backup of list
+suite/backup/t/backup_security_check.test:# 4) Minimum set of privileges for "empty" backup of *
+suite/backup/t/backup_security_check.test:# 5) Minimum set of specific privileges for "full" backup of *
+suite/backup/t/backup_security_check.test:# 6) Minimum set of db-level privileges for "full" backup of *
+suite/backup/t/backup_security_check.test:#
+suite/backup/t/backup_security_check.test:# Don't care about mtr.
+suite/backup/t/backup_security_check.test:# Don't care about mtr.
 suite/backup/t/backup_commit_backup_falcon.test:# This is the Falcon version of backup_commit_backup.test. The only
 suite/backup/t/backup_commit_backup_falcon.test:# reason for having this test file is that Falcon is disabled in the
 suite/backup/t/backup_commit_backup_falcon.test:# main mysql branch. When Falcon is enabled, do the following:
@@ -60328,16 +60842,33 @@ suite/backup/t/backup_commit_backup_falc
 suite/backup/t/backup_commit_backup_falcon.test:#   - Remove this file
 suite/backup/t/backup_commit_backup_falcon.test:#   - Remove references to $FALCON_SUPPORTED in backup_commit_backup.test
 suite/backup/t/backup_commit_backup_falcon.test:#
+suite/backup/t/backup_slow_query_log.test:#
+suite/backup/t/backup_slow_query_log.test:# BUG#34202: Backup: RESTORE turns off the slow log
+suite/backup/t/backup_slow_query_log.test:#
+suite/backup/t/backup_slow_query_log.test:# Backup and Restore should not turn off the slow log.
+suite/backup/t/backup_slow_query_log.test:# This test file includes tests that ensure the slow
+suite/backup/t/backup_slow_query_log.test:# log is, if engaged, is still engaged after a backup or
+suite/backup/t/backup_slow_query_log.test:# restore.
+suite/backup/t/backup_slow_query_log.test:#
 suite/backup/t/backup_security.test:#
 suite/backup/t/backup_security.test:# This test includes tests for all of the security-related tasks in 
-suite/backup/t/backup_security.test:# Online Backup. These include tests for:
-suite/backup/t/backup_security.test:#
-suite/backup/t/backup_security.test:# 1) Only users with BACKUP or RESTORE privilege can run backup or restore.
-suite/backup/t/backup_security.test:#
+suite/backup/t/backup_security.test:# MySQL Backup. These include tests for:
 suite/backup/t/backup_security.test:#
-suite/backup/t/backup_security.test:# Test 1 - Only users with BACKUP and RESTORE privilege can run backup 
-suite/backup/t/backup_security.test:#          and restore.
+suite/backup/t/backup_security.test:# 1) Ensure the visibility check works for a basic backup and restore for
+suite/backup/t/backup_security.test:#    each type of object.
+suite/backup/t/backup_security.test:# 2) Only users with BACKUP or RESTORE privilege can run backup or restore.
+suite/backup/t/backup_security.test:# 3) Users must have the ability to read (SELECT) all databases
+suite/backup/t/backup_security.test:#    as well as have BACKUP on *.* to execute BACKUP DATABASE * TO <file>.
+suite/backup/t/backup_security.test:# 4) Users must have the ability to read (SELECT) all objects in a database
+suite/backup/t/backup_security.test:#    as well as have BACKUP to execute BACKUP DATABASE backup_test TO <file>.
+suite/backup/t/backup_security.test:# 5) Users with partial access (SELECT on some objects) cannot backup
+suite/backup/t/backup_security.test:#    the database without errors.
+suite/backup/t/backup_security.test:# 6) Users with individual privileges and no database-level except EVENT
+suite/backup/t/backup_security.test:#    can successfully backup the database.
 suite/backup/t/backup_security.test:#
+suite/backup/t/backup_security.test:# Make sure there is only 1 other database that user has select on.
+suite/backup/t/backup_security.test:# This is needed for deterministic result because a list of 
+suite/backup/t/backup_security.test:# databases are unordered.
 suite/backup/t/backup_triggers_and_events.test:#
 suite/backup/t/backup_triggers_and_events.test:# This test checks that re-created events or triggers are not fired during
 suite/backup/t/backup_triggers_and_events.test:# RESTORE operation.
@@ -61131,6 +61662,12 @@ suite/backup/t/backup_pipe.test:# mkfifo
 suite/backup/t/backup_pipe.test:# chmod helps for providing specific access mode to the file. chmod 666
 suite/backup/t/backup_pipe.test:# provides read and write access to user.
 suite/backup/t/backup_pipe.test:# "chmod 666 pipe_name" allows to read and write to the pipe.
+suite/backup/t/backup_pipe.test:#
+suite/backup/t/backup_pipe.test:# First check that the pipe is not removed if BACKUP fails (BUG#42999).
+suite/backup/t/backup_pipe.test:#
+suite/backup/t/backup_pipe.test:#
+suite/backup/t/backup_pipe.test:# Now test normal operation.
+suite/backup/t/backup_pipe.test:#
 suite/backup/t/backup_pipe.test:# cat helps in redirecting the output from pipe to another file.
 suite/backup/t/backup_pipe.test:#
 suite/backup/t/backup_pipe.test:# Test 2: Concurrent backup / restore operation(Test case for bug#39056)
@@ -61163,12 +61700,24 @@ suite/backup/t/backup_xpfm_compat_restor
 suite/backup/t/backup_xpfm_compat_restore_lctn0.test:#
 suite/backup/t/backup_xpfm_compat_restore_lctn0.test:#
 suite/backup/t/backup_xpfm_compat_restore_lctn0.test:#--echo #
+suite/backup/t/backup_xpfm_compat_restore_lctn0.test:#--echo # Linux x86 lctn1
+suite/backup/t/backup_xpfm_compat_restore_lctn0.test:#--echo #
+suite/backup/t/backup_xpfm_compat_restore_lctn0.test:#--let $IMAGE_FILE = backup_xpfm_compat_lctn1-linux_x86.bak
+suite/backup/t/backup_xpfm_compat_restore_lctn0.test:#--let $SHOW_OBJECTS=suite/backup/include/backup_xpfm_compat_show.inc
+suite/backup/t/backup_xpfm_compat_restore_lctn0.test:#--source suite/backup/include/backup_xpfm_compat_restore.inc
+suite/backup/t/backup_xpfm_compat_restore_lctn0.test:#--echo #
 suite/backup/t/backup_xpfm_compat_restore_lctn0.test:#--echo # Linux x86_64 lctn1
 suite/backup/t/backup_xpfm_compat_restore_lctn0.test:#--echo #
 suite/backup/t/backup_xpfm_compat_restore_lctn0.test:#--let $IMAGE_FILE = backup_xpfm_compat_lctn1-linux_x86_64.bak
 suite/backup/t/backup_xpfm_compat_restore_lctn0.test:#--let $SHOW_OBJECTS=suite/backup/include/backup_xpfm_compat_show.inc
 suite/backup/t/backup_xpfm_compat_restore_lctn0.test:#--source suite/backup/include/backup_xpfm_compat_restore.inc
 suite/backup/t/backup_xpfm_compat_restore_lctn0.test:#--echo #
+suite/backup/t/backup_xpfm_compat_restore_lctn0.test:#--echo # Solaris Sparc_64 lctn1
+suite/backup/t/backup_xpfm_compat_restore_lctn0.test:#--echo #
+suite/backup/t/backup_xpfm_compat_restore_lctn0.test:#--let $IMAGE_FILE = backup_xpfm_compat_lctn1-sol_sparc_64.bak
+suite/backup/t/backup_xpfm_compat_restore_lctn0.test:#--let $SHOW_OBJECTS=suite/backup/include/backup_xpfm_compat_show.inc
+suite/backup/t/backup_xpfm_compat_restore_lctn0.test:#--source suite/backup/include/backup_xpfm_compat_restore.inc
+suite/backup/t/backup_xpfm_compat_restore_lctn0.test:#--echo #
 suite/backup/t/backup_xpfm_compat_restore_lctn0.test:#--echo # Windows 32 lctn1
 suite/backup/t/backup_xpfm_compat_restore_lctn0.test:#--echo #
 suite/backup/t/backup_xpfm_compat_restore_lctn0.test:#--let $IMAGE_FILE = backup_xpfm_compat_lctn1-windows_32.bak
@@ -61178,7 +61727,18 @@ suite/backup/t/backup_xpfm_compat_restor
 suite/backup/t/backup_xpfm_compat_restore_lctn0.test:#--echo # Windows 32 lctn2
 suite/backup/t/backup_xpfm_compat_restore_lctn0.test:#--echo #
 suite/backup/t/backup_xpfm_compat_restore_lctn0.test:#--let $IMAGE_FILE = backup_xpfm_compat_lctn2-windows_32.bak
-suite/backup/t/backup_xpfm_compat_restore_lctn0.test:#--let $SHOW_OBJECTS=suite/backup/include/backup_xpfm_compat_show_lower.inc
+suite/backup/t/backup_xpfm_compat_restore_lctn0.test:#--let $SHOW_OBJECTS=suite/backup/include/backup_xpfm_compat_show.inc
+suite/backup/t/backup_xpfm_compat_restore_lctn0.test:#--source suite/backup/include/backup_xpfm_compat_restore.inc
+suite/backup/t/backup_xpfm_compat_restore_lctn0.test:#--echo #
+suite/backup/t/backup_xpfm_compat_restore_lctn0.test:#--echo # Windows 64 lctn1
+suite/backup/t/backup_xpfm_compat_restore_lctn0.test:#--echo #
+suite/backup/t/backup_xpfm_compat_restore_lctn0.test:#--let $IMAGE_FILE = backup_xpfm_compat_lctn1-windows_64.bak
+suite/backup/t/backup_xpfm_compat_restore_lctn0.test:#--let $SHOW_OBJECTS=suite/backup/include/backup_xpfm_compat_show.inc
+suite/backup/t/backup_xpfm_compat_restore_lctn0.test:#--source suite/backup/include/backup_xpfm_compat_restore.inc
+suite/backup/t/backup_xpfm_compat_restore_lctn0.test:#--echo #
+suite/backup/t/backup_xpfm_compat_restore_lctn0.test:#--echo # Windows 64 lctn2
+suite/backup/t/backup_xpfm_compat_restore_lctn0.test:#--echo #
+suite/backup/t/backup_xpfm_compat_restore_lctn0.test:#--let $IMAGE_FILE = backup_xpfm_compat_lctn2-windows_64.bak
 suite/backup/t/backup_xpfm_compat_restore_lctn0.test:#--let $SHOW_OBJECTS=suite/backup/include/backup_xpfm_compat_show.inc
 suite/backup/t/backup_xpfm_compat_restore_lctn0.test:#--source suite/backup/include/backup_xpfm_compat_restore.inc
 suite/backup/t/backup_check_i_s.test:#
@@ -61240,7 +61800,7 @@ suite/backup/t/backup_xpfm_compat_backup
 suite/backup/t/backup_xpfm_compat_backup_lctn1.test:#
 suite/backup/t/backup_xpfm_compat_backup_lctn1.test:# Part 1 - Generate backup image for this platform
 suite/backup/t/backup_xpfm_compat_backup_lctn1.test:#          with lower_case_table_names=1
-suite/backup/t/backup_xpfm_compat_backup_lctn1.test:#          as mysql-test/backup_xpfm_compat_lctn1.bak
+suite/backup/t/backup_xpfm_compat_backup_lctn1.test:#          as backup_xpfm_compat_lctn1.bak
 suite/backup/t/backup_xpfm_compat_backup_lctn1.test:#
 suite/backup/t/backup_xpfm_compat_backup_lctn1.test:# WL#4771 - Online Backup: Test cross-platform compatibility
 suite/backup/t/backup_xpfm_compat_backup_lctn1.test:#
@@ -61792,6 +62352,7 @@ suite/backup/t/backup_db_grants.test:#
 suite/backup/t/backup_db_grants.test:#
 suite/backup/t/backup_db_grants.test:#
 suite/backup/t/backup_db_grants.test:#
+suite/backup/t/backup_db_grants.test:##################
 suite/backup/t/backup_no_engine.test:# Test how online backup handles tables using non-existent storage engines
 suite/backup/t/backup_no_engine.test:# The server used to crash in this situation (BUG#30938)
 suite/backup/t/backup_no_engine.test:# .frm file for a table using non-existent storage engine
@@ -61875,7 +62436,7 @@ suite/backup/t/backup_xpfm_compat_backup
 suite/backup/t/backup_xpfm_compat_backup_lctn2.test:#
 suite/backup/t/backup_xpfm_compat_backup_lctn2.test:# Part 1 - Generate backup image for this platform
 suite/backup/t/backup_xpfm_compat_backup_lctn2.test:#          with lower_case_table_names=2
-suite/backup/t/backup_xpfm_compat_backup_lctn2.test:#          as mysql-test/backup_xpfm_compat_lctn2.bak
+suite/backup/t/backup_xpfm_compat_backup_lctn2.test:#          as backup_xpfm_compat_lctn2.bak
 suite/backup/t/backup_xpfm_compat_backup_lctn2.test:#
 suite/backup/t/backup_xpfm_compat_backup_lctn2.test:# WL#4771 - Online Backup: Test cross-platform compatibility
 suite/backup/t/backup_xpfm_compat_backup_lctn2.test:#
@@ -62405,13 +62966,6 @@ suite/backup/t/backup_xpfm_compat_restor
 suite/backup/t/backup_xpfm_compat_restore_lctn2.test:#
 suite/backup/t/backup_xpfm_compat_restore_lctn2.test:#
 suite/backup/t/backup_xpfm_compat_restore_lctn2.test:#
-suite/backup/t/backup_xpfm_compat_restore_lctn2.test:#--echo #
-suite/backup/t/backup_xpfm_compat_restore_lctn2.test:#--echo # Windows 32 lctn2
-suite/backup/t/backup_xpfm_compat_restore_lctn2.test:#--echo #
-suite/backup/t/backup_xpfm_compat_restore_lctn2.test:#--let $IMAGE_FILE = backup_xpfm_compat_lctn2-windows_32.bak
-suite/backup/t/backup_xpfm_compat_restore_lctn2.test:#--let $SHOW_OBJECTS=suite/backup/include/backup_xpfm_compat_show_lower.inc
-suite/backup/t/backup_xpfm_compat_restore_lctn2.test:#--let $SHOW_OBJECTS=suite/backup/include/backup_xpfm_compat_show.inc
-suite/backup/t/backup_xpfm_compat_restore_lctn2.test:#--source suite/backup/include/backup_xpfm_compat_restore.inc
 suite/backup/t/backup_errors_compression.test:#
 suite/backup/t/backup_errors_compression.test:# This test is created as part of WL#4408 to test all the error conditions for
 suite/backup/t/backup_errors_compression.test:# backup command with compression. There is already an existing 
@@ -62436,15 +62990,25 @@ suite/backup/t/backup_lock_conflict_falc
 suite/backup/t/backup_lock_conflict_falcon.test:#
 suite/backup/t/backup_lock_conflict_falcon.test:#   - Remove this file
 suite/backup/t/backup_lock_conflict_falcon.test:#   - Remove references to $FALCON_SUPPORTED in backup_lock_conflict.test
-suite/backup/t/backup_no_data.test:#
-suite/backup/t/backup_no_data.test:# Normally, when tests are run the test/ directory corresponding to the test database
-suite/backup/t/backup_no_data.test:# is empty. In particular, it doesn't contain the db.opt file storing database settings.
-suite/backup/t/backup_no_data.test:# Some tests rely on that, as they use server options to determine these settings.
-suite/backup/t/backup_no_data.test:# If we backup test database (e.g., with "BACKUP DATABASE * ...") and then restore it,
-suite/backup/t/backup_no_data.test:# then it will be created using "CREATE DATABASE test" statement and this will create
-suite/backup/t/backup_no_data.test:# the db.opt file. As a result, some tests run after that will fail. To avoid this situation
-suite/backup/t/backup_no_data.test:# we remove the test/db.opt file as a part of clean-up.
-suite/backup/t/backup_no_data.test:#
+suite/backup/t/backup_no_data.test:# The BACKUP DATABASE * TO 'all.bak' is disabled because of BUG#46765
+suite/backup/t/backup_no_data.test:# BUG#46765: Restore throws warnings when performing backup of test database.
+suite/backup/t/backup_no_data.test:# Once this bug is fixed, please enable the "BACKUP DATABASE *..."
+suite/backup/t/backup_no_data.test:#BACKUP DATABASE * TO 'all.bak';
+suite/backup/t/backup_no_data.test:#RESTORE FROM 'all.bak' OVERWRITE;
+suite/backup/t/backup_no_data.test:# Normally when the tests are run, the test/ directory corrosponding to the 
+suite/backup/t/backup_no_data.test:# test database is empty and doesn't contain the db.opt file storing database
+suite/backup/t/backup_no_data.test:# settings. Some tests rely on that, as they use server options to determine 
+suite/backup/t/backup_no_data.test:# these settings. If we backup test database (e.g. with "BACKUP DATABASE * ..") 
+suite/backup/t/backup_no_data.test:# and then restore it, then it will be created using "CREATE DATABASE test" 
+suite/backup/t/backup_no_data.test:# statement and this will create the db.opt file. As a result, some tests run 
+suite/backup/t/backup_no_data.test:# after that will fail. To avoid this situation we remove the test/db.opt file 
+suite/backup/t/backup_no_data.test:# as a part of clean-up.
+suite/backup/t/backup_no_data.test:# The below lines are commented as we are not performing backup / restore of 
+suite/backup/t/backup_no_data.test:# test database. Please enable the commented lines when BACKUP DATABASE * TO ..
+suite/backup/t/backup_no_data.test:# is performed after fix of BUG#46765
+suite/backup/t/backup_no_data.test:#--error 0,1
+suite/backup/t/backup_no_data.test:#--remove_file $MYSQLD_BACKUPDIR/test/db.opt
+suite/backup/t/backup_no_data.test:#--enable_warnings
 suite/backup/t/backup_compression.test:# Execute backup database operation and verify compression syntax.
 suite/backup/t/backup_compression.test:# Ensure that backup history logs properly indicate the backup performed with
 suite/backup/t/backup_compression.test:# compression.
@@ -62460,7 +63024,7 @@ suite/backup/t/backup_xpfm_compat_backup
 suite/backup/t/backup_xpfm_compat_backup_lctn0.test:#
 suite/backup/t/backup_xpfm_compat_backup_lctn0.test:# Part 1 - Generate backup image for this platform
 suite/backup/t/backup_xpfm_compat_backup_lctn0.test:#          with lower_case_table_names=0
-suite/backup/t/backup_xpfm_compat_backup_lctn0.test:#          as mysql-test/backup_xpfm_compat_lctn0.bak
+suite/backup/t/backup_xpfm_compat_backup_lctn0.test:#          as backup_xpfm_compat_lctn0.bak
 suite/backup/t/backup_xpfm_compat_backup_lctn0.test:#
 suite/backup/t/backup_xpfm_compat_backup_lctn0.test:# WL#4771 - Online Backup: Test cross-platform compatibility
 suite/backup/t/backup_xpfm_compat_backup_lctn0.test:#
@@ -62492,6 +63056,14 @@ suite/backup/t/backup_logs.test:# driver
 suite/backup/t/backup_logs.test:# Record the time when BACKUP has started.
 suite/backup/t/backup_logs.test:# Set the time_zone to +0:00 to have same server timezone as of
 suite/backup/t/backup_logs.test:# backup history table.
+suite/backup/t/backup_logs.test:# Use mysqlbackup utility to read the summary of the backup image.
+suite/backup/t/backup_logs.test:#
+suite/backup/t/backup_logs.test:# No need to include in the result set the following queries whose only purpose
+suite/backup/t/backup_logs.test:# is to get the contents of the summary file produced by the above command.\
+suite/backup/t/backup_logs.test:#
+suite/backup/t/backup_logs.test:# Create a table and load output of mysqlbackup into it to access the data.
+suite/backup/t/backup_logs.test:# Read times from the summary table (creation time is reported twice).
+suite/backup/t/backup_logs.test:# Compare times from summary with these in backup_history log.
 suite/backup/t/backup_logs.test:#Show results
 suite/backup/t/backup_logs.test:# Check the backup file size and compare it from backup_history
 suite/backup/t/backup_logs.test:# logs. Note that total_bytes in backup_progress is always
@@ -62512,6 +63084,14 @@ suite/backup/t/backup_logs.test:# The fi
 suite/backup/t/backup_logs.test:# The second backup will read the value (500) and increment it.
 suite/backup/t/backup_logs.test:#--replace_column 1 #
 suite/backup/t/backup_logs.test:#
+suite/backup/t/backup_logs.test:# Errors can occur on platforms with shorter filename (like Cygwin
+suite/backup/t/backup_logs.test:# on Windows).
+suite/backup/t/backup_logs.test:#
+suite/backup/t/backup_logs.test:#
+suite/backup/t/backup_logs.test:# Errors can occur on platforms with shorter filename (like Cygwin
+suite/backup/t/backup_logs.test:# on Windows).
+suite/backup/t/backup_logs.test:#
+suite/backup/t/backup_logs.test:#
 suite/backup/t/backup_logs.test:# Cleanup.
 suite/backup/t/backup_logs.test:#
 suite/backup/t/backup_bml_block.test:#
@@ -62999,10 +63579,7 @@ suite/backup/include/backup_xpfm_compat_
 suite/backup/include/backup_xpfm_compat_backup.inc:#
 suite/backup/include/backup_xpfm_compat_backup.inc:# Routine grants.
 suite/backup/include/backup_xpfm_compat_backup.inc:#
-suite/backup/include/backup_xpfm_compat_backup.inc:#SHOW GRANTS FOR 'bup_user1'@'%';
-suite/backup/include/backup_xpfm_compat_backup.inc:#SHOW GRANTS FOR 'BUP_USER2';
-suite/backup/include/backup_xpfm_compat_backup.inc:#SHOW GRANTS FOR 'BupUser3'@'%';
-suite/backup/include/backup_xpfm_compat_backup.inc:#SHOW GRANTS FOR 'no_user'@'%';
+suite/backup/include/backup_xpfm_compat_backup.inc:#
 suite/backup/include/backup_xpfm_compat_backup.inc:#
 suite/backup/include/backup_xpfm_compat_backup.inc:#
 suite/backup/include/backup_xpfm_compat_backup.inc:#
@@ -63024,6 +63601,7 @@ suite/backup/include/backup_xpfm_compat_
 suite/backup/include/backup_xpfm_compat_show.inc:#
 suite/backup/include/backup_xpfm_compat_show.inc:#
 suite/backup/include/backup_xpfm_compat_show.inc:#
+suite/backup/include/backup_xpfm_compat_show.inc:#
 suite/backup/include/backup_ext.inc:# The external program "mysql_convert_table_format" is not incorporated with
 suite/backup/include/backup_ext.inc:# mtr framework. Therefore, in order to use this program in a portable way, 
 suite/backup/include/backup_ext.inc:# we have created the following script.
@@ -63749,6 +64327,7 @@ suite/parts/t/partition_mgm_lc2_ndb.test
 suite/parts/t/partition_mgm_lc2_ndb.test:# Use either $can_only_key or new=on option to run test.
 suite/parts/t/partition_mgm_lc2_ndb.test:# Allow hash/list/range partitioning with ndb
 suite/parts/t/partition_mgm_lc2_ndb.test:#SET new=on;
+suite/parts/t/partition_mgm_lc2_ndb.test:# NDB does not yet support TRUNCATE PARTITION
 suite/parts/t/partition_mgm_lc2_ndb.test:#------------------------------------------------------------------------------#
 suite/parts/t/partition_mgm_lc2_ndb.test:# Execute the tests to be applied to all storage engines
 suite/parts/t/partition_int_myisam.test:################################################################################
@@ -64496,6 +65075,8 @@ suite/parts/t/partition_auto_increment_b
 suite/parts/t/partition_auto_increment_blackhole.test:# The server must support partitioning.
 suite/parts/t/partition_auto_increment_blackhole.test:#------------------------------------------------------------------------------#
 suite/parts/t/partition_auto_increment_blackhole.test:# Engine specific settings and requirements
+suite/parts/t/partition_auto_increment_blackhole.test:# Bug#45823 Assertion failure in file row/row0mysql.c line 1386
+suite/parts/t/partition_auto_increment_blackhole.test:# Blackhole does not handle negative autoincrement values correctly
 suite/parts/t/partition_auto_increment_blackhole.test:##### Storage engine to be tested
 suite/parts/t/partition_auto_increment_blackhole.test:#------------------------------------------------------------------------------#
 suite/parts/t/partition_auto_increment_blackhole.test:# Execute the tests to be applied to all storage engines
@@ -64648,6 +65229,8 @@ suite/parts/t/partition_auto_increment_a
 suite/parts/t/partition_auto_increment_archive.test:#------------------------------------------------------------------------------#
 suite/parts/t/partition_auto_increment_archive.test:# Engine specific settings and requirements
 suite/parts/t/partition_auto_increment_archive.test:# Archve does not support delete
+suite/parts/t/partition_auto_increment_archive.test:# Bug#45823 Assertion failure in file row/row0mysql.c line 1386
+suite/parts/t/partition_auto_increment_archive.test:# Archive does not handle negative autoincrement values correctly
 suite/parts/t/partition_auto_increment_archive.test:##### Storage engine to be tested
 suite/parts/t/partition_auto_increment_archive.test:#------------------------------------------------------------------------------#
 suite/parts/t/partition_auto_increment_archive.test:# Execute the tests to be applied to all storage engines
@@ -65064,6 +65647,7 @@ suite/parts/t/partition_mgm_lc1_ndb.test
 suite/parts/t/partition_mgm_lc1_ndb.test:# Use either $can_only_key or new=on option to run test.
 suite/parts/t/partition_mgm_lc1_ndb.test:# Allow hash/list/range partitioning with ndb
 suite/parts/t/partition_mgm_lc1_ndb.test:#SET new=on;
+suite/parts/t/partition_mgm_lc1_ndb.test:# NDB does not yet support TRUNCATE PARTITION
 suite/parts/t/partition_mgm_lc1_ndb.test:#------------------------------------------------------------------------------#
 suite/parts/t/partition_mgm_lc1_ndb.test:# Execute the tests to be applied to all storage engines
 suite/parts/t/partition_decimal_innodb.test:################################################################################
@@ -66093,6 +66677,7 @@ suite/parts/t/partition_mgm_lc0_ndb.test
 suite/parts/t/partition_mgm_lc0_ndb.test:# Use either $can_only_key or new=on option to run test.
 suite/parts/t/partition_mgm_lc0_ndb.test:# Allow hash/list/range partitioning with ndb
 suite/parts/t/partition_mgm_lc0_ndb.test:#SET new=on;
+suite/parts/t/partition_mgm_lc0_ndb.test:# NDB does not yet support TRUNCATE PARTITION
 suite/parts/t/partition_mgm_lc0_ndb.test:#------------------------------------------------------------------------------#
 suite/parts/t/partition_mgm_lc0_ndb.test:# Execute the tests to be applied to all storage engines
 suite/parts/t/partition_mgm_lc1_innodb.test:################################################################################
@@ -66335,6 +66920,7 @@ suite/parts/inc/partition_mgm.inc:#     
 suite/parts/inc/partition_mgm.inc:#   part_optA-D   Extra partitioning options (E.g. INDEX/DATA DIR)             #
 suite/parts/inc/partition_mgm.inc:#                                                                              #
 suite/parts/inc/partition_mgm.inc:#   have_bug33158 NDB case insensitive create, but case sensitive rename       #
+suite/parts/inc/partition_mgm.inc:#   no_truncate   No support for truncate partition                            #
 suite/parts/inc/partition_mgm.inc:#------------------------------------------------------------------------------#
 suite/parts/inc/partition_mgm.inc:# Original Author: mattiasj                                                    #
 suite/parts/inc/partition_mgm.inc:# Original Date: 2008-06-27                                                    #
@@ -68246,6 +68832,9 @@ include/test_fieldsize.inc:# The followi
 include/wait_for_query_to_succeed.inc:#
 include/wait_for_query_to_succeed.inc:# Run a query over and over until it succeeds ot timeout occurs
 include/wait_for_query_to_succeed.inc:#
+include/have_dynamic_loading.inc:#
+include/have_dynamic_loading.inc:# Whether server supports dynamic loading.
+include/have_dynamic_loading.inc:#
 include/deadlock.inc:# include/deadlock.inc
 include/deadlock.inc:#
 include/deadlock.inc:# The variable
@@ -70722,6 +71311,8 @@ include/have_multi_ndb.inc:# Check that 
 include/have_multi_ndb.inc:# Check that server2 has NDB support
 include/have_multi_ndb.inc:# cleanup
 include/have_multi_ndb.inc:# Set the default connection
+include/partition_date_range.inc:# Created for verifying bug#20577.
+include/partition_date_range.inc:# expects TABLE t1 (... , a DATE, ...)
 include/mix1.inc:# include/mix1.inc
 include/mix1.inc:#
 include/mix1.inc:# The variables
@@ -70942,35 +71533,6 @@ include/mix1.inc:#
 include/mix1.inc:# Bug #33697: ORDER BY primary key DESC vs. ref access + filesort
 include/mix1.inc:# (reproduced only with InnoDB tables)
 include/mix1.inc:#
-include/mix1.inc:#
-include/mix1.inc:# Bug#21704: Renaming column does not update FK definition.
-include/mix1.inc:#
-include/mix1.inc:#
-include/mix1.inc:# --disable_warnings
-include/mix1.inc:# DROP TABLE IF EXISTS t1;
-include/mix1.inc:# DROP TABLE IF EXISTS t2;
-include/mix1.inc:# --enable_warnings
-include/mix1.inc:#
-include/mix1.inc:# CREATE TABLE t1(id INT PRIMARY KEY)
-include/mix1.inc:#   ENGINE=innodb;
-include/mix1.inc:#
-include/mix1.inc:# CREATE TABLE t2(
-include/mix1.inc:#   t1_id INT PRIMARY KEY,
-include/mix1.inc:#   CONSTRAINT fk1 FOREIGN KEY (t1_id) REFERENCES t1(id))
-include/mix1.inc:#   ENGINE=innodb;
-include/mix1.inc:#
-include/mix1.inc:# --echo
-include/mix1.inc:#
-include/mix1.inc:# --disable_result_log
-include/mix1.inc:# --error ER_ERROR_ON_RENAME
-include/mix1.inc:# ALTER TABLE t1 CHANGE id id2 INT;
-include/mix1.inc:# --enable_result_log
-include/mix1.inc:#
-include/mix1.inc:# --echo
-include/mix1.inc:#
-include/mix1.inc:# DROP TABLE t2;
-include/mix1.inc:# DROP TABLE t1;
-include/mix1.inc:#
 include/mrr_tests.inc:# Test empty result set
 include/mrr_tests.inc:# Ok, t3.ref_length=6, limit is 64 => 10 elements fit into the buffer
 include/mrr_tests.inc:# Test the cases when buffer gets exhausted at different points in source

=== modified file 'mysql-test/extra/scripts/monitor_disabled_tests/disabled_tags.txt'
--- a/mysql-test/extra/scripts/monitor_disabled_tests/disabled_tags.txt	2009-07-11 20:16:40 +0000
+++ b/mysql-test/extra/scripts/monitor_disabled_tests/disabled_tags.txt	2009-09-23 19:32:57 +0000
@@ -4,6 +4,7 @@ t/warnings_engine_disabled.test:# Only r
 t/warnings_engine_disabled.test:# about that - since NDB is disabled
 t/warnings_engine_disabled.test:# Bug#29263 disabled storage engines omitted in SHOW ENGINES
 t/mysqltest.test:# (May be disabled warnings affect $mysql_errno.)
+t/not_partition.test:#            when partitioning is disabled
 t/not_partition.test:--error ER_FEATURE_DISABLED
 t/not_partition.test:--error ER_FEATURE_DISABLED
 t/not_partition.test:--error ER_FEATURE_DISABLED
@@ -35,7 +36,6 @@ t/key.test:# Bug #20604: Test for disabl
 t/mysqlbinlog-cp932.test:# disabled in embedded until tools running is fixed with embedded
 t/ps_ddl1.test:--echo # Attention: Result logging is disabled.
 t/ps_ddl1.test:--echo # Attention: Result logging is disabled.
-t/mysqldump.test:# THIS PART OF THE TEST IS DISABLED UNTIL Bug#32991 IS FIXED
 t/sp-dynamic.test:# B. Recursion. Recusion is disabled in SP, and recursive use of PS is not
 t/sp-dynamic.test:# from a stored function (currently disabled).
 t/partition_not_windows.test:# The test for Bug 20770 is disabled on Windows due to BUG#33687; it
@@ -51,6 +51,9 @@ t/alter_table.test:col5 enum('PENDING', 
 t/alter_table.test:--echo "The key should still be disabled"
 t/alter_table.test:--echo "The non-unique index will be disabled"
 t/alter_table.test:--echo "The non-unique index will be disabled"
+t/partition_disabled.test:# Run this test only when mysqld has partitioning, but it is disabled.
+t/partition_disabled.test:--require r/disabled_partition.require
+t/partition_disabled.test:#            when partitioning is disabled
 t/merge.test:--echo # CREATE ... SELECT is disabled for MERGE tables.
 t/index_merge_myisam.test:# Now test that intersection can be disabled
 t/index_merge_myisam.test:--echo No intersect when index_merge is disabled:
@@ -70,6 +73,7 @@ t/type_timestamp.test:# Let us test some
 t/sp-error.test:# Bug#16164 "Easter egg": check that SHOW AUTHORS is disabled in
 t/sp-error.test:# This was disabled in 5.1.12. See bug #20701
 t/sp-error.test:# Disabled because there are no deprecated warnings in 6.+
+suite/innodb/t/innodb-index.test:# r2667 The following test is disabled because MySQL behavior changed.
 suite/stress/t/ddl_memory.test:   --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled
 suite/stress/t/ddl_archive.test:   --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled
 suite/stress/t/ddl_myisam.test:   --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled
@@ -168,6 +172,7 @@ suite/backup/t/backup_object_count_falco
 suite/backup/t/backup_db_grants.test:# Section of test disabled due to errors in PB. See BUG#39016
 suite/backup/t/backup_commit_restore_falcon.test:# reason for having this test file is that Falcon is disabled in the
 suite/backup/t/backup_lock_conflict_falcon.test:# reason for having this test file is that Falcon is disabled in the
+suite/backup/t/backup_no_data.test:# The BACKUP DATABASE * TO 'all.bak' is disabled because of BUG#46765
 suite/funcs_2/t/disabled.def:# Disabled by hhunger (2008-03-03) due to WL4204
 suite/parts/t/partition_value_ndb.test:# Change: Remove test from disabled.def + change test that it gets skipped     #
 suite/parts/t/disabled.def:ndb_dd_backuprestore           : Bug#32659 2008-07-14 alik  Disabled to make 6.0 greaner (the test fails too often)

=== modified file 'mysql-test/include/default_mysqld.cnf'
--- a/mysql-test/include/default_mysqld.cnf	2009-09-16 06:09:09 +0000
+++ b/mysql-test/include/default_mysqld.cnf	2009-09-22 20:18:14 +0000
@@ -14,11 +14,13 @@ sort_buffer=                256K
 max_heap_table_size=        1M
 
 loose-innodb_data_file_path=      ibdata1:10M:autoextend
-loose-innodb_buffer_pool_size=    64M
+loose-innodb_buffer_pool_size=    8M
 loose-innodb_write_io_threads=    2
 loose-innodb_read_io_threads=     2
-loose-innodb_log_buffer_size=     4M
-loose-innodb_log_file_size=       32M
+loose-innodb_log_buffer_size=     1M
+loose-innodb_log_file_size=       5M
+loose-innodb_additional_mem_pool_size= 1M
+loose-innodb_log_files_in_group=  2
 
 slave-net-timeout=120
 

=== modified file 'mysql-test/include/locktrans.inc'
--- a/mysql-test/include/locktrans.inc	2009-04-03 17:58:04 +0000
+++ b/mysql-test/include/locktrans.inc	2009-09-16 13:31:23 +0000
@@ -38,14 +38,14 @@ if ($nowait_support)
 {
 --echo #
 --echo # Valid syntax for transactional locks with NOWAIT option.
---echo ## In the preliminary reference implementation we expect these errors:
---echo ## NOWAIT+SHARE="timed out", NOWAIT+EXCLUSIVE="not supported".
+--echo ## In the preliminary reference implementation we expect 
+--echo ## "not supported" error.
 --echo ## Statements abort on first error.
---error ER_LOCK_WAIT_TIMEOUT
+--error ER_UNSUPPORTED_EXTENSION
 LOCK TABLE t1 IN SHARE MODE NOWAIT, t2 IN EXCLUSIVE MODE NOWAIT;
 --error ER_UNSUPPORTED_EXTENSION
 LOCK TABLE t1 IN EXCLUSIVE MODE NOWAIT, t2 IN SHARE MODE NOWAIT;
---error ER_LOCK_WAIT_TIMEOUT
+--error ER_UNSUPPORTED_EXTENSION
 LOCK TABLE t1 IN EXCLUSIVE MODE, t2 IN SHARE MODE NOWAIT;
 }
 #
@@ -729,7 +729,7 @@ LOCK TABLE t1 IN EXCLUSIVE MODE;
     connection conn1;
     --echo # Try an exclusive lock,
     --echo # which conflicts and cannot immediately be taken.
-    --error ER_LOCK_WAIT_TIMEOUT
+    --error ER_UNSUPPORTED_EXTENSION
     LOCK TABLE t1 IN SHARE MODE NOWAIT;
 --echo # connection default.
 connection default;

=== modified file 'mysql-test/include/master-slave.inc'
--- a/mysql-test/include/master-slave.inc	2009-06-25 12:33:12 +0000
+++ b/mysql-test/include/master-slave.inc	2009-09-23 20:37:24 +0000
@@ -1,9 +1,5 @@
 # Replication tests need binlog
 #
-
-# -- [DISABLED Bug#45238]
---source include/not_windows.inc
-
 # $skip_slave_start  If true, the slave will not be started
 source include/have_log_bin.inc;
 

=== modified file 'mysql-test/include/mtr_warnings.sql'
--- a/mysql-test/include/mtr_warnings.sql	2009-09-25 11:17:54 +0000
+++ b/mysql-test/include/mtr_warnings.sql	2009-09-29 15:03:12 +0000
@@ -163,6 +163,7 @@ INSERT INTO global_suppressions VALUES
  ("Slave: Can't DROP 'c7'.* 1091"),
  ("Slave: Key column 'c6'.* 1072"),
  ("Slave I/O: The slave I/O thread stops because a fatal error is encountered when it try to get the value of SERVER_ID variable from master."),
+ ("The slave I.O thread stops because a fatal error is encountered when it try to get the value of SERVER_ID variable from master."),
  (".SELECT UNIX_TIMESTAMP... failed on master, do not trust column Seconds_Behind_Master of SHOW SLAVE STATUS"),
 
  /* Test case for Bug#31590 in order_by.test produces the following error */

=== modified file 'mysql-test/lib/mtr_cases.pm'
--- a/mysql-test/lib/mtr_cases.pm	2009-09-23 12:24:24 +0000
+++ b/mysql-test/lib/mtr_cases.pm	2009-09-29 15:03:12 +0000
@@ -494,6 +494,7 @@ sub collect_one_suite($)
       $lib_innodb_plugin)
   {
     my @new_cases;
+    my $sep= (IS_WINDOWS) ? ';' : ':';
 
     foreach my $test (@cases)
     {
@@ -521,12 +522,13 @@ sub collect_one_suite($)
         }
       }
       my $plugin_filename= basename($lib_innodb_plugin);
+      my $plugin_list= "innodb=$plugin_filename" . $sep . "innodb_locks=$plugin_filename";
       push(@{$new_test->{master_opt}}, '--ignore-builtin-innodb');
       push(@{$new_test->{master_opt}}, '--plugin-dir=' . dirname($lib_innodb_plugin));
-      push(@{$new_test->{master_opt}}, "--plugin_load=innodb=$plugin_filename;innodb_locks=$plugin_filename");
+      push(@{$new_test->{master_opt}}, "--plugin_load=$plugin_list");
       push(@{$new_test->{slave_opt}}, '--ignore-builtin-innodb');
       push(@{$new_test->{slave_opt}}, '--plugin-dir=' . dirname($lib_innodb_plugin));
-      push(@{$new_test->{slave_opt}}, "--plugin_load=innodb=$plugin_filename;innodb_locks=$plugin_filename");
+      push(@{$new_test->{slave_opt}}, "--plugin_load=$plugin_list");
       if ($new_test->{combination})
       {
         $new_test->{combination}.= ' + InnoDB plugin';

=== modified file 'mysql-test/mysql-test-run.pl'
--- a/mysql-test/mysql-test-run.pl	2009-09-23 08:41:13 +0000
+++ b/mysql-test/mysql-test-run.pl	2009-09-29 15:03:12 +0000
@@ -128,7 +128,7 @@ our $opt_vs_config = $ENV{'MTR_VS_CONFIG
 
 # If you add a new suite, please check TEST_DIRS in Makefile.am.
 #
-my $DEFAULT_SUITES= "main,backup,backup_engines,backup_ptr,binlog,federated,rpl,rpl_ndb,ndb,innodb";
+my $DEFAULT_SUITES= "main,backup,backup_engines,backup_ptr,binlog,federated,rpl,rpl_ndb,ndb";
 
 our $opt_usage;
 our $opt_list_options;
@@ -1841,7 +1841,7 @@ sub environment_setup {
       ($lib_example_plugin ? dirname($lib_example_plugin) : "");
 
     $ENV{'HA_EXAMPLE_SO'}="'".$plugin_filename."'";
-    $ENV{'EXAMPLE_PLUGIN_LOAD'}="--plugin_load=;EXAMPLE=".$plugin_filename.";";
+    $ENV{'EXAMPLE_PLUGIN_LOAD'}="--plugin_load=EXAMPLE=".$plugin_filename;
   }
   else
   {

=== modified file 'mysql-test/r/delayed.result'
--- a/mysql-test/r/delayed.result	2009-03-11 17:17:00 +0000
+++ b/mysql-test/r/delayed.result	2009-09-25 11:03:29 +0000
@@ -311,3 +311,25 @@ a	b
 drop table t1;
 set global low_priority_updates = @old_delayed_updates;
 End of 5.1 tests
+#
+# Bug #47274 assert in open_table on CREATE TABLE <already existing>
+#
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+CREATE TABLE t1 ( f1 INTEGER AUTO_INCREMENT, PRIMARY KEY (f1));
+# The following CREATE TABLEs before gave an assert.
+INSERT DELAYED t1 VALUES (4);
+CREATE TABLE t1 AS SELECT 1 AS f1;
+ERROR 42S01: Table 't1' already exists
+REPLACE DELAYED t1 VALUES (5);
+CREATE TABLE t1 AS SELECT 1 AS f1;
+ERROR 42S01: Table 't1' already exists
+INSERT DELAYED t1 VALUES (6);
+CREATE TABLE t1 (f1 INTEGER);
+ERROR 42S01: Table 't1' already exists
+CREATE TABLE t2 (f1 INTEGER);
+INSERT DELAYED t1 VALUES (7);
+CREATE TABLE t1 LIKE t2;
+ERROR 42S01: Table 't1' already exists
+DROP TABLE t2;
+DROP TABLE t1;

=== modified file 'mysql-test/r/explain.result'
--- a/mysql-test/r/explain.result	2009-09-04 08:14:01 +0000
+++ b/mysql-test/r/explain.result	2009-09-21 12:56:38 +0000
@@ -213,3 +213,14 @@ def					Extra	253	255	14	N	1	31	8
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
 End of 5.2 tests.
+#
+# Bug#46860: 
+# Crash/segfault using EXPLAIN EXTENDED on query using UNION in subquery.
+#
+drop table if exists t1;
+create table `t1` (`a` int);
+explain extended select 1 from `t1`, `t1` as `t2`
+where `t1`.`a`  > all ( (select `a` from `t1` ) union (select `a`) );
+ERROR 23000: Column 'a' in field list is ambiguous
+drop table t1;
+End of 6.0 tests.

=== modified file 'mysql-test/r/func_math.result'
--- a/mysql-test/r/func_math.result	2009-09-16 08:23:16 +0000
+++ b/mysql-test/r/func_math.result	2009-09-25 14:15:30 +0000
@@ -492,4 +492,8 @@ select 123456789012345678901234567890.12
 ERROR 22003: Out of range value for column 'x' at row 1
 select "123456789012345678901234567890.123456789012345678901234567890" div 1 as x;
 ERROR 22003: Out of range value for column 'x' at row 1
+SHOW WARNINGS;
+Level	Code	Message
+Warning	1292	Truncated incorrect DECIMAL value: ''
+Error	1264	Out of range value for column 'x' at row 1
 End of 6.0 tests

=== modified file 'mysql-test/r/information_schema_db.result'
--- a/mysql-test/r/information_schema_db.result	2009-09-16 06:00:54 +0000
+++ b/mysql-test/r/information_schema_db.result	2009-09-29 11:50:14 +0000
@@ -142,7 +142,7 @@ show create view testdb_1.v7;
 View	Create View	character_set_client	collation_connection
 v7	CREATE ALGORITHM=UNDEFINED DEFINER=`no_such_user`@`no_such_host` SQL SECURITY DEFINER VIEW `v7` AS select `testdb_1`.`t2`.`f1` AS `f1` from `t2`	latin1	latin1_swedish_ci
 Warnings:
-Warning	1356	View 'testdb_1.v7' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+Note	1449	The user specified as a definer ('no_such_user'@'no_such_host') does not exist
 show fields from testdb_1.v7;
 Field	Type	Null	Key	Default	Extra
 f1	char(4)	YES		NULL	
@@ -174,7 +174,7 @@ show create view testdb_1.v7;
 View	Create View	character_set_client	collation_connection
 v7	CREATE ALGORITHM=UNDEFINED DEFINER=`no_such_user`@`no_such_host` SQL SECURITY DEFINER VIEW `v7` AS select `testdb_1`.`t2`.`f1` AS `f1` from `t2`	latin1	latin1_swedish_ci
 Warnings:
-Warning	1356	View 'testdb_1.v7' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+Note	1449	The user specified as a definer ('no_such_user'@'no_such_host') does not exist
 revoke insert(f1) on v3 from testdb_2@localhost;
 revoke select,show view on v5 from testdb_2@localhost;
 use testdb_1;
@@ -192,7 +192,8 @@ ERROR 42000: SELECT command denied to us
 show create view testdb_1.v7;
 ERROR 42000: SELECT command denied to user 'testdb_2'@'localhost' for table 'v7'
 show create view v4;
-ERROR HY000: EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+View	Create View	character_set_client	collation_connection
+v4	CREATE ALGORITHM=UNDEFINED DEFINER=`testdb_2`@`localhost` SQL SECURITY DEFINER VIEW `v4` AS select `v3`.`f1` AS `f1`,`v3`.`f2` AS `f2` from `testdb_1`.`v3`	latin1	latin1_swedish_ci
 show fields from v4;
 Field	Type	Null	Key	Default	Extra
 f1	char(4)	YES		NULL	

=== modified file 'mysql-test/r/innodb.result'
--- a/mysql-test/r/innodb.result	2009-09-16 06:09:09 +0000
+++ b/mysql-test/r/innodb.result	2009-09-22 20:18:14 +0000
@@ -1725,7 +1725,7 @@ count(*)
 drop table t1;
 show status like "Innodb_buffer_pool_pages_total";
 Variable_name	Value
-Innodb_buffer_pool_pages_total	4096
+Innodb_buffer_pool_pages_total	512
 show status like "Innodb_page_size";
 Variable_name	Value
 Innodb_page_size	16384

=== added file 'mysql-test/r/innodb_mysql_sync.result'
--- a/mysql-test/r/innodb_mysql_sync.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/innodb_mysql_sync.result	2009-09-16 12:39:35 +0000
@@ -0,0 +1,26 @@
+#
+# Bug 42074 concurrent optimize table and 
+# alter table = Assertion failed: thd->is_error()
+#
+DROP TABLE IF EXISTS t1;
+# Create InnoDB table
+CREATE TABLE t1 (id INT) engine=innodb;
+# Connection 1
+# Start optimizing table
+SET DEBUG_SYNC='ha_admin_try_alter SIGNAL optimize_started WAIT_FOR table_altered';
+OPTIMIZE TABLE t1;
+# Connection 2
+# Change table to engine=memory
+SET DEBUG_SYNC='now WAIT_FOR optimize_started';
+ALTER TABLE t1 engine=memory;
+SET DEBUG_SYNC='now SIGNAL table_altered';
+# Connection 1
+# Complete optimization
+Table	Op	Msg_type	Msg_text
+test.t1	optimize	note	Table does not support optimize, doing recreate + analyze instead
+test.t1	optimize	error	Got error -1 from storage engine
+test.t1	optimize	status	Operation failed
+Warnings:
+Error	1030	Got error -1 from storage engine
+DROP TABLE t1;
+SET DEBUG_SYNC='RESET';

=== modified file 'mysql-test/r/join_cache.result'
--- a/mysql-test/r/join_cache.result	2009-09-04 06:58:24 +0000
+++ b/mysql-test/r/join_cache.result	2009-09-25 12:19:01 +0000
@@ -3993,3 +3993,38 @@ pk
 NULL
 DROP TABLE IF EXISTS t1, t2, t3;
 #
+# Bug #46328: Use of aggregate function without GROUP BY clause 
+#             returns many rows (vs. one )
+#             
+CREATE TABLE t1 (
+int_key int(11) NOT NULL,
+KEY int_key (int_key)
+);
+INSERT INTO t1 VALUES
+(0),(2),(2),(2),(3),(4),(5),(5),(6),(6),(8),(8),(9),(9);
+CREATE TABLE t2 (
+int_key int(11) NOT NULL,
+KEY int_key (int_key)
+);
+INSERT INTO t2 VALUES (2),(3);
+
+# The query shall return 1 record with a max value 9 and one of the 
+# int_key values inserted above (undefined which one). A changed 
+# execution plan may change the value in the second column
+SELECT  MAX(t1.int_key), t1.int_key
+FROM t1 STRAIGHT_JOIN t2  
+ORDER BY t1.int_key;
+MAX(t1.int_key)	int_key
+9	0
+
+explain 
+SELECT  MAX(t1.int_key), t1.int_key
+FROM t1 STRAIGHT_JOIN t2  
+ORDER BY t1.int_key;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	index	NULL	int_key	4	NULL	14	Using index
+1	SIMPLE	t2	index	NULL	int_key	4	NULL	2	Using index; Using join buffer
+
+DROP TABLE t1,t2;
+SET join_cache_level=default;
+#

=== modified file 'mysql-test/r/lock_multi.result'
--- a/mysql-test/r/lock_multi.result	2009-08-24 09:56:29 +0000
+++ b/mysql-test/r/lock_multi.result	2009-09-23 06:32:02 +0000
@@ -220,3 +220,34 @@ flush tables with read lock;;
 connection: default
 flush tables;
 drop table t1;
+#
+# Bug#47249 assert in MDL_global_lock::is_lock_type_compatible
+#
+DROP TABLE IF EXISTS t1;
+DROP VIEW  IF EXISTS v1;
+#
+# Test 1: LOCK TABLES v1 WRITE, t1 READ;
+#
+CREATE TABLE t1 ( f1 integer );
+CREATE VIEW v1 AS SELECT f1 FROM t1 ;
+# Connection 2
+LOCK TABLES v1 WRITE, t1 READ;
+FLUSH TABLE t1;
+# Connection 1
+LOCK TABLES t1 WRITE;
+FLUSH TABLE t1;
+DROP TABLE t1;
+DROP VIEW v1;
+#
+# Test 2: LOCK TABLES t1 WRITE, v1 READ;
+#
+CREATE TABLE t1 ( f1 integer );
+CREATE VIEW v1 AS SELECT f1 FROM t1 ;
+# Connection 2
+LOCK TABLES t1 WRITE, v1 READ;
+FLUSH TABLE t1;
+# Connection 1
+LOCK TABLES t1 WRITE;
+FLUSH TABLE t1;
+DROP TABLE t1;
+DROP VIEW v1;

=== modified file 'mysql-test/r/locktrans_innodb.result'
--- a/mysql-test/r/locktrans_innodb.result	2009-07-31 17:53:36 +0000
+++ b/mysql-test/r/locktrans_innodb.result	2009-09-25 10:48:44 +0000
@@ -23,15 +23,15 @@ LOCK TABLE t1 IN SHARE MODE, t2 IN EXCLU
 UNLOCK TABLES;
 #
 # Valid syntax for transactional locks with NOWAIT option.
-## In the preliminary reference implementation we expect these errors:
-## NOWAIT+SHARE="timed out", NOWAIT+EXCLUSIVE="not supported".
+## In the preliminary reference implementation we expect 
+## "not supported" error.
 ## Statements abort on first error.
 LOCK TABLE t1 IN SHARE MODE NOWAIT, t2 IN EXCLUSIVE MODE NOWAIT;
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+ERROR 42000: Table 't1' uses an extension that doesn't exist in this MySQL version
 LOCK TABLE t1 IN EXCLUSIVE MODE NOWAIT, t2 IN SHARE MODE NOWAIT;
 ERROR 42000: Table 't1' uses an extension that doesn't exist in this MySQL version
 LOCK TABLE t1 IN EXCLUSIVE MODE, t2 IN SHARE MODE NOWAIT;
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+ERROR 42000: Table 't2' uses an extension that doesn't exist in this MySQL version
 #
 # Valid syntax for aliases with and without 'AS'.
 LOCK TABLE t1 AS a1 READ, t2 a2 WRITE;
@@ -617,7 +617,7 @@ LOCK TABLE t1 IN EXCLUSIVE MODE;
 # Try an exclusive lock,
 # which conflicts and cannot immediately be taken.
 LOCK TABLE t1 IN SHARE MODE NOWAIT;
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+ERROR 42000: Table 't1' uses an extension that doesn't exist in this MySQL version
 # connection default.
 # Commit.
 COMMIT;
@@ -935,3 +935,22 @@ UNLOCK TABLES;
 SET AUTOCOMMIT= 1;
 UNLOCK TABLES;
 DROP TABLE t1, t2;
+#
+# Bug 46678 Transactional locks do not protect a table from 
+#           concurrent DROP or RENAME 
+#
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) engine = innodb;
+# Connection 1
+BEGIN;
+LOCK TABLES t1 IN EXCLUSIVE MODE;
+# Connection 2
+# DROP TABLE should wait
+DROP TABLE t1;
+# Connection 1
+# t1 should still exist
+SELECT * FROM t1;
+i
+COMMIT;
+# Connection 2
+# Connection 1

=== modified file 'mysql-test/r/merge.result'
--- a/mysql-test/r/merge.result	2009-09-16 05:36:47 +0000
+++ b/mysql-test/r/merge.result	2009-09-25 14:15:30 +0000
@@ -2423,4 +2423,34 @@ c1
 DROP TRIGGER t2_au;
 DROP FUNCTION f1;
 DROP TABLE tm1, t1, t2, t3, t4, t5;
+#
+# Bug47098 assert in MDL_context::destroy on HANDLER
+#          <damaged merge table> OPEN
+#
+# Test that merge tables are closed correctly when opened using 
+# HANDLER ... OPEN.
+# The general case.
+DROP TABLE IF EXISTS t1, t2, t3;
+# Connection con1.
+CREATE TABLE t1 (c1 int);
+CREATE TABLE t2 (c1 int);
+CREATE TABLE t3 (c1 int) ENGINE = MERGE UNION (t1,t2);
+START TRANSACTION;
+HANDLER t3 OPEN;
+ERROR HY000: Table storage engine for 't3' doesn't have this option
+DROP TABLE t1, t2, t3;
+# Connection default.
+# Disconnecting con1, all mdl_tickets must have been released.
+# The bug-specific case.
+# Connection con1.
+CREATE TABLE t1 (c1 int);
+CREATE TABLE t2 (c1 int);
+CREATE TABLE t3 (c1 int) ENGINE = MERGE UNION (t1,t2);
+DROP TABLE t2;
+START TRANSACTION;
+HANDLER t3 OPEN;
+ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
+DROP TABLE t1, t3;
+# Connection default.
+# Disconnecting con1, all mdl_tickets must have been released.
 End of 6.0 tests

=== modified file 'mysql-test/r/merge_recover.result'
--- a/mysql-test/r/merge_recover.result	2009-09-28 08:18:52 +0000
+++ b/mysql-test/r/merge_recover.result	2009-09-29 15:03:12 +0000
@@ -17,9 +17,7 @@ call mtr.add_suppression("Got an error f
 call mtr.add_suppression("MySQL thread id .*, query id .* localhost.*root Checking table");
 call mtr.add_suppression(" '\..test.t1'");
 set global table_open_cache=256;
-set global table_definition_cache=256;
-Warnings:
-Warning	1292	Truncated incorrect table_definition_cache value: '256'
+set global table_definition_cache=400;
 drop procedure if exists p_create;
 create procedure p_create()
 begin

=== added file 'mysql-test/r/partition_sync.result'
--- a/mysql-test/r/partition_sync.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/partition_sync.result	2009-09-22 11:44:58 +0000
@@ -0,0 +1,57 @@
+#
+# Bug #43867 ALTER TABLE on a partitioned table 
+#            causes unnecessary deadlocks
+#
+CREATE TABLE t1 (a int) PARTITION BY RANGE (a)
+(PARTITION p0 VALUES LESS THAN (1),
+PARTITION p1 VALUES LESS THAN (2));
+INSERT INTO t1 VALUES (0),(1);
+# Connection 2
+BEGIN;
+SELECT * FROM t1;
+a
+0
+1
+# Connection 1
+ALTER TABLE t1 DROP PARTITION p3;
+ERROR HY000: Error in list of partitions to DROP
+# Connection 2
+# This failed with deadlock and should not do so.
+SELECT * FROM t1;
+a
+0
+1
+# Connection 1
+DROP TABLE t1;
+#
+# Bug #46654 False deadlock on concurrent DML/DDL 
+#            with partitions, inconsistent behavior
+#
+DROP TABLE IF EXISTS tbl_with_partitions;
+CREATE TABLE tbl_with_partitions ( i INT ) 
+PARTITION BY HASH(i);
+INSERT INTO tbl_with_partitions VALUES (1);
+# Connection 3
+LOCK TABLE tbl_with_partitions READ;
+# Connection 1
+# Access table with disabled autocommit
+SET AUTOCOMMIT = 0;
+SELECT * FROM tbl_with_partitions;
+i
+1
+# Connection 2
+# Alter table, abort after prepare
+set session debug="+d,abort_copy_table";
+ALTER TABLE tbl_with_partitions ADD COLUMN f INT;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+# Connection 1
+# Try accessing the table after Alter aborted.
+# This used to give ER_LOCK_DEADLOCK.
+SELECT * FROM tbl_with_partitions;
+i
+1
+# Connection 3
+UNLOCK TABLES;
+# Connection 1
+# Cleanup
+DROP TABLE tbl_with_partitions;

=== modified file 'mysql-test/r/select.result'
--- a/mysql-test/r/select.result	2009-07-06 08:38:21 +0000
+++ b/mysql-test/r/select.result	2009-09-22 20:18:14 +0000
@@ -4585,4 +4585,35 @@ time_key
 15:13:38
 drop table A,AA,B,BB;
 # end of test#45266
+#
+# Bug#45277: Lost HAVING clause led to a wrong result.
+#
+CREATE TABLE `CC` (
+`int_nokey` int(11) NOT NULL,
+`int_key` int(11) NOT NULL,
+`varchar_key` varchar(1) NOT NULL,
+`varchar_nokey` varchar(1) NOT NULL,
+KEY `int_key` (`int_key`),
+KEY `varchar_key` (`varchar_key`)
+);
+INSERT INTO `CC` VALUES
+(0,8,'q','q'),(5,8,'m','m'),(7,3,'j','j'),(1,2,'z','z'),(8,2,'a','a'),(2,6,'',''),(1,8,'e'
+,'e'),(8,9,'t','t'),(5,2,'q','q'),(4,6,'b','b'),(5,5,'w','w'),(3,2,'m','m'),(0,4,'x','x'),
+(8,9,'',''),(0,6,'w','w'),(4,5,'x','x'),(0,0,'e','e'),(0,0,'e','e'),(2,8,'p','p'),(0,0,'x'
+,'x');
+EXPLAIN SELECT `varchar_nokey` G1  FROM CC  WHERE `int_nokey` AND `int_key`  <= 4
+HAVING G1  ORDER  BY `varchar_key` LIMIT  6   ;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	CC	range	int_key	int_key	4	NULL	10	Using index condition; Using where; Using MRR; Using filesort
+SELECT `varchar_nokey` G1  FROM CC  WHERE `int_nokey` AND `int_key`  <= 4
+HAVING G1  ORDER  BY `varchar_key` LIMIT  6   ;
+G1
+Warnings:
+Warning	1292	Truncated incorrect DOUBLE value: 'j'
+Warning	1292	Truncated incorrect DOUBLE value: 'z'
+Warning	1292	Truncated incorrect DOUBLE value: 'a'
+Warning	1292	Truncated incorrect DOUBLE value: 'q'
+Warning	1292	Truncated incorrect DOUBLE value: 'm'
+DROP TABLE CC;
+# End of test#45277
 End of 6.0 tests

=== modified file 'mysql-test/r/select_jcl6.result'
--- a/mysql-test/r/select_jcl6.result	2009-07-06 08:38:21 +0000
+++ b/mysql-test/r/select_jcl6.result	2009-09-22 20:18:14 +0000
@@ -4589,6 +4589,37 @@ time_key
 15:13:38
 drop table A,AA,B,BB;
 # end of test#45266
+#
+# Bug#45277: Lost HAVING clause led to a wrong result.
+#
+CREATE TABLE `CC` (
+`int_nokey` int(11) NOT NULL,
+`int_key` int(11) NOT NULL,
+`varchar_key` varchar(1) NOT NULL,
+`varchar_nokey` varchar(1) NOT NULL,
+KEY `int_key` (`int_key`),
+KEY `varchar_key` (`varchar_key`)
+);
+INSERT INTO `CC` VALUES
+(0,8,'q','q'),(5,8,'m','m'),(7,3,'j','j'),(1,2,'z','z'),(8,2,'a','a'),(2,6,'',''),(1,8,'e'
+,'e'),(8,9,'t','t'),(5,2,'q','q'),(4,6,'b','b'),(5,5,'w','w'),(3,2,'m','m'),(0,4,'x','x'),
+(8,9,'',''),(0,6,'w','w'),(4,5,'x','x'),(0,0,'e','e'),(0,0,'e','e'),(2,8,'p','p'),(0,0,'x'
+,'x');
+EXPLAIN SELECT `varchar_nokey` G1  FROM CC  WHERE `int_nokey` AND `int_key`  <= 4
+HAVING G1  ORDER  BY `varchar_key` LIMIT  6   ;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	CC	range	int_key	int_key	4	NULL	10	Using index condition; Using where; Using MRR; Using filesort
+SELECT `varchar_nokey` G1  FROM CC  WHERE `int_nokey` AND `int_key`  <= 4
+HAVING G1  ORDER  BY `varchar_key` LIMIT  6   ;
+G1
+Warnings:
+Warning	1292	Truncated incorrect DOUBLE value: 'j'
+Warning	1292	Truncated incorrect DOUBLE value: 'z'
+Warning	1292	Truncated incorrect DOUBLE value: 'a'
+Warning	1292	Truncated incorrect DOUBLE value: 'q'
+Warning	1292	Truncated incorrect DOUBLE value: 'm'
+DROP TABLE CC;
+# End of test#45277
 End of 6.0 tests
 set join_cache_level=default;
 show variables like 'join_cache_level';

=== modified file 'mysql-test/r/sp-error.result'
--- a/mysql-test/r/sp-error.result	2009-09-16 05:54:22 +0000
+++ b/mysql-test/r/sp-error.result	2009-09-20 14:42:51 +0000
@@ -1690,3 +1690,14 @@ NULL
 SELECT non_existent (a) FROM t1 WHERE b = 999999;
 ERROR 42000: FUNCTION test.non_existent does not exist
 DROP TABLE t1;
+CREATE TABLE t1 ( f2 INTEGER, f3 INTEGER );
+INSERT INTO t1 VALUES  ( 1, 1 );
+CREATE FUNCTION func_1 () RETURNS INTEGER
+BEGIN
+INSERT INTO t1 SELECT * FROM t1 ;
+RETURN 1 ;
+END|
+INSERT INTO t1 SELECT * FROM (SELECT 2 AS f1, 2 AS f2) AS A WHERE func_1() = 5;
+ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
+DROP FUNCTION func_1;
+DROP TABLE t1;

=== modified file 'mysql-test/r/subselect3.result'
--- a/mysql-test/r/subselect3.result	2009-09-16 08:23:16 +0000
+++ b/mysql-test/r/subselect3.result	2009-09-21 12:56:38 +0000
@@ -873,9 +873,6 @@ Level	Code	Message
 Note	1276	Field or reference 'test.t1.a' of SELECT #3 was resolved in SELECT #2
 Note	1276	Field or reference 'test.t1.c' of SELECT #3 was resolved in SELECT #2
 Error	1054	Unknown column 'c' in 'field list'
-Note	1003	select `c` AS `c` from (select (select count(`test`.`t1`.`a`) AS `COUNT(a)` from (select count(`test`.`t1`.`b`) AS `COUNT(b)` from `test`.`t1`) `x` group by `c`) AS `(SELECT COUNT(a) FROM 
-(SELECT COUNT(b) FROM t1) AS x GROUP BY c
-)` from `test`.`t1` group by `test`.`t1`.`b`) `y`
 DROP TABLE t1;
 End of 5.0 tests
 #  

=== modified file 'mysql-test/r/subselect3_jcl6.result'
--- a/mysql-test/r/subselect3_jcl6.result	2009-04-30 19:37:21 +0000
+++ b/mysql-test/r/subselect3_jcl6.result	2009-09-21 12:56:38 +0000
@@ -877,9 +877,6 @@ Level	Code	Message
 Note	1276	Field or reference 'test.t1.a' of SELECT #3 was resolved in SELECT #2
 Note	1276	Field or reference 'test.t1.c' of SELECT #3 was resolved in SELECT #2
 Error	1054	Unknown column 'c' in 'field list'
-Note	1003	select `c` AS `c` from (select (select count(`test`.`t1`.`a`) AS `COUNT(a)` from (select count(`test`.`t1`.`b`) AS `COUNT(b)` from `test`.`t1`) `x` group by `c`) AS `(SELECT COUNT(a) FROM 
-(SELECT COUNT(b) FROM t1) AS x GROUP BY c
-)` from `test`.`t1` group by `test`.`t1`.`b`) `y`
 DROP TABLE t1;
 End of 5.0 tests
 #  

=== modified file 'mysql-test/r/view.result'
--- a/mysql-test/r/view.result	2009-09-16 08:23:16 +0000
+++ b/mysql-test/r/view.result	2009-09-27 20:39:24 +0000
@@ -4002,3 +4002,35 @@ WHERE 1 IN (SELECT id FROM t1) WITH CHEC
 DELETE FROM v3;
 DROP VIEW v1,v2,v3;
 DROP TABLE t1,t2;
+#
+# Bug #47335 assert in get_table_share
+#
+DROP TABLE IF EXISTS t1;
+DROP VIEW IF EXISTS v1;
+CREATE TEMPORARY TABLE t1 (id INT);
+ALTER VIEW t1 AS SELECT 1 AS f1;
+ERROR 42S02: Table 'test.t1' doesn't exist
+DROP TABLE t1;
+CREATE VIEW v1 AS SELECT 1 AS f1;
+CREATE TEMPORARY TABLE v1 (id INT);
+ALTER VIEW v1 AS SELECT 2 AS f1;
+DROP TABLE v1;
+SELECT * FROM v1;
+f1
+2
+DROP VIEW v1;
+#
+# Bug #47635 assert in start_waiting_global_read_lock 
+#            during CREATE VIEW
+#
+DROP TABLE IF EXISTS t1, t2;
+DROP VIEW IF EXISTS t2;
+CREATE TABLE t1 (f1 integer);
+CREATE TEMPORARY TABLE IF NOT EXISTS t1 (f1 integer);
+CREATE TEMPORARY TABLE t2 (f1 integer);
+DROP TABLE t1;
+FLUSH TABLES WITH READ LOCK;
+CREATE VIEW t2 AS SELECT * FROM t1;
+ERROR HY000: Can't execute the query because you have a conflicting read lock
+UNLOCK TABLES;
+DROP TABLE t1, t2;

=== modified file 'mysql-test/r/view_grant.result'
--- a/mysql-test/r/view_grant.result	2009-08-21 14:47:56 +0000
+++ b/mysql-test/r/view_grant.result	2009-09-29 11:50:14 +0000
@@ -606,7 +606,7 @@ SHOW CREATE VIEW v;
 View	Create View	character_set_client	collation_connection
 v	CREATE ALGORITHM=UNDEFINED DEFINER=`no-such-user`@`localhost` SQL SECURITY DEFINER VIEW `v` AS select `test`.`t1`.`a` AS `a` from `t1`	latin1	latin1_swedish_ci
 Warnings:
-Warning	1356	View 'test.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+Note	1449	The user specified as a definer ('no-such-user'@'localhost') does not exist
 SELECT * FROM v;
 ERROR HY000: The user specified as a definer ('no-such-user'@'localhost') does not exist
 DROP VIEW v;
@@ -954,7 +954,7 @@ SHOW CREATE VIEW v1;
 View	Create View	character_set_client	collation_connection
 v1	CREATE ALGORITHM=UNDEFINED DEFINER=`no_such`@`user_1` SQL SECURITY DEFINER VIEW `v1` AS select `test`.`t1`.`i` AS `i` from `t1`	latin1	latin1_swedish_ci
 Warnings:
-Warning	1356	View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+Note	1449	The user specified as a definer ('no_such'@'user_1') does not exist
 ALTER ALGORITHM=MERGE VIEW v1 AS SELECT * FROM t1;
 Warnings:
 Note	1449	The user specified as a definer ('no_such'@'user_1') does not exist
@@ -962,7 +962,7 @@ SHOW CREATE VIEW v1;
 View	Create View	character_set_client	collation_connection
 v1	CREATE ALGORITHM=MERGE DEFINER=`no_such`@`user_1` SQL SECURITY DEFINER VIEW `v1` AS select `test`.`t1`.`i` AS `i` from `t1`	latin1	latin1_swedish_ci
 Warnings:
-Warning	1356	View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+Note	1449	The user specified as a definer ('no_such'@'user_1') does not exist
 ALTER ALGORITHM=TEMPTABLE DEFINER=no_such@user_2 VIEW v1 AS SELECT * FROM t1;
 Warnings:
 Note	1449	The user specified as a definer ('no_such'@'user_2') does not exist
@@ -970,7 +970,7 @@ SHOW CREATE VIEW v1;
 View	Create View	character_set_client	collation_connection
 v1	CREATE ALGORITHM=TEMPTABLE DEFINER=`no_such`@`user_2` SQL SECURITY DEFINER VIEW `v1` AS select `test`.`t1`.`i` AS `i` from `t1`	latin1	latin1_swedish_ci
 Warnings:
-Warning	1356	View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+Note	1449	The user specified as a definer ('no_such'@'user_2') does not exist
 DROP VIEW v1;
 DROP TABLE t1;
 CREATE USER mysqluser1@localhost;
@@ -1035,3 +1035,177 @@ DROP DATABASE mysqltest1;
 DROP VIEW test.v3;
 DROP USER mysqluser1@localhost;
 USE test;
+#
+# Bug#35996: SELECT + SHOW VIEW should be enough to display view 
+# definition
+#
+CREATE USER mysqluser1@localhost;
+CREATE DATABASE mysqltest1;
+CREATE DATABASE mysqltest2;
+GRANT USAGE, SELECT, CREATE VIEW, SHOW VIEW 
+ON mysqltest2.* TO mysqluser1@localhost;
+USE mysqltest1;
+CREATE TABLE t1( a INT );
+CREATE TABLE t2( a INT, b INT );
+CREATE FUNCTION f1() RETURNS INT RETURN 1;
+CREATE VIEW v1 AS SELECT 1 AS a;
+CREATE VIEW v2 AS SELECT 1 AS a, 2 AS b;
+GRANT SELECT        ON TABLE    t1 TO mysqluser1@localhost;
+GRANT SELECT (a, b) ON TABLE    t2 TO mysqluser1@localhost;
+GRANT EXECUTE       ON FUNCTION f1 TO mysqluser1@localhost;
+GRANT SELECT        ON TABLE    v1 TO mysqluser1@localhost;
+GRANT SELECT (a, b) ON TABLE    v2 TO mysqluser1@localhost;
+CREATE VIEW v_t1 AS SELECT * FROM t1;
+CREATE VIEW v_t2 AS SELECT * FROM t2;
+CREATE VIEW v_f1 AS SELECT f1() AS a;
+CREATE VIEW v_v1 AS SELECT * FROM v1;
+CREATE VIEW v_v2 AS SELECT * FROM v2;
+GRANT SELECT, SHOW VIEW ON v_t1 TO mysqluser1@localhost;
+GRANT SELECT, SHOW VIEW ON v_t2 TO mysqluser1@localhost;
+GRANT SELECT, SHOW VIEW ON v_f1 TO mysqluser1@localhost;
+GRANT SELECT, SHOW VIEW ON v_v1 TO mysqluser1@localhost;
+GRANT SELECT, SHOW VIEW ON v_v2 TO mysqluser1@localhost;
+CREATE VIEW v_mysqluser1_t1 AS SELECT * FROM mysqltest1.t1;
+CREATE VIEW v_mysqluser1_t2 AS SELECT * FROM mysqltest1.t2;
+CREATE VIEW v_mysqluser1_f1 AS SELECT mysqltest1.f1() AS a;
+CREATE VIEW v_mysqluser1_v1 AS SELECT * FROM mysqltest1.v1;
+CREATE VIEW v_mysqluser1_v2 AS SELECT * FROM mysqltest1.v2;
+SHOW CREATE VIEW mysqltest1.v_t1;
+View	Create View	character_set_client	collation_connection
+v_t1	CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest1`.`v_t1` AS select `mysqltest1`.`t1`.`a` AS `a` from `mysqltest1`.`t1`	latin1	latin1_swedish_ci
+SHOW CREATE VIEW mysqltest1.v_t2;
+View	Create View	character_set_client	collation_connection
+v_t2	CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest1`.`v_t2` AS select `mysqltest1`.`t2`.`a` AS `a`,`mysqltest1`.`t2`.`b` AS `b` from `mysqltest1`.`t2`	latin1	latin1_swedish_ci
+SHOW CREATE VIEW mysqltest1.v_f1;
+View	Create View	character_set_client	collation_connection
+v_f1	CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest1`.`v_f1` AS select `f1`() AS `a`	latin1	latin1_swedish_ci
+SHOW CREATE VIEW mysqltest1.v_v1;
+View	Create View	character_set_client	collation_connection
+v_v1	CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest1`.`v_v1` AS select `v1`.`a` AS `a` from `mysqltest1`.`v1`	latin1	latin1_swedish_ci
+SHOW CREATE VIEW mysqltest1.v_v2;
+View	Create View	character_set_client	collation_connection
+v_v2	CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest1`.`v_v2` AS select `v2`.`a` AS `a`,`v2`.`b` AS `b` from `mysqltest1`.`v2`	latin1	latin1_swedish_ci
+SHOW CREATE VIEW v_mysqluser1_t1;
+View	Create View	character_set_client	collation_connection
+v_mysqluser1_t1	CREATE ALGORITHM=UNDEFINED DEFINER=`mysqluser1`@`localhost` SQL SECURITY DEFINER VIEW `v_mysqluser1_t1` AS select `mysqltest1`.`t1`.`a` AS `a` from `mysqltest1`.`t1`	latin1	latin1_swedish_ci
+SHOW CREATE VIEW v_mysqluser1_t2;
+View	Create View	character_set_client	collation_connection
+v_mysqluser1_t2	CREATE ALGORITHM=UNDEFINED DEFINER=`mysqluser1`@`localhost` SQL SECURITY DEFINER VIEW `v_mysqluser1_t2` AS select `mysqltest1`.`t2`.`a` AS `a`,`mysqltest1`.`t2`.`b` AS `b` from `mysqltest1`.`t2`	latin1	latin1_swedish_ci
+SHOW CREATE VIEW v_mysqluser1_f1;
+View	Create View	character_set_client	collation_connection
+v_mysqluser1_f1	CREATE ALGORITHM=UNDEFINED DEFINER=`mysqluser1`@`localhost` SQL SECURITY DEFINER VIEW `v_mysqluser1_f1` AS select `mysqltest1`.`f1`() AS `a`	latin1	latin1_swedish_ci
+SHOW CREATE VIEW v_mysqluser1_v1;
+View	Create View	character_set_client	collation_connection
+v_mysqluser1_v1	CREATE ALGORITHM=UNDEFINED DEFINER=`mysqluser1`@`localhost` SQL SECURITY DEFINER VIEW `v_mysqluser1_v1` AS select `v1`.`a` AS `a` from `mysqltest1`.`v1`	latin1	latin1_swedish_ci
+SHOW CREATE VIEW v_mysqluser1_v2;
+View	Create View	character_set_client	collation_connection
+v_mysqluser1_v2	CREATE ALGORITHM=UNDEFINED DEFINER=`mysqluser1`@`localhost` SQL SECURITY DEFINER VIEW `v_mysqluser1_v2` AS select `v2`.`a` AS `a`,`v2`.`b` AS `b` from `mysqltest1`.`v2`	latin1	latin1_swedish_ci
+REVOKE SELECT     ON TABLE    t1 FROM mysqluser1@localhost;
+REVOKE SELECT (a) ON TABLE    t2 FROM mysqluser1@localhost;
+REVOKE EXECUTE    ON FUNCTION f1 FROM mysqluser1@localhost;
+REVOKE SELECT     ON TABLE    v1 FROM mysqluser1@localhost;
+SHOW CREATE VIEW mysqltest1.v_t1;
+View	Create View	character_set_client	collation_connection
+v_t1	CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest1`.`v_t1` AS select `mysqltest1`.`t1`.`a` AS `a` from `mysqltest1`.`t1`	latin1	latin1_swedish_ci
+SHOW CREATE VIEW mysqltest1.v_t2;
+View	Create View	character_set_client	collation_connection
+v_t2	CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest1`.`v_t2` AS select `mysqltest1`.`t2`.`a` AS `a`,`mysqltest1`.`t2`.`b` AS `b` from `mysqltest1`.`t2`	latin1	latin1_swedish_ci
+SHOW CREATE VIEW mysqltest1.v_f1;
+View	Create View	character_set_client	collation_connection
+v_f1	CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest1`.`v_f1` AS select `f1`() AS `a`	latin1	latin1_swedish_ci
+SHOW CREATE VIEW mysqltest1.v_v1;
+View	Create View	character_set_client	collation_connection
+v_v1	CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest1`.`v_v1` AS select `v1`.`a` AS `a` from `mysqltest1`.`v1`	latin1	latin1_swedish_ci
+SHOW CREATE VIEW mysqltest1.v_v2;
+View	Create View	character_set_client	collation_connection
+v_v2	CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest1`.`v_v2` AS select `v2`.`a` AS `a`,`v2`.`b` AS `b` from `mysqltest1`.`v2`	latin1	latin1_swedish_ci
+SHOW CREATE VIEW v_mysqluser1_t1;
+View	Create View	character_set_client	collation_connection
+v_mysqluser1_t1	CREATE ALGORITHM=UNDEFINED DEFINER=`mysqluser1`@`localhost` SQL SECURITY DEFINER VIEW `v_mysqluser1_t1` AS select `mysqltest1`.`t1`.`a` AS `a` from `mysqltest1`.`t1`	latin1	latin1_swedish_ci
+SHOW CREATE VIEW v_mysqluser1_t2;
+View	Create View	character_set_client	collation_connection
+v_mysqluser1_t2	CREATE ALGORITHM=UNDEFINED DEFINER=`mysqluser1`@`localhost` SQL SECURITY DEFINER VIEW `v_mysqluser1_t2` AS select `mysqltest1`.`t2`.`a` AS `a`,`mysqltest1`.`t2`.`b` AS `b` from `mysqltest1`.`t2`	latin1	latin1_swedish_ci
+SHOW CREATE VIEW v_mysqluser1_f1;
+View	Create View	character_set_client	collation_connection
+v_mysqluser1_f1	CREATE ALGORITHM=UNDEFINED DEFINER=`mysqluser1`@`localhost` SQL SECURITY DEFINER VIEW `v_mysqluser1_f1` AS select `mysqltest1`.`f1`() AS `a`	latin1	latin1_swedish_ci
+SHOW CREATE VIEW v_mysqluser1_v1;
+View	Create View	character_set_client	collation_connection
+v_mysqluser1_v1	CREATE ALGORITHM=UNDEFINED DEFINER=`mysqluser1`@`localhost` SQL SECURITY DEFINER VIEW `v_mysqluser1_v1` AS select `v1`.`a` AS `a` from `mysqltest1`.`v1`	latin1	latin1_swedish_ci
+SHOW CREATE VIEW v_mysqluser1_v2;
+View	Create View	character_set_client	collation_connection
+v_mysqluser1_v2	CREATE ALGORITHM=UNDEFINED DEFINER=`mysqluser1`@`localhost` SQL SECURITY DEFINER VIEW `v_mysqluser1_v2` AS select `v2`.`a` AS `a`,`v2`.`b` AS `b` from `mysqltest1`.`v2`	latin1	latin1_swedish_ci
+# Testing the case when the views reference missing objects.
+# Obviously, there are no privileges to check for, so we
+# need only each object type once.
+DROP TABLE t1;
+DROP FUNCTION f1;
+DROP VIEW v1;
+SHOW CREATE VIEW mysqltest1.v_t1;
+View	Create View	character_set_client	collation_connection
+v_t1	CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest1`.`v_t1` AS select `mysqltest1`.`t1`.`a` AS `a` from `mysqltest1`.`t1`	latin1	latin1_swedish_ci
+Warnings:
+Warning	1356	View 'mysqltest1.v_t1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+SHOW CREATE VIEW mysqltest1.v_f1;
+View	Create View	character_set_client	collation_connection
+v_f1	CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest1`.`v_f1` AS select `f1`() AS `a`	latin1	latin1_swedish_ci
+Warnings:
+Warning	1356	View 'mysqltest1.v_f1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+SHOW CREATE VIEW mysqltest1.v_v1;
+View	Create View	character_set_client	collation_connection
+v_v1	CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest1`.`v_v1` AS select `v1`.`a` AS `a` from `mysqltest1`.`v1`	latin1	latin1_swedish_ci
+Warnings:
+Warning	1356	View 'mysqltest1.v_v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+SHOW CREATE VIEW v_mysqluser1_t1;
+View	Create View	character_set_client	collation_connection
+v_mysqluser1_t1	CREATE ALGORITHM=UNDEFINED DEFINER=`mysqluser1`@`localhost` SQL SECURITY DEFINER VIEW `v_mysqluser1_t1` AS select `mysqltest1`.`t1`.`a` AS `a` from `mysqltest1`.`t1`	latin1	latin1_swedish_ci
+Warnings:
+Warning	1356	View 'mysqltest2.v_mysqluser1_t1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+SHOW CREATE VIEW v_mysqluser1_f1;
+View	Create View	character_set_client	collation_connection
+v_mysqluser1_f1	CREATE ALGORITHM=UNDEFINED DEFINER=`mysqluser1`@`localhost` SQL SECURITY DEFINER VIEW `v_mysqluser1_f1` AS select `mysqltest1`.`f1`() AS `a`	latin1	latin1_swedish_ci
+Warnings:
+Warning	1356	View 'mysqltest2.v_mysqluser1_f1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+SHOW CREATE VIEW v_mysqluser1_v1;
+View	Create View	character_set_client	collation_connection
+v_mysqluser1_v1	CREATE ALGORITHM=UNDEFINED DEFINER=`mysqluser1`@`localhost` SQL SECURITY DEFINER VIEW `v_mysqluser1_v1` AS select `v1`.`a` AS `a` from `mysqltest1`.`v1`	latin1	latin1_swedish_ci
+Warnings:
+Warning	1356	View 'mysqltest2.v_mysqluser1_v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+REVOKE SHOW VIEW ON v_t1 FROM mysqluser1@localhost;
+REVOKE SHOW VIEW ON v_f1 FROM mysqluser1@localhost;
+REVOKE SHOW VIEW ON v_v1 FROM mysqluser1@localhost;
+SHOW CREATE VIEW mysqltest1.v_t1;
+ERROR 42000: SHOW VIEW command denied to user 'mysqluser1'@'localhost' for table 'v_t1'
+SHOW CREATE VIEW mysqltest1.v_f1;
+ERROR 42000: SHOW VIEW command denied to user 'mysqluser1'@'localhost' for table 'v_f1'
+SHOW CREATE VIEW mysqltest1.v_v1;
+ERROR 42000: SHOW VIEW command denied to user 'mysqluser1'@'localhost' for table 'v_v1'
+SHOW CREATE VIEW v_mysqluser1_t1;
+View	Create View	character_set_client	collation_connection
+v_mysqluser1_t1	CREATE ALGORITHM=UNDEFINED DEFINER=`mysqluser1`@`localhost` SQL SECURITY DEFINER VIEW `v_mysqluser1_t1` AS select `mysqltest1`.`t1`.`a` AS `a` from `mysqltest1`.`t1`	latin1	latin1_swedish_ci
+Warnings:
+Warning	1356	View 'mysqltest2.v_mysqluser1_t1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+SHOW CREATE VIEW v_mysqluser1_f1;
+View	Create View	character_set_client	collation_connection
+v_mysqluser1_f1	CREATE ALGORITHM=UNDEFINED DEFINER=`mysqluser1`@`localhost` SQL SECURITY DEFINER VIEW `v_mysqluser1_f1` AS select `mysqltest1`.`f1`() AS `a`	latin1	latin1_swedish_ci
+Warnings:
+Warning	1356	View 'mysqltest2.v_mysqluser1_f1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+SHOW CREATE VIEW v_mysqluser1_v1;
+View	Create View	character_set_client	collation_connection
+v_mysqluser1_v1	CREATE ALGORITHM=UNDEFINED DEFINER=`mysqluser1`@`localhost` SQL SECURITY DEFINER VIEW `v_mysqluser1_v1` AS select `v1`.`a` AS `a` from `mysqltest1`.`v1`	latin1	latin1_swedish_ci
+Warnings:
+Warning	1356	View 'mysqltest2.v_mysqluser1_v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+DROP USER mysqluser1@localhost;
+DROP DATABASE mysqltest1;
+DROP DATABASE mysqltest2;
+USE test;
+CREATE TABLE t1( a INT );
+CREATE DEFINER = no_such_user@no_such_host VIEW v1 AS SELECT * FROM t1;
+Warnings:
+Note	1449	The user specified as a definer ('no_such_user'@'no_such_host') does not exist
+SHOW CREATE VIEW v1;
+View	Create View	character_set_client	collation_connection
+v1	CREATE ALGORITHM=UNDEFINED DEFINER=`no_such_user`@`no_such_host` SQL SECURITY DEFINER VIEW `v1` AS select `test`.`t1`.`a` AS `a` from `t1`	latin1	latin1_swedish_ci
+Warnings:
+Note	1449	The user specified as a definer ('no_such_user'@'no_such_host') does not exist
+DROP TABLE t1;
+DROP VIEW v1;

=== modified file 'mysql-test/suite/backup/t/backup_no_data.test'
--- a/mysql-test/suite/backup/t/backup_no_data.test	2009-08-18 16:51:05 +0000
+++ b/mysql-test/suite/backup/t/backup_no_data.test	2009-09-23 19:32:57 +0000
@@ -22,10 +22,11 @@ BACKUP DATABASE empty_db TO 'empty_db.ba
 --error 0,1
 --remove_file $MYSQLD_BACKUPDIR/all.bak
 
-# The BACKUP DATABASE * TO 'all.bak' is disabled because of BUG#46765
+# The BACKUP DATABASE * TO 'all.bak' is disabled because of BUG#43836
 # BUG#46765: Restore throws warnings when performing backup of test database.
 # Once this bug is fixed, please enable the "BACKUP DATABASE *..."
 
+# -- [DISABLED Bug#43836]
 --replace_column 1 #
 #BACKUP DATABASE * TO 'all.bak';
 BACKUP DATABASE empty_db, other_db TO 'all.bak';

=== removed directory 'mysql-test/suite/innodb'
=== removed directory 'mysql-test/suite/innodb/include'
=== removed file 'mysql-test/suite/innodb/include/have_innodb_plugin.inc'
--- a/mysql-test/suite/innodb/include/have_innodb_plugin.inc	2009-09-23 11:10:33 +0000
+++ b/mysql-test/suite/innodb/include/have_innodb_plugin.inc	1970-01-01 00:00:00 +0000
@@ -1 +0,0 @@
-skip no innodb plugin for mysql-6.0-codebase;

=== removed file 'mysql-test/suite/innodb/include/innodb-index.inc'
--- a/mysql-test/suite/innodb/include/innodb-index.inc	2009-06-10 13:51:20 +0000
+++ b/mysql-test/suite/innodb/include/innodb-index.inc	1970-01-01 00:00:00 +0000
@@ -1,26 +0,0 @@
---eval create table t1(a int not null, b int, c char(10), d varchar(20), primary key (a)) engine = innodb default charset=$charset
-insert into t1 values (1,1,'ab','ab'),(2,2,'ac','ac'),(3,2,'ad','ad'),(4,4,'afe','afe');
-commit;
---error ER_DUP_ENTRY
-alter table t1 add unique index (b);
-insert into t1 values(8,9,'fff','fff');
-select * from t1;
-show create table t1;
-alter table t1 add index (b);
-insert into t1 values(10,10,'kkk','iii');
-select * from t1;
-select * from t1 force index(b) order by b;
-explain select * from t1 force index(b) order by b;
-show create table t1;
-alter table t1 add unique index (c), add index (d);
-insert into t1 values(11,11,'aaa','mmm');
-select * from t1;
-select * from t1 force index(b) order by b;
-select * from t1 force index(c) order by c;
-select * from t1 force index(d) order by d;
-explain select * from t1 force index(b) order by b;
-explain select * from t1 force index(c) order by c;
-explain select * from t1 force index(d) order by d;
-show create table t1;
-check table t1;
-drop table t1;

=== removed directory 'mysql-test/suite/innodb/r'
=== removed file 'mysql-test/suite/innodb/r/innodb-analyze.result'
--- a/mysql-test/suite/innodb/r/innodb-analyze.result	2009-06-10 13:51:20 +0000
+++ b/mysql-test/suite/innodb/r/innodb-analyze.result	1970-01-01 00:00:00 +0000
@@ -1,2 +0,0 @@
-Variable_name	Value
-innodb_stats_sample_pages	1

=== removed file 'mysql-test/suite/innodb/r/innodb-index.result'
--- a/mysql-test/suite/innodb/r/innodb-index.result	2009-06-10 13:51:20 +0000
+++ b/mysql-test/suite/innodb/r/innodb-index.result	1970-01-01 00:00:00 +0000
@@ -1,1170 +0,0 @@
-create table t1(a int not null, b int, c char(10) not null, d varchar(20)) engine = innodb;
-insert into t1 values (5,5,'oo','oo'),(4,4,'tr','tr'),(3,4,'ad','ad'),(2,3,'ak','ak');
-commit;
-alter table t1 add index b (b), add index b (b);
-ERROR 42000: Duplicate key name 'b'
-alter table t1 add index (b,b);
-ERROR 42S21: Duplicate column name 'b'
-alter table t1 add index d2 (d);
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  `c` char(10) NOT NULL,
-  `d` varchar(20) DEFAULT NULL,
-  KEY `d2` (`d`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-explain select * from t1 force index(d2) order by d;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	d2	23	NULL	4	
-select * from t1 force index (d2) order by d;
-a	b	c	d
-3	4	ad	ad
-2	3	ak	ak
-5	5	oo	oo
-4	4	tr	tr
-alter table t1 add unique index (b);
-ERROR 23000: Duplicate entry '4' for key 'b'
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  `c` char(10) NOT NULL,
-  `d` varchar(20) DEFAULT NULL,
-  KEY `d2` (`d`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-alter table t1 add index (b);
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  `c` char(10) NOT NULL,
-  `d` varchar(20) DEFAULT NULL,
-  KEY `d2` (`d`),
-  KEY `b` (`b`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-CREATE TABLE `t1#1`(a INT PRIMARY KEY) ENGINE=InnoDB;
-alter table t1 add unique index (c), add index (d);
-ERROR HY000: Table 'test.t1#1' already exists
-rename table `t1#1` to `t1#2`;
-alter table t1 add unique index (c), add index (d);
-ERROR HY000: Table 'test.t1#2' already exists
-drop table `t1#2`;
-alter table t1 add unique index (c), add index (d);
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  `c` char(10) NOT NULL,
-  `d` varchar(20) DEFAULT NULL,
-  UNIQUE KEY `c` (`c`),
-  KEY `d2` (`d`),
-  KEY `b` (`b`),
-  KEY `d` (`d`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-explain select * from t1 force index(c) order by c;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	c	10	NULL	4	
-alter table t1 add primary key (a), drop index c;
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  `c` char(10) NOT NULL,
-  `d` varchar(20) DEFAULT NULL,
-  PRIMARY KEY (`a`),
-  KEY `d2` (`d`),
-  KEY `b` (`b`),
-  KEY `d` (`d`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-alter table t1 add primary key (c);
-ERROR 42000: Multiple primary key defined
-alter table t1 drop primary key, add primary key (b);
-ERROR 23000: Duplicate entry '4' for key 'PRIMARY'
-create unique index c on t1 (c);
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  `c` char(10) NOT NULL,
-  `d` varchar(20) DEFAULT NULL,
-  PRIMARY KEY (`a`),
-  UNIQUE KEY `c` (`c`),
-  KEY `d2` (`d`),
-  KEY `b` (`b`),
-  KEY `d` (`d`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-explain select * from t1 force index(c) order by c;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	c	10	NULL	4	
-select * from t1 force index(c) order by c;
-a	b	c	d
-3	4	ad	ad
-2	3	ak	ak
-5	5	oo	oo
-4	4	tr	tr
-alter table t1 drop index b, add index (b);
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  `c` char(10) NOT NULL,
-  `d` varchar(20) DEFAULT NULL,
-  PRIMARY KEY (`a`),
-  UNIQUE KEY `c` (`c`),
-  KEY `d2` (`d`),
-  KEY `d` (`d`),
-  KEY `b` (`b`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-insert into t1 values(6,1,'ggg','ggg');
-select * from t1;
-a	b	c	d
-2	3	ak	ak
-3	4	ad	ad
-4	4	tr	tr
-5	5	oo	oo
-6	1	ggg	ggg
-select * from t1 force index(b) order by b;
-a	b	c	d
-6	1	ggg	ggg
-2	3	ak	ak
-3	4	ad	ad
-4	4	tr	tr
-5	5	oo	oo
-select * from t1 force index(c) order by c;
-a	b	c	d
-3	4	ad	ad
-2	3	ak	ak
-6	1	ggg	ggg
-5	5	oo	oo
-4	4	tr	tr
-select * from t1 force index(d) order by d;
-a	b	c	d
-3	4	ad	ad
-2	3	ak	ak
-6	1	ggg	ggg
-5	5	oo	oo
-4	4	tr	tr
-explain select * from t1 force index(b) order by b;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	b	5	NULL	5	
-explain select * from t1 force index(c) order by c;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	c	10	NULL	5	
-explain select * from t1 force index(d) order by d;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	d	23	NULL	5	
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  `c` char(10) NOT NULL,
-  `d` varchar(20) DEFAULT NULL,
-  PRIMARY KEY (`a`),
-  UNIQUE KEY `c` (`c`),
-  KEY `d2` (`d`),
-  KEY `d` (`d`),
-  KEY `b` (`b`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t1;
-create table t1(a int not null, b int, c char(10), d varchar(20), primary key (a)) engine = innodb;
-insert into t1 values (1,1,'ab','ab'),(2,2,'ac','ac'),(3,3,'ad','ad'),(4,4,'afe','afe');
-commit;
-alter table t1 add index (c(2));
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  `c` char(10) DEFAULT NULL,
-  `d` varchar(20) DEFAULT NULL,
-  PRIMARY KEY (`a`),
-  KEY `c` (`c`(2))
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-alter table t1 add unique index (d(10));
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  `c` char(10) DEFAULT NULL,
-  `d` varchar(20) DEFAULT NULL,
-  PRIMARY KEY (`a`),
-  UNIQUE KEY `d` (`d`(10)),
-  KEY `c` (`c`(2))
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-insert into t1 values(5,1,'ggg','ggg');
-select * from t1;
-a	b	c	d
-1	1	ab	ab
-2	2	ac	ac
-3	3	ad	ad
-4	4	afe	afe
-5	1	ggg	ggg
-select * from t1 force index(c) order by c;
-a	b	c	d
-1	1	ab	ab
-2	2	ac	ac
-3	3	ad	ad
-4	4	afe	afe
-5	1	ggg	ggg
-select * from t1 force index(d) order by d;
-a	b	c	d
-1	1	ab	ab
-2	2	ac	ac
-3	3	ad	ad
-4	4	afe	afe
-5	1	ggg	ggg
-explain select * from t1 order by b;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	5	Using filesort
-explain select * from t1 force index(c) order by c;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	5	Using filesort
-explain select * from t1 force index(d) order by d;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	5	Using filesort
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  `c` char(10) DEFAULT NULL,
-  `d` varchar(20) DEFAULT NULL,
-  PRIMARY KEY (`a`),
-  UNIQUE KEY `d` (`d`(10)),
-  KEY `c` (`c`(2))
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-alter table t1 drop index d;
-insert into t1 values(8,9,'fff','fff');
-select * from t1;
-a	b	c	d
-1	1	ab	ab
-2	2	ac	ac
-3	3	ad	ad
-4	4	afe	afe
-5	1	ggg	ggg
-8	9	fff	fff
-select * from t1 force index(c) order by c;
-a	b	c	d
-1	1	ab	ab
-2	2	ac	ac
-3	3	ad	ad
-4	4	afe	afe
-8	9	fff	fff
-5	1	ggg	ggg
-explain select * from t1 order by b;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	6	Using filesort
-explain select * from t1 force index(c) order by c;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	6	Using filesort
-explain select * from t1 order by d;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	6	Using filesort
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  `c` char(10) DEFAULT NULL,
-  `d` varchar(20) DEFAULT NULL,
-  PRIMARY KEY (`a`),
-  KEY `c` (`c`(2))
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t1;
-create table t1(a int not null, b int, c char(10), d varchar(20), primary key (a)) engine = innodb;
-insert into t1 values (1,1,'ab','ab'),(2,2,'ac','ac'),(3,2,'ad','ad'),(4,4,'afe','afe');
-commit;
-alter table t1 add unique index (b,c);
-insert into t1 values(8,9,'fff','fff');
-select * from t1;
-a	b	c	d
-1	1	ab	ab
-2	2	ac	ac
-3	2	ad	ad
-4	4	afe	afe
-8	9	fff	fff
-select * from t1 force index(b) order by b;
-a	b	c	d
-1	1	ab	ab
-2	2	ac	ac
-3	2	ad	ad
-4	4	afe	afe
-8	9	fff	fff
-explain select * from t1 force index(b) order by b;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	b	16	NULL	5	
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  `c` char(10) DEFAULT NULL,
-  `d` varchar(20) DEFAULT NULL,
-  PRIMARY KEY (`a`),
-  UNIQUE KEY `b` (`b`,`c`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-alter table t1 add index (b,c);
-insert into t1 values(11,11,'kkk','kkk');
-select * from t1;
-a	b	c	d
-1	1	ab	ab
-2	2	ac	ac
-3	2	ad	ad
-4	4	afe	afe
-8	9	fff	fff
-11	11	kkk	kkk
-select * from t1 force index(b) order by b;
-a	b	c	d
-1	1	ab	ab
-2	2	ac	ac
-3	2	ad	ad
-4	4	afe	afe
-8	9	fff	fff
-11	11	kkk	kkk
-explain select * from t1 force index(b) order by b;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	b	16	NULL	6	
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  `c` char(10) DEFAULT NULL,
-  `d` varchar(20) DEFAULT NULL,
-  PRIMARY KEY (`a`),
-  UNIQUE KEY `b` (`b`,`c`),
-  KEY `b_2` (`b`,`c`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-alter table t1 add unique index (c,d);
-insert into t1 values(13,13,'yyy','aaa');
-select * from t1;
-a	b	c	d
-1	1	ab	ab
-2	2	ac	ac
-3	2	ad	ad
-4	4	afe	afe
-8	9	fff	fff
-11	11	kkk	kkk
-13	13	yyy	aaa
-select * from t1 force index(b) order by b;
-a	b	c	d
-1	1	ab	ab
-2	2	ac	ac
-3	2	ad	ad
-4	4	afe	afe
-8	9	fff	fff
-11	11	kkk	kkk
-13	13	yyy	aaa
-select * from t1 force index(c) order by c;
-a	b	c	d
-1	1	ab	ab
-2	2	ac	ac
-3	2	ad	ad
-4	4	afe	afe
-8	9	fff	fff
-11	11	kkk	kkk
-13	13	yyy	aaa
-explain select * from t1 force index(b) order by b;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	b	16	NULL	7	
-explain select * from t1 force index(c) order by c;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	c	34	NULL	7	
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  `c` char(10) DEFAULT NULL,
-  `d` varchar(20) DEFAULT NULL,
-  PRIMARY KEY (`a`),
-  UNIQUE KEY `b` (`b`,`c`),
-  UNIQUE KEY `c` (`c`,`d`),
-  KEY `b_2` (`b`,`c`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t1;
-create table t1(a int not null, b int not null, c int, primary key (a), key (b)) engine = innodb;
-create table t3(a int not null, c int not null, d int, primary key (a), key (c)) engine = innodb;
-create table t4(a int not null, d int not null, e int, primary key (a), key (d)) engine = innodb;
-create table t2(a int not null, b int not null, c int not null, d int not null, e int,
-foreign key (b) references t1(b) on delete cascade,
-foreign key (c) references t3(c), foreign key (d) references t4(d))
-engine = innodb;
-alter table t1 drop index b;
-ERROR HY000: Cannot drop index 'b': needed in a foreign key constraint
-alter table t3 drop index c;
-ERROR HY000: Cannot drop index 'c': needed in a foreign key constraint
-alter table t4 drop index d;
-ERROR HY000: Cannot drop index 'd': needed in a foreign key constraint
-alter table t2 drop index b;
-ERROR HY000: Cannot drop index 'b': needed in a foreign key constraint
-alter table t2 drop index b, drop index c, drop index d;
-ERROR HY000: Cannot drop index 'b': needed in a foreign key constraint
-create unique index dc on t2 (d,c);
-create index dc on t1 (b,c);
-alter table t2 add primary key (a);
-insert into t1 values (1,1,1);
-insert into t3 values (1,1,1);
-insert into t4 values (1,1,1);
-insert into t2 values (1,1,1,1,1);
-commit;
-alter table t4 add constraint dc foreign key (a) references t1(a);
-show create table t4;
-Table	Create Table
-t4	CREATE TABLE `t4` (
-  `a` int(11) NOT NULL,
-  `d` int(11) NOT NULL,
-  `e` int(11) DEFAULT NULL,
-  PRIMARY KEY (`a`),
-  KEY `d` (`d`),
-  CONSTRAINT `dc` FOREIGN KEY (`a`) REFERENCES `t1` (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-alter table t3 add constraint dc foreign key (a) references t1(a);
-ERROR HY000: Can't create table '#sql-temporary' (errno: 121)
-show create table t3;
-Table	Create Table
-t3	CREATE TABLE `t3` (
-  `a` int(11) NOT NULL,
-  `c` int(11) NOT NULL,
-  `d` int(11) DEFAULT NULL,
-  PRIMARY KEY (`a`),
-  KEY `c` (`c`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-alter table t2 drop index b, add index (b);
-show create table t2;
-Table	Create Table
-t2	CREATE TABLE `t2` (
-  `a` int(11) NOT NULL,
-  `b` int(11) NOT NULL,
-  `c` int(11) NOT NULL,
-  `d` int(11) NOT NULL,
-  `e` int(11) DEFAULT NULL,
-  PRIMARY KEY (`a`),
-  UNIQUE KEY `dc` (`d`,`c`),
-  KEY `c` (`c`),
-  KEY `b` (`b`),
-  CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`b`) REFERENCES `t1` (`b`) ON DELETE CASCADE,
-  CONSTRAINT `t2_ibfk_2` FOREIGN KEY (`c`) REFERENCES `t3` (`c`),
-  CONSTRAINT `t2_ibfk_3` FOREIGN KEY (`d`) REFERENCES `t4` (`d`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-delete from t1;
-ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t4`, CONSTRAINT `dc` FOREIGN KEY (`a`) REFERENCES `t1` (`a`))
-drop index dc on t4;
-ERROR 42000: Can't DROP 'dc'; check that column/key exists
-alter table t3 drop foreign key dc;
-ERROR HY000: Error on rename of './test/t3' to '#sql2-temporary' (errno: 152)
-alter table t4 drop foreign key dc;
-select * from t2;
-a	b	c	d	e
-1	1	1	1	1
-delete from t1;
-select * from t2;
-a	b	c	d	e
-drop table t2,t4,t3,t1;
-create table t1(a int not null, b int, c char(10), d varchar(20), primary key (a)) engine = innodb default charset=utf8;
-insert into t1 values (1,1,'ab','ab'),(2,2,'ac','ac'),(3,2,'ad','ad'),(4,4,'afe','afe');
-commit;
-alter table t1 add unique index (b);
-ERROR 23000: Duplicate entry '2' for key 'b'
-insert into t1 values(8,9,'fff','fff');
-select * from t1;
-a	b	c	d
-1	1	ab	ab
-2	2	ac	ac
-3	2	ad	ad
-4	4	afe	afe
-8	9	fff	fff
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  `c` char(10) DEFAULT NULL,
-  `d` varchar(20) DEFAULT NULL,
-  PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8
-alter table t1 add index (b);
-insert into t1 values(10,10,'kkk','iii');
-select * from t1;
-a	b	c	d
-1	1	ab	ab
-2	2	ac	ac
-3	2	ad	ad
-4	4	afe	afe
-8	9	fff	fff
-10	10	kkk	iii
-select * from t1 force index(b) order by b;
-a	b	c	d
-1	1	ab	ab
-2	2	ac	ac
-3	2	ad	ad
-4	4	afe	afe
-8	9	fff	fff
-10	10	kkk	iii
-explain select * from t1 force index(b) order by b;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	b	5	NULL	6	
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  `c` char(10) DEFAULT NULL,
-  `d` varchar(20) DEFAULT NULL,
-  PRIMARY KEY (`a`),
-  KEY `b` (`b`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8
-alter table t1 add unique index (c), add index (d);
-insert into t1 values(11,11,'aaa','mmm');
-select * from t1;
-a	b	c	d
-1	1	ab	ab
-2	2	ac	ac
-3	2	ad	ad
-4	4	afe	afe
-8	9	fff	fff
-10	10	kkk	iii
-11	11	aaa	mmm
-select * from t1 force index(b) order by b;
-a	b	c	d
-1	1	ab	ab
-2	2	ac	ac
-3	2	ad	ad
-4	4	afe	afe
-8	9	fff	fff
-10	10	kkk	iii
-11	11	aaa	mmm
-select * from t1 force index(c) order by c;
-a	b	c	d
-11	11	aaa	mmm
-1	1	ab	ab
-2	2	ac	ac
-3	2	ad	ad
-4	4	afe	afe
-8	9	fff	fff
-10	10	kkk	iii
-select * from t1 force index(d) order by d;
-a	b	c	d
-1	1	ab	ab
-2	2	ac	ac
-3	2	ad	ad
-4	4	afe	afe
-8	9	fff	fff
-10	10	kkk	iii
-11	11	aaa	mmm
-explain select * from t1 force index(b) order by b;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	b	5	NULL	7	
-explain select * from t1 force index(c) order by c;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	c	31	NULL	7	
-explain select * from t1 force index(d) order by d;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	d	63	NULL	7	
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  `c` char(10) DEFAULT NULL,
-  `d` varchar(20) DEFAULT NULL,
-  PRIMARY KEY (`a`),
-  UNIQUE KEY `c` (`c`),
-  KEY `b` (`b`),
-  KEY `d` (`d`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8
-check table t1;
-Table	Op	Msg_type	Msg_text
-test.t1	check	status	OK
-drop table t1;
-create table t1(a int not null, b int) engine = innodb;
-insert into t1 values (1,1),(1,1),(1,1),(1,1);
-alter table t1 add unique index (a);
-ERROR 23000: Duplicate entry '1' for key 'a'
-alter table t1 add unique index (b);
-ERROR 23000: Duplicate entry '1' for key 'b'
-alter table t1 add unique index (a), add unique index(b);
-ERROR 23000: Duplicate entry '1' for key 'a'
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t1;
-create table t1(a int not null, c int not null,b int, primary key(a), unique key(c), key(b)) engine = innodb;
-alter table t1 drop index c, drop index b;
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `c` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t1;
-create table t1(a int not null, b int, primary key(a)) engine = innodb;
-alter table t1 add index (b);
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  PRIMARY KEY (`a`),
-  KEY `b` (`b`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t1;
-create table t1(a int not null, b int, c char(10), d varchar(20), primary key (a)) engine = innodb;
-insert into t1 values (1,1,'ab','ab'),(2,2,'ac','ac'),(3,3,'ac','ac'),(4,4,'afe','afe'),(5,4,'affe','affe');
-alter table t1 add unique index (b), add unique index (c), add unique index (d);
-ERROR 23000: Duplicate entry '4' for key 'b'
-alter table t1 add unique index (c), add unique index (b), add index (d);
-ERROR 23000: Duplicate entry 'ac' for key 'c'
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  `c` char(10) DEFAULT NULL,
-  `d` varchar(20) DEFAULT NULL,
-  PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t1;
-create table t1(a int not null, b int not null, c int, primary key (a), key(c)) engine=innodb;
-insert into t1 values (5,1,5),(4,2,4),(3,3,3),(2,4,2),(1,5,1);
-alter table t1 add unique index (b);
-insert into t1 values (10,20,20),(11,19,19),(12,18,18),(13,17,17);
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) NOT NULL,
-  `c` int(11) DEFAULT NULL,
-  PRIMARY KEY (`a`),
-  UNIQUE KEY `b` (`b`),
-  KEY `c` (`c`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-check table t1;
-Table	Op	Msg_type	Msg_text
-test.t1	check	status	OK
-explain select * from t1 force index(c) order by c;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	c	5	NULL	9	
-explain select * from t1 order by a;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	PRIMARY	4	NULL	9	
-explain select * from t1 force index(b) order by b;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	b	4	NULL	9	
-select * from t1 order by a;
-a	b	c
-1	5	1
-2	4	2
-3	3	3
-4	2	4
-5	1	5
-10	20	20
-11	19	19
-12	18	18
-13	17	17
-select * from t1 force index(b) order by b;
-a	b	c
-5	1	5
-4	2	4
-3	3	3
-2	4	2
-1	5	1
-13	17	17
-12	18	18
-11	19	19
-10	20	20
-select * from t1 force index(c) order by c;
-a	b	c
-1	5	1
-2	4	2
-3	3	3
-4	2	4
-5	1	5
-13	17	17
-12	18	18
-11	19	19
-10	20	20
-drop table t1;
-create table t1(a int not null, b int not null) engine=innodb;
-insert into t1 values (1,1);
-alter table t1 add primary key(b);
-insert into t1 values (2,2);
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) NOT NULL,
-  PRIMARY KEY (`b`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-check table t1;
-Table	Op	Msg_type	Msg_text
-test.t1	check	status	OK
-select * from t1;
-a	b
-1	1
-2	2
-explain select * from t1;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	2	
-explain select * from t1 order by a;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	2	Using filesort
-explain select * from t1 order by b;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	PRIMARY	4	NULL	2	
-checksum table t1;
-Table	Checksum
-test.t1	582702641
-drop table t1;
-create table t1(a int not null) engine=innodb;
-insert into t1 values (1);
-alter table t1 add primary key(a);
-insert into t1 values (2);
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-check table t1;
-Table	Op	Msg_type	Msg_text
-test.t1	check	status	OK
-commit;
-select * from t1;
-a
-1
-2
-explain select * from t1;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	PRIMARY	4	NULL	2	Using index
-explain select * from t1 order by a;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	PRIMARY	4	NULL	2	Using index
-drop table t1;
-create table t2(d varchar(17) primary key) engine=innodb default charset=utf8;
-create table t3(a int primary key) engine=innodb;
-insert into t3 values(22),(44),(33),(55),(66);
-insert into t2 values ('jejdkrun87'),('adfd72nh9k'),
-('adfdpplkeock'),('adfdijnmnb78k'),('adfdijn0loKNHJik');
-create table t1(a int, b blob, c text, d text not null)
-engine=innodb default charset = utf8;
-insert into t1
-select a,left(repeat(d,100*a),65535),repeat(d,20*a),d from t2,t3;
-drop table t2, t3;
-select count(*) from t1 where a=44;
-count(*)
-5
-select a,
-length(b),b=left(repeat(d,100*a),65535),length(c),c=repeat(d,20*a),d from t1;
-a	length(b)	b=left(repeat(d,100*a),65535)	length(c)	c=repeat(d,20*a)	d
-22	22000	1	4400	1	adfd72nh9k
-22	35200	1	7040	1	adfdijn0loKNHJik
-22	28600	1	5720	1	adfdijnmnb78k
-22	26400	1	5280	1	adfdpplkeock
-22	22000	1	4400	1	jejdkrun87
-33	33000	1	6600	1	adfd72nh9k
-33	52800	1	10560	1	adfdijn0loKNHJik
-33	42900	1	8580	1	adfdijnmnb78k
-33	39600	1	7920	1	adfdpplkeock
-33	33000	1	6600	1	jejdkrun87
-44	44000	1	8800	1	adfd72nh9k
-44	65535	1	14080	1	adfdijn0loKNHJik
-44	57200	1	11440	1	adfdijnmnb78k
-44	52800	1	10560	1	adfdpplkeock
-44	44000	1	8800	1	jejdkrun87
-55	55000	1	11000	1	adfd72nh9k
-55	65535	1	17600	1	adfdijn0loKNHJik
-55	65535	1	14300	1	adfdijnmnb78k
-55	65535	1	13200	1	adfdpplkeock
-55	55000	1	11000	1	jejdkrun87
-66	65535	1	13200	1	adfd72nh9k
-66	65535	1	21120	1	adfdijn0loKNHJik
-66	65535	1	17160	1	adfdijnmnb78k
-66	65535	1	15840	1	adfdpplkeock
-66	65535	1	13200	1	jejdkrun87
-alter table t1 add primary key (a), add key (b(20));
-ERROR 23000: Duplicate entry '22' for key 'PRIMARY'
-delete from t1 where a%2;
-check table t1;
-Table	Op	Msg_type	Msg_text
-test.t1	check	status	OK
-alter table t1 add primary key (a,b(255),c(255)), add key (b(767));
-select count(*) from t1 where a=44;
-count(*)
-5
-select a,
-length(b),b=left(repeat(d,100*a),65535),length(c),c=repeat(d,20*a),d from t1;
-a	length(b)	b=left(repeat(d,100*a),65535)	length(c)	c=repeat(d,20*a)	d
-22	22000	1	4400	1	adfd72nh9k
-22	35200	1	7040	1	adfdijn0loKNHJik
-22	28600	1	5720	1	adfdijnmnb78k
-22	26400	1	5280	1	adfdpplkeock
-22	22000	1	4400	1	jejdkrun87
-44	44000	1	8800	1	adfd72nh9k
-44	65535	1	14080	1	adfdijn0loKNHJik
-44	57200	1	11440	1	adfdijnmnb78k
-44	52800	1	10560	1	adfdpplkeock
-44	44000	1	8800	1	jejdkrun87
-66	65535	1	13200	1	adfd72nh9k
-66	65535	1	21120	1	adfdijn0loKNHJik
-66	65535	1	17160	1	adfdijnmnb78k
-66	65535	1	15840	1	adfdpplkeock
-66	65535	1	13200	1	jejdkrun87
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL DEFAULT '0',
-  `b` blob NOT NULL,
-  `c` text NOT NULL,
-  `d` text NOT NULL,
-  PRIMARY KEY (`a`,`b`(255),`c`(255)),
-  KEY `b` (`b`(767))
-) ENGINE=InnoDB DEFAULT CHARSET=utf8
-check table t1;
-Table	Op	Msg_type	Msg_text
-test.t1	check	status	OK
-explain select * from t1 where b like 'adfd%';
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	ALL	b	NULL	NULL	NULL	15	Using where
-create table t2(a int, b varchar(255), primary key(a,b)) engine=innodb;
-insert into t2 select a,left(b,255) from t1;
-drop table t1;
-rename table t2 to t1;
-set innodb_lock_wait_timeout=1;
-begin;
-select a from t1 limit 1 for update;
-a
-22
-set innodb_lock_wait_timeout=1;
-create index t1ba on t1 (b,a);
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-commit;
-begin;
-select a from t1 limit 1 lock in share mode;
-a
-22
-create index t1ba on t1 (b,a);
-drop index t1ba on t1;
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-commit;
-explain select a from t1 order by b;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	t1ba	261	NULL	15	Using index
-select a,sleep(2+a/100) from t1 order by b limit 3;
-select sleep(1);
-sleep(1)
-0
-drop index t1ba on t1;
-a	sleep(2+a/100)
-22	0
-44	0
-66	0
-explain select a from t1 order by b;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	PRIMARY	261	NULL	15	Using index; Using filesort
-select a from t1 order by b limit 3;
-a
-22
-66
-44
-commit;
-drop table t1;
-set global innodb_file_per_table=on;
-set global innodb_file_format='Barracuda';
-create table t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob,h blob,
-i blob,j blob,k blob,l blob,m blob,n blob,o blob,p blob,
-q blob,r blob,s blob,t blob,u blob)
-engine=innodb row_format=dynamic;
-create index t1a on t1 (a(1));
-create index t1b on t1 (b(1));
-create index t1c on t1 (c(1));
-create index t1d on t1 (d(1));
-create index t1e on t1 (e(1));
-create index t1f on t1 (f(1));
-create index t1g on t1 (g(1));
-create index t1h on t1 (h(1));
-create index t1i on t1 (i(1));
-create index t1j on t1 (j(1));
-create index t1k on t1 (k(1));
-create index t1l on t1 (l(1));
-create index t1m on t1 (m(1));
-create index t1n on t1 (n(1));
-create index t1o on t1 (o(1));
-create index t1p on t1 (p(1));
-create index t1q on t1 (q(1));
-create index t1r on t1 (r(1));
-create index t1s on t1 (s(1));
-create index t1t on t1 (t(1));
-create index t1u on t1 (u(1));
-ERROR HY000: Too big row
-create index t1ut on t1 (u(1), t(1));
-ERROR HY000: Too big row
-create index t1st on t1 (s(1), t(1));
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` blob,
-  `b` blob,
-  `c` blob,
-  `d` blob,
-  `e` blob,
-  `f` blob,
-  `g` blob,
-  `h` blob,
-  `i` blob,
-  `j` blob,
-  `k` blob,
-  `l` blob,
-  `m` blob,
-  `n` blob,
-  `o` blob,
-  `p` blob,
-  `q` blob,
-  `r` blob,
-  `s` blob,
-  `t` blob,
-  `u` blob,
-  KEY `t1a` (`a`(1)),
-  KEY `t1b` (`b`(1)),
-  KEY `t1c` (`c`(1)),
-  KEY `t1d` (`d`(1)),
-  KEY `t1e` (`e`(1)),
-  KEY `t1f` (`f`(1)),
-  KEY `t1g` (`g`(1)),
-  KEY `t1h` (`h`(1)),
-  KEY `t1i` (`i`(1)),
-  KEY `t1j` (`j`(1)),
-  KEY `t1k` (`k`(1)),
-  KEY `t1l` (`l`(1)),
-  KEY `t1m` (`m`(1)),
-  KEY `t1n` (`n`(1)),
-  KEY `t1o` (`o`(1)),
-  KEY `t1p` (`p`(1)),
-  KEY `t1q` (`q`(1)),
-  KEY `t1r` (`r`(1)),
-  KEY `t1s` (`s`(1)),
-  KEY `t1t` (`t`(1)),
-  KEY `t1st` (`s`(1),`t`(1))
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
-create index t1u on t1 (u(1));
-ERROR HY000: Too big row
-alter table t1 row_format=compact;
-create index t1u on t1 (u(1));
-drop table t1;
-set global innodb_file_per_table=0;
-set global innodb_file_format=Antelope;
-SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
-SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
-CREATE TABLE t1(
-c1	BIGINT(12) NOT NULL,
-PRIMARY KEY (c1)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-CREATE TABLE t2(
-c1	BIGINT(16) NOT NULL,
-c2	BIGINT(12) NOT NULL,
-c3	BIGINT(12) NOT NULL,
-PRIMARY KEY (c1)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
-FOREIGN KEY (c3) REFERENCES t1(c1);
-SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
-SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
-SHOW CREATE TABLE t2;
-Table	Create Table
-t2	CREATE TABLE `t2` (
-  `c1` bigint(16) NOT NULL,
-  `c2` bigint(12) NOT NULL,
-  `c3` bigint(12) NOT NULL,
-  PRIMARY KEY (`c1`),
-  KEY `fk_t2_ca` (`c3`),
-  CONSTRAINT `fk_t2_ca` FOREIGN KEY (`c3`) REFERENCES `t1` (`c1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-CREATE INDEX i_t2_c3_c2 ON t2(c3, c2);
-SHOW CREATE TABLE t2;
-Table	Create Table
-t2	CREATE TABLE `t2` (
-  `c1` bigint(16) NOT NULL,
-  `c2` bigint(12) NOT NULL,
-  `c3` bigint(12) NOT NULL,
-  PRIMARY KEY (`c1`),
-  KEY `i_t2_c3_c2` (`c3`,`c2`),
-  CONSTRAINT `fk_t2_ca` FOREIGN KEY (`c3`) REFERENCES `t1` (`c1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
-SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
-INSERT INTO t2 VALUES(0,0,0);
-ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `fk_t2_ca` FOREIGN KEY (`c3`) REFERENCES `t1` (`c1`))
-INSERT INTO t1 VALUES(0);
-INSERT INTO t2 VALUES(0,0,0);
-DROP TABLE t2;
-CREATE TABLE t2(
-c1	BIGINT(16) NOT NULL,
-c2	BIGINT(12) NOT NULL,
-c3	BIGINT(12) NOT NULL,
-PRIMARY KEY (c1,c2,c3)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
-FOREIGN KEY (c3) REFERENCES t1(c1);
-SHOW CREATE TABLE t2;
-Table	Create Table
-t2	CREATE TABLE `t2` (
-  `c1` bigint(16) NOT NULL,
-  `c2` bigint(12) NOT NULL,
-  `c3` bigint(12) NOT NULL,
-  PRIMARY KEY (`c1`,`c2`,`c3`),
-  KEY `fk_t2_ca` (`c3`),
-  CONSTRAINT `fk_t2_ca` FOREIGN KEY (`c3`) REFERENCES `t1` (`c1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-CREATE INDEX i_t2_c3_c2 ON t2(c3, c2);
-SHOW CREATE TABLE t2;
-Table	Create Table
-t2	CREATE TABLE `t2` (
-  `c1` bigint(16) NOT NULL,
-  `c2` bigint(12) NOT NULL,
-  `c3` bigint(12) NOT NULL,
-  PRIMARY KEY (`c1`,`c2`,`c3`),
-  KEY `i_t2_c3_c2` (`c3`,`c2`),
-  CONSTRAINT `fk_t2_ca` FOREIGN KEY (`c3`) REFERENCES `t1` (`c1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-INSERT INTO t2 VALUES(0,0,1);
-ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `fk_t2_ca` FOREIGN KEY (`c3`) REFERENCES `t1` (`c1`))
-INSERT INTO t2 VALUES(0,0,0);
-DELETE FROM t1;
-ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `fk_t2_ca` FOREIGN KEY (`c3`) REFERENCES `t1` (`c1`))
-DELETE FROM t2;
-DROP TABLE t2;
-DROP TABLE t1;
-CREATE TABLE t1(
-c1	BIGINT(12) NOT NULL,
-c2	INT(4) NOT NULL,
-PRIMARY KEY (c2,c1)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-CREATE TABLE t2(
-c1	BIGINT(16) NOT NULL,
-c2	BIGINT(12) NOT NULL,
-c3	BIGINT(12) NOT NULL,
-PRIMARY KEY (c1)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
-FOREIGN KEY (c3,c2) REFERENCES t1(c1,c1);
-ERROR HY000: Can't create table '#sql-temporary' (errno: 150)
-ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
-FOREIGN KEY (c3,c2) REFERENCES t1(c1,c2);
-ERROR HY000: Can't create table '#sql-temporary' (errno: 150)
-ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
-FOREIGN KEY (c3,c2) REFERENCES t1(c2,c1);
-ERROR HY000: Can't create table '#sql-temporary' (errno: 150)
-ALTER TABLE t1 MODIFY COLUMN c2 BIGINT(12) NOT NULL;
-ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
-FOREIGN KEY (c3,c2) REFERENCES t1(c1,c2);
-ERROR HY000: Can't create table '#sql-temporary' (errno: 150)
-ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
-FOREIGN KEY (c3,c2) REFERENCES t1(c2,c1);
-SHOW CREATE TABLE t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `c1` bigint(12) NOT NULL,
-  `c2` bigint(12) NOT NULL,
-  PRIMARY KEY (`c2`,`c1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-SHOW CREATE TABLE t2;
-Table	Create Table
-t2	CREATE TABLE `t2` (
-  `c1` bigint(16) NOT NULL,
-  `c2` bigint(12) NOT NULL,
-  `c3` bigint(12) NOT NULL,
-  PRIMARY KEY (`c1`),
-  KEY `fk_t2_ca` (`c3`,`c2`),
-  CONSTRAINT `fk_t2_ca` FOREIGN KEY (`c3`, `c2`) REFERENCES `t1` (`c2`, `c1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-CREATE INDEX i_t2_c2_c1 ON t2(c2, c1);
-SHOW CREATE TABLE t2;
-Table	Create Table
-t2	CREATE TABLE `t2` (
-  `c1` bigint(16) NOT NULL,
-  `c2` bigint(12) NOT NULL,
-  `c3` bigint(12) NOT NULL,
-  PRIMARY KEY (`c1`),
-  KEY `fk_t2_ca` (`c3`,`c2`),
-  KEY `i_t2_c2_c1` (`c2`,`c1`),
-  CONSTRAINT `fk_t2_ca` FOREIGN KEY (`c3`, `c2`) REFERENCES `t1` (`c2`, `c1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-CREATE INDEX i_t2_c3_c1_c2 ON t2(c3, c1, c2);
-SHOW CREATE TABLE t2;
-Table	Create Table
-t2	CREATE TABLE `t2` (
-  `c1` bigint(16) NOT NULL,
-  `c2` bigint(12) NOT NULL,
-  `c3` bigint(12) NOT NULL,
-  PRIMARY KEY (`c1`),
-  KEY `fk_t2_ca` (`c3`,`c2`),
-  KEY `i_t2_c2_c1` (`c2`,`c1`),
-  KEY `i_t2_c3_c1_c2` (`c3`,`c1`,`c2`),
-  CONSTRAINT `fk_t2_ca` FOREIGN KEY (`c3`, `c2`) REFERENCES `t1` (`c2`, `c1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-CREATE INDEX i_t2_c3_c2 ON t2(c3, c2);
-SHOW CREATE TABLE t2;
-Table	Create Table
-t2	CREATE TABLE `t2` (
-  `c1` bigint(16) NOT NULL,
-  `c2` bigint(12) NOT NULL,
-  `c3` bigint(12) NOT NULL,
-  PRIMARY KEY (`c1`),
-  KEY `i_t2_c2_c1` (`c2`,`c1`),
-  KEY `i_t2_c3_c1_c2` (`c3`,`c1`,`c2`),
-  KEY `i_t2_c3_c2` (`c3`,`c2`),
-  CONSTRAINT `fk_t2_ca` FOREIGN KEY (`c3`, `c2`) REFERENCES `t1` (`c2`, `c1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-DROP TABLE t2;
-DROP TABLE t1;
-CREATE TABLE t1 (a INT, b CHAR(1)) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (3,'a'),(3,'b'),(1,'c'),(0,'d'),(1,'e');
-BEGIN;
-SELECT * FROM t1;
-a	b
-3	a
-3	b
-1	c
-0	d
-1	e
-CREATE INDEX t1a ON t1(a);
-SELECT * FROM t1;
-a	b
-3	a
-3	b
-1	c
-0	d
-1	e
-SELECT * FROM t1 FORCE INDEX(t1a) ORDER BY a;
-ERROR HY000: Table definition has changed, please retry transaction
-SELECT * FROM t1;
-a	b
-3	a
-3	b
-1	c
-0	d
-1	e
-COMMIT;
-SELECT * FROM t1 FORCE INDEX(t1a) ORDER BY a;
-a	b
-0	d
-1	c
-1	e
-3	a
-3	b
-DROP TABLE t1;

=== removed file 'mysql-test/suite/innodb/r/innodb-index_ucs2.result'
--- a/mysql-test/suite/innodb/r/innodb-index_ucs2.result	2009-06-10 13:51:20 +0000
+++ b/mysql-test/suite/innodb/r/innodb-index_ucs2.result	1970-01-01 00:00:00 +0000
@@ -1,116 +0,0 @@
-create table t1(a int not null, b int, c char(10), d varchar(20), primary key (a)) engine = innodb default charset=ucs2;
-insert into t1 values (1,1,'ab','ab'),(2,2,'ac','ac'),(3,2,'ad','ad'),(4,4,'afe','afe');
-commit;
-alter table t1 add unique index (b);
-ERROR 23000: Duplicate entry '2' for key 'b'
-insert into t1 values(8,9,'fff','fff');
-select * from t1;
-a	b	c	d
-1	1	ab	ab
-2	2	ac	ac
-3	2	ad	ad
-4	4	afe	afe
-8	9	fff	fff
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  `c` char(10) DEFAULT NULL,
-  `d` varchar(20) DEFAULT NULL,
-  PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=ucs2
-alter table t1 add index (b);
-insert into t1 values(10,10,'kkk','iii');
-select * from t1;
-a	b	c	d
-1	1	ab	ab
-2	2	ac	ac
-3	2	ad	ad
-4	4	afe	afe
-8	9	fff	fff
-10	10	kkk	iii
-select * from t1 force index(b) order by b;
-a	b	c	d
-1	1	ab	ab
-2	2	ac	ac
-3	2	ad	ad
-4	4	afe	afe
-8	9	fff	fff
-10	10	kkk	iii
-explain select * from t1 force index(b) order by b;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	b	5	NULL	6	
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  `c` char(10) DEFAULT NULL,
-  `d` varchar(20) DEFAULT NULL,
-  PRIMARY KEY (`a`),
-  KEY `b` (`b`)
-) ENGINE=InnoDB DEFAULT CHARSET=ucs2
-alter table t1 add unique index (c), add index (d);
-insert into t1 values(11,11,'aaa','mmm');
-select * from t1;
-a	b	c	d
-1	1	ab	ab
-2	2	ac	ac
-3	2	ad	ad
-4	4	afe	afe
-8	9	fff	fff
-10	10	kkk	iii
-11	11	aaa	mmm
-select * from t1 force index(b) order by b;
-a	b	c	d
-1	1	ab	ab
-2	2	ac	ac
-3	2	ad	ad
-4	4	afe	afe
-8	9	fff	fff
-10	10	kkk	iii
-11	11	aaa	mmm
-select * from t1 force index(c) order by c;
-a	b	c	d
-11	11	aaa	mmm
-1	1	ab	ab
-2	2	ac	ac
-3	2	ad	ad
-4	4	afe	afe
-8	9	fff	fff
-10	10	kkk	iii
-select * from t1 force index(d) order by d;
-a	b	c	d
-1	1	ab	ab
-2	2	ac	ac
-3	2	ad	ad
-4	4	afe	afe
-8	9	fff	fff
-10	10	kkk	iii
-11	11	aaa	mmm
-explain select * from t1 force index(b) order by b;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	b	5	NULL	7	
-explain select * from t1 force index(c) order by c;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	c	21	NULL	7	
-explain select * from t1 force index(d) order by d;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	index	NULL	d	43	NULL	7	
-show create table t1;
-Table	Create Table
-t1	CREATE TABLE `t1` (
-  `a` int(11) NOT NULL,
-  `b` int(11) DEFAULT NULL,
-  `c` char(10) DEFAULT NULL,
-  `d` varchar(20) DEFAULT NULL,
-  PRIMARY KEY (`a`),
-  UNIQUE KEY `c` (`c`),
-  KEY `b` (`b`),
-  KEY `d` (`d`)
-) ENGINE=InnoDB DEFAULT CHARSET=ucs2
-check table t1;
-Table	Op	Msg_type	Msg_text
-test.t1	check	status	OK
-drop table t1;

=== removed file 'mysql-test/suite/innodb/r/innodb-timeout.result'
--- a/mysql-test/suite/innodb/r/innodb-timeout.result	2009-06-10 13:51:20 +0000
+++ b/mysql-test/suite/innodb/r/innodb-timeout.result	1970-01-01 00:00:00 +0000
@@ -1,38 +0,0 @@
-set global innodb_lock_wait_timeout=42;
-select @@innodb_lock_wait_timeout;
-@@innodb_lock_wait_timeout
-42
-set innodb_lock_wait_timeout=1;
-select @@innodb_lock_wait_timeout;
-@@innodb_lock_wait_timeout
-1
-select @@innodb_lock_wait_timeout;
-@@innodb_lock_wait_timeout
-42
-set global innodb_lock_wait_timeout=347;
-select @@innodb_lock_wait_timeout;
-@@innodb_lock_wait_timeout
-42
-set innodb_lock_wait_timeout=1;
-select @@innodb_lock_wait_timeout;
-@@innodb_lock_wait_timeout
-1
-select @@innodb_lock_wait_timeout;
-@@innodb_lock_wait_timeout
-347
-create table t1(a int primary key)engine=innodb;
-begin;
-insert into t1 values(1),(2),(3);
-select * from t1 for update;
-commit;
-a
-1
-2
-3
-begin;
-insert into t1 values(4);
-select * from t1 for update;
-commit;
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-drop table t1;
-set global innodb_lock_wait_timeout=50;

=== removed file 'mysql-test/suite/innodb/r/innodb-use-sys-malloc.result'
--- a/mysql-test/suite/innodb/r/innodb-use-sys-malloc.result	2009-06-10 13:51:20 +0000
+++ b/mysql-test/suite/innodb/r/innodb-use-sys-malloc.result	1970-01-01 00:00:00 +0000
@@ -1,48 +0,0 @@
-SELECT @@GLOBAL.innodb_use_sys_malloc;
-@@GLOBAL.innodb_use_sys_malloc
-1
-1 Expected
-SET @@GLOBAL.innodb_use_sys_malloc=0;
-ERROR HY000: Variable 'innodb_use_sys_malloc' is a read only variable
-Expected error 'Read only variable'
-SELECT @@GLOBAL.innodb_use_sys_malloc;
-@@GLOBAL.innodb_use_sys_malloc
-1
-1 Expected
-drop table if exists t1;
-create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
-insert into t1 values (1),(2),(3),(4),(5),(6),(7);
-select * from t1;
-a
-1
-2
-3
-4
-5
-6
-7
-drop table t1;
-SELECT @@GLOBAL.innodb_use_sys_malloc;
-@@GLOBAL.innodb_use_sys_malloc
-1
-1 Expected
-SET @@GLOBAL.innodb_use_sys_malloc=0;
-ERROR HY000: Variable 'innodb_use_sys_malloc' is a read only variable
-Expected error 'Read only variable'
-SELECT @@GLOBAL.innodb_use_sys_malloc;
-@@GLOBAL.innodb_use_sys_malloc
-1
-1 Expected
-drop table if exists t1;
-create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
-insert into t1 values (1),(2),(3),(4),(5),(6),(7);
-select * from t1;
-a
-1
-2
-3
-4
-5
-6
-7
-drop table t1;

=== removed file 'mysql-test/suite/innodb/r/innodb-zip.result'
--- a/mysql-test/suite/innodb/r/innodb-zip.result	2009-09-16 06:00:54 +0000
+++ b/mysql-test/suite/innodb/r/innodb-zip.result	1970-01-01 00:00:00 +0000
@@ -1,421 +0,0 @@
-set global innodb_file_per_table=off;
-set global innodb_file_format=`0`;
-create table t0(a int primary key) engine=innodb row_format=compressed;
-Warnings:
-Warning	1478	InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table.
-Warning	1478	InnoDB: assuming ROW_FORMAT=COMPACT.
-create table t00(a int primary key) engine=innodb
-key_block_size=4 row_format=compressed;
-Warnings:
-Warning	1478	InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
-Warning	1478	InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
-Warning	1478	InnoDB: ignoring KEY_BLOCK_SIZE=4.
-Warning	1478	InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table.
-Warning	1478	InnoDB: assuming ROW_FORMAT=COMPACT.
-create table t1(a int primary key) engine=innodb row_format=dynamic;
-Warnings:
-Warning	1478	InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_per_table.
-Warning	1478	InnoDB: assuming ROW_FORMAT=COMPACT.
-create table t2(a int primary key) engine=innodb row_format=redundant;
-create table t3(a int primary key) engine=innodb row_format=compact;
-create table t4(a int primary key) engine=innodb key_block_size=9;
-Warnings:
-Warning	1478	InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
-Warning	1478	InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
-Warning	1478	InnoDB: ignoring KEY_BLOCK_SIZE=9.
-create table t5(a int primary key) engine=innodb
-key_block_size=1 row_format=redundant;
-Warnings:
-Warning	1478	InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
-Warning	1478	InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
-Warning	1478	InnoDB: ignoring KEY_BLOCK_SIZE=1.
-set global innodb_file_per_table=on;
-create table t6(a int primary key) engine=innodb
-key_block_size=1 row_format=redundant;
-Warnings:
-Warning	1478	InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
-Warning	1478	InnoDB: ignoring KEY_BLOCK_SIZE=1.
-set global innodb_file_format=`1`;
-create table t7(a int primary key) engine=innodb
-key_block_size=1 row_format=redundant;
-Warnings:
-Warning	1478	InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
-create table t8(a int primary key) engine=innodb
-key_block_size=1 row_format=fixed;
-Warnings:
-Warning	1478	InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
-Warning	1478	InnoDB: assuming ROW_FORMAT=COMPACT.
-create table t9(a int primary key) engine=innodb
-key_block_size=1 row_format=compact;
-Warnings:
-Warning	1478	InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
-create table t10(a int primary key) engine=innodb
-key_block_size=1 row_format=dynamic;
-Warnings:
-Warning	1478	InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
-create table t11(a int primary key) engine=innodb
-key_block_size=1 row_format=compressed;
-create table t12(a int primary key) engine=innodb
-key_block_size=1;
-create table t13(a int primary key) engine=innodb
-row_format=compressed;
-create table t14(a int primary key) engine=innodb key_block_size=9;
-Warnings:
-Warning	1478	InnoDB: ignoring KEY_BLOCK_SIZE=9.
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-table_schema	table_name	row_format
-test	t0	Compact
-test	t00	Compact
-test	t1	Compact
-test	t10	Dynamic
-test	t11	Compressed
-test	t12	Compressed
-test	t13	Compressed
-test	t14	Compact
-test	t2	Redundant
-test	t3	Compact
-test	t4	Compact
-test	t5	Redundant
-test	t6	Redundant
-test	t7	Redundant
-test	t8	Compact
-test	t9	Compact
-drop table t0,t00,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14;
-alter table t1 key_block_size=0;
-Warnings:
-Warning	1478	InnoDB: ignoring KEY_BLOCK_SIZE=0.
-alter table t1 row_format=dynamic;
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-table_schema	table_name	row_format
-test	t1	Dynamic
-alter table t1 row_format=compact;
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-table_schema	table_name	row_format
-test	t1	Compact
-alter table t1 row_format=redundant;
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-table_schema	table_name	row_format
-test	t1	Redundant
-drop table t1;
-create table t1(a int not null, b text, index(b(10))) engine=innodb
-key_block_size=1;
-create table t2(b text)engine=innodb;
-insert into t2 values(concat('1abcdefghijklmnopqrstuvwxyz', repeat('A',5000)));
-insert into t1 select 1, b from t2;
-commit;
-begin;
-update t1 set b=repeat('B',100);
-select a,left(b,40) from t1 natural join t2;
-a	left(b,40)
-1	1abcdefghijklmnopqrstuvwxyzAAAAAAAAAAAAA
-rollback;
-select a,left(b,40) from t1 natural join t2;
-a	left(b,40)
-1	1abcdefghijklmnopqrstuvwxyzAAAAAAAAAAAAA
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-table_schema	table_name	row_format
-test	t1	Compressed
-test	t2	Compact
-drop table t1,t2;
-SET SESSION innodb_strict_mode = off;
-CREATE TABLE t1(
-c TEXT NOT NULL, d TEXT NOT NULL,
-PRIMARY KEY (c(767),d(767)))
-ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
-ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs
-CREATE TABLE t1(
-c TEXT NOT NULL, d TEXT NOT NULL,
-PRIMARY KEY (c(767),d(767)))
-ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 CHARSET=ASCII;
-ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs
-CREATE TABLE t1(
-c TEXT NOT NULL, d TEXT NOT NULL,
-PRIMARY KEY (c(767),d(767)))
-ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4 CHARSET=ASCII;
-drop table t1;
-CREATE TABLE t1(c TEXT, PRIMARY KEY (c(440)))
-ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
-ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs
-CREATE TABLE t1(c TEXT, PRIMARY KEY (c(439)))
-ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
-INSERT INTO t1 VALUES(REPEAT('A',512)),(REPEAT('B',512));
-DROP TABLE t1;
-create table t1( c1 int not null, c2 blob, c3 blob, c4 blob,
-primary key(c1, c2(22), c3(22)))
-engine = innodb row_format = dynamic;
-begin;
-insert into t1 values(1, repeat('A', 20000), repeat('B', 20000),
-repeat('C', 20000));
-update t1 set c3 = repeat('D', 20000) where c1 = 1;
-commit;
-select count(*) from t1 where c2 = repeat('A', 20000);
-count(*)
-1
-select count(*) from t1 where c3 = repeat('D', 20000);
-count(*)
-1
-select count(*) from t1 where c4 = repeat('C', 20000);
-count(*)
-1
-update t1 set c3 = repeat('E', 20000) where c1 = 1;
-drop table t1;
-set global innodb_file_format=`0`;
-select @@innodb_file_format;
-@@innodb_file_format
-Antelope
-set global innodb_file_format=`1`;
-select @@innodb_file_format;
-@@innodb_file_format
-Barracuda
-set global innodb_file_format=`2`;
-ERROR HY000: Incorrect arguments to SET
-set global innodb_file_format=`-1`;
-ERROR HY000: Incorrect arguments to SET
-set global innodb_file_format=`Antelope`;
-set global innodb_file_format=`Barracuda`;
-set global innodb_file_format=`Cheetah`;
-ERROR HY000: Incorrect arguments to SET
-set global innodb_file_format=`abc`;
-ERROR HY000: Incorrect arguments to SET
-set global innodb_file_format=`1a`;
-ERROR HY000: Incorrect arguments to SET
-set global innodb_file_format=``;
-ERROR HY000: Incorrect arguments to SET
-set global innodb_file_per_table = on;
-set global innodb_file_format = `1`;
-set innodb_strict_mode = off;
-create table t1 (id int primary key) engine = innodb key_block_size = 0;
-Warnings:
-Warning	1478	InnoDB: ignoring KEY_BLOCK_SIZE=0.
-drop table t1;
-set innodb_strict_mode = on;
-create table t1 (id int primary key) engine = innodb key_block_size = 0;
-ERROR HY000: Can't create table 'test.t1' (errno: 1478)
-show errors;
-Level	Code	Message
-Error	1478	InnoDB: invalid KEY_BLOCK_SIZE = 0. Valid values are [1, 2, 4, 8, 16]
-Error	1005	Can't create table 'test.t1' (errno: 1478)
-create table t2 (id int primary key) engine = innodb key_block_size = 9;
-ERROR HY000: Can't create table 'test.t2' (errno: 1478)
-show errors;
-Level	Code	Message
-Error	1478	InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
-Error	1005	Can't create table 'test.t2' (errno: 1478)
-create table t3 (id int primary key) engine = innodb key_block_size = 1;
-create table t4 (id int primary key) engine = innodb key_block_size = 2;
-create table t5 (id int primary key) engine = innodb key_block_size = 4;
-create table t6 (id int primary key) engine = innodb key_block_size = 8;
-create table t7 (id int primary key) engine = innodb key_block_size = 16;
-create table t8 (id int primary key) engine = innodb row_format = compressed;
-create table t9 (id int primary key) engine = innodb row_format = dynamic;
-create table t10(id int primary key) engine = innodb row_format = compact;
-create table t11(id int primary key) engine = innodb row_format = redundant;
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-table_schema	table_name	row_format
-test	t10	Compact
-test	t11	Redundant
-test	t3	Compressed
-test	t4	Compressed
-test	t5	Compressed
-test	t6	Compressed
-test	t7	Compressed
-test	t8	Compressed
-test	t9	Dynamic
-drop table t3, t4, t5, t6, t7, t8, t9, t10, t11;
-create table t1 (id int primary key) engine = innodb
-key_block_size = 8 row_format = compressed;
-create table t2 (id int primary key) engine = innodb
-key_block_size = 8 row_format = redundant;
-ERROR HY000: Can't create table 'test.t2' (errno: 1478)
-show errors;
-Level	Code	Message
-Error	1478	InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE.
-Error	1005	Can't create table 'test.t2' (errno: 1478)
-create table t3 (id int primary key) engine = innodb
-key_block_size = 8 row_format = compact;
-ERROR HY000: Can't create table 'test.t3' (errno: 1478)
-show errors;
-Level	Code	Message
-Error	1478	InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE.
-Error	1005	Can't create table 'test.t3' (errno: 1478)
-create table t4 (id int primary key) engine = innodb
-key_block_size = 8 row_format = dynamic;
-ERROR HY000: Can't create table 'test.t4' (errno: 1478)
-show errors;
-Level	Code	Message
-Error	1478	InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
-Error	1005	Can't create table 'test.t4' (errno: 1478)
-create table t5 (id int primary key) engine = innodb
-key_block_size = 8 row_format = default;
-ERROR HY000: Can't create table 'test.t5' (errno: 1478)
-show errors;
-Level	Code	Message
-Error	1478	InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE.
-Error	1005	Can't create table 'test.t5' (errno: 1478)
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-table_schema	table_name	row_format
-test	t1	Compressed
-drop table t1;
-create table t1 (id int primary key) engine = innodb
-key_block_size = 9 row_format = redundant;
-ERROR HY000: Can't create table 'test.t1' (errno: 1478)
-show errors;
-Level	Code	Message
-Error	1478	InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
-Error	1478	InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE.
-Error	1005	Can't create table 'test.t1' (errno: 1478)
-create table t2 (id int primary key) engine = innodb
-key_block_size = 9 row_format = compact;
-ERROR HY000: Can't create table 'test.t2' (errno: 1478)
-show errors;
-Level	Code	Message
-Error	1478	InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
-Error	1478	InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE.
-Error	1005	Can't create table 'test.t2' (errno: 1478)
-create table t2 (id int primary key) engine = innodb
-key_block_size = 9 row_format = dynamic;
-ERROR HY000: Can't create table 'test.t2' (errno: 1478)
-show errors;
-Level	Code	Message
-Error	1478	InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
-Error	1478	InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
-Error	1005	Can't create table 'test.t2' (errno: 1478)
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-table_schema	table_name	row_format
-set global innodb_file_per_table = off;
-create table t1 (id int primary key) engine = innodb key_block_size = 1;
-ERROR HY000: Can't create table 'test.t1' (errno: 1478)
-show errors;
-Level	Code	Message
-Error	1478	InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
-Error	1005	Can't create table 'test.t1' (errno: 1478)
-create table t2 (id int primary key) engine = innodb key_block_size = 2;
-ERROR HY000: Can't create table 'test.t2' (errno: 1478)
-show errors;
-Level	Code	Message
-Error	1478	InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
-Error	1005	Can't create table 'test.t2' (errno: 1478)
-create table t3 (id int primary key) engine = innodb key_block_size = 4;
-ERROR HY000: Can't create table 'test.t3' (errno: 1478)
-show errors;
-Level	Code	Message
-Error	1478	InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
-Error	1005	Can't create table 'test.t3' (errno: 1478)
-create table t4 (id int primary key) engine = innodb key_block_size = 8;
-ERROR HY000: Can't create table 'test.t4' (errno: 1478)
-show errors;
-Level	Code	Message
-Error	1478	InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
-Error	1005	Can't create table 'test.t4' (errno: 1478)
-create table t5 (id int primary key) engine = innodb key_block_size = 16;
-ERROR HY000: Can't create table 'test.t5' (errno: 1478)
-show errors;
-Level	Code	Message
-Error	1478	InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
-Error	1005	Can't create table 'test.t5' (errno: 1478)
-create table t6 (id int primary key) engine = innodb row_format = compressed;
-ERROR HY000: Can't create table 'test.t6' (errno: 1478)
-show errors;
-Level	Code	Message
-Error	1478	InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table.
-Error	1005	Can't create table 'test.t6' (errno: 1478)
-create table t7 (id int primary key) engine = innodb row_format = dynamic;
-ERROR HY000: Can't create table 'test.t7' (errno: 1478)
-show errors;
-Level	Code	Message
-Error	1478	InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_per_table.
-Error	1005	Can't create table 'test.t7' (errno: 1478)
-create table t8 (id int primary key) engine = innodb row_format = compact;
-create table t9 (id int primary key) engine = innodb row_format = redundant;
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-table_schema	table_name	row_format
-test	t8	Compact
-test	t9	Redundant
-drop table t8, t9;
-set global innodb_file_per_table = on;
-set global innodb_file_format = `0`;
-create table t1 (id int primary key) engine = innodb key_block_size = 1;
-ERROR HY000: Can't create table 'test.t1' (errno: 1478)
-show errors;
-Level	Code	Message
-Error	1478	InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
-Error	1005	Can't create table 'test.t1' (errno: 1478)
-create table t2 (id int primary key) engine = innodb key_block_size = 2;
-ERROR HY000: Can't create table 'test.t2' (errno: 1478)
-show errors;
-Level	Code	Message
-Error	1478	InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
-Error	1005	Can't create table 'test.t2' (errno: 1478)
-create table t3 (id int primary key) engine = innodb key_block_size = 4;
-ERROR HY000: Can't create table 'test.t3' (errno: 1478)
-show errors;
-Level	Code	Message
-Error	1478	InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
-Error	1005	Can't create table 'test.t3' (errno: 1478)
-create table t4 (id int primary key) engine = innodb key_block_size = 8;
-ERROR HY000: Can't create table 'test.t4' (errno: 1478)
-show errors;
-Level	Code	Message
-Error	1478	InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
-Error	1005	Can't create table 'test.t4' (errno: 1478)
-create table t5 (id int primary key) engine = innodb key_block_size = 16;
-ERROR HY000: Can't create table 'test.t5' (errno: 1478)
-show errors;
-Level	Code	Message
-Error	1478	InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
-Error	1005	Can't create table 'test.t5' (errno: 1478)
-create table t6 (id int primary key) engine = innodb row_format = compressed;
-ERROR HY000: Can't create table 'test.t6' (errno: 1478)
-show errors;
-Level	Code	Message
-Error	1478	InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope.
-Error	1005	Can't create table 'test.t6' (errno: 1478)
-create table t7 (id int primary key) engine = innodb row_format = dynamic;
-ERROR HY000: Can't create table 'test.t7' (errno: 1478)
-show errors;
-Level	Code	Message
-Error	1478	InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope.
-Error	1005	Can't create table 'test.t7' (errno: 1478)
-create table t8 (id int primary key) engine = innodb row_format = compact;
-create table t9 (id int primary key) engine = innodb row_format = redundant;
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-table_schema	table_name	row_format
-test	t8	Compact
-test	t9	Redundant
-drop table t8, t9;
-set global innodb_file_per_table=0;
-set global innodb_file_format=Antelope;
-set global innodb_file_per_table=on;
-set global innodb_file_format=`Barracuda`;
-set global innodb_file_format_check=`Antelope`;
-create table normal_table (
-c1 int
-) engine = innodb;
-select @@innodb_file_format_check;
-@@innodb_file_format_check
-Antelope
-create table zip_table (
-c1 int
-) engine = innodb key_block_size = 8;
-select @@innodb_file_format_check;
-@@innodb_file_format_check
-Barracuda
-set global innodb_file_format_check=`Antelope`;
-select @@innodb_file_format_check;
-@@innodb_file_format_check
-Antelope
-show table status;
-select @@innodb_file_format_check;
-@@innodb_file_format_check
-Barracuda
-drop table normal_table, zip_table;

=== removed file 'mysql-test/suite/innodb/r/innodb_bug36169.result'
--- a/mysql-test/suite/innodb/r/innodb_bug36169.result	2009-06-10 13:51:20 +0000
+++ b/mysql-test/suite/innodb/r/innodb_bug36169.result	1970-01-01 00:00:00 +0000
@@ -1,2 +0,0 @@
-SET GLOBAL innodb_file_format='Barracuda';
-SET GLOBAL innodb_file_per_table=ON;

=== removed file 'mysql-test/suite/innodb/r/innodb_bug36172.result'
--- a/mysql-test/suite/innodb/r/innodb_bug36172.result	2009-06-10 13:51:20 +0000
+++ b/mysql-test/suite/innodb/r/innodb_bug36172.result	1970-01-01 00:00:00 +0000
@@ -1 +0,0 @@
-SET storage_engine=InnoDB;

=== removed file 'mysql-test/suite/innodb/r/innodb_bug40360.result'
--- a/mysql-test/suite/innodb/r/innodb_bug40360.result	2009-06-10 13:51:20 +0000
+++ b/mysql-test/suite/innodb/r/innodb_bug40360.result	1970-01-01 00:00:00 +0000
@@ -1,4 +0,0 @@
-SET TX_ISOLATION='READ-COMMITTED';
-CREATE TABLE bug40360 (a INT) engine=innodb;
-INSERT INTO bug40360 VALUES (1);
-DROP TABLE bug40360;

=== removed file 'mysql-test/suite/innodb/r/innodb_bug41904.result'
--- a/mysql-test/suite/innodb/r/innodb_bug41904.result	2009-06-10 13:51:20 +0000
+++ b/mysql-test/suite/innodb/r/innodb_bug41904.result	1970-01-01 00:00:00 +0000
@@ -1,4 +0,0 @@
-CREATE TABLE bug41904 (id INT PRIMARY KEY, uniquecol CHAR(15)) ENGINE=InnoDB;
-INSERT INTO bug41904 VALUES (1,NULL), (2,NULL);
-CREATE UNIQUE INDEX ui ON bug41904 (uniquecol);
-DROP TABLE bug41904;

=== removed file 'mysql-test/suite/innodb/r/innodb_bug44032.result'
--- a/mysql-test/suite/innodb/r/innodb_bug44032.result	2009-06-10 13:51:20 +0000
+++ b/mysql-test/suite/innodb/r/innodb_bug44032.result	1970-01-01 00:00:00 +0000
@@ -1,7 +0,0 @@
-CREATE TABLE bug44032(c CHAR(3) CHARACTER SET UTF8) ROW_FORMAT=REDUNDANT
-ENGINE=InnoDB;
-INSERT INTO bug44032 VALUES('abc'),(0xEFBCA4EFBCA4EFBCA4);
-UPDATE bug44032 SET c='DDD' WHERE c=0xEFBCA4EFBCA4EFBCA4;
-UPDATE bug44032 SET c=NULL WHERE c='DDD';
-UPDATE bug44032 SET c='DDD' WHERE c IS NULL;
-DROP TABLE bug44032;

=== removed file 'mysql-test/suite/innodb/r/innodb_file_format.result'
--- a/mysql-test/suite/innodb/r/innodb_file_format.result	2009-09-23 08:41:13 +0000
+++ b/mysql-test/suite/innodb/r/innodb_file_format.result	1970-01-01 00:00:00 +0000
@@ -1,45 +0,0 @@
-call mtr.add_suppression("InnoDB: invalid innodb_file_format_check value");
-select @@innodb_file_format;
-@@innodb_file_format
-Antelope
-select @@innodb_file_format_check;
-@@innodb_file_format_check
-Antelope
-set global innodb_file_format=antelope;
-set global innodb_file_format=barracuda;
-set global innodb_file_format=cheetah;
-ERROR HY000: Incorrect arguments to SET
-select @@innodb_file_format;
-@@innodb_file_format
-Barracuda
-set global innodb_file_format=default;
-select @@innodb_file_format;
-@@innodb_file_format
-Antelope
-set global innodb_file_format=on;
-ERROR HY000: Incorrect arguments to SET
-set global innodb_file_format=off;
-ERROR HY000: Incorrect arguments to SET
-select @@innodb_file_format;
-@@innodb_file_format
-Antelope
-set global innodb_file_format_check=antelope;
-set global innodb_file_format_check=barracuda;
-set global innodb_file_format_check=cheetah;
-ERROR HY000: Incorrect arguments to SET
-select @@innodb_file_format_check;
-@@innodb_file_format_check
-Barracuda
-set global innodb_file_format_check=default;
-Warnings:
-Warning	1210	Ignoring SET innodb_file_format=on
-select @@innodb_file_format_check;
-@@innodb_file_format_check
-Barracuda
-set global innodb_file_format=on;
-ERROR HY000: Incorrect arguments to SET
-set global innodb_file_format=off;
-ERROR HY000: Incorrect arguments to SET
-select @@innodb_file_format_check;
-@@innodb_file_format_check
-Barracuda

=== removed file 'mysql-test/suite/innodb/r/innodb_information_schema.result'
--- a/mysql-test/suite/innodb/r/innodb_information_schema.result	2009-06-10 13:51:20 +0000
+++ b/mysql-test/suite/innodb/r/innodb_information_schema.result	1970-01-01 00:00:00 +0000
@@ -1,23 +0,0 @@
-lock_mode	lock_type	lock_table	lock_index	lock_rec	lock_data
-X	RECORD	`test`.```t'\"_str`	`PRIMARY`	2	'1', 'abc', '''abc', 'abc''', 'a''bc', 'a''bc''', '''abc'''''
-X	RECORD	`test`.```t'\"_str`	`PRIMARY`	2	'1', 'abc', '''abc', 'abc''', 'a''bc', 'a''bc''', '''abc'''''
-X	RECORD	`test`.```t'\"_str`	`PRIMARY`	3	'2', 'abc', '"abc', 'abc"', 'a"bc', 'a"bc"', '"abc""'
-X	RECORD	`test`.```t'\"_str`	`PRIMARY`	3	'2', 'abc', '"abc', 'abc"', 'a"bc', 'a"bc"', '"abc""'
-X	RECORD	`test`.```t'\"_str`	`PRIMARY`	4	'3', 'abc', '\\abc', 'abc\\', 'a\\bc', 'a\\bc\\', '\\abc\\\\'
-X	RECORD	`test`.```t'\"_str`	`PRIMARY`	4	'3', 'abc', '\\abc', 'abc\\', 'a\\bc', 'a\\bc\\', '\\abc\\\\'
-X	RECORD	`test`.```t'\"_str`	`PRIMARY`	5	'4', 'abc', '\0abc', 'abc\0', 'a\0bc', 'a\0bc\0', 'a\0bc\0\0'
-X	RECORD	`test`.```t'\"_str`	`PRIMARY`	5	'4', 'abc', '\0abc', 'abc\0', 'a\0bc', 'a\0bc\0', 'a\0bc\0\0'
-X	RECORD	`test`.`t_min`	`PRIMARY`	2	-128, 0, -32768, 0, -8388608, 0, -2147483648, 0, -9223372036854775808, 0
-X	RECORD	`test`.`t_min`	`PRIMARY`	2	-128, 0, -32768, 0, -8388608, 0, -2147483648, 0, -9223372036854775808, 0
-X	RECORD	`test`.`t_max`	`PRIMARY`	2	127, 255, 32767, 65535, 8388607, 16777215, 2147483647, 4294967295, 9223372036854775807, 18446744073709551615
-X	RECORD	`test`.`t_max`	`PRIMARY`	2	127, 255, 32767, 65535, 8388607, 16777215, 2147483647, 4294967295, 9223372036854775807, 18446744073709551615
-X	RECORD	`test`.```t'\"_str`	`PRIMARY`	1	supremum pseudo-record
-X	RECORD	`test`.```t'\"_str`	`PRIMARY`	1	supremum pseudo-record
-lock_table	COUNT(*)
-`test`.`t_max`	2
-`test`.`t_min`	2
-`test`.```t'\"_str`	10
-lock_table	COUNT(*)
-"test"."t_max"	2
-"test"."t_min"	2
-"test"."`t'\""_str"	10

=== removed directory 'mysql-test/suite/innodb/t'
=== removed file 'mysql-test/suite/innodb/t/disabled.def'
--- a/mysql-test/suite/innodb/t/disabled.def	2009-06-11 12:57:44 +0000
+++ b/mysql-test/suite/innodb/t/disabled.def	1970-01-01 00:00:00 +0000
@@ -1 +0,0 @@
-innodb-index: InnoDB: Error: table `test`.`t1#1` already exists in InnoDB internal

=== removed file 'mysql-test/suite/innodb/t/innodb-analyze.test'
--- a/mysql-test/suite/innodb/t/innodb-analyze.test	2009-09-16 06:00:54 +0000
+++ b/mysql-test/suite/innodb/t/innodb-analyze.test	1970-01-01 00:00:00 +0000
@@ -1,66 +0,0 @@
-#
-# Test that mysqld does not crash when running ANALYZE TABLE with
-# different values of the parameter innodb_stats_sample_pages.
-#
-
--- source include/have_innodb.inc
--- source suite/innodb/include/have_innodb_plugin.inc
-
-# we care only that the following SQL commands do not produce errors
-# and do not crash the server
--- disable_query_log
--- disable_result_log
--- enable_warnings
-
-SET GLOBAL innodb_stats_sample_pages=0;
-
-# check that the value has been adjusted to 1
--- enable_result_log
-SHOW VARIABLES LIKE 'innodb_stats_sample_pages';
--- disable_result_log
-
-CREATE TABLE innodb_analyze (
-	a INT,
-	b INT,
-	KEY(a),
-	KEY(b,a)
-) ENGINE=InnoDB;
-
-# test with empty table
-
-ANALYZE TABLE innodb_analyze;
-
-SET GLOBAL innodb_stats_sample_pages=2;
-ANALYZE TABLE innodb_analyze;
-
-SET GLOBAL innodb_stats_sample_pages=4;
-ANALYZE TABLE innodb_analyze;
-
-SET GLOBAL innodb_stats_sample_pages=8;
-ANALYZE TABLE innodb_analyze;
-
-SET GLOBAL innodb_stats_sample_pages=16;
-ANALYZE TABLE innodb_analyze;
-
-INSERT INTO innodb_analyze VALUES
-(1,1), (1,1), (1,2), (1,3), (1,4), (1,5),
-(8,1), (8,8), (8,2), (7,1), (1,4), (3,5);
-
-SET GLOBAL innodb_stats_sample_pages=1;
-ANALYZE TABLE innodb_analyze;
-
-SET GLOBAL innodb_stats_sample_pages=2;
-ANALYZE TABLE innodb_analyze;
-
-SET GLOBAL innodb_stats_sample_pages=4;
-ANALYZE TABLE innodb_analyze;
-
-SET GLOBAL innodb_stats_sample_pages=8;
-ANALYZE TABLE innodb_analyze;
-
-SET GLOBAL innodb_stats_sample_pages=16;
-ANALYZE TABLE innodb_analyze;
-
-DROP TABLE innodb_analyze;
-
-SET GLOBAL innodb_stats_sample_pages=DEFAULT;

=== removed file 'mysql-test/suite/innodb/t/innodb-index.test'
--- a/mysql-test/suite/innodb/t/innodb-index.test	2009-06-11 12:57:44 +0000
+++ b/mysql-test/suite/innodb/t/innodb-index.test	1970-01-01 00:00:00 +0000
@@ -1,534 +0,0 @@
--- source include/have_innodb.inc
-
-create table t1(a int not null, b int, c char(10) not null, d varchar(20)) engine = innodb;
-insert into t1 values (5,5,'oo','oo'),(4,4,'tr','tr'),(3,4,'ad','ad'),(2,3,'ak','ak');
-commit;
---error ER_DUP_KEYNAME
-alter table t1 add index b (b), add index b (b);
---error ER_DUP_FIELDNAME
-alter table t1 add index (b,b);
-alter table t1 add index d2 (d);
-show create table t1;
-explain select * from t1 force index(d2) order by d;
-select * from t1 force index (d2) order by d;
---error ER_DUP_ENTRY
-alter table t1 add unique index (b);
-show create table t1;
-alter table t1 add index (b);
-show create table t1;
-
-# Check how existing tables interfere with temporary tables.
-CREATE TABLE `t1#1`(a INT PRIMARY KEY) ENGINE=InnoDB;
-
---error 156
-alter table t1 add unique index (c), add index (d);
-rename table `t1#1` to `t1#2`;
---error 156
-alter table t1 add unique index (c), add index (d);
-drop table `t1#2`;
-
-alter table t1 add unique index (c), add index (d);
-show create table t1;
-explain select * from t1 force index(c) order by c;
-alter table t1 add primary key (a), drop index c;
-show create table t1;
---error ER_MULTIPLE_PRI_KEY
-alter table t1 add primary key (c);
---error ER_DUP_ENTRY
-alter table t1 drop primary key, add primary key (b);
-create unique index c on t1 (c);
-show create table t1;
-explain select * from t1 force index(c) order by c;
-select * from t1 force index(c) order by c;
-alter table t1 drop index b, add index (b);
-show create table t1;
-insert into t1 values(6,1,'ggg','ggg');
-select * from t1;
-select * from t1 force index(b) order by b;
-select * from t1 force index(c) order by c;
-select * from t1 force index(d) order by d;
-explain select * from t1 force index(b) order by b;
-explain select * from t1 force index(c) order by c;
-explain select * from t1 force index(d) order by d;
-show create table t1;
-drop table t1;
-
-create table t1(a int not null, b int, c char(10), d varchar(20), primary key (a)) engine = innodb;
-insert into t1 values (1,1,'ab','ab'),(2,2,'ac','ac'),(3,3,'ad','ad'),(4,4,'afe','afe');
-commit;
-alter table t1 add index (c(2));
-show create table t1;
-alter table t1 add unique index (d(10));
-show create table t1;
-insert into t1 values(5,1,'ggg','ggg');
-select * from t1;
-select * from t1 force index(c) order by c;
-select * from t1 force index(d) order by d;
-explain select * from t1 order by b;
-explain select * from t1 force index(c) order by c;
-explain select * from t1 force index(d) order by d;
-show create table t1;
-alter table t1 drop index d;
-insert into t1 values(8,9,'fff','fff');
-select * from t1;
-select * from t1 force index(c) order by c;
-explain select * from t1 order by b;
-explain select * from t1 force index(c) order by c;
-explain select * from t1 order by d;
-show create table t1;
-drop table t1;
-
-create table t1(a int not null, b int, c char(10), d varchar(20), primary key (a)) engine = innodb;
-insert into t1 values (1,1,'ab','ab'),(2,2,'ac','ac'),(3,2,'ad','ad'),(4,4,'afe','afe');
-commit;
-alter table t1 add unique index (b,c);
-insert into t1 values(8,9,'fff','fff');
-select * from t1;
-select * from t1 force index(b) order by b;
-explain select * from t1 force index(b) order by b;
-show create table t1;
-alter table t1 add index (b,c);
-insert into t1 values(11,11,'kkk','kkk');
-select * from t1;
-select * from t1 force index(b) order by b;
-explain select * from t1 force index(b) order by b;
-show create table t1;
-alter table t1 add unique index (c,d);
-insert into t1 values(13,13,'yyy','aaa');
-select * from t1;
-select * from t1 force index(b) order by b;
-select * from t1 force index(c) order by c;
-explain select * from t1 force index(b) order by b;
-explain select * from t1 force index(c) order by c;
-show create table t1;
-drop table t1;
-
-create table t1(a int not null, b int not null, c int, primary key (a), key (b)) engine = innodb;
-create table t3(a int not null, c int not null, d int, primary key (a), key (c)) engine = innodb;
-create table t4(a int not null, d int not null, e int, primary key (a), key (d)) engine = innodb;
-create table t2(a int not null, b int not null, c int not null, d int not null, e int,
-foreign key (b) references t1(b) on delete cascade,
-foreign key (c) references t3(c), foreign key (d) references t4(d))
-engine = innodb;
---error ER_DROP_INDEX_FK
-alter table t1 drop index b;
---error ER_DROP_INDEX_FK
-alter table t3 drop index c;
---error ER_DROP_INDEX_FK
-alter table t4 drop index d;
---error ER_DROP_INDEX_FK
-alter table t2 drop index b;
---error ER_DROP_INDEX_FK
-alter table t2 drop index b, drop index c, drop index d;
-# Apparently, the following makes mysql_alter_table() drop index d.
-create unique index dc on t2 (d,c);
-create index dc on t1 (b,c);
-# This should preserve the foreign key constraints.
-alter table t2 add primary key (a);
-insert into t1 values (1,1,1);
-insert into t3 values (1,1,1);
-insert into t4 values (1,1,1);
-insert into t2 values (1,1,1,1,1);
-commit;
-alter table t4 add constraint dc foreign key (a) references t1(a);
-show create table t4;
---replace_regex /'test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
-# a foreign key 'test/dc' already exists
---error ER_CANT_CREATE_TABLE
-alter table t3 add constraint dc foreign key (a) references t1(a);
-show create table t3;
-alter table t2 drop index b, add index (b);
-show create table t2;
---error ER_ROW_IS_REFERENCED_2
-delete from t1;
---error ER_CANT_DROP_FIELD_OR_KEY
-drop index dc on t4;
-# there is no foreign key dc on t3
---replace_regex /'\.\/test\/#sql2-[0-9a-f-]*'/'#sql2-temporary'/
---error ER_ERROR_ON_RENAME
-alter table t3 drop foreign key dc;
-alter table t4 drop foreign key dc;
-select * from t2;
-delete from t1;
-select * from t2;
-
-drop table t2,t4,t3,t1;
-
--- let charset = utf8
--- source suite/innodb/include/innodb-index.inc
-
-create table t1(a int not null, b int) engine = innodb;
-insert into t1 values (1,1),(1,1),(1,1),(1,1);
---error ER_DUP_ENTRY
-alter table t1 add unique index (a);
---error ER_DUP_ENTRY
-alter table t1 add unique index (b);
---error ER_DUP_ENTRY
-alter table t1 add unique index (a), add unique index(b);
-show create table t1;
-drop table t1;
-
-create table t1(a int not null, c int not null,b int, primary key(a), unique key(c), key(b)) engine = innodb;
-alter table t1 drop index c, drop index b;
-show create table t1;
-drop table t1;
-
-create table t1(a int not null, b int, primary key(a)) engine = innodb;
-alter table t1 add index (b);
-show create table t1;
-drop table t1;
-
-create table t1(a int not null, b int, c char(10), d varchar(20), primary key (a)) engine = innodb;
-insert into t1 values (1,1,'ab','ab'),(2,2,'ac','ac'),(3,3,'ac','ac'),(4,4,'afe','afe'),(5,4,'affe','affe');
---error ER_DUP_ENTRY
-alter table t1 add unique index (b), add unique index (c), add unique index (d);
---error ER_DUP_ENTRY
-alter table t1 add unique index (c), add unique index (b), add index (d);
-show create table t1;
-drop table t1;
-
-create table t1(a int not null, b int not null, c int, primary key (a), key(c)) engine=innodb;
-insert into t1 values (5,1,5),(4,2,4),(3,3,3),(2,4,2),(1,5,1);
-alter table t1 add unique index (b);
-insert into t1 values (10,20,20),(11,19,19),(12,18,18),(13,17,17);
-show create table t1;
-check table t1;
-explain select * from t1 force index(c) order by c;
-explain select * from t1 order by a;
-explain select * from t1 force index(b) order by b;
-select * from t1 order by a;
-select * from t1 force index(b) order by b;
-select * from t1 force index(c) order by c;
-drop table t1;
-
-create table t1(a int not null, b int not null) engine=innodb;
-insert into t1 values (1,1);
-alter table t1 add primary key(b);
-insert into t1 values (2,2);
-show create table t1;
-check table t1;
-select * from t1;
-explain select * from t1;
-explain select * from t1 order by a;
-explain select * from t1 order by b;
-checksum table t1;
-drop table t1;
-
-create table t1(a int not null) engine=innodb;
-insert into t1 values (1);
-alter table t1 add primary key(a);
-insert into t1 values (2);
-show create table t1;
-check table t1;
-commit;
-select * from t1;
-explain select * from t1;
-explain select * from t1 order by a;
-drop table t1;
-
-create table t2(d varchar(17) primary key) engine=innodb default charset=utf8;
-create table t3(a int primary key) engine=innodb;
-
-insert into t3 values(22),(44),(33),(55),(66);
-
-insert into t2 values ('jejdkrun87'),('adfd72nh9k'),
-('adfdpplkeock'),('adfdijnmnb78k'),('adfdijn0loKNHJik');
-
-create table t1(a int, b blob, c text, d text not null)
-engine=innodb default charset = utf8;
-
-# r2667 The following test is disabled because MySQL behavior changed.
-# r2667 The test was added with this comment:
-# r2667 
-# r2667 ------------------------------------------------------------------------
-# r2667 r1699 | marko | 2007-08-10 19:53:19 +0300 (Fri, 10 Aug 2007) | 5 lines
-# r2667 
-# r2667 branches/zip: Add changes that accidentally omitted from r1698:
-# r2667 
-# r2667 innodb-index.test, innodb-index.result: Add a test for creating
-# r2667 a PRIMARY KEY on a column that contains a NULL value.
-# r2667 ------------------------------------------------------------------------
-# r2667 
-# r2667 but in BZR-r2667:
-# r2667 http://bazaar.launchpad.net/~mysql/mysql-server/mysql-5.1/revision/davi%40mysql.com-20080617141221-8yre8ys9j4uw3xx5?start_revid=joerg%40mysql.com-20080630105418-7qoe5ehomgrcdb89
-# r2667 MySQL changed the behavior to do full table copy when creating PRIMARY INDEX
-# r2667 on a non-NULL column instead of calling ::add_index() which would fail (and
-# r2667 this is what we were testing here). Before r2667 the code execution path was
-# r2667 like this (when adding PRIMARY INDEX on a non-NULL column with ALTER TABLE):
-# r2667 
-# r2667 mysql_alter_table()
-# r2667   compare_tables()  // would return ALTER_TABLE_INDEX_CHANGED
-# r2667   ::add_index()  // would fail with "primary index cannot contain NULL"
-# r2667 
-# r2667 after r2667 the code execution path is the following:
-# r2667 
-# r2667 mysql_alter_table()
-# r2667   compare_tables()  // returns ALTER_TABLE_DATA_CHANGED
-# r2667   full copy is done, without calling ::add_index()
-# r2667 
-# r2667 To enable, remove "# r2667: " below.
-# r2667 
-# r2667: insert into t1 values (null,null,null,'null');
-insert into t1
-select a,left(repeat(d,100*a),65535),repeat(d,20*a),d from t2,t3;
-drop table t2, t3;
-select count(*) from t1 where a=44;
-select a,
-length(b),b=left(repeat(d,100*a),65535),length(c),c=repeat(d,20*a),d from t1;
-# r2667: --error ER_PRIMARY_CANT_HAVE_NULL
-# r2667: alter table t1 add primary key (a), add key (b(20));
-# r2667: delete from t1 where d='null';
---error ER_DUP_ENTRY
-alter table t1 add primary key (a), add key (b(20));
-delete from t1 where a%2;
-check table t1;
-alter table t1 add primary key (a,b(255),c(255)), add key (b(767));
-select count(*) from t1 where a=44;
-select a,
-length(b),b=left(repeat(d,100*a),65535),length(c),c=repeat(d,20*a),d from t1;
-show create table t1;
-check table t1;
-explain select * from t1 where b like 'adfd%';
-
-#
-# Test locking
-#
-
-create table t2(a int, b varchar(255), primary key(a,b)) engine=innodb;
-insert into t2 select a,left(b,255) from t1;
-drop table t1;
-rename table t2 to t1;
-
-connect (a,localhost,root,,);
-connect (b,localhost,root,,);
-connection a;
-set innodb_lock_wait_timeout=1;
-begin;
-# Obtain an IX lock on the table
-select a from t1 limit 1 for update;
-connection b;
-set innodb_lock_wait_timeout=1;
-# This would require an S lock on the table, conflicting with the IX lock.
---error ER_LOCK_WAIT_TIMEOUT
-create index t1ba on t1 (b,a);
-connection a;
-commit;
-begin;
-# Obtain an IS lock on the table
-select a from t1 limit 1 lock in share mode;
-connection b;
-# This will require an S lock on the table.  No conflict with the IS lock.
-create index t1ba on t1 (b,a);
-# This would require an X lock on the table, conflicting with the IS lock.
---error ER_LOCK_WAIT_TIMEOUT
-drop index t1ba on t1;
-connection a;
-commit;
-explain select a from t1 order by b;
---send
-select a,sleep(2+a/100) from t1 order by b limit 3;
-
-# The following DROP INDEX will succeed, altough the SELECT above has
-# opened a read view.  However, during the execution of the SELECT,
-# MySQL should hold a table lock that should block the execution
-# of the DROP INDEX below.
-
-connection b;
-select sleep(1);
-drop index t1ba on t1;
-
-# After the index was dropped, subsequent SELECTs will use the same
-# read view, but they should not be accessing the dropped index any more.
-
-connection a;
-reap;
-explain select a from t1 order by b;
-select a from t1 order by b limit 3;
-commit;
-
-connection default;
-disconnect a;
-disconnect b;
-
-drop table t1;
-
-let $per_table=`select @@innodb_file_per_table`;
-let $format=`select @@innodb_file_format`;
-set global innodb_file_per_table=on;
-set global innodb_file_format='Barracuda';
-# Test creating a table that could lead to undo log overflow.
-# In the undo log, we write a 768-byte prefix (REC_MAX_INDEX_COL_LEN)
-# of each externally stored column that appears as a column prefix in an index.
-# For this test case, it would suffice to write 1 byte, though.
-create table t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob,h blob,
-		i blob,j blob,k blob,l blob,m blob,n blob,o blob,p blob,
-		q blob,r blob,s blob,t blob,u blob)
-	engine=innodb row_format=dynamic;
-create index t1a on t1 (a(1));
-create index t1b on t1 (b(1));
-create index t1c on t1 (c(1));
-create index t1d on t1 (d(1));
-create index t1e on t1 (e(1));
-create index t1f on t1 (f(1));
-create index t1g on t1 (g(1));
-create index t1h on t1 (h(1));
-create index t1i on t1 (i(1));
-create index t1j on t1 (j(1));
-create index t1k on t1 (k(1));
-create index t1l on t1 (l(1));
-create index t1m on t1 (m(1));
-create index t1n on t1 (n(1));
-create index t1o on t1 (o(1));
-create index t1p on t1 (p(1));
-create index t1q on t1 (q(1));
-create index t1r on t1 (r(1));
-create index t1s on t1 (s(1));
-create index t1t on t1 (t(1));
---error 139
-create index t1u on t1 (u(1));
---error 139
-create index t1ut on t1 (u(1), t(1));
-create index t1st on t1 (s(1), t(1));
-show create table t1;
---error 139
-create index t1u on t1 (u(1));
-alter table t1 row_format=compact;
-create index t1u on t1 (u(1));
-
-drop table t1;
-eval set global innodb_file_per_table=$per_table;
-eval set global innodb_file_format=$format;
-
-#
-# Test to check whether CREATE INDEX handles implicit foreign key
-# constraint modifications (Issue #70, Bug #38786)
-#
-SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
-SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
-
-CREATE TABLE t1(
-  c1	BIGINT(12) NOT NULL,
-  PRIMARY KEY (c1)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-
-CREATE TABLE t2(
-  c1	BIGINT(16) NOT NULL,
-  c2	BIGINT(12) NOT NULL,
-  c3	BIGINT(12) NOT NULL,
-  PRIMARY KEY (c1)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-
-ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
- FOREIGN KEY (c3) REFERENCES t1(c1);
-
-SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
-SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
-
-SHOW CREATE TABLE t2;
-
-CREATE INDEX i_t2_c3_c2 ON t2(c3, c2);
-
-SHOW CREATE TABLE t2;
-
-SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
-SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
-
---error ER_NO_REFERENCED_ROW_2
-INSERT INTO t2 VALUES(0,0,0);
-INSERT INTO t1 VALUES(0);
-INSERT INTO t2 VALUES(0,0,0);
-
-DROP TABLE t2;
-
-CREATE TABLE t2(
-  c1	BIGINT(16) NOT NULL,
-  c2	BIGINT(12) NOT NULL,
-  c3	BIGINT(12) NOT NULL,
-  PRIMARY KEY (c1,c2,c3)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-
-ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
- FOREIGN KEY (c3) REFERENCES t1(c1);
-
-SHOW CREATE TABLE t2;
-
-CREATE INDEX i_t2_c3_c2 ON t2(c3, c2);
-
-SHOW CREATE TABLE t2;
---error ER_NO_REFERENCED_ROW_2
-INSERT INTO t2 VALUES(0,0,1);
-INSERT INTO t2 VALUES(0,0,0);
---error ER_ROW_IS_REFERENCED_2
-DELETE FROM t1;
-DELETE FROM t2;
-
-DROP TABLE t2;
-DROP TABLE t1;
-
-CREATE TABLE t1(
-  c1	BIGINT(12) NOT NULL,
-  c2	INT(4) NOT NULL,
-  PRIMARY KEY (c2,c1)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-
-CREATE TABLE t2(
-  c1	BIGINT(16) NOT NULL,
-  c2	BIGINT(12) NOT NULL,
-  c3	BIGINT(12) NOT NULL,
-  PRIMARY KEY (c1)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-
---replace_regex /'test\.#sql-[0-9_a-f-]*'/'#sql-temporary'/
---error ER_CANT_CREATE_TABLE
-ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
- FOREIGN KEY (c3,c2) REFERENCES t1(c1,c1);
---replace_regex /'test\.#sql-[0-9_a-f-]*'/'#sql-temporary'/
---error ER_CANT_CREATE_TABLE
-ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
- FOREIGN KEY (c3,c2) REFERENCES t1(c1,c2);
---replace_regex /'test\.#sql-[0-9_a-f-]*'/'#sql-temporary'/
---error ER_CANT_CREATE_TABLE
-ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
- FOREIGN KEY (c3,c2) REFERENCES t1(c2,c1);
-ALTER TABLE t1 MODIFY COLUMN c2 BIGINT(12) NOT NULL;
---replace_regex /'test\.#sql-[0-9_a-f-]*'/'#sql-temporary'/
---error ER_CANT_CREATE_TABLE
-ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
- FOREIGN KEY (c3,c2) REFERENCES t1(c1,c2);
-
-ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
- FOREIGN KEY (c3,c2) REFERENCES t1(c2,c1);
-SHOW CREATE TABLE t1;
-SHOW CREATE TABLE t2;
-CREATE INDEX i_t2_c2_c1 ON t2(c2, c1);
-SHOW CREATE TABLE t2;
-CREATE INDEX i_t2_c3_c1_c2 ON t2(c3, c1, c2);
-SHOW CREATE TABLE t2;
-CREATE INDEX i_t2_c3_c2 ON t2(c3, c2);
-SHOW CREATE TABLE t2;
-
-DROP TABLE t2;
-DROP TABLE t1;
-
-connect (a,localhost,root,,);
-connect (b,localhost,root,,);
-connection a;
-CREATE TABLE t1 (a INT, b CHAR(1)) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (3,'a'),(3,'b'),(1,'c'),(0,'d'),(1,'e');
-connection b;
-BEGIN;
-SELECT * FROM t1;
-connection a;
-CREATE INDEX t1a ON t1(a);
-connection b;
-SELECT * FROM t1;
---error ER_TABLE_DEF_CHANGED
-SELECT * FROM t1 FORCE INDEX(t1a) ORDER BY a;
-SELECT * FROM t1;
-COMMIT;
-SELECT * FROM t1 FORCE INDEX(t1a) ORDER BY a;
-connection default;
-disconnect a;
-disconnect b;
-
-DROP TABLE t1;

=== removed file 'mysql-test/suite/innodb/t/innodb-index_ucs2.test'
--- a/mysql-test/suite/innodb/t/innodb-index_ucs2.test	2009-06-11 12:57:44 +0000
+++ b/mysql-test/suite/innodb/t/innodb-index_ucs2.test	1970-01-01 00:00:00 +0000
@@ -1,5 +0,0 @@
--- source include/have_innodb.inc
--- source include/have_ucs2.inc
-
--- let charset = ucs2
--- source suite/innodb/include/innodb-index.inc

=== removed file 'mysql-test/suite/innodb/t/innodb-timeout.test'
--- a/mysql-test/suite/innodb/t/innodb-timeout.test	2009-09-16 06:00:54 +0000
+++ b/mysql-test/suite/innodb/t/innodb-timeout.test	1970-01-01 00:00:00 +0000
@@ -1,65 +0,0 @@
--- source include/have_innodb.inc
--- source suite/innodb/include/have_innodb_plugin.inc
-
-let $timeout=`select @@innodb_lock_wait_timeout`;
-set global innodb_lock_wait_timeout=42;
-
-connect (a,localhost,root,,);
-connect (b,localhost,root,,);
-
-connection a;
-select @@innodb_lock_wait_timeout;
-set innodb_lock_wait_timeout=1;
-select @@innodb_lock_wait_timeout;
-
-connection b;
-select @@innodb_lock_wait_timeout;
-set global innodb_lock_wait_timeout=347;
-select @@innodb_lock_wait_timeout;
-set innodb_lock_wait_timeout=1;
-select @@innodb_lock_wait_timeout;
-
-connect (c,localhost,root,,);
-connection c;
-select @@innodb_lock_wait_timeout;
-connection default;
-disconnect c;
-
-connection a;
-create table t1(a int primary key)engine=innodb;
-begin;
-insert into t1 values(1),(2),(3);
-
-connection b;
---send
-select * from t1 for update;
-
-connection a;
-commit;
-
-connection b;
-reap;
-
-connection a;
-begin;
-insert into t1 values(4);
-
-connection b;
---send
-select * from t1 for update;
-
-connection a;
-sleep 2;
-commit;
-
-connection b;
---error ER_LOCK_WAIT_TIMEOUT
-reap;
-drop table t1;
-
-connection default;
-
-disconnect a;
-disconnect b;
-
-eval set global innodb_lock_wait_timeout=$timeout;

=== removed file 'mysql-test/suite/innodb/t/innodb-use-sys-malloc-master.opt'
--- a/mysql-test/suite/innodb/t/innodb-use-sys-malloc-master.opt	2009-06-24 17:18:58 +0000
+++ b/mysql-test/suite/innodb/t/innodb-use-sys-malloc-master.opt	1970-01-01 00:00:00 +0000
@@ -1,2 +0,0 @@
---loose-innodb-use-sys-malloc=true
---loose-innodb-use-sys-malloc=true

=== removed file 'mysql-test/suite/innodb/t/innodb-use-sys-malloc.test'
--- a/mysql-test/suite/innodb/t/innodb-use-sys-malloc.test	2009-09-16 06:00:54 +0000
+++ b/mysql-test/suite/innodb/t/innodb-use-sys-malloc.test	1970-01-01 00:00:00 +0000
@@ -1,49 +0,0 @@
---source include/have_innodb.inc
--- source suite/innodb/include/have_innodb_plugin.inc
-
-#display current value of innodb_use_sys_malloc
-SELECT @@GLOBAL.innodb_use_sys_malloc;
---echo 1 Expected
-
-#try changing it. Should fail.
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SET @@GLOBAL.innodb_use_sys_malloc=0;
---echo Expected error 'Read only variable'
-
-SELECT @@GLOBAL.innodb_use_sys_malloc;
---echo 1 Expected
-
-
-#do some stuff to see if it works.
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
-insert into t1 values (1),(2),(3),(4),(5),(6),(7);
-select * from t1;
-drop table t1;
---source include/have_innodb.inc
-
-#display current value of innodb_use_sys_malloc
-SELECT @@GLOBAL.innodb_use_sys_malloc;
---echo 1 Expected
-
-#try changing it. Should fail.
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SET @@GLOBAL.innodb_use_sys_malloc=0;
---echo Expected error 'Read only variable'
-
-SELECT @@GLOBAL.innodb_use_sys_malloc;
---echo 1 Expected
-
-
-#do some stuff to see if it works.
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
-insert into t1 values (1),(2),(3),(4),(5),(6),(7);
-select * from t1;
-drop table t1;

=== removed file 'mysql-test/suite/innodb/t/innodb-zip.test'
--- a/mysql-test/suite/innodb/t/innodb-zip.test	2009-09-16 06:00:54 +0000
+++ b/mysql-test/suite/innodb/t/innodb-zip.test	1970-01-01 00:00:00 +0000
@@ -1,344 +0,0 @@
--- source include/have_innodb.inc
--- source suite/innodb/include/have_innodb_plugin.inc
-
-let $per_table=`select @@innodb_file_per_table`;
-let $format=`select @@innodb_file_format`;
-let $innodb_file_format_check_orig=`select @@innodb_file_format_check`;
-set global innodb_file_per_table=off;
-set global innodb_file_format=`0`;
-
-create table t0(a int primary key) engine=innodb row_format=compressed;
-create table t00(a int primary key) engine=innodb
-key_block_size=4 row_format=compressed;
-create table t1(a int primary key) engine=innodb row_format=dynamic;
-create table t2(a int primary key) engine=innodb row_format=redundant;
-create table t3(a int primary key) engine=innodb row_format=compact;
-create table t4(a int primary key) engine=innodb key_block_size=9;
-create table t5(a int primary key) engine=innodb
-key_block_size=1 row_format=redundant;
-
-set global innodb_file_per_table=on;
-create table t6(a int primary key) engine=innodb
-key_block_size=1 row_format=redundant;
-set global innodb_file_format=`1`;
-create table t7(a int primary key) engine=innodb
-key_block_size=1 row_format=redundant;
-create table t8(a int primary key) engine=innodb
-key_block_size=1 row_format=fixed;
-create table t9(a int primary key) engine=innodb
-key_block_size=1 row_format=compact;
-create table t10(a int primary key) engine=innodb
-key_block_size=1 row_format=dynamic;
-create table t11(a int primary key) engine=innodb
-key_block_size=1 row_format=compressed;
-create table t12(a int primary key) engine=innodb
-key_block_size=1;
-create table t13(a int primary key) engine=innodb
-row_format=compressed;
-create table t14(a int primary key) engine=innodb key_block_size=9;
-
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-
-drop table t0,t00,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14;
-alter table t1 key_block_size=0;
-alter table t1 row_format=dynamic;
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-alter table t1 row_format=compact;
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-alter table t1 row_format=redundant;
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-drop table t1;
-
-create table t1(a int not null, b text, index(b(10))) engine=innodb
-key_block_size=1;
-
-create table t2(b text)engine=innodb;
-insert into t2 values(concat('1abcdefghijklmnopqrstuvwxyz', repeat('A',5000)));
-
-insert into t1 select 1, b from t2;
-commit;
-
-connect (a,localhost,root,,);
-connect (b,localhost,root,,);
-
-connection a;
-begin;
-update t1 set b=repeat('B',100);
-
-connection b;
-select a,left(b,40) from t1 natural join t2;
-
-connection a;
-rollback;
-
-connection b;
-select a,left(b,40) from t1 natural join t2;
-
-connection default;
-disconnect a;
-disconnect b;
-
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-drop table t1,t2;
-
-# The following should fail even in non-strict mode.
-SET SESSION innodb_strict_mode = off;
---error ER_TOO_BIG_ROWSIZE
-CREATE TABLE t1(
-	c TEXT NOT NULL, d TEXT NOT NULL,
-	PRIMARY KEY (c(767),d(767)))
-ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
---error ER_TOO_BIG_ROWSIZE
-CREATE TABLE t1(
-	c TEXT NOT NULL, d TEXT NOT NULL,
-	PRIMARY KEY (c(767),d(767)))
-ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 CHARSET=ASCII;
-CREATE TABLE t1(
-	c TEXT NOT NULL, d TEXT NOT NULL,
-	PRIMARY KEY (c(767),d(767)))
-ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4 CHARSET=ASCII;
-drop table t1;
---error ER_TOO_BIG_ROWSIZE
-CREATE TABLE t1(c TEXT, PRIMARY KEY (c(440)))
-ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
-CREATE TABLE t1(c TEXT, PRIMARY KEY (c(439)))
-ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
-INSERT INTO t1 VALUES(REPEAT('A',512)),(REPEAT('B',512));
-DROP TABLE t1;
-
-#
-# Test blob column inheritance (mantis issue#36)
-#
-
-create table t1( c1 int not null, c2 blob, c3 blob, c4 blob,
-		primary key(c1, c2(22), c3(22)))
-		engine = innodb row_format = dynamic;
-begin;
-insert into t1 values(1, repeat('A', 20000), repeat('B', 20000),
-			repeat('C', 20000));
-
-update t1 set c3 = repeat('D', 20000) where c1 = 1;
-commit;
-
-# one blob column which is unchanged in update and part of PK
-# one blob column which is changed and part of of PK
-# one blob column which is not part of PK and is unchanged
-select count(*) from t1 where c2 = repeat('A', 20000);
-select count(*) from t1 where c3 = repeat('D', 20000);
-select count(*) from t1 where c4 = repeat('C', 20000);
-
-update t1 set c3 = repeat('E', 20000) where c1 = 1;
-drop table t1;
-
-#
-#
-# Test innodb_file_format
-#
-set global innodb_file_format=`0`;
-select @@innodb_file_format;
-set global innodb_file_format=`1`;
-select @@innodb_file_format;
--- error ER_WRONG_ARGUMENTS
-set global innodb_file_format=`2`;
--- error ER_WRONG_ARGUMENTS
-set global innodb_file_format=`-1`;
-set global innodb_file_format=`Antelope`;
-set global innodb_file_format=`Barracuda`;
--- error ER_WRONG_ARGUMENTS
-set global innodb_file_format=`Cheetah`;
--- error ER_WRONG_ARGUMENTS
-set global innodb_file_format=`abc`;
--- error ER_WRONG_ARGUMENTS
-set global innodb_file_format=`1a`;
--- error ER_WRONG_ARGUMENTS
-set global innodb_file_format=``;
-
-#test strict mode.
-# this does not work anymore, has been removed from mysqltest
-# -- enable_errors
-set global innodb_file_per_table = on;
-set global innodb_file_format = `1`;
-
-set innodb_strict_mode = off;
-create table t1 (id int primary key) engine = innodb key_block_size = 0;
-drop table t1;
-
-#set strict_mode
-set innodb_strict_mode = on;
-
-#Test different values of KEY_BLOCK_SIZE
-
---error ER_CANT_CREATE_TABLE
-create table t1 (id int primary key) engine = innodb key_block_size = 0;
-show errors;
-
---error ER_CANT_CREATE_TABLE
-create table t2 (id int primary key) engine = innodb key_block_size = 9;
-show errors;
-
-
-create table t3 (id int primary key) engine = innodb key_block_size = 1;
-create table t4 (id int primary key) engine = innodb key_block_size = 2;
-create table t5 (id int primary key) engine = innodb key_block_size = 4;
-create table t6 (id int primary key) engine = innodb key_block_size = 8;
-create table t7 (id int primary key) engine = innodb key_block_size = 16;
-
-#check various ROW_FORMAT values.
-create table t8 (id int primary key) engine = innodb row_format = compressed;
-create table t9 (id int primary key) engine = innodb row_format = dynamic;
-create table t10(id int primary key) engine = innodb row_format = compact;
-create table t11(id int primary key) engine = innodb row_format = redundant;
-
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-drop table t3, t4, t5, t6, t7, t8, t9, t10, t11;
-
-#test different values of ROW_FORMAT with KEY_BLOCK_SIZE
-create table t1 (id int primary key) engine = innodb
-key_block_size = 8 row_format = compressed;
-
---error ER_CANT_CREATE_TABLE
-create table t2 (id int primary key) engine = innodb
-key_block_size = 8 row_format = redundant;
-show errors;
-
---error ER_CANT_CREATE_TABLE
-create table t3 (id int primary key) engine = innodb
-key_block_size = 8 row_format = compact;
-show errors;
-
---error ER_CANT_CREATE_TABLE
-create table t4 (id int primary key) engine = innodb
-key_block_size = 8 row_format = dynamic;
-show errors;
-
---error ER_CANT_CREATE_TABLE
-create table t5 (id int primary key) engine = innodb
-key_block_size = 8 row_format = default;
-show errors;
-
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-drop table t1;
-
-#test multiple errors
---error ER_CANT_CREATE_TABLE
-create table t1 (id int primary key) engine = innodb
-key_block_size = 9 row_format = redundant;
-show errors;
-
---error ER_CANT_CREATE_TABLE
-create table t2 (id int primary key) engine = innodb
-key_block_size = 9 row_format = compact;
-show errors;
-
---error ER_CANT_CREATE_TABLE
-create table t2 (id int primary key) engine = innodb
-key_block_size = 9 row_format = dynamic;
-show errors;
-
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-
-#test valid values with innodb_file_per_table unset
-set global innodb_file_per_table = off;
-
---error ER_CANT_CREATE_TABLE
-create table t1 (id int primary key) engine = innodb key_block_size = 1;
-show errors;
---error ER_CANT_CREATE_TABLE
-create table t2 (id int primary key) engine = innodb key_block_size = 2;
-show errors;
---error ER_CANT_CREATE_TABLE
-create table t3 (id int primary key) engine = innodb key_block_size = 4;
-show errors;
---error ER_CANT_CREATE_TABLE
-create table t4 (id int primary key) engine = innodb key_block_size = 8;
-show errors;
---error ER_CANT_CREATE_TABLE
-create table t5 (id int primary key) engine = innodb key_block_size = 16;
-show errors;
---error ER_CANT_CREATE_TABLE
-create table t6 (id int primary key) engine = innodb row_format = compressed;
-show errors;
---error ER_CANT_CREATE_TABLE
-create table t7 (id int primary key) engine = innodb row_format = dynamic;
-show errors;
-create table t8 (id int primary key) engine = innodb row_format = compact;
-create table t9 (id int primary key) engine = innodb row_format = redundant;
-
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-drop table t8, t9;
-
-#test valid values with innodb_file_format unset
-set global innodb_file_per_table = on;
-set global innodb_file_format = `0`; 
-
---error ER_CANT_CREATE_TABLE
-create table t1 (id int primary key) engine = innodb key_block_size = 1;
-show errors;
---error ER_CANT_CREATE_TABLE
-create table t2 (id int primary key) engine = innodb key_block_size = 2;
-show errors;
---error ER_CANT_CREATE_TABLE
-create table t3 (id int primary key) engine = innodb key_block_size = 4;
-show errors;
---error ER_CANT_CREATE_TABLE
-create table t4 (id int primary key) engine = innodb key_block_size = 8;
-show errors;
---error ER_CANT_CREATE_TABLE
-create table t5 (id int primary key) engine = innodb key_block_size = 16;
-show errors;
---error ER_CANT_CREATE_TABLE
-create table t6 (id int primary key) engine = innodb row_format = compressed;
-show errors;
---error ER_CANT_CREATE_TABLE
-create table t7 (id int primary key) engine = innodb row_format = dynamic;
-show errors;
-create table t8 (id int primary key) engine = innodb row_format = compact;
-create table t9 (id int primary key) engine = innodb row_format = redundant;
-
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-drop table t8, t9;
-
-eval set global innodb_file_per_table=$per_table;
-eval set global innodb_file_format=$format;
-#
-# Testing of tablespace tagging
-#
--- disable_info
-set global innodb_file_per_table=on;
-set global innodb_file_format=`Barracuda`;
-set global innodb_file_format_check=`Antelope`;
-create table normal_table (
-  c1 int
-) engine = innodb;
-select @@innodb_file_format_check;
-create table zip_table (
-  c1 int
-) engine = innodb key_block_size = 8;
-select @@innodb_file_format_check;
-set global innodb_file_format_check=`Antelope`;
-select @@innodb_file_format_check;
--- disable_result_log
-show table status;
--- enable_result_log
-select @@innodb_file_format_check;
-drop table normal_table, zip_table;
--- disable_result_log
-
-#
-# restore environment to the state it was before this test execution
-#
-
--- disable_query_log
-eval set global innodb_file_format=$format;
-eval set global innodb_file_per_table=$per_table;
-eval set global innodb_file_format_check=$innodb_file_format_check_orig;

=== removed file 'mysql-test/suite/innodb/t/innodb_bug36169.test'
--- a/mysql-test/suite/innodb/t/innodb_bug36169.test	2009-09-16 06:00:54 +0000
+++ b/mysql-test/suite/innodb/t/innodb_bug36169.test	1970-01-01 00:00:00 +0000
@@ -1,1159 +0,0 @@
-#
-# Bug#36169 create innodb compressed table with too large row size crashed
-# http://bugs.mysql.com/36169
-#
-
--- source include/have_innodb.inc
--- source suite/innodb/include/have_innodb_plugin.inc
-
-SET GLOBAL innodb_file_format='Barracuda';
-SET GLOBAL innodb_file_per_table=ON;
-
-#
-# The following is copied from http://bugs.mysql.com/36169
-# (http://bugs.mysql.com/file.php?id=9121)
-# Probably it can be simplified but that is not obvious.
-#
-
-# we care only that the following SQL commands do produce errors
-# as expected and do not crash the server
--- disable_query_log
--- disable_result_log
-
-# Generating 10 tables
-# Creating a table with 94 columns and 24 indexes
-DROP TABLE IF EXISTS `table0`;
---error ER_TOO_BIG_ROWSIZE
-CREATE TABLE IF NOT EXISTS `table0`
-(`col0` BOOL,
-`col1` BOOL,
-`col2` TINYINT,
-`col3` DATE,
-`col4` TIME,
-`col5` SET ('test1','test2','test3'),
-`col6` TIME,
-`col7` TEXT,
-`col8` DECIMAL,
-`col9` SET ('test1','test2','test3'),
-`col10` FLOAT,
-`col11` DOUBLE PRECISION,
-`col12` ENUM ('test1','test2','test3'),
-`col13` TINYBLOB,
-`col14` YEAR,
-`col15` SET ('test1','test2','test3'),
-`col16` NUMERIC,
-`col17` NUMERIC,
-`col18` BLOB,
-`col19` DATETIME,
-`col20` DOUBLE PRECISION,
-`col21` DECIMAL,
-`col22` DATETIME,
-`col23` NUMERIC,
-`col24` NUMERIC,
-`col25` LONGTEXT,
-`col26` TINYBLOB,
-`col27` TIME,
-`col28` TINYBLOB,
-`col29` ENUM ('test1','test2','test3'),
-`col30` SMALLINT,
-`col31` REAL,
-`col32` FLOAT,
-`col33` CHAR (175),
-`col34` TINYTEXT,
-`col35` TINYTEXT,
-`col36` TINYBLOB,
-`col37` TINYBLOB,
-`col38` TINYTEXT,
-`col39` MEDIUMBLOB,
-`col40` TIMESTAMP,
-`col41` DOUBLE,
-`col42` SMALLINT,
-`col43` LONGBLOB,
-`col44` VARCHAR (80),
-`col45` MEDIUMTEXT,
-`col46` NUMERIC,
-`col47` BIGINT,
-`col48` DATE,
-`col49` TINYBLOB,
-`col50` DATE,
-`col51` BOOL,
-`col52` MEDIUMINT,
-`col53` FLOAT,
-`col54` TINYBLOB,
-`col55` LONGTEXT,
-`col56` SMALLINT,
-`col57` ENUM ('test1','test2','test3'),
-`col58` DATETIME,
-`col59` MEDIUMTEXT,
-`col60` VARCHAR (232),
-`col61` NUMERIC,
-`col62` YEAR,
-`col63` SMALLINT,
-`col64` TIMESTAMP,
-`col65` BLOB,
-`col66` LONGBLOB,
-`col67` INT,
-`col68` LONGTEXT,
-`col69` ENUM ('test1','test2','test3'),
-`col70` INT,
-`col71` TIME,
-`col72` TIMESTAMP,
-`col73` TIMESTAMP,
-`col74` VARCHAR (170),
-`col75` SET ('test1','test2','test3'),
-`col76` TINYBLOB,
-`col77` BIGINT,
-`col78` NUMERIC,
-`col79` DATETIME,
-`col80` YEAR,
-`col81` NUMERIC,
-`col82` LONGBLOB,
-`col83` TEXT,
-`col84` CHAR (83),
-`col85` DECIMAL,
-`col86` FLOAT,
-`col87` INT,
-`col88` VARCHAR (145),
-`col89` DATE,
-`col90` DECIMAL,
-`col91` DECIMAL,
-`col92` MEDIUMBLOB,
-`col93` TIME,
-KEY `idx0` (`col69`,`col90`,`col8`),
-KEY `idx1` (`col60`),
-KEY `idx2` (`col60`,`col70`,`col74`),
-KEY `idx3` (`col22`,`col32`,`col72`,`col30`),
-KEY `idx4` (`col29`),
-KEY `idx5` (`col19`,`col45`(143)),
-KEY `idx6` (`col46`,`col48`,`col5`,`col39`(118)),
-KEY `idx7` (`col48`,`col61`),
-KEY `idx8` (`col93`),
-KEY `idx9` (`col31`),
-KEY `idx10` (`col30`,`col21`),
-KEY `idx11` (`col67`),
-KEY `idx12` (`col44`,`col6`,`col8`,`col38`(226)),
-KEY `idx13` (`col71`,`col41`,`col15`,`col49`(88)),
-KEY `idx14` (`col78`),
-KEY `idx15` (`col63`,`col67`,`col64`),
-KEY `idx16` (`col17`,`col86`),
-KEY `idx17` (`col77`,`col56`,`col10`,`col55`(24)),
-KEY `idx18` (`col62`),
-KEY `idx19` (`col31`,`col57`,`col56`,`col53`),
-KEY `idx20` (`col46`),
-KEY `idx21` (`col83`(54)),
-KEY `idx22` (`col51`,`col7`(120)),
-KEY `idx23` (`col7`(163),`col31`,`col71`,`col14`)
-)engine=innodb ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
-
-# Creating a table with 10 columns and 32 indexes
-DROP TABLE IF EXISTS `table1`;
---error ER_TOO_BIG_ROWSIZE
-CREATE TABLE IF NOT EXISTS `table1`
-(`col0` CHAR (113),
-`col1` FLOAT,
-`col2` BIGINT,
-`col3` DECIMAL,
-`col4` BLOB,
-`col5` LONGTEXT,
-`col6` SET ('test1','test2','test3'),
-`col7` BIGINT,
-`col8` BIGINT,
-`col9` TINYBLOB,
-KEY `idx0` (`col5`(101),`col7`,`col8`),
-KEY `idx1` (`col8`),
-KEY `idx2` (`col4`(177),`col9`(126),`col6`,`col3`),
-KEY `idx3` (`col5`(160)),
-KEY `idx4` (`col9`(242)),
-KEY `idx5` (`col4`(139),`col2`,`col3`),
-KEY `idx6` (`col7`),
-KEY `idx7` (`col6`,`col2`,`col0`,`col3`),
-KEY `idx8` (`col9`(66)),
-KEY `idx9` (`col5`(253)),
-KEY `idx10` (`col1`,`col7`,`col2`),
-KEY `idx11` (`col9`(242),`col0`,`col8`,`col5`(163)),
-KEY `idx12` (`col8`),
-KEY `idx13` (`col0`,`col9`(37)),
-KEY `idx14` (`col0`),
-KEY `idx15` (`col5`(111)),
-KEY `idx16` (`col8`,`col0`,`col5`(13)),
-KEY `idx17` (`col4`(139)),
-KEY `idx18` (`col5`(189),`col2`,`col3`,`col9`(136)),
-KEY `idx19` (`col0`,`col3`,`col1`,`col8`),
-KEY `idx20` (`col8`),
-KEY `idx21` (`col0`,`col7`,`col9`(227),`col3`),
-KEY `idx22` (`col0`),
-KEY `idx23` (`col2`),
-KEY `idx24` (`col3`),
-KEY `idx25` (`col2`,`col3`),
-KEY `idx26` (`col0`),
-KEY `idx27` (`col5`(254)),
-KEY `idx28` (`col3`),
-KEY `idx29` (`col3`),
-KEY `idx30` (`col7`,`col3`,`col0`,`col4`(220)),
-KEY `idx31` (`col4`(1),`col0`)
-)engine=innodb ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
-
-# Creating a table with 141 columns and 18 indexes
-DROP TABLE IF EXISTS `table2`;
---error ER_TOO_BIG_ROWSIZE
-CREATE TABLE IF NOT EXISTS `table2`
-(`col0` BOOL,
-`col1` MEDIUMINT,
-`col2` VARCHAR (209),
-`col3` MEDIUMBLOB,
-`col4` CHAR (13),
-`col5` DOUBLE,
-`col6` TINYTEXT,
-`col7` REAL,
-`col8` SMALLINT,
-`col9` BLOB,
-`col10` TINYINT,
-`col11` DECIMAL,
-`col12` BLOB,
-`col13` DECIMAL,
-`col14` LONGBLOB,
-`col15` SMALLINT,
-`col16` LONGBLOB,
-`col17` TINYTEXT,
-`col18` FLOAT,
-`col19` CHAR (78),
-`col20` MEDIUMTEXT,
-`col21` SET ('test1','test2','test3'),
-`col22` MEDIUMINT,
-`col23` INT,
-`col24` MEDIUMBLOB,
-`col25` ENUM ('test1','test2','test3'),
-`col26` TINYBLOB,
-`col27` VARCHAR (116),
-`col28` TIMESTAMP,
-`col29` BLOB,
-`col30` SMALLINT,
-`col31` DOUBLE PRECISION,
-`col32` DECIMAL,
-`col33` DECIMAL,
-`col34` TEXT,
-`col35` MEDIUMINT,
-`col36` MEDIUMINT,
-`col37` BIGINT,
-`col38` VARCHAR (253),
-`col39` TINYBLOB,
-`col40` MEDIUMBLOB,
-`col41` BIGINT,
-`col42` DOUBLE,
-`col43` TEXT,
-`col44` BLOB,
-`col45` TIME,
-`col46` MEDIUMINT,
-`col47` DOUBLE PRECISION,
-`col48` SET ('test1','test2','test3'),
-`col49` DOUBLE PRECISION,
-`col50` VARCHAR (97),
-`col51` TEXT,
-`col52` NUMERIC,
-`col53` ENUM ('test1','test2','test3'),
-`col54` MEDIUMTEXT,
-`col55` MEDIUMINT,
-`col56` DATETIME,
-`col57` DATETIME,
-`col58` MEDIUMTEXT,
-`col59` CHAR (244),
-`col60` LONGBLOB,
-`col61` MEDIUMBLOB,
-`col62` DOUBLE,
-`col63` SMALLINT,
-`col64` BOOL,
-`col65` SMALLINT,
-`col66` VARCHAR (212),
-`col67` TIME,
-`col68` REAL,
-`col69` BOOL,
-`col70` BIGINT,
-`col71` DATE,
-`col72` TINYINT,
-`col73` ENUM ('test1','test2','test3'),
-`col74` DATE,
-`col75` TIME,
-`col76` DATETIME,
-`col77` BOOL,
-`col78` TINYTEXT,
-`col79` MEDIUMINT,
-`col80` NUMERIC,
-`col81` LONGTEXT,
-`col82` SET ('test1','test2','test3'),
-`col83` DOUBLE PRECISION,
-`col84` NUMERIC,
-`col85` VARCHAR (184),
-`col86` DOUBLE PRECISION,
-`col87` MEDIUMTEXT,
-`col88` MEDIUMBLOB,
-`col89` BOOL,
-`col90` SMALLINT,
-`col91` TINYINT,
-`col92` ENUM ('test1','test2','test3'),
-`col93` BOOL,
-`col94` TIMESTAMP,
-`col95` BOOL,
-`col96` MEDIUMTEXT,
-`col97` DECIMAL,
-`col98` BOOL,
-`col99` DECIMAL,
-`col100` MEDIUMINT,
-`col101` DOUBLE PRECISION,
-`col102` TINYINT,
-`col103` BOOL,
-`col104` MEDIUMINT,
-`col105` DECIMAL,
-`col106` NUMERIC,
-`col107` TIMESTAMP,
-`col108` MEDIUMBLOB,
-`col109` TINYBLOB,
-`col110` SET ('test1','test2','test3'),
-`col111` YEAR,
-`col112` TIMESTAMP,
-`col113` CHAR (201),
-`col114` BOOL,
-`col115` TINYINT,
-`col116` DOUBLE,
-`col117` TINYINT,
-`col118` TIMESTAMP,
-`col119` SET ('test1','test2','test3'),
-`col120` SMALLINT,
-`col121` TINYBLOB,
-`col122` TIMESTAMP,
-`col123` BLOB,
-`col124` DATE,
-`col125` SMALLINT,
-`col126` ENUM ('test1','test2','test3'),
-`col127` MEDIUMBLOB,
-`col128` DOUBLE PRECISION,
-`col129` REAL,
-`col130` VARCHAR (159),
-`col131` MEDIUMBLOB,
-`col132` BIGINT,
-`col133` INT,
-`col134` SET ('test1','test2','test3'),
-`col135` CHAR (198),
-`col136` SET ('test1','test2','test3'),
-`col137` MEDIUMTEXT,
-`col138` SMALLINT,
-`col139` BLOB,
-`col140` LONGBLOB,
-KEY `idx0` (`col14`(139),`col24`(208),`col38`,`col35`),
-KEY `idx1` (`col48`,`col118`,`col29`(131),`col100`),
-KEY `idx2` (`col86`,`col67`,`col43`(175)),
-KEY `idx3` (`col19`),
-KEY `idx4` (`col40`(220),`col67`),
-KEY `idx5` (`col99`,`col56`),
-KEY `idx6` (`col68`,`col28`,`col137`(157)),
-KEY `idx7` (`col51`(160),`col99`,`col45`,`col39`(9)),
-KEY `idx8` (`col15`,`col52`,`col90`,`col94`),
-KEY `idx9` (`col24`(3),`col139`(248),`col108`(118),`col41`),
-KEY `idx10` (`col36`,`col92`,`col114`),
-KEY `idx11` (`col115`,`col9`(116)),
-KEY `idx12` (`col130`,`col93`,`col134`),
-KEY `idx13` (`col123`(65)),
-KEY `idx14` (`col44`(90),`col86`,`col119`),
-KEY `idx15` (`col69`),
-KEY `idx16` (`col132`,`col81`(118),`col18`),
-KEY `idx17` (`col24`(250),`col7`,`col92`,`col45`)
-)engine=innodb ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
-
-# Creating a table with 199 columns and 1 indexes
-DROP TABLE IF EXISTS `table3`;
---error ER_TOO_BIG_ROWSIZE
-CREATE TABLE IF NOT EXISTS `table3`
-(`col0` SMALLINT,
-`col1` SET ('test1','test2','test3'),
-`col2` TINYTEXT,
-`col3` DOUBLE,
-`col4` NUMERIC,
-`col5` DATE,
-`col6` BIGINT,
-`col7` DOUBLE,
-`col8` TEXT,
-`col9` INT,
-`col10` REAL,
-`col11` TINYINT,
-`col12` NUMERIC,
-`col13` NUMERIC,
-`col14` TIME,
-`col15` DOUBLE,
-`col16` REAL,
-`col17` MEDIUMBLOB,
-`col18` YEAR,
-`col19` TINYTEXT,
-`col20` YEAR,
-`col21` CHAR (250),
-`col22` TINYINT,
-`col23` TINYINT,
-`col24` SMALLINT,
-`col25` DATETIME,
-`col26` MEDIUMINT,
-`col27` LONGBLOB,
-`col28` VARCHAR (106),
-`col29` FLOAT,
-`col30` MEDIUMTEXT,
-`col31` TINYBLOB,
-`col32` BIGINT,
-`col33` YEAR,
-`col34` REAL,
-`col35` MEDIUMBLOB,
-`col36` LONGTEXT,
-`col37` LONGBLOB,
-`col38` BIGINT,
-`col39` FLOAT,
-`col40` TIME,
-`col41` DATETIME,
-`col42` BOOL,
-`col43` BIGINT,
-`col44` SMALLINT,
-`col45` TIME,
-`col46` DOUBLE PRECISION,
-`col47` TIME,
-`col48` TINYTEXT,
-`col49` DOUBLE PRECISION,
-`col50` BIGINT,
-`col51` NUMERIC,
-`col52` TINYBLOB,
-`col53` DATE,
-`col54` DECIMAL,
-`col55` SMALLINT,
-`col56` TINYTEXT,
-`col57` ENUM ('test1','test2','test3'),
-`col58` YEAR,
-`col59` TIME,
-`col60` TINYINT,
-`col61` DECIMAL,
-`col62` DOUBLE,
-`col63` DATE,
-`col64` LONGTEXT,
-`col65` DOUBLE,
-`col66` VARCHAR (88),
-`col67` MEDIUMTEXT,
-`col68` DATE,
-`col69` MEDIUMINT,
-`col70` DECIMAL,
-`col71` MEDIUMTEXT,
-`col72` LONGTEXT,
-`col73` REAL,
-`col74` DOUBLE,
-`col75` TIME,
-`col76` DATE,
-`col77` DECIMAL,
-`col78` MEDIUMBLOB,
-`col79` NUMERIC,
-`col80` BIGINT,
-`col81` YEAR,
-`col82` SMALLINT,
-`col83` MEDIUMINT,
-`col84` TINYINT,
-`col85` MEDIUMBLOB,
-`col86` TIME,
-`col87` MEDIUMBLOB,
-`col88` LONGTEXT,
-`col89` BOOL,
-`col90` BLOB,
-`col91` LONGBLOB,
-`col92` YEAR,
-`col93` BLOB,
-`col94` INT,
-`col95` TINYTEXT,
-`col96` TINYINT,
-`col97` DECIMAL,
-`col98` ENUM ('test1','test2','test3'),
-`col99` MEDIUMINT,
-`col100` TINYINT,
-`col101` MEDIUMBLOB,
-`col102` TINYINT,
-`col103` SET ('test1','test2','test3'),
-`col104` TIMESTAMP,
-`col105` TEXT,
-`col106` DATETIME,
-`col107` MEDIUMTEXT,
-`col108` CHAR (220),
-`col109` TIME,
-`col110` VARCHAR (131),
-`col111` DECIMAL,
-`col112` FLOAT,
-`col113` SMALLINT,
-`col114` BIGINT,
-`col115` LONGBLOB,
-`col116` SET ('test1','test2','test3'),
-`col117` ENUM ('test1','test2','test3'),
-`col118` BLOB,
-`col119` MEDIUMTEXT,
-`col120` SET ('test1','test2','test3'),
-`col121` DATETIME,
-`col122` FLOAT,
-`col123` VARCHAR (242),
-`col124` YEAR,
-`col125` MEDIUMBLOB,
-`col126` TIME,
-`col127` BOOL,
-`col128` TINYBLOB,
-`col129` DOUBLE,
-`col130` TINYINT,
-`col131` BIGINT,
-`col132` SMALLINT,
-`col133` INT,
-`col134` DOUBLE PRECISION,
-`col135` MEDIUMBLOB,
-`col136` SET ('test1','test2','test3'),
-`col137` TINYTEXT,
-`col138` DOUBLE PRECISION,
-`col139` NUMERIC,
-`col140` BLOB,
-`col141` SET ('test1','test2','test3'),
-`col142` INT,
-`col143` VARCHAR (26),
-`col144` BLOB,
-`col145` REAL,
-`col146` SET ('test1','test2','test3'),
-`col147` LONGBLOB,
-`col148` TEXT,
-`col149` BLOB,
-`col150` CHAR (189),
-`col151` LONGTEXT,
-`col152` INT,
-`col153` FLOAT,
-`col154` LONGTEXT,
-`col155` DATE,
-`col156` LONGBLOB,
-`col157` TINYBLOB,
-`col158` REAL,
-`col159` DATE,
-`col160` TIME,
-`col161` YEAR,
-`col162` DOUBLE,
-`col163` VARCHAR (90),
-`col164` FLOAT,
-`col165` NUMERIC,
-`col166` ENUM ('test1','test2','test3'),
-`col167` DOUBLE PRECISION,
-`col168` DOUBLE PRECISION,
-`col169` TINYBLOB,
-`col170` TIME,
-`col171` SMALLINT,
-`col172` TINYTEXT,
-`col173` SMALLINT,
-`col174` DOUBLE,
-`col175` VARCHAR (14),
-`col176` VARCHAR (90),
-`col177` REAL,
-`col178` MEDIUMINT,
-`col179` TINYBLOB,
-`col180` FLOAT,
-`col181` TIMESTAMP,
-`col182` REAL,
-`col183` DOUBLE PRECISION,
-`col184` BIGINT,
-`col185` INT,
-`col186` MEDIUMTEXT,
-`col187` TIME,
-`col188` FLOAT,
-`col189` TIME,
-`col190` INT,
-`col191` FLOAT,
-`col192` MEDIUMINT,
-`col193` TINYINT,
-`col194` MEDIUMTEXT,
-`col195` DATE,
-`col196` TIME,
-`col197` YEAR,
-`col198` CHAR (206),
-KEY `idx0` (`col39`,`col23`)
-)engine=innodb ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
-
-# Creating a table with 133 columns and 16 indexes
-DROP TABLE IF EXISTS `table4`;
---error ER_TOO_BIG_ROWSIZE
-CREATE TABLE IF NOT EXISTS `table4`
-(`col0` VARCHAR (60),
-`col1` NUMERIC,
-`col2` LONGTEXT,
-`col3` MEDIUMTEXT,
-`col4` LONGTEXT,
-`col5` LONGBLOB,
-`col6` LONGBLOB,
-`col7` DATETIME,
-`col8` TINYTEXT,
-`col9` BLOB,
-`col10` BOOL,
-`col11` BIGINT,
-`col12` TEXT,
-`col13` VARCHAR (213),
-`col14` TINYBLOB,
-`col15` BOOL,
-`col16` MEDIUMTEXT,
-`col17` DOUBLE,
-`col18` TEXT,
-`col19` BLOB,
-`col20` SET ('test1','test2','test3'),
-`col21` TINYINT,
-`col22` DATETIME,
-`col23` TINYINT,
-`col24` ENUM ('test1','test2','test3'),
-`col25` REAL,
-`col26` BOOL,
-`col27` FLOAT,
-`col28` LONGBLOB,
-`col29` DATETIME,
-`col30` FLOAT,
-`col31` SET ('test1','test2','test3'),
-`col32` LONGBLOB,
-`col33` NUMERIC,
-`col34` YEAR,
-`col35` VARCHAR (146),
-`col36` BIGINT,
-`col37` DATETIME,
-`col38` DATE,
-`col39` SET ('test1','test2','test3'),
-`col40` CHAR (112),
-`col41` FLOAT,
-`col42` YEAR,
-`col43` TIME,
-`col44` DOUBLE,
-`col45` NUMERIC,
-`col46` FLOAT,
-`col47` DECIMAL,
-`col48` BIGINT,
-`col49` DECIMAL,
-`col50` YEAR,
-`col51` MEDIUMTEXT,
-`col52` LONGBLOB,
-`col53` SET ('test1','test2','test3'),
-`col54` BLOB,
-`col55` FLOAT,
-`col56` REAL,
-`col57` REAL,
-`col58` TEXT,
-`col59` MEDIUMBLOB,
-`col60` INT,
-`col61` INT,
-`col62` DATE,
-`col63` TEXT,
-`col64` DATE,
-`col65` ENUM ('test1','test2','test3'),
-`col66` DOUBLE PRECISION,
-`col67` TINYTEXT,
-`col68` TINYBLOB,
-`col69` FLOAT,
-`col70` BLOB,
-`col71` DATETIME,
-`col72` DOUBLE,
-`col73` LONGTEXT,
-`col74` TIME,
-`col75` DATETIME,
-`col76` VARCHAR (122),
-`col77` MEDIUMTEXT,
-`col78` MEDIUMTEXT,
-`col79` BOOL,
-`col80` LONGTEXT,
-`col81` TINYTEXT,
-`col82` NUMERIC,
-`col83` DOUBLE PRECISION,
-`col84` DATE,
-`col85` YEAR,
-`col86` BLOB,
-`col87` TINYTEXT,
-`col88` DOUBLE PRECISION,
-`col89` MEDIUMINT,
-`col90` MEDIUMTEXT,
-`col91` NUMERIC,
-`col92` DATETIME,
-`col93` NUMERIC,
-`col94` SET ('test1','test2','test3'),
-`col95` TINYTEXT,
-`col96` SET ('test1','test2','test3'),
-`col97` YEAR,
-`col98` MEDIUMINT,
-`col99` TEXT,
-`col100` TEXT,
-`col101` TIME,
-`col102` VARCHAR (225),
-`col103` TINYTEXT,
-`col104` TEXT,
-`col105` MEDIUMTEXT,
-`col106` TINYINT,
-`col107` TEXT,
-`col108` LONGBLOB,
-`col109` LONGTEXT,
-`col110` TINYTEXT,
-`col111` CHAR (56),
-`col112` YEAR,
-`col113` ENUM ('test1','test2','test3'),
-`col114` TINYBLOB,
-`col115` DATETIME,
-`col116` DATE,
-`col117` TIME,
-`col118` MEDIUMTEXT,
-`col119` DOUBLE PRECISION,
-`col120` FLOAT,
-`col121` TIMESTAMP,
-`col122` MEDIUMINT,
-`col123` YEAR,
-`col124` DATE,
-`col125` TEXT,
-`col126` FLOAT,
-`col127` TINYTEXT,
-`col128` BOOL,
-`col129` NUMERIC,
-`col130` TIMESTAMP,
-`col131` INT,
-`col132` MEDIUMBLOB,
-KEY `idx0` (`col130`),
-KEY `idx1` (`col30`,`col55`,`col19`(31)),
-KEY `idx2` (`col104`(186)),
-KEY `idx3` (`col131`),
-KEY `idx4` (`col64`,`col93`,`col2`(11)),
-KEY `idx5` (`col34`,`col121`,`col22`),
-KEY `idx6` (`col33`,`col55`,`col83`),
-KEY `idx7` (`col17`,`col87`(245),`col99`(17)),
-KEY `idx8` (`col65`,`col120`),
-KEY `idx9` (`col82`),
-KEY `idx10` (`col9`(72)),
-KEY `idx11` (`col88`),
-KEY `idx12` (`col128`,`col9`(200),`col71`,`col66`),
-KEY `idx13` (`col77`(126)),
-KEY `idx14` (`col105`(26),`col13`,`col117`),
-KEY `idx15` (`col4`(246),`col130`,`col115`,`col3`(141))
-)engine=innodb ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
-
-# Creating a table with 176 columns and 13 indexes
-DROP TABLE IF EXISTS `table5`;
---error ER_TOO_BIG_ROWSIZE
-CREATE TABLE IF NOT EXISTS `table5`
-(`col0` MEDIUMTEXT,
-`col1` VARCHAR (90),
-`col2` TINYTEXT,
-`col3` TIME,
-`col4` BOOL,
-`col5` TINYTEXT,
-`col6` BOOL,
-`col7` TIMESTAMP,
-`col8` TINYBLOB,
-`col9` TINYINT,
-`col10` YEAR,
-`col11` SET ('test1','test2','test3'),
-`col12` TEXT,
-`col13` CHAR (248),
-`col14` BIGINT,
-`col15` TEXT,
-`col16` TINYINT,
-`col17` NUMERIC,
-`col18` SET ('test1','test2','test3'),
-`col19` LONGBLOB,
-`col20` FLOAT,
-`col21` INT,
-`col22` TEXT,
-`col23` BOOL,
-`col24` DECIMAL,
-`col25` DOUBLE PRECISION,
-`col26` FLOAT,
-`col27` TINYBLOB,
-`col28` NUMERIC,
-`col29` MEDIUMBLOB,
-`col30` DATE,
-`col31` LONGTEXT,
-`col32` DATE,
-`col33` FLOAT,
-`col34` BIGINT,
-`col35` TINYTEXT,
-`col36` MEDIUMTEXT,
-`col37` TIME,
-`col38` INT,
-`col39` TINYINT,
-`col40` SET ('test1','test2','test3'),
-`col41` CHAR (130),
-`col42` SMALLINT,
-`col43` INT,
-`col44` MEDIUMTEXT,
-`col45` VARCHAR (126),
-`col46` INT,
-`col47` DOUBLE PRECISION,
-`col48` BIGINT,
-`col49` MEDIUMTEXT,
-`col50` TINYBLOB,
-`col51` MEDIUMINT,
-`col52` TEXT,
-`col53` VARCHAR (208),
-`col54` VARCHAR (207),
-`col55` NUMERIC,
-`col56` DATETIME,
-`col57` ENUM ('test1','test2','test3'),
-`col58` NUMERIC,
-`col59` TINYBLOB,
-`col60` VARCHAR (73),
-`col61` MEDIUMTEXT,
-`col62` TINYBLOB,
-`col63` DATETIME,
-`col64` NUMERIC,
-`col65` MEDIUMINT,
-`col66` DATETIME,
-`col67` NUMERIC,
-`col68` TINYINT,
-`col69` VARCHAR (58),
-`col70` DECIMAL,
-`col71` MEDIUMTEXT,
-`col72` DATE,
-`col73` TIME,
-`col74` DOUBLE PRECISION,
-`col75` DECIMAL,
-`col76` MEDIUMBLOB,
-`col77` REAL,
-`col78` YEAR,
-`col79` YEAR,
-`col80` LONGBLOB,
-`col81` BLOB,
-`col82` BIGINT,
-`col83` ENUM ('test1','test2','test3'),
-`col84` NUMERIC,
-`col85` SET ('test1','test2','test3'),
-`col86` MEDIUMTEXT,
-`col87` LONGBLOB,
-`col88` TIME,
-`col89` ENUM ('test1','test2','test3'),
-`col90` DECIMAL,
-`col91` FLOAT,
-`col92` DATETIME,
-`col93` TINYTEXT,
-`col94` TIMESTAMP,
-`col95` TIMESTAMP,
-`col96` TEXT,
-`col97` REAL,
-`col98` VARCHAR (198),
-`col99` TIME,
-`col100` TINYINT,
-`col101` BIGINT,
-`col102` LONGBLOB,
-`col103` LONGBLOB,
-`col104` MEDIUMINT,
-`col105` MEDIUMTEXT,
-`col106` TIMESTAMP,
-`col107` SMALLINT,
-`col108` NUMERIC,
-`col109` DECIMAL,
-`col110` FLOAT,
-`col111` DECIMAL,
-`col112` REAL,
-`col113` TINYTEXT,
-`col114` FLOAT,
-`col115` VARCHAR (7),
-`col116` LONGTEXT,
-`col117` DATE,
-`col118` BIGINT,
-`col119` TEXT,
-`col120` BIGINT,
-`col121` BLOB,
-`col122` CHAR (110),
-`col123` NUMERIC,
-`col124` MEDIUMBLOB,
-`col125` NUMERIC,
-`col126` NUMERIC,
-`col127` BOOL,
-`col128` TIME,
-`col129` TINYBLOB,
-`col130` TINYBLOB,
-`col131` DATE,
-`col132` INT,
-`col133` VARCHAR (123),
-`col134` CHAR (238),
-`col135` VARCHAR (225),
-`col136` LONGTEXT,
-`col137` LONGBLOB,
-`col138` REAL,
-`col139` TINYBLOB,
-`col140` DATETIME,
-`col141` TINYTEXT,
-`col142` LONGBLOB,
-`col143` BIGINT,
-`col144` VARCHAR (236),
-`col145` TEXT,
-`col146` YEAR,
-`col147` DECIMAL,
-`col148` TEXT,
-`col149` MEDIUMBLOB,
-`col150` TINYINT,
-`col151` BOOL,
-`col152` VARCHAR (72),
-`col153` INT,
-`col154` VARCHAR (165),
-`col155` TINYINT,
-`col156` MEDIUMTEXT,
-`col157` DOUBLE PRECISION,
-`col158` TIME,
-`col159` MEDIUMBLOB,
-`col160` LONGBLOB,
-`col161` DATETIME,
-`col162` DOUBLE PRECISION,
-`col163` BLOB,
-`col164` ENUM ('test1','test2','test3'),
-`col165` TIMESTAMP,
-`col166` DATE,
-`col167` TINYBLOB,
-`col168` TINYBLOB,
-`col169` LONGBLOB,
-`col170` DATETIME,
-`col171` BIGINT,
-`col172` VARCHAR (30),
-`col173` LONGTEXT,
-`col174` TIME,
-`col175` FLOAT,
-KEY `idx0` (`col16`,`col156`(139),`col97`,`col120`),
-KEY `idx1` (`col24`,`col0`(108)),
-KEY `idx2` (`col117`,`col173`(34),`col132`,`col82`),
-KEY `idx3` (`col2`(86)),
-KEY `idx4` (`col2`(43)),
-KEY `idx5` (`col83`,`col35`(87),`col111`),
-KEY `idx6` (`col6`,`col134`,`col92`),
-KEY `idx7` (`col56`),
-KEY `idx8` (`col30`,`col53`,`col129`(66)),
-KEY `idx9` (`col53`,`col113`(211),`col32`,`col15`(75)),
-KEY `idx10` (`col34`),
-KEY `idx11` (`col126`),
-KEY `idx12` (`col24`)
-)engine=innodb ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
-
-# Creating a table with 179 columns and 46 indexes
-DROP TABLE IF EXISTS `table6`;
--- error ER_TOO_BIG_ROWSIZE
---error ER_TOO_BIG_ROWSIZE
-CREATE TABLE IF NOT EXISTS `table6`
-(`col0` ENUM ('test1','test2','test3'),
-`col1` MEDIUMBLOB,
-`col2` MEDIUMBLOB,
-`col3` DATETIME,
-`col4` DATE,
-`col5` YEAR,
-`col6` REAL,
-`col7` NUMERIC,
-`col8` MEDIUMBLOB,
-`col9` TEXT,
-`col10` TIMESTAMP,
-`col11` DOUBLE,
-`col12` DOUBLE,
-`col13` SMALLINT,
-`col14` TIMESTAMP,
-`col15` DECIMAL,
-`col16` DATE,
-`col17` TEXT,
-`col18` LONGBLOB,
-`col19` BIGINT,
-`col20` FLOAT,
-`col21` DATETIME,
-`col22` TINYINT,
-`col23` MEDIUMBLOB,
-`col24` SET ('test1','test2','test3'),
-`col25` TIME,
-`col26` TEXT,
-`col27` LONGTEXT,
-`col28` BIGINT,
-`col29` REAL,
-`col30` YEAR,
-`col31` MEDIUMBLOB,
-`col32` MEDIUMINT,
-`col33` FLOAT,
-`col34` TEXT,
-`col35` DATE,
-`col36` TIMESTAMP,
-`col37` REAL,
-`col38` BLOB,
-`col39` BLOB,
-`col40` BLOB,
-`col41` TINYBLOB,
-`col42` INT,
-`col43` TINYINT,
-`col44` REAL,
-`col45` BIGINT,
-`col46` TIMESTAMP,
-`col47` BLOB,
-`col48` ENUM ('test1','test2','test3'),
-`col49` BOOL,
-`col50` CHAR (109),
-`col51` DOUBLE,
-`col52` DOUBLE PRECISION,
-`col53` ENUM ('test1','test2','test3'),
-`col54` FLOAT,
-`col55` DOUBLE PRECISION,
-`col56` CHAR (166),
-`col57` TEXT,
-`col58` TIME,
-`col59` DECIMAL,
-`col60` TEXT,
-`col61` ENUM ('test1','test2','test3'),
-`col62` LONGTEXT,
-`col63` YEAR,
-`col64` DOUBLE,
-`col65` CHAR (87),
-`col66` DATE,
-`col67` BOOL,
-`col68` MEDIUMBLOB,
-`col69` DATETIME,
-`col70` DECIMAL,
-`col71` TIME,
-`col72` REAL,
-`col73` LONGTEXT,
-`col74` BLOB,
-`col75` REAL,
-`col76` INT,
-`col77` INT,
-`col78` FLOAT,
-`col79` DOUBLE,
-`col80` MEDIUMINT,
-`col81` ENUM ('test1','test2','test3'),
-`col82` VARCHAR (221),
-`col83` BIGINT,
-`col84` TINYINT,
-`col85` BIGINT,
-`col86` FLOAT,
-`col87` MEDIUMBLOB,
-`col88` CHAR (126),
-`col89` MEDIUMBLOB,
-`col90` DATETIME,
-`col91` TINYINT,
-`col92` DOUBLE,
-`col93` NUMERIC,
-`col94` DATE,
-`col95` BLOB,
-`col96` DATETIME,
-`col97` TIME,
-`col98` LONGBLOB,
-`col99` INT,
-`col100` SET ('test1','test2','test3'),
-`col101` TINYBLOB,
-`col102` INT,
-`col103` MEDIUMBLOB,
-`col104` MEDIUMTEXT,
-`col105` FLOAT,
-`col106` TINYBLOB,
-`col107` VARCHAR (26),
-`col108` TINYINT,
-`col109` TIME,
-`col110` TINYBLOB,
-`col111` LONGBLOB,
-`col112` TINYTEXT,
-`col113` FLOAT,
-`col114` TINYINT,
-`col115` NUMERIC,
-`col116` TIME,
-`col117` SET ('test1','test2','test3'),
-`col118` DATE,
-`col119` SMALLINT,
-`col120` BLOB,
-`col121` TINYTEXT,
-`col122` REAL,
-`col123` YEAR,
-`col124` REAL,
-`col125` BOOL,
-`col126` BLOB,
-`col127` REAL,
-`col128` MEDIUMBLOB,
-`col129` TIMESTAMP,
-`col130` LONGBLOB,
-`col131` MEDIUMBLOB,
-`col132` YEAR,
-`col133` YEAR,
-`col134` INT,
-`col135` MEDIUMINT,
-`col136` MEDIUMINT,
-`col137` TINYTEXT,
-`col138` TINYBLOB,
-`col139` BLOB,
-`col140` SET ('test1','test2','test3'),
-`col141` ENUM ('test1','test2','test3'),
-`col142` ENUM ('test1','test2','test3'),
-`col143` TINYTEXT,
-`col144` DATETIME,
-`col145` TEXT,
-`col146` DOUBLE PRECISION,
-`col147` DECIMAL,
-`col148` MEDIUMTEXT,
-`col149` TINYTEXT,
-`col150` SET ('test1','test2','test3'),
-`col151` MEDIUMTEXT,
-`col152` CHAR (126),
-`col153` DOUBLE,
-`col154` CHAR (243),
-`col155` SET ('test1','test2','test3'),
-`col156` SET ('test1','test2','test3'),
-`col157` DATETIME,
-`col158` DOUBLE,
-`col159` NUMERIC,
-`col160` DECIMAL,
-`col161` FLOAT,
-`col162` LONGBLOB,
-`col163` LONGTEXT,
-`col164` INT,
-`col165` TIME,
-`col166` CHAR (27),
-`col167` VARCHAR (63),
-`col168` TEXT,
-`col169` TINYBLOB,
-`col170` TINYBLOB,
-`col171` ENUM ('test1','test2','test3'),
-`col172` INT,
-`col173` TIME,
-`col174` DECIMAL,
-`col175` DOUBLE,
-`col176` MEDIUMBLOB,
-`col177` LONGBLOB,
-`col178` CHAR (43),
-KEY `idx0` (`col131`(219)),
-KEY `idx1` (`col67`,`col122`,`col59`,`col87`(33)),
-KEY `idx2` (`col83`,`col42`,`col57`(152)),
-KEY `idx3` (`col106`(124)),
-KEY `idx4` (`col173`,`col80`,`col165`,`col89`(78)),
-KEY `idx5` (`col174`,`col145`(108),`col23`(228),`col141`),
-KEY `idx6` (`col157`,`col140`),
-KEY `idx7` (`col130`(188),`col15`),
-KEY `idx8` (`col52`),
-KEY `idx9` (`col144`),
-KEY `idx10` (`col155`),
-KEY `idx11` (`col62`(230),`col1`(109)),
-KEY `idx12` (`col151`(24),`col95`(85)),
-KEY `idx13` (`col114`),
-KEY `idx14` (`col42`,`col98`(56),`col146`),
-KEY `idx15` (`col147`,`col39`(254),`col35`),
-KEY `idx16` (`col79`),
-KEY `idx17` (`col65`),
-KEY `idx18` (`col149`(165),`col168`(119),`col32`,`col117`),
-KEY `idx19` (`col64`),
-KEY `idx20` (`col93`),
-KEY `idx21` (`col64`,`col113`,`col104`(182)),
-KEY `idx22` (`col52`,`col111`(189)),
-KEY `idx23` (`col45`),
-KEY `idx24` (`col154`,`col107`,`col110`(159)),
-KEY `idx25` (`col149`(1),`col87`(131)),
-KEY `idx26` (`col58`,`col115`,`col63`),
-KEY `idx27` (`col95`(9),`col0`,`col87`(113)),
-KEY `idx28` (`col92`,`col130`(1)),
-KEY `idx29` (`col151`(129),`col137`(254),`col13`),
-KEY `idx30` (`col49`),
-KEY `idx31` (`col28`),
-KEY `idx32` (`col83`,`col146`),
-KEY `idx33` (`col155`,`col90`,`col17`(245)),
-KEY `idx34` (`col174`,`col169`(44),`col107`),
-KEY `idx35` (`col113`),
-KEY `idx36` (`col52`),
-KEY `idx37` (`col16`,`col120`(190)),
-KEY `idx38` (`col28`),
-KEY `idx39` (`col131`(165)),
-KEY `idx40` (`col135`,`col26`(86)),
-KEY `idx41` (`col69`,`col94`),
-KEY `idx42` (`col105`,`col151`(38),`col97`),
-KEY `idx43` (`col88`),
-KEY `idx44` (`col176`(100),`col42`,`col73`(189),`col94`),
-KEY `idx45` (`col2`(27),`col27`(116))
-)engine=innodb ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
-
-DROP TABLE IF EXISTS table0;
-DROP TABLE IF EXISTS table1;
-DROP TABLE IF EXISTS table2;
-DROP TABLE IF EXISTS table3;
-DROP TABLE IF EXISTS table4;
-DROP TABLE IF EXISTS table5;
-DROP TABLE IF EXISTS table6;
-
-SET GLOBAL innodb_file_per_table=DEFAULT;
-SET GLOBAL innodb_file_format='Antelope';
-SET GLOBAL innodb_file_format_check='Antelope';

=== removed file 'mysql-test/suite/innodb/t/innodb_bug36172.test'
--- a/mysql-test/suite/innodb/t/innodb_bug36172.test	2009-09-16 06:00:54 +0000
+++ b/mysql-test/suite/innodb/t/innodb_bug36172.test	1970-01-01 00:00:00 +0000
@@ -1,31 +0,0 @@
-#
-# Test case for bug 36172
-#
-
--- source include/not_embedded.inc
--- source include/have_innodb.inc
--- source suite/innodb/include/have_innodb_plugin.inc
-
-SET storage_engine=InnoDB;
-
-# we do not really care about what gets printed, we are only
-# interested in getting success or failure according to our
-# expectations
-
--- disable_query_log
--- disable_result_log
-
-SET GLOBAL innodb_file_format='Barracuda';
-SET GLOBAL innodb_file_per_table=on;
-
-DROP TABLE IF EXISTS `table0`;
-CREATE TABLE `table0` (   `col0` tinyint(1) DEFAULT NULL,   `col1` tinyint(1) DEFAULT NULL,   `col2` tinyint(4) DEFAULT NULL,   `col3` date DEFAULT NULL,   `col4` time DEFAULT NULL,   `col5` set('test1','test2','test3') DEFAULT NULL,   `col6` time DEFAULT NULL,   `col7` text,   `col8` decimal(10,0) DEFAULT NULL,   `col9` set('test1','test2','test3') DEFAULT NULL,   `col10` float DEFAULT NULL,   `col11` double DEFAULT NULL,   `col12` enum('test1','test2','test3') DEFAULT NULL,   `col13` tinyblob,   `col14` year(4) DEFAULT NULL,   `col15` set('test1','test2','test3') DEFAULT NULL,   `col16` decimal(10,0) DEFAULT NULL,   `col17` decimal(10,0) DEFAULT NULL,   `col18` blob,   `col19` datetime DEFAULT NULL,   `col20` double DEFAULT NULL,   `col21` decimal(10,0) DEFAULT NULL,   `col22` datetime DEFAULT NULL,   `col23` decimal(10,0) DEFAULT NULL,   `col24` decimal(10,0) DEFAULT NULL,   `col25` longtext,   `col26` tinyblob,   `col27` time DEFAULT NULL,   `col28` tinyblob,   `col29` e
 num('test1','test2','test3') DEFAULT NULL,   `col30` smallint(6) DEFAULT NULL,   `col31` double DEFAULT NULL,   `col32` float DEFAULT NULL,   `col33` char(175) DEFAULT NULL,   `col34` tinytext,   `col35` tinytext,   `col36` tinyblob,   `col37` tinyblob,   `col38` tinytext,   `col39` mediumblob,   `col40` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,   `col41` double DEFAULT NULL,   `col42` smallint(6) DEFAULT NULL,   `col43` longblob,   `col44` varchar(80) DEFAULT NULL,   `col45` mediumtext,   `col46` decimal(10,0) DEFAULT NULL,   `col47` bigint(20) DEFAULT NULL,   `col48` date DEFAULT NULL,   `col49` tinyblob,   `col50` date DEFAULT NULL,   `col51` tinyint(1) DEFAULT NULL,   `col52` mediumint(9) DEFAULT NULL,   `col53` float DEFAULT NULL,   `col54` tinyblob,   `col55` longtext,   `col56` smallint(6) DEFAULT NULL,   `col57` enum('test1','test2','test3') DEFAULT NULL,   `col58` datetime DEFAULT NULL,   `col59` mediumtext,   `col60` varchar(232) DEF
 AULT NULL,   `col61` decimal(10,0) DEFAULT NULL,   `col62` year(4) DEFAULT NULL,   `col63` smallint(6) DEFAULT NULL,   `col64` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',   `col65` blob,   `col66` longblob,   `col67` int(11) DEFAULT NULL,   `col68` longtext,   `col69` enum('test1','test2','test3') DEFAULT NULL,   `col70` int(11) DEFAULT NULL,   `col71` time DEFAULT NULL,   `col72` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',   `col73` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',   `col74` varchar(170) DEFAULT NULL,   `col75` set('test1','test2','test3') DEFAULT NULL,   `col76` tinyblob,   `col77` bigint(20) DEFAULT NULL,   `col78` decimal(10,0) DEFAULT NULL,   `col79` datetime DEFAULT NULL,   `col80` year(4) DEFAULT NULL,   `col81` decimal(10,0) DEFAULT NULL,   `col82` longblob,   `col83` text,   `col84` char(83) DEFAULT NULL,   `col85` decimal(10,0) DEFAULT NULL,   `col86` float DEFAULT NULL,   `col87` int(11) DEFAULT NULL,   `col88` varchar(145) DEFAULT NUL
 L,   `col89` date DEFAULT NULL,   `col90` decimal(10,0) DEFAULT NULL,   `col91` decimal(10,0) DEFAULT NULL,   `col92` mediumblob,   `col93` time DEFAULT NULL,   KEY `idx0` (`col69`,`col90`,`col8`),   KEY `idx1` (`col60`),   KEY `idx2` (`col60`,`col70`,`col74`),   KEY `idx3` (`col22`,`col32`,`col72`,`col30`),   KEY `idx4` (`col29`),   KEY `idx5` (`col19`,`col45`(143)),   KEY `idx6` (`col46`,`col48`,`col5`,`col39`(118)),   KEY `idx7` (`col48`,`col61`),   KEY `idx8` (`col93`),   KEY `idx9` (`col31`),   KEY `idx10` (`col30`,`col21`),   KEY `idx11` (`col67`),   KEY `idx12` (`col44`,`col6`,`col8`,`col38`(226)),   KEY `idx13` (`col71`,`col41`,`col15`,`col49`(88)),   KEY `idx14` (`col78`),   KEY `idx15` (`col63`,`col67`,`col64`),   KEY `idx16` (`col17`,`col86`),   KEY `idx17` (`col77`,`col56`,`col10`,`col55`(24)),   KEY `idx18` (`col62`),   KEY `idx19` (`col31`,`col57`,`col56`,`col53`),   KEY `idx20` (`col46`),   KEY `idx21` (`col83`(54)),   KEY `idx22` (`col51`,`col7`(120)),   KEY 
 `idx23` (`col7`(163),`col31`,`col71`,`col14`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2;
-insert ignore into `table0` set  `col23` = 7887371.5084383683, `col24` = 4293854615.6906948000, `col25` = 'vitalist', `col26` = 'widespread', `col27` = '3570490', `col28` = 'habitual', `col30` = -5471, `col31` = 4286985783.6771750000, `col32` = 6354540.9826654866, `col33` = 'defoliation', `col34` = 'logarithms', `col35` = 'tegument\'s', `col36` = 'scouting\'s', `col37` = 'intermittency', `col38` = 'elongates', `col39` = 'prophecies', `col40` = '20560103035939', `col41` = 4292809130.0544143000, `col42` = 22057, `col43` = 'Hess\'s', `col44` = 'bandstand', `col45` = 'phenylketonuria', `col46` = 6338767.4018677324, `col47` = 5310247, `col48` = '12592418', `col49` = 'churchman\'s', `col50` = '32226125', `col51` = -58, `col52` = -6207968, `col53` = 1244839.3255104220, `col54` = 'robotized', `col55` = 'monotonous', `col56` = -26909, `col58` = '20720107023550', `col59` = 'suggestiveness\'s', `col60` = 'gemology', `col61` = 4287800670.2229986000, `col62` = '1944', `col63` = -16827, `
 col64` = '20700107212324', `col65` = 'Nicolais', `col66` = 'apteryx', `col67` = 6935317, `col68` = 'stroganoff', `col70` = 3316430, `col71` = '3277608', `col72` = '19300511045918', `col73` = '20421201003327', `col74` = 'attenuant', `col75` = '15173', `col76` = 'upstroke\'s', `col77` = 8118987, `col78` = 6791516.2735374002, `col79` = '20780701144624', `col80` = '2134', `col81` = 4290682351.3127537000, `col82` = 'unexplainably', `col83` = 'Storm', `col84` = 'Greyso\'s', `col85` = 4289119212.4306774000, `col86` = 7617575.8796655172, `col87` = -6325335, `col88` = 'fondue\'s', `col89` = '40608940', `col90` = 1659421.8093508712, `col91` = 8346904.6584368423, `col92` = 'reloads', `col93` = '5188366';
-CHECK TABLE table0 EXTENDED;
-INSERT IGNORE INTO `table0` SET `col19` = '19940127002709', `col20` = 2383927.9055146948, `col21` = 4293243420.5621204000, `col22` = '20511211123705', `col23` = 4289899778.6573381000, `col24` = 4293449279.0540481000, `col25` = 'emphysemic', `col26` = 'dentally', `col27` = '2347406', `col28` = 'eruct', `col30` = 1222, `col31` = 4294372994.9941406000, `col32` = 4291385574.1173744000, `col33` = 'borrowing\'s', `col34` = 'septics', `col35` = 'ratter\'s', `col36` = 'Kaye', `col37` = 'Florentia', `col38` = 'allium', `col39` = 'barkeep', `col40` = '19510407003441', `col41` = 4293559200.4215522000, `col42` = 22482, `col43` = 'decussate', `col44` = 'Brom\'s', `col45` = 'violated', `col46` = 4925506.4635456400, `col47` = 930549, `col48` = '51296066', `col49` = 'voluminously', `col50` = '29306676', `col51` = -88, `col52` = -2153690, `col53` = 4290250202.1464887000, `col54` = 'expropriation', `col55` = 'Aberdeen\'s', `col56` = 20343, `col58` = '19640415171532', `col59` = 'extern', `col6
 0` = 'Ubana', `col61` = 4290487961.8539081000, `col62` = '2147', `col63` = -24271, `col64` = '20750801194548', `col65` = 'Cunaxa\'s', `col66` = 'pasticcio', `col67` = 2795817, `col68` = 'Indore\'s', `col70` = 6864127, `col71` = '1817832', `col72` = '20540506114211', `col73` = '20040101012300', `col74` = 'rationalized', `col75` = '45522', `col76` = 'indene', `col77` = -6964559, `col78` = 4247535.5266884370, `col79` = '20720416124357', `col80` = '2143', `col81` = 4292060102.4466386000, `col82` = 'striving', `col83` = 'boneblack\'s', `col84` = 'redolent', `col85` = 6489697.9009369183, `col86` = 4287473465.9731131000, `col87` = 7726015, `col88` = 'perplexed', `col89` = '17153791', `col90` = 5478587.1108127078, `col91` = 4287091404.7004304000, `col92` = 'Boulez\'s', `col93` = '2931278';
-CHECK TABLE table0 EXTENDED;
-DROP TABLE table0;
-
-SET GLOBAL innodb_file_per_table=DEFAULT;
-SET GLOBAL innodb_file_format='Antelope';
-SET GLOBAL innodb_file_format_check='Antelope';

=== removed file 'mysql-test/suite/innodb/t/innodb_bug40360.test'
--- a/mysql-test/suite/innodb/t/innodb_bug40360.test	2009-06-10 13:51:20 +0000
+++ b/mysql-test/suite/innodb/t/innodb_bug40360.test	1970-01-01 00:00:00 +0000
@@ -1,16 +0,0 @@
-#
-# Make sure http://bugs.mysql.com/40360 remains fixed.
-#
-
--- source include/not_embedded.inc
--- source include/have_innodb.inc
-
-SET TX_ISOLATION='READ-COMMITTED';
-
-# This is the default since MySQL 5.1.29 SET BINLOG_FORMAT='STATEMENT';
-
-CREATE TABLE bug40360 (a INT) engine=innodb;
-
-INSERT INTO bug40360 VALUES (1);
-
-DROP TABLE bug40360;

=== removed file 'mysql-test/suite/innodb/t/innodb_bug41904.test'
--- a/mysql-test/suite/innodb/t/innodb_bug41904.test	2009-06-10 13:51:20 +0000
+++ b/mysql-test/suite/innodb/t/innodb_bug41904.test	1970-01-01 00:00:00 +0000
@@ -1,14 +0,0 @@
-#
-# Make sure http://bugs.mysql.com/41904 remains fixed.
-#
-
--- source include/not_embedded.inc
--- source include/have_innodb.inc
-
-CREATE TABLE bug41904 (id INT PRIMARY KEY, uniquecol CHAR(15)) ENGINE=InnoDB;
-
-INSERT INTO bug41904 VALUES (1,NULL), (2,NULL);
-
-CREATE UNIQUE INDEX ui ON bug41904 (uniquecol);
-
-DROP TABLE bug41904;

=== removed file 'mysql-test/suite/innodb/t/innodb_bug44032.test'
--- a/mysql-test/suite/innodb/t/innodb_bug44032.test	2009-06-10 13:51:20 +0000
+++ b/mysql-test/suite/innodb/t/innodb_bug44032.test	1970-01-01 00:00:00 +0000
@@ -1,13 +0,0 @@
-# Bug44032 no update-in-place of UTF-8 columns in ROW_FORMAT=REDUNDANT
-# (btr_cur_update_in_place not invoked when updating from/to NULL;
-# the update is performed by delete and insert instead)
-
--- source include/have_innodb.inc
-
-CREATE TABLE bug44032(c CHAR(3) CHARACTER SET UTF8) ROW_FORMAT=REDUNDANT
-ENGINE=InnoDB;
-INSERT INTO bug44032 VALUES('abc'),(0xEFBCA4EFBCA4EFBCA4);
-UPDATE bug44032 SET c='DDD' WHERE c=0xEFBCA4EFBCA4EFBCA4;
-UPDATE bug44032 SET c=NULL WHERE c='DDD';
-UPDATE bug44032 SET c='DDD' WHERE c IS NULL;
-DROP TABLE bug44032;

=== removed file 'mysql-test/suite/innodb/t/innodb_file_format.test'
--- a/mysql-test/suite/innodb/t/innodb_file_format.test	2009-09-23 08:41:13 +0000
+++ b/mysql-test/suite/innodb/t/innodb_file_format.test	1970-01-01 00:00:00 +0000
@@ -1,43 +0,0 @@
--- source include/have_innodb.inc
--- source suite/innodb/include/have_innodb_plugin.inc
-
-call mtr.add_suppression("InnoDB: invalid innodb_file_format_check value");
-
-let $format=`select @@innodb_file_format`;
-let $innodb_file_format_check_orig=`select @@innodb_file_format_check`;
-
-select @@innodb_file_format;
-select @@innodb_file_format_check;
-set global innodb_file_format=antelope;
-set global innodb_file_format=barracuda;
---error ER_WRONG_ARGUMENTS
-set global innodb_file_format=cheetah;
-select @@innodb_file_format;
-set global innodb_file_format=default;
-select @@innodb_file_format;
---error ER_WRONG_ARGUMENTS
-set global innodb_file_format=on;
---error ER_WRONG_ARGUMENTS
-set global innodb_file_format=off;
-select @@innodb_file_format;
-set global innodb_file_format_check=antelope;
-set global innodb_file_format_check=barracuda;
---error ER_WRONG_ARGUMENTS
-set global innodb_file_format_check=cheetah;
-select @@innodb_file_format_check;
-set global innodb_file_format_check=default;
-select @@innodb_file_format_check;
---error ER_WRONG_ARGUMENTS
-set global innodb_file_format=on;
---error ER_WRONG_ARGUMENTS
-set global innodb_file_format=off;
-select @@innodb_file_format_check;
-
-#
-# restore environment to the state it was before this test execution
-#
-
--- disable_query_log
-eval set global innodb_file_format=$format;
-eval set global innodb_file_format_check=$innodb_file_format_check_orig;
--- enable_query_log

=== removed file 'mysql-test/suite/innodb/t/innodb_information_schema.test'
--- a/mysql-test/suite/innodb/t/innodb_information_schema.test	2009-09-16 06:00:54 +0000
+++ b/mysql-test/suite/innodb/t/innodb_information_schema.test	1970-01-01 00:00:00 +0000
@@ -1,146 +0,0 @@
-# 
-# Test that user data is correctly "visualized" in
-# INFORMATION_SCHEMA.innodb_locks.lock_data
-#
-
--- source include/have_innodb.inc
--- source suite/innodb/include/have_innodb_plugin.inc
-
--- disable_query_log
--- disable_result_log
-
-SET storage_engine=InnoDB;
-
--- disable_warnings
-DROP TABLE IF EXISTS t_min, t_max;
--- enable_warnings
-
-let $table_def =
-(
-	c01 TINYINT,
-	c02 TINYINT UNSIGNED,
-	c03 SMALLINT,
-	c04 SMALLINT UNSIGNED,
-	c05 MEDIUMINT,
-	c06 MEDIUMINT UNSIGNED,
-	c07 INT,
-	c08 INT UNSIGNED,
-	c09 BIGINT,
-	c10 BIGINT UNSIGNED,
-	PRIMARY KEY(c01, c02, c03, c04, c05, c06, c07, c08, c09, c10)
-);
-
--- eval CREATE TABLE t_min $table_def;
-INSERT INTO t_min VALUES
-(-128, 0,
- -32768, 0,
- -8388608, 0,
- -2147483648, 0,
- -9223372036854775808, 0);
-
--- eval CREATE TABLE t_max $table_def;
-INSERT INTO t_max VALUES
-(127, 255,
- 32767, 65535,
- 8388607, 16777215,
- 2147483647, 4294967295,
- 9223372036854775807, 18446744073709551615);
-
-CREATE TABLE ```t'\"_str` (
-	c1 VARCHAR(32),
-	c2 VARCHAR(32),
-	c3 VARCHAR(32),
-	c4 VARCHAR(32),
-	c5 VARCHAR(32),
-	c6 VARCHAR(32),
-	c7 VARCHAR(32),
-	PRIMARY KEY(c1, c2, c3, c4, c5, c6, c7)
-);
-INSERT INTO ```t'\"_str` VALUES
-('1', 'abc', '''abc', 'abc''', 'a''bc', 'a''bc''', '''abc''''');
-INSERT INTO ```t'\"_str` VALUES
-('2', 'abc', '"abc', 'abc"', 'a"bc', 'a"bc"', '"abc""');
-INSERT INTO ```t'\"_str` VALUES
-('3', 'abc', '\\abc', 'abc\\', 'a\\bc', 'a\\bc\\', '\\abc\\\\');
-INSERT INTO ```t'\"_str` VALUES
-('4', 'abc', 0x00616263, 0x61626300, 0x61006263, 0x6100626300, 0x610062630000);
-
--- connect (con_lock,localhost,root,,)
--- connect (con_min_trylock,localhost,root,,)
--- connect (con_max_trylock,localhost,root,,)
--- connect (con_str_insert_supremum,localhost,root,,)
--- connect (con_str_lock_row1,localhost,root,,)
--- connect (con_str_lock_row2,localhost,root,,)
--- connect (con_str_lock_row3,localhost,root,,)
--- connect (con_str_lock_row4,localhost,root,,)
--- connect (con_verify_innodb_locks,localhost,root,,)
-
--- connection con_lock
-SET autocommit=0;
-SELECT * FROM t_min FOR UPDATE;
-SELECT * FROM t_max FOR UPDATE;
-SELECT * FROM ```t'\"_str` FOR UPDATE;
-
--- connection con_min_trylock
--- send
-SELECT * FROM t_min FOR UPDATE;
-
--- connection con_max_trylock
--- send
-SELECT * FROM t_max FOR UPDATE;
-
--- connection con_str_insert_supremum
--- send
-INSERT INTO ```t'\"_str` VALUES
-('z', 'z', 'z', 'z', 'z', 'z', 'z');
-
--- connection con_str_lock_row1
--- send
-SELECT * FROM ```t'\"_str` WHERE c1 = '1' FOR UPDATE;
-
--- connection con_str_lock_row2
--- send
-SELECT * FROM ```t'\"_str` WHERE c1 = '2' FOR UPDATE;
-
--- connection con_str_lock_row3
--- send
-SELECT * FROM ```t'\"_str` WHERE c1 = '3' FOR UPDATE;
-
--- connection con_str_lock_row4
--- send
-SELECT * FROM ```t'\"_str` WHERE c1 = '4' FOR UPDATE;
-
-# Give time to the above 2 queries to execute before continuing.
-# Without this sleep it sometimes happens that the SELECT from innodb_locks
-# executes before some of them, resulting in less than expected number
-# of rows being selected from innodb_locks.
--- sleep 0.1
-
--- enable_result_log
--- connection con_verify_innodb_locks
-SELECT lock_mode, lock_type, lock_table, lock_index, lock_rec, lock_data
-FROM INFORMATION_SCHEMA.INNODB_LOCKS ORDER BY lock_data;
-
-SELECT lock_table,COUNT(*) FROM INFORMATION_SCHEMA.INNODB_LOCKS
-GROUP BY lock_table;
-
-set @save_sql_mode = @@sql_mode;
-SET SQL_MODE='ANSI_QUOTES';
-SELECT lock_table,COUNT(*) FROM INFORMATION_SCHEMA.INNODB_LOCKS
-GROUP BY lock_table;
-SET @@sql_mode=@save_sql_mode;
--- disable_result_log
-
--- connection default
-
--- disconnect con_lock
--- disconnect con_min_trylock
--- disconnect con_max_trylock
--- disconnect con_str_insert_supremum
--- disconnect con_str_lock_row1
--- disconnect con_str_lock_row2
--- disconnect con_str_lock_row3
--- disconnect con_str_lock_row4
--- disconnect con_verify_innodb_locks
-
-DROP TABLE t_min, t_max, ```t'\"_str`;

=== modified file 'mysql-test/suite/parts/t/disabled.def'
--- a/mysql-test/suite/parts/t/disabled.def	2009-06-24 19:39:33 +0000
+++ b/mysql-test/suite/parts/t/disabled.def	2009-09-23 19:24:00 +0000
@@ -1,4 +1,4 @@
-partition_basic_ndb            : Bug#45710
+partition_basic_ndb            : Bug#44919 parts-suite in mtr tries to use features not supported by ndb
 # http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster-limitations-syntax.html
 partition_syntax_ndb           : Bug#36735 Not supported
 ndb_dd_backuprestore           : Bug#32659 2008-07-14 alik  Disabled to make 6.0 greaner (the test fails too often)

=== modified file 'mysql-test/suite/rpl/r/rpl_backup_shutdown.result'
--- a/mysql-test/suite/rpl/r/rpl_backup_shutdown.result	2009-04-29 18:20:21 +0000
+++ b/mysql-test/suite/rpl/r/rpl_backup_shutdown.result	2009-09-25 02:55:21 +0000
@@ -110,12 +110,14 @@ DROP DATABASE db2;
 --> Start master server ...
 SHOW DATABASES LIKE 'db%';
 Database (db%)
+STOP SLAVE IO_THREAD;
 # Perform Restore
 RESTORE FROM 'db12m.bak';
 backup_id
 #
 # Slave will be stopped as result of restore incident event
 # Connecting to slave...
+START SLAVE IO_THREAD;
 # Check the slave status
 SHOW SLAVE STATUS;
 Slave_IO_State	#

=== modified file 'mysql-test/suite/rpl/r/rpl_locktrans_innodb.result'
--- a/mysql-test/suite/rpl/r/rpl_locktrans_innodb.result	2009-07-31 17:53:36 +0000
+++ b/mysql-test/suite/rpl/r/rpl_locktrans_innodb.result	2009-09-16 13:31:23 +0000
@@ -29,15 +29,15 @@ LOCK TABLE t1 IN SHARE MODE, t2 IN EXCLU
 UNLOCK TABLES;
 #
 # Valid syntax for transactional locks with NOWAIT option.
-## In the preliminary reference implementation we expect these errors:
-## NOWAIT+SHARE="timed out", NOWAIT+EXCLUSIVE="not supported".
+## In the preliminary reference implementation we expect 
+## "not supported" error.
 ## Statements abort on first error.
 LOCK TABLE t1 IN SHARE MODE NOWAIT, t2 IN EXCLUSIVE MODE NOWAIT;
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+ERROR 42000: Table 't1' uses an extension that doesn't exist in this MySQL version
 LOCK TABLE t1 IN EXCLUSIVE MODE NOWAIT, t2 IN SHARE MODE NOWAIT;
 ERROR 42000: Table 't1' uses an extension that doesn't exist in this MySQL version
 LOCK TABLE t1 IN EXCLUSIVE MODE, t2 IN SHARE MODE NOWAIT;
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+ERROR 42000: Table 't2' uses an extension that doesn't exist in this MySQL version
 #
 # Valid syntax for aliases with and without 'AS'.
 LOCK TABLE t1 AS a1 READ, t2 a2 WRITE;
@@ -623,7 +623,7 @@ LOCK TABLE t1 IN EXCLUSIVE MODE;
 # Try an exclusive lock,
 # which conflicts and cannot immediately be taken.
 LOCK TABLE t1 IN SHARE MODE NOWAIT;
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+ERROR 42000: Table 't1' uses an extension that doesn't exist in this MySQL version
 # connection default.
 # Commit.
 COMMIT;

=== modified file 'mysql-test/suite/rpl/r/rpl_log_pos.result'
--- a/mysql-test/suite/rpl/r/rpl_log_pos.result	2009-09-25 11:17:54 +0000
+++ b/mysql-test/suite/rpl/r/rpl_log_pos.result	2009-09-29 15:03:12 +0000
@@ -109,4 +109,5 @@ n
 2
 3
 drop table t1;
+call mtr.add_suppression("Got fatal error 1236 from master when reading data from binary log: 'binlog truncated in the middle of event', Error_code: 1236");
 End of 5.0 tests

=== modified file 'mysql-test/suite/rpl/r/rpl_packet.result'
--- a/mysql-test/suite/rpl/r/rpl_packet.result	2009-09-25 11:17:54 +0000
+++ b/mysql-test/suite/rpl/r/rpl_packet.result	2009-09-29 15:03:12 +0000
@@ -65,4 +65,8 @@ Got fatal error 1236 from master when re
 DROP TABLE t1;
 SET @@global.max_allowed_packet= 1024;
 SET @@global.net_buffer_length= 1024;
+call mtr.add_suppression("Slave I.O: Got a packet bigger than 'max_allowed_packet' bytes, Error_code: 1153");
+call mtr.add_suppression("log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master");
 DROP TABLE t1;
+call mtr.add_suppression("Slave I.O: Got a packet bigger than 'max_allowed_packet' bytes, Error_code: 1153");
+call mtr.add_suppression("log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master");

=== modified file 'mysql-test/suite/rpl/t/disabled.def'
--- a/mysql-test/suite/rpl/t/disabled.def	2009-09-27 10:24:46 +0000
+++ b/mysql-test/suite/rpl/t/disabled.def	2009-09-29 15:03:12 +0000
@@ -12,5 +12,3 @@
 
 rpl_heartbeat_basic        : Bug#43828 Sporadic failures (Serge.Kozlov@stripped)
 rpl_heartbeat_2slaves      : Bug#43828 Sporadic failures (Serge.Kozlov@stripped)
-rpl_failed_optimize        : WL#4284: Can't optimize table used by a pending transaction (there is metadata lock on the table).
-rpl_read_only              : WL#4284: Setting Read only won't succeed until all metadata locks are released.

=== modified file 'mysql-test/suite/rpl/t/rpl_backup_multi.test'
--- a/mysql-test/suite/rpl/t/rpl_backup_multi.test	2009-09-01 12:31:10 +0000
+++ b/mysql-test/suite/rpl/t/rpl_backup_multi.test	2009-09-27 20:39:24 +0000
@@ -8,10 +8,6 @@
 
 --source include/not_embedded.inc
 --source include/have_innodb.inc
-
-# -- [DISABLED Bug#45238]
---source include/not_windows.inc
-
 # Set up multi master-slave configuration
 --source suite/rpl/include/rpl_backup_multi.inc
 

=== modified file 'mysql-test/suite/rpl/t/rpl_backup_shutdown.test'
--- a/mysql-test/suite/rpl/t/rpl_backup_shutdown.test	2009-04-29 18:20:21 +0000
+++ b/mysql-test/suite/rpl/t/rpl_backup_shutdown.test	2009-09-25 02:55:21 +0000
@@ -69,6 +69,25 @@ EOF
 
 SHOW DATABASES LIKE 'db%';
 
+# BUG #47161 rpl_backup_shutdown fails sporadically on PB2.  
+# The master is shutdowned and restarted before "RESTORE FROM 'db12m.bak' is
+# executed".  
+# At that point, slave I/O thread notices that connection has been broken, and
+# attempt to automatically reconnect.  Sometimes, connection succeeds before
+# the 'RESTORE' operation is issued on the master. This is no problem, because
+# slave I/O thread will read the INCIDENT EVENT from master binlog and SQL
+# thread will eventually stop. However, if slave I/O thread attempts
+# connection when the 'RESTORE' command already ongoing on the master, then
+# master will refuse it and connection will not be retried. As a consequence,
+# Slave I/O thread will not be able to read the INCIDENT EVENT, ultimately
+# causing slave SQL thread not be aware of the incident event. This will make
+# in slave SQL thread not to stop and ultimately test will time out ("source
+# include/wait_for_slave_sql_to_stop.inc").
+connection slave;
+STOP SLAVE IO_THREAD;
+source include/wait_for_slave_io_to_stop.inc;
+
+connection master;
 --echo # Perform Restore
 --replace_column 1 #
 RESTORE FROM 'db12m.bak';
@@ -76,6 +95,10 @@ RESTORE FROM 'db12m.bak';
 --echo # Slave will be stopped as result of restore incident event
 --echo # Connecting to slave...
 connection slave;
+
+START SLAVE IO_THREAD;
+source include/wait_for_slave_io_to_start.inc;
+
 source include/wait_for_slave_sql_to_stop.inc;
 
 --echo # Check the slave status

=== modified file 'mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test'
--- a/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test	2009-06-24 19:39:33 +0000
+++ b/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test	2009-09-23 20:37:24 +0000
@@ -7,9 +7,6 @@
 #############################################################
 --source include/have_innodb.inc
 
-# -- [DISABLED Bug#45238]
---source include/not_windows.inc
-
 # Use wait_for_slave_to_(start|stop) for current connections
 let $keep_connection= 1;
 

=== modified file 'mysql-test/suite/rpl/t/rpl_log_pos.test'
--- a/mysql-test/suite/rpl/t/rpl_log_pos.test	2009-09-24 13:19:06 +0000
+++ b/mysql-test/suite/rpl/t/rpl_log_pos.test	2009-09-29 15:03:12 +0000
@@ -40,4 +40,7 @@ connection master;
 drop table t1;
 sync_slave_with_master;
 
+connection slave;
+call mtr.add_suppression("Got fatal error 1236 from master when reading data from binary log: 'binlog truncated in the middle of event', Error_code: 1236");
+
 --echo End of 5.0 tests

=== modified file 'mysql-test/suite/rpl/t/rpl_packet.test'
--- a/mysql-test/suite/rpl/t/rpl_packet.test	2009-09-25 11:17:54 +0000
+++ b/mysql-test/suite/rpl/t/rpl_packet.test	2009-09-29 15:03:12 +0000
@@ -147,8 +147,12 @@ connection master;
 DROP TABLE t1;
 eval SET @@global.max_allowed_packet= $old_max_allowed_packet;
 eval SET @@global.net_buffer_length= $old_net_buffer_length;
+call mtr.add_suppression("Slave I.O: Got a packet bigger than 'max_allowed_packet' bytes, Error_code: 1153");
+call mtr.add_suppression("log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master");
 # slave is stopped
 connection slave;
 DROP TABLE t1;
+call mtr.add_suppression("Slave I.O: Got a packet bigger than 'max_allowed_packet' bytes, Error_code: 1153");
+call mtr.add_suppression("log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master");
 
 # End of tests

=== modified file 'mysql-test/suite/rpl/t/rpl_row_colSize.test'
--- a/mysql-test/suite/rpl/t/rpl_row_colSize.test	2009-06-24 19:39:33 +0000
+++ b/mysql-test/suite/rpl/t/rpl_row_colSize.test	2009-09-23 20:37:24 +0000
@@ -6,9 +6,6 @@
 # having columns that are smaller (shorter) than the slave.      #
 ##################################################################
 
-# -- [DISABLED Bug#45238]
---source include/not_windows.inc
-
 -- source include/master-slave.inc
 -- source include/have_binlog_format_row.inc
 

=== modified file 'mysql-test/suite/rpl/t/rpl_row_create_table.test'
--- a/mysql-test/suite/rpl/t/rpl_row_create_table.test	2009-06-24 19:39:33 +0000
+++ b/mysql-test/suite/rpl/t/rpl_row_create_table.test	2009-09-23 20:37:24 +0000
@@ -1,9 +1,5 @@
 # Testing table creations for row-based replication.
 --source include/have_binlog_format_row.inc
-
-# -- [DISABLED Bug#45238]
---source include/not_windows.inc
-
 --source include/master-slave.inc
 --source include/have_innodb.inc
 connection slave;

=== modified file 'mysql-test/suite/rpl/t/rpl_stm_log.test'
--- a/mysql-test/suite/rpl/t/rpl_stm_log.test	2009-06-24 19:39:33 +0000
+++ b/mysql-test/suite/rpl/t/rpl_stm_log.test	2009-09-23 20:37:24 +0000
@@ -1,10 +1,6 @@
 # Requires statement logging
 
 -- source include/have_binlog_format_mixed_or_statement.inc
-
-# -- [DISABLED Bug#45238]
---source include/not_windows.inc
-
 -- source include/master-slave.inc
 let $engine_type=MyISAM;
 -- source extra/rpl_tests/rpl_log.test

=== modified file 'mysql-test/suite/rpl/t/rpl_temporary.test'
--- a/mysql-test/suite/rpl/t/rpl_temporary.test	2009-06-24 19:39:33 +0000
+++ b/mysql-test/suite/rpl/t/rpl_temporary.test	2009-09-23 20:37:24 +0000
@@ -1,9 +1,5 @@
 # Test need anonymous user when connection are made as "zedjzlcsjhd"
 source include/add_anonymous_users.inc;
-
-# -- [DISABLED Bug#45238]
---source include/not_windows.inc
-
 -- source include/master-slave.inc
 
 # Clean up old slave's binlogs.

=== modified file 'mysql-test/suite/rpl/t/rpl_truncate_3innodb.test'
--- a/mysql-test/suite/rpl/t/rpl_truncate_3innodb.test	2009-06-24 19:39:33 +0000
+++ b/mysql-test/suite/rpl/t/rpl_truncate_3innodb.test	2009-09-23 20:37:24 +0000
@@ -1,10 +1,4 @@
-
 --source include/have_innodb.inc
 --source include/not_ndb_default.inc
-
-# -- [DISABLED Bug#45238]
---source include/not_windows.inc
-
-
 let $engine=InnoDB;
 --source extra/rpl_tests/rpl_truncate.test

=== modified file 'mysql-test/t/delayed.test'
--- a/mysql-test/t/delayed.test	2009-03-11 17:17:00 +0000
+++ b/mysql-test/t/delayed.test	2009-09-25 11:03:29 +0000
@@ -338,3 +338,38 @@ drop table t1;
 set global low_priority_updates = @old_delayed_updates;
 
 --echo End of 5.1 tests
+
+
+
+--echo #
+--echo # Bug #47274 assert in open_table on CREATE TABLE <already existing>
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+--enable_warnings
+
+CREATE TABLE t1 ( f1 INTEGER AUTO_INCREMENT, PRIMARY KEY (f1));
+
+--echo # The following CREATE TABLEs before gave an assert.
+
+INSERT DELAYED t1 VALUES (4);
+--error ER_TABLE_EXISTS_ERROR
+CREATE TABLE t1 AS SELECT 1 AS f1;
+
+REPLACE DELAYED t1 VALUES (5);
+--error ER_TABLE_EXISTS_ERROR
+CREATE TABLE t1 AS SELECT 1 AS f1;
+
+INSERT DELAYED t1 VALUES (6);
+--error ER_TABLE_EXISTS_ERROR
+CREATE TABLE t1 (f1 INTEGER);
+
+CREATE TABLE t2 (f1 INTEGER);
+INSERT DELAYED t1 VALUES (7);
+--error ER_TABLE_EXISTS_ERROR
+CREATE TABLE t1 LIKE t2;
+
+DROP TABLE t2;
+DROP TABLE t1;

=== modified file 'mysql-test/t/disabled.def'
--- a/mysql-test/t/disabled.def	2009-09-29 08:40:52 +0000
+++ b/mysql-test/t/disabled.def	2009-09-29 15:03:12 +0000
@@ -12,8 +12,6 @@
 kill                 : Bug#37780 2008-12-03 HHunger need some changes to be robust enough for pushbuild.
 innodb_bug39438      : Bug#42383 2009-01-28 lsoares "This fails in embedded and on windows.  Note that this test is not run on windows and on embedded in PB for main trees currently"
 query_cache_28249    : Bug#43861 2009-03-25 main.query_cache_28249 fails sporadically
-information_schema   : Bug#42893 2009-03-26 alik main.information_schema times out sporadically
-skip_name_resolve    : Bug#43006 2009-06-25 alik main.skip_name_resolve fails on Windows in PB2
 mysql_locale_posix   : Bug#46131 2009-07-11 alik main.mysql_locale_posix fais, thus disabled
 partition_innodb_builtin : Bug#32430 2009-09-25 mattiasj Waiting for push of Innodb changes
 partition_innodb_plugin  : Bug#32430 2009-09-25 mattiasj Waiting for push of Innodb changes

=== modified file 'mysql-test/t/explain.test'
--- a/mysql-test/t/explain.test	2009-09-04 08:14:01 +0000
+++ b/mysql-test/t/explain.test	2009-09-21 12:56:38 +0000
@@ -1,5 +1,5 @@
 #
-# Test of different EXPLAIN's
+# Test of different EXPLAINs
 
 --disable_warnings
 drop table if exists t1;
@@ -175,3 +175,18 @@ explain select 1;
 --disable_metadata
 
 --echo End of 5.2 tests.
+
+--echo #
+--echo # Bug#46860: 
+--echo # Crash/segfault using EXPLAIN EXTENDED on query using UNION in subquery.
+--echo #
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table `t1` (`a` int);
+--error ER_NON_UNIQ_ERROR
+explain extended select 1 from `t1`, `t1` as `t2`
+where `t1`.`a`  > all ( (select `a` from `t1` ) union (select `a`) );
+drop table t1;
+
+--echo End of 6.0 tests.

=== modified file 'mysql-test/t/func_math.test'
--- a/mysql-test/t/func_math.test	2009-09-16 08:23:16 +0000
+++ b/mysql-test/t/func_math.test	2009-09-21 12:24:53 +0000
@@ -312,12 +312,14 @@ DROP TABLE t1;
 --echo End of 5.1 tests
 
 #
-# Bug #8457: Precision math: DIV returns incorrect result with large decimal value
-#
+# Bug #8457: Precision math:
+#            DIV returns incorrect result with large decimal value
+# Bug #46606:Casting error for large numbers in 5.4 when 'div' is used
 
 --error ER_WARN_DATA_OUT_OF_RANGE
 select 123456789012345678901234567890.123456789012345678901234567890 div 1 as x;
 --error ER_WARN_DATA_OUT_OF_RANGE
 select "123456789012345678901234567890.123456789012345678901234567890" div 1 as x; 
+SHOW WARNINGS;
 
 --echo End of 6.0 tests

=== modified file 'mysql-test/t/information_schema_db.test'
--- a/mysql-test/t/information_schema_db.test	2009-09-16 06:00:54 +0000
+++ b/mysql-test/t/information_schema_db.test	2009-09-29 11:50:14 +0000
@@ -184,7 +184,6 @@ show fields from testdb_1.v7;
 --error ER_TABLEACCESS_DENIED_ERROR
 show create view testdb_1.v7;
 
---error ER_VIEW_NO_EXPLAIN
 show create view v4;
 #--error ER_VIEW_NO_EXPLAIN
 show fields from v4;

=== added file 'mysql-test/t/innodb_mysql_sync.test'
--- a/mysql-test/t/innodb_mysql_sync.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/innodb_mysql_sync.test	2009-09-16 12:39:35 +0000
@@ -0,0 +1,48 @@
+#
+# Test file for InnoDB tests that require the debug sync facility
+#
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+# Save the initial number of concurrent sessions.
+--source include/count_sessions.inc
+
+
+--echo #
+--echo # Bug 42074 concurrent optimize table and 
+--echo # alter table = Assertion failed: thd->is_error()
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+--echo # Create InnoDB table
+CREATE TABLE t1 (id INT) engine=innodb;
+connect (con2, localhost, root);
+
+--echo # Connection 1
+--echo # Start optimizing table
+connection default;
+SET DEBUG_SYNC='ha_admin_try_alter SIGNAL optimize_started WAIT_FOR table_altered';
+--send OPTIMIZE TABLE t1
+
+--echo # Connection 2
+--echo # Change table to engine=memory
+connection con2;
+SET DEBUG_SYNC='now WAIT_FOR optimize_started';
+ALTER TABLE t1 engine=memory;
+SET DEBUG_SYNC='now SIGNAL table_altered';
+
+--echo # Connection 1
+--echo # Complete optimization
+connection default;
+--reap
+
+disconnect con2;
+DROP TABLE t1;
+SET DEBUG_SYNC='RESET';
+
+
+# Check that all connections opened by test cases in this file are really
+# gone so execution of other tests won't be affected by their presence.
+--source include/wait_until_count_sessions.inc

=== modified file 'mysql-test/t/join_cache.test'
--- a/mysql-test/t/join_cache.test	2009-09-04 06:58:24 +0000
+++ b/mysql-test/t/join_cache.test	2009-09-25 12:19:01 +0000
@@ -1645,6 +1645,47 @@ GROUP BY 1;
 
 DROP TABLE IF EXISTS t1, t2, t3;
 
+--echo #
+--echo # Bug #46328: Use of aggregate function without GROUP BY clause 
+--echo #             returns many rows (vs. one )
+--echo #             
+
+CREATE TABLE t1 (
+  int_key int(11) NOT NULL,
+  KEY int_key (int_key)
+);
+
+INSERT INTO t1 VALUES
+(0),(2),(2),(2),(3),(4),(5),(5),(6),(6),(8),(8),(9),(9);
+
+CREATE TABLE t2 (
+  int_key int(11) NOT NULL,
+  KEY int_key (int_key)
+);
+
+INSERT INTO t2 VALUES (2),(3);
+
+--echo
+
+--echo # The query shall return 1 record with a max value 9 and one of the 
+--echo # int_key values inserted above (undefined which one). A changed 
+--echo # execution plan may change the value in the second column
+SELECT  MAX(t1.int_key), t1.int_key
+FROM t1 STRAIGHT_JOIN t2  
+ORDER BY t1.int_key;
+
+--echo
+
+explain 
+SELECT  MAX(t1.int_key), t1.int_key
+FROM t1 STRAIGHT_JOIN t2  
+ORDER BY t1.int_key;
+
+--echo
+
+DROP TABLE t1,t2;
+
+SET join_cache_level=default;
 
 --echo #
 

=== modified file 'mysql-test/t/lock_multi.test'
--- a/mysql-test/t/lock_multi.test	2009-08-24 09:56:29 +0000
+++ b/mysql-test/t/lock_multi.test	2009-09-23 06:32:02 +0000
@@ -668,6 +668,63 @@ connection flush;
 connection default;
 disconnect flush;
 
+
+--echo #
+--echo # Bug#47249 assert in MDL_global_lock::is_lock_type_compatible
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP VIEW  IF EXISTS v1;
+--enable_warnings
+
+--echo #
+--echo # Test 1: LOCK TABLES v1 WRITE, t1 READ;
+--echo #
+
+CREATE TABLE t1 ( f1 integer );
+CREATE VIEW v1 AS SELECT f1 FROM t1 ;
+
+--echo # Connection 2
+connect (con2,localhost,root);
+LOCK TABLES v1 WRITE, t1 READ;
+FLUSH TABLE t1;
+disconnect con2;
+--source include/wait_until_disconnected.inc
+
+--echo # Connection 1
+connection default;
+LOCK TABLES t1 WRITE;
+FLUSH TABLE t1;                                    # Assertion happened here
+
+# Cleanup
+DROP TABLE t1;
+DROP VIEW v1;
+
+--echo #
+--echo # Test 2: LOCK TABLES t1 WRITE, v1 READ;
+--echo #
+
+CREATE TABLE t1 ( f1 integer );
+CREATE VIEW v1 AS SELECT f1 FROM t1 ;
+
+--echo # Connection 2
+connect (con2,localhost,root);
+LOCK TABLES t1 WRITE, v1 READ;
+FLUSH TABLE t1;
+disconnect con2;
+--source include/wait_until_disconnected.inc
+
+--echo # Connection 1
+connection default;
+LOCK TABLES t1 WRITE;
+FLUSH TABLE t1;                                    # Assertion happened here
+
+# Cleanup
+DROP TABLE t1;
+DROP VIEW v1;
+
+
 # Wait till all disconnects are completed
 --source include/wait_until_count_sessions.inc
 

=== modified file 'mysql-test/t/locktrans_innodb.test'
--- a/mysql-test/t/locktrans_innodb.test	2007-02-13 17:39:23 +0000
+++ b/mysql-test/t/locktrans_innodb.test	2009-09-25 10:48:44 +0000
@@ -18,3 +18,42 @@ let $nowait_support= 1;
 let $other_non_trans_engine_type= MyISAM;
 
 --source include/locktrans.inc
+
+
+--echo #
+--echo # Bug 46678 Transactional locks do not protect a table from 
+--echo #           concurrent DROP or RENAME 
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 ( i INT ) engine = innodb;
+
+--echo # Connection 1
+BEGIN;
+LOCK TABLES t1 IN EXCLUSIVE MODE;
+
+--echo # Connection 2
+connect(con2,localhost,root);
+connection con2;
+--echo # DROP TABLE should wait
+--send DROP TABLE t1
+
+--echo # Connection 1
+connection default;
+let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist
+                     WHERE state= 'Waiting for table' AND
+                           info= 'DROP TABLE t1';
+--source include/wait_condition.inc
+--echo # t1 should still exist
+SELECT * FROM t1;
+COMMIT;
+
+--echo # Connection 2
+connection con2;
+--reap
+
+--echo # Connection 1
+disconnect con2;

=== modified file 'mysql-test/t/mdl_sync.test'
--- a/mysql-test/t/mdl_sync.test	2009-09-01 15:57:05 +0000
+++ b/mysql-test/t/mdl_sync.test	2009-09-25 14:36:45 +0000
@@ -1,3 +1,6 @@
+# -- [DISABLED Bug#47304]
+--source include/not_embedded.inc
+
 #
 # We need the Debug Sync Facility.
 #

=== modified file 'mysql-test/t/merge.test'
--- a/mysql-test/t/merge.test	2009-09-16 05:36:47 +0000
+++ b/mysql-test/t/merge.test	2009-09-22 11:29:49 +0000
@@ -1859,6 +1859,45 @@ DROP TRIGGER t2_au;
 DROP FUNCTION f1;
 DROP TABLE tm1, t1, t2, t3, t4, t5;
 
+--echo #
+--echo # Bug47098 assert in MDL_context::destroy on HANDLER
+--echo #          <damaged merge table> OPEN
+--echo #
+--echo # Test that merge tables are closed correctly when opened using 
+--echo # HANDLER ... OPEN.
+--echo # The general case.
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2, t3;
+--enable_warnings
+--echo # Connection con1.
+connect (con1,localhost,root,,);
+CREATE TABLE t1 (c1 int);
+CREATE TABLE t2 (c1 int);
+CREATE TABLE t3 (c1 int) ENGINE = MERGE UNION (t1,t2);
+START TRANSACTION;
+--error ER_ILLEGAL_HA
+HANDLER t3 OPEN;
+DROP TABLE t1, t2, t3;
+--echo # Connection default.
+connection default;
+--echo # Disconnecting con1, all mdl_tickets must have been released.
+disconnect con1;
+--echo # The bug-specific case.
+--echo # Connection con1.
+connect (con1,localhost,root,,);
+CREATE TABLE t1 (c1 int);
+CREATE TABLE t2 (c1 int);
+CREATE TABLE t3 (c1 int) ENGINE = MERGE UNION (t1,t2);
+DROP TABLE t2;
+START TRANSACTION;
+--error ER_WRONG_MRG_TABLE
+HANDLER t3 OPEN;
+DROP TABLE t1, t3;
+--echo # Connection default.
+connection default;
+--echo # Disconnecting con1, all mdl_tickets must have been released.
+disconnect con1;
+
 --echo End of 6.0 tests
 
 --disable_result_log

=== modified file 'mysql-test/t/merge_recover.test'
--- a/mysql-test/t/merge_recover.test	2009-09-07 09:14:24 +0000
+++ b/mysql-test/t/merge_recover.test	2009-09-23 10:32:00 +0000
@@ -21,7 +21,7 @@ call mtr.add_suppression("MySQL thread i
 call mtr.add_suppression(" '\..test.t1'");
 
 set global table_open_cache=256;
-set global table_definition_cache=256;
+set global table_definition_cache=400;
 --disable_warnings
 drop procedure if exists p_create;
 --enable_warnings

=== added file 'mysql-test/t/partition_sync.test'
--- a/mysql-test/t/partition_sync.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/partition_sync.test	2009-09-23 06:39:50 +0000
@@ -0,0 +1,93 @@
+--source include/have_partition.inc
+--source include/have_debug.inc
+# Save the initial number of concurrent sessions.
+--source include/count_sessions.inc
+
+--echo #
+--echo # Bug #43867 ALTER TABLE on a partitioned table 
+--echo #            causes unnecessary deadlocks
+--echo #
+
+CREATE TABLE t1 (a int) PARTITION BY RANGE (a)
+(PARTITION p0 VALUES LESS THAN (1),
+ PARTITION p1 VALUES LESS THAN (2));
+
+INSERT INTO t1 VALUES (0),(1);
+
+connect(con1,localhost,root);
+
+--echo # Connection 2
+connection con1;
+BEGIN;
+SELECT * FROM t1;
+
+--echo # Connection 1
+connection default;
+--error ER_DROP_PARTITION_NON_EXISTENT
+ALTER TABLE t1 DROP PARTITION p3;
+
+--echo # Connection 2
+connection con1;
+--echo # This failed with deadlock and should not do so.
+SELECT * FROM t1;
+
+--echo # Connection 1
+connection default;
+disconnect con1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # Bug #46654 False deadlock on concurrent DML/DDL 
+--echo #            with partitions, inconsistent behavior
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS tbl_with_partitions;
+--enable_warnings
+
+CREATE TABLE tbl_with_partitions ( i INT ) 
+	PARTITION BY HASH(i);
+INSERT INTO tbl_with_partitions VALUES (1);
+
+connect(con2,localhost,root);
+connect(con3,localhost,root);
+
+--echo # Connection 3
+connection con3;
+LOCK TABLE tbl_with_partitions READ;
+
+--echo # Connection 1
+--echo # Access table with disabled autocommit
+connection default;
+SET AUTOCOMMIT = 0;
+SELECT * FROM tbl_with_partitions;
+
+--echo # Connection 2
+--echo # Alter table, abort after prepare
+connection con2;
+set session debug="+d,abort_copy_table";
+--error ER_LOCK_WAIT_TIMEOUT
+ALTER TABLE tbl_with_partitions ADD COLUMN f INT;
+
+--echo # Connection 1
+--echo # Try accessing the table after Alter aborted.
+--echo # This used to give ER_LOCK_DEADLOCK.
+connection default;
+SELECT * FROM tbl_with_partitions;
+
+--echo # Connection 3
+connection con3;
+UNLOCK TABLES;
+
+--echo # Connection 1
+--echo # Cleanup
+connection default;
+disconnect con2;
+disconnect con3;
+DROP TABLE tbl_with_partitions;
+
+
+# Check that all connections opened by test cases in this file are really
+# gone so execution of other tests won't be affected by their presence.
+--source include/wait_until_count_sessions.inc

=== modified file 'mysql-test/t/select.test'
--- a/mysql-test/t/select.test	2009-07-06 08:38:21 +0000
+++ b/mysql-test/t/select.test	2009-09-03 12:50:59 +0000
@@ -3938,4 +3938,29 @@ SELECT B.`time_key` FROM B LEFT JOIN BB 
 drop table A,AA,B,BB;
 --echo # end of test#45266
 
+--echo #
+--echo # Bug#45277: Lost HAVING clause led to a wrong result.
+--echo #
+CREATE TABLE `CC` (
+  `int_nokey` int(11) NOT NULL,
+  `int_key` int(11) NOT NULL,
+  `varchar_key` varchar(1) NOT NULL,
+  `varchar_nokey` varchar(1) NOT NULL,
+  KEY `int_key` (`int_key`),
+  KEY `varchar_key` (`varchar_key`)
+);
+INSERT INTO `CC` VALUES
+(0,8,'q','q'),(5,8,'m','m'),(7,3,'j','j'),(1,2,'z','z'),(8,2,'a','a'),(2,6,'',''),(1,8,'e'
+,'e'),(8,9,'t','t'),(5,2,'q','q'),(4,6,'b','b'),(5,5,'w','w'),(3,2,'m','m'),(0,4,'x','x'),
+(8,9,'',''),(0,6,'w','w'),(4,5,'x','x'),(0,0,'e','e'),(0,0,'e','e'),(2,8,'p','p'),(0,0,'x'
+,'x');
+EXPLAIN SELECT `varchar_nokey` G1  FROM CC  WHERE `int_nokey` AND `int_key`  <= 4
+  HAVING G1  ORDER  BY `varchar_key` LIMIT  6   ;
+
+SELECT `varchar_nokey` G1  FROM CC  WHERE `int_nokey` AND `int_key`  <= 4
+  HAVING G1  ORDER  BY `varchar_key` LIMIT  6   ;
+
+DROP TABLE CC;
+--echo # End of test#45277
+
 --echo End of 6.0 tests

=== modified file 'mysql-test/t/sp-error.test'
--- a/mysql-test/t/sp-error.test	2009-05-29 08:09:00 +0000
+++ b/mysql-test/t/sp-error.test	2009-09-20 14:42:51 +0000
@@ -2517,3 +2517,33 @@ SELECT AVG (a) FROM t1 WHERE b = 999999;
 --error ER_SP_DOES_NOT_EXIST
 SELECT non_existent (a) FROM t1 WHERE b = 999999;
 DROP TABLE t1;
+
+
+
+#
+# Bug #46374 crash, INSERT INTO t1 uses function, function modifies t1
+#
+CREATE TABLE t1 ( f2 INTEGER, f3 INTEGER );
+INSERT INTO t1 VALUES  ( 1, 1 );
+
+delimiter |;
+
+CREATE FUNCTION func_1 () RETURNS INTEGER
+BEGIN
+  INSERT INTO t1 SELECT * FROM t1 ;
+  RETURN 1 ;
+END|
+
+delimiter ;|
+
+# The bug caused the following INSERT statement to trigger
+# an assertion.   Error 1442 is the correct response
+#
+--error 1442
+INSERT INTO t1 SELECT * FROM (SELECT 2 AS f1, 2 AS f2) AS A WHERE func_1() = 5;
+
+# Cleanup
+DROP FUNCTION func_1;
+DROP TABLE t1;
+
+

=== modified file 'mysql-test/t/view.test'
--- a/mysql-test/t/view.test	2009-09-16 08:23:16 +0000
+++ b/mysql-test/t/view.test	2009-09-25 14:38:12 +0000
@@ -1,3 +1,4 @@
+
 --disable_warnings
 drop table if exists t1,t2,t3,t4,t9,`t1a``b`,v1,v2,v3,v4,v5,v6;
 drop view if exists t1,t2,`t1a``b`,v1,v2,v3,v4,v5,v6;
@@ -3966,3 +3967,47 @@ DELETE FROM v3;
 
 DROP VIEW v1,v2,v3;
 DROP TABLE t1,t2;
+
+
+--echo #
+--echo # Bug #47335 assert in get_table_share
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP VIEW IF EXISTS v1;
+--enable_warnings
+
+CREATE TEMPORARY TABLE t1 (id INT);
+--error ER_NO_SUCH_TABLE
+ALTER VIEW t1 AS SELECT 1 AS f1;
+DROP TABLE t1;
+
+CREATE VIEW v1 AS SELECT 1 AS f1;
+CREATE TEMPORARY TABLE v1 (id INT);
+ALTER VIEW v1 AS SELECT 2 AS f1;
+DROP TABLE v1;
+SELECT * FROM v1;
+DROP VIEW v1;
+
+
+--echo #
+--echo # Bug #47635 assert in start_waiting_global_read_lock 
+--echo #            during CREATE VIEW
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2;
+DROP VIEW IF EXISTS t2;
+--enable_warnings
+
+CREATE TABLE t1 (f1 integer);
+CREATE TEMPORARY TABLE IF NOT EXISTS t1 (f1 integer);
+CREATE TEMPORARY TABLE t2 (f1 integer);
+DROP TABLE t1;
+FLUSH TABLES WITH READ LOCK;
+--error ER_CANT_UPDATE_WITH_READLOCK
+CREATE VIEW t2 AS SELECT * FROM t1;
+
+UNLOCK TABLES;
+DROP TABLE t1, t2;

=== modified file 'mysql-test/t/view_grant.test'
--- a/mysql-test/t/view_grant.test	2009-08-21 14:47:56 +0000
+++ b/mysql-test/t/view_grant.test	2009-09-29 11:50:14 +0000
@@ -1379,6 +1379,127 @@ DROP VIEW test.v3;
 DROP USER mysqluser1@localhost;
 USE test;
 
+--echo #
+--echo # Bug#35996: SELECT + SHOW VIEW should be enough to display view 
+--echo # definition
+--echo #
+-- source include/not_embedded.inc
+CREATE USER mysqluser1@localhost;
+CREATE DATABASE mysqltest1;
+CREATE DATABASE mysqltest2;
+GRANT USAGE, SELECT, CREATE VIEW, SHOW VIEW 
+ON mysqltest2.* TO mysqluser1@localhost;
+
+USE mysqltest1;
+
+CREATE TABLE t1( a INT );
+CREATE TABLE t2( a INT, b INT );
+CREATE FUNCTION f1() RETURNS INT RETURN 1;
+CREATE VIEW v1 AS SELECT 1 AS a;
+CREATE VIEW v2 AS SELECT 1 AS a, 2 AS b;
+
+GRANT SELECT        ON TABLE    t1 TO mysqluser1@localhost;
+GRANT SELECT (a, b) ON TABLE    t2 TO mysqluser1@localhost;
+GRANT EXECUTE       ON FUNCTION f1 TO mysqluser1@localhost;
+GRANT SELECT        ON TABLE    v1 TO mysqluser1@localhost;
+GRANT SELECT (a, b) ON TABLE    v2 TO mysqluser1@localhost;
+
+CREATE VIEW v_t1 AS SELECT * FROM t1;
+CREATE VIEW v_t2 AS SELECT * FROM t2;
+CREATE VIEW v_f1 AS SELECT f1() AS a;
+CREATE VIEW v_v1 AS SELECT * FROM v1;
+CREATE VIEW v_v2 AS SELECT * FROM v2;
+
+GRANT SELECT, SHOW VIEW ON v_t1 TO mysqluser1@localhost;
+GRANT SELECT, SHOW VIEW ON v_t2 TO mysqluser1@localhost;
+GRANT SELECT, SHOW VIEW ON v_f1 TO mysqluser1@localhost;
+GRANT SELECT, SHOW VIEW ON v_v1 TO mysqluser1@localhost;
+GRANT SELECT, SHOW VIEW ON v_v2 TO mysqluser1@localhost;
+
+--connect (connection1, localhost, mysqluser1,, mysqltest2)
+CREATE VIEW v_mysqluser1_t1 AS SELECT * FROM mysqltest1.t1;
+CREATE VIEW v_mysqluser1_t2 AS SELECT * FROM mysqltest1.t2;
+CREATE VIEW v_mysqluser1_f1 AS SELECT mysqltest1.f1() AS a;
+CREATE VIEW v_mysqluser1_v1 AS SELECT * FROM mysqltest1.v1;
+CREATE VIEW v_mysqluser1_v2 AS SELECT * FROM mysqltest1.v2;
+
+SHOW CREATE VIEW mysqltest1.v_t1;
+SHOW CREATE VIEW mysqltest1.v_t2;
+SHOW CREATE VIEW mysqltest1.v_f1;
+SHOW CREATE VIEW mysqltest1.v_v1;
+SHOW CREATE VIEW mysqltest1.v_v2;
+
+SHOW CREATE VIEW v_mysqluser1_t1;
+SHOW CREATE VIEW v_mysqluser1_t2;
+SHOW CREATE VIEW v_mysqluser1_f1;
+SHOW CREATE VIEW v_mysqluser1_v1;
+SHOW CREATE VIEW v_mysqluser1_v2;
+
+--connection default
+REVOKE SELECT     ON TABLE    t1 FROM mysqluser1@localhost;
+REVOKE SELECT (a) ON TABLE    t2 FROM mysqluser1@localhost;
+REVOKE EXECUTE    ON FUNCTION f1 FROM mysqluser1@localhost;
+REVOKE SELECT     ON TABLE    v1 FROM mysqluser1@localhost;
+
+--connection connection1
+SHOW CREATE VIEW mysqltest1.v_t1;
+SHOW CREATE VIEW mysqltest1.v_t2;
+SHOW CREATE VIEW mysqltest1.v_f1;
+SHOW CREATE VIEW mysqltest1.v_v1;
+SHOW CREATE VIEW mysqltest1.v_v2;
+
+SHOW CREATE VIEW v_mysqluser1_t1;
+SHOW CREATE VIEW v_mysqluser1_t2;
+SHOW CREATE VIEW v_mysqluser1_f1;
+SHOW CREATE VIEW v_mysqluser1_v1;
+SHOW CREATE VIEW v_mysqluser1_v2;
+
+--connection default
+--echo # Testing the case when the views reference missing objects.
+--echo # Obviously, there are no privileges to check for, so we
+--echo # need only each object type once.
+DROP TABLE t1;
+DROP FUNCTION f1;
+DROP VIEW v1;
+
+--connection connection1
+SHOW CREATE VIEW mysqltest1.v_t1;
+SHOW CREATE VIEW mysqltest1.v_f1;
+SHOW CREATE VIEW mysqltest1.v_v1;
+
+SHOW CREATE VIEW v_mysqluser1_t1;
+SHOW CREATE VIEW v_mysqluser1_f1;
+SHOW CREATE VIEW v_mysqluser1_v1;
+
+--connection default
+REVOKE SHOW VIEW ON v_t1 FROM mysqluser1@localhost;
+REVOKE SHOW VIEW ON v_f1 FROM mysqluser1@localhost;
+REVOKE SHOW VIEW ON v_v1 FROM mysqluser1@localhost;
+
+--connection connection1
+--error ER_TABLEACCESS_DENIED_ERROR
+SHOW CREATE VIEW mysqltest1.v_t1;
+--error ER_TABLEACCESS_DENIED_ERROR
+SHOW CREATE VIEW mysqltest1.v_f1;
+--error ER_TABLEACCESS_DENIED_ERROR
+SHOW CREATE VIEW mysqltest1.v_v1;
+SHOW CREATE VIEW v_mysqluser1_t1;
+SHOW CREATE VIEW v_mysqluser1_f1;
+SHOW CREATE VIEW v_mysqluser1_v1;
+
+--disconnect connection1
+--connection default
+DROP USER mysqluser1@localhost;
+DROP DATABASE mysqltest1;
+DROP DATABASE mysqltest2;
+USE test;
+
+CREATE TABLE t1( a INT );
+CREATE DEFINER = no_such_user@no_such_host VIEW v1 AS SELECT * FROM t1;
+SHOW CREATE VIEW v1;
+DROP TABLE t1;
+DROP VIEW v1;
+
 # Wait till we reached the initial number of concurrent sessions
 --source include/wait_until_count_sessions.inc
 

=== modified file 'sql/authors.h'
--- a/sql/authors.h	2009-06-22 09:36:50 +0000
+++ b/sql/authors.h	2009-09-25 14:15:30 +0000
@@ -39,6 +39,7 @@ struct show_table_authors_st {
 struct show_table_authors_st show_table_authors[]= {
   { "Brian (Krow) Aker", "Seattle, WA, USA",
     "Architecture, archive, federated, bunch of little stuff :)" },
+  { "Marc Alff", "Denver, CO, USA", "Signal, Resignal" },
   { "Venu Anuganti", "", "Client/server protocol (4.1)" },
   { "David Axmark", "Uppsala, Sweden",
     "Small stuff long time ago, Monty ripped it out!" },

=== modified file 'sql/item_sum.cc'
--- a/sql/item_sum.cc	2009-08-24 20:19:13 +0000
+++ b/sql/item_sum.cc	2009-09-27 20:39:24 +0000
@@ -839,7 +839,7 @@ bool Aggregator_distinct::setup(THD *thd
     DBUG_ENTER("Item_sum_distinct::setup");
     /* It's legal to call setup() more than once when in a subquery */
     if (tree)
-      return FALSE;
+      DBUG_RETURN(FALSE);
 
     /*
       Virtual table and the tree are created anew on each re-execution of
@@ -847,7 +847,7 @@ bool Aggregator_distinct::setup(THD *thd
       mem_root.
     */
     if (field_list.push_back(&field_def))
-      return TRUE;
+      DBUG_RETURN(TRUE);
 
     item_sum->null_value= item_sum->maybe_null= 1;
     item_sum->quick_group= 0;
@@ -862,7 +862,7 @@ bool Aggregator_distinct::setup(THD *thd
     }
 
     if (always_null)
-      return FALSE;
+      DBUG_RETURN(FALSE);
 
     enum enum_field_types field_type;
 
@@ -875,7 +875,7 @@ bool Aggregator_distinct::setup(THD *thd
                                  item_sum->get_arg(0)->unsigned_flag);
 
     if (! (table= create_virtual_tmp_table(thd, field_list)))
-      return TRUE;
+      DBUG_RETURN(TRUE);
 
     /* XXX: check that the case of CHAR(0) works OK */
     tree_key_length= table->s->reclength - table->s->null_bytes;

=== modified file 'sql/lex.h'
--- a/sql/lex.h	2009-08-26 09:14:05 +0000
+++ b/sql/lex.h	2009-09-25 14:15:30 +0000
@@ -424,7 +424,7 @@ static SYMBOL symbols[] = {
   { "PREV",		SYM(PREV_SYM)},
   { "PRIMARY",		SYM(PRIMARY_SYM)},
   { "PRIVILEGES",	SYM(PRIVILEGES)},
-  { "PROCEDURE",	SYM(PROCEDURE)},
+  { "PROCEDURE",	SYM(PROCEDURE_SYM)},
   { "PROCESS"	,	SYM(PROCESS)},
   { "PROCESSLIST",	SYM(PROCESSLIST_SYM)},
   { "PROFILE",    SYM(PROFILE_SYM)},

=== modified file 'sql/lock.cc'
--- a/sql/lock.cc	2009-09-14 16:03:38 +0000
+++ b/sql/lock.cc	2009-09-25 10:48:44 +0000
@@ -968,7 +968,8 @@ bool lock_table_names(THD *thd, TABLE_LI
   DEBUG_SYNC(thd, "before_wait_locked_tname");
   for (lock_table= table_list; lock_table; lock_table= lock_table->next_local)
   {
-    lock_table->mdl_request.init(MDL_TABLE, lock_table->db, lock_table->table_name,
+    lock_table->mdl_request.init(MDL_key::TABLE,
+                                 lock_table->db, lock_table->table_name,
                                  MDL_EXCLUSIVE);
     mdl_requests.push_front(&lock_table->mdl_request);
   }
@@ -1510,10 +1511,13 @@ int try_transactional_lock(THD *thd, TAB
 {
   uint          dummy_counter;
   int           error;
-  int           result= 0;
   DBUG_ENTER("try_transactional_lock");
 
-  /* Need to open the tables to be able to access engine methods. */
+  /*
+     Need to open the tables to be able to access engine methods.
+     This will also take MDL_SHARED locks to prevent ddl operations
+     from other connections.
+  */
   if (open_tables(thd, &table_list, &dummy_counter, 0))
   {
     /* purecov: begin tested */
@@ -1525,37 +1529,32 @@ int try_transactional_lock(THD *thd, TAB
   /* Required by InnoDB. */
   thd->in_lock_tables= TRUE;
 
-  if ((error= set_handler_table_locks(thd, table_list, TRUE)))
+  error= set_handler_table_locks(thd, table_list, TRUE);
+  if (error == HA_ERR_WRONG_COMMAND)
   {
     /*
-      Not all transactional locks could be taken. If the error was
-      something else but "unsupported by storage engine", abort the
-      execution of this statement.
-    */
-    if (error != HA_ERR_WRONG_COMMAND)
-    {
-      DBUG_PRINT("lock_info", ("aborting, lock_table failed"));
-      result= -1;
-      goto err;
-    }
-    /*
       Fall back to non-transactional locks because transactional locks
       are unsupported by a storage engine. No need to unlock the
       successfully taken transactional locks. They go away at end of
       transaction anyway.
     */
     DBUG_PRINT("lock_info", ("fall back to non-trans lock: no SE support"));
-    result= 1;
+    /* Tables will be reopened when taking non-transactional locks. */
+    close_tables_for_reopen(thd, &table_list);
+  }
+  else
+  {
+    /* We need to explicitly commit if autocommit mode is active. */
+    trans_commit_stmt(thd);
+    /*
+       Close the tables. The locks (if taken) persist in the storage engines
+       and in the MDL subsystem.
+    */
+    close_thread_tables(thd);
   }
 
- err:
-  /* We need to explicitly commit if autocommit mode is active. */
-  trans_commit_stmt(thd);
-  /* Close the tables. The locks (if taken) persist in the storage engines. */
-  close_tables_for_reopen(thd, &table_list);
   thd->in_lock_tables= FALSE;
-  DBUG_PRINT("lock_info", ("result: %d", result));
-  DBUG_RETURN(result);
+  DBUG_RETURN(error == HA_ERR_WRONG_COMMAND ? 1 : -test(error));
 }
 
 

=== modified file 'sql/mdl.cc'
--- a/sql/mdl.cc	2009-08-25 07:22:47 +0000
+++ b/sql/mdl.cc	2009-09-23 06:32:02 +0000
@@ -307,7 +307,7 @@ void MDL_context::merge(MDL_context *src
   @param  mdl_type       The MDL lock type for the request.
 */
 
-void MDL_request::init(enum_mdl_namespace mdl_namespace,
+void MDL_request::init(MDL_key::enum_mdl_namespace mdl_namespace,
                        const char *db_arg,
                        const char *name_arg,
                        enum enum_mdl_type mdl_type_arg)
@@ -319,6 +319,24 @@ void MDL_request::init(enum_mdl_namespac
 
 
 /**
+  Initialize a lock request using pre-built MDL_key.
+
+  @sa MDL_request::init(namespace, db, name, type).
+
+  @param key_arg       The pre-built MDL key for the request.
+  @param mdl_type_arg  The MDL lock type for the request.
+*/
+
+void MDL_request::init(const MDL_key *key_arg,
+                       enum enum_mdl_type mdl_type_arg)
+{
+  key.mdl_key_init(key_arg);
+  type= mdl_type_arg;
+  ticket= NULL;
+}
+
+
+/**
   Allocate and initialize one lock request.
 
   Same as mdl_init_lock(), but allocates the lock and the key buffer
@@ -337,7 +355,7 @@ void MDL_request::init(enum_mdl_namespac
 */
 
 MDL_request *
-MDL_request::create(enum_mdl_namespace mdl_namespace, const char *db,
+MDL_request::create(MDL_key::enum_mdl_namespace mdl_namespace, const char *db,
                     const char *name, enum_mdl_type mdl_type,
                     MEM_ROOT *root)
 {
@@ -1005,6 +1023,9 @@ MDL_ticket::upgrade_shared_lock_to_exclu
   if (m_type == MDL_EXCLUSIVE)
     DBUG_RETURN(FALSE);
 
+  /* Only allow upgrades from MDL_SHARED_UPGRADABLE */
+  DBUG_ASSERT(m_type == MDL_SHARED_UPGRADABLE);
+
   pthread_mutex_lock(&LOCK_mdl);
 
   old_msg= MDL_ENTER_COND(thd, mysys_var);
@@ -1254,7 +1275,7 @@ void MDL_context::release_ticket(MDL_tic
   MDL_lock *lock= ticket->m_lock;
   DBUG_ENTER("release_ticket");
   DBUG_PRINT("enter", ("db=%s name=%s", lock->key.db_name(),
-                                        lock->key.table_name()));
+                                        lock->key.name()));
 
   safe_mutex_assert_owner(&LOCK_mdl);
 
@@ -1426,7 +1447,7 @@ void MDL_context::release_global_shared_
 */
 
 bool
-MDL_context::is_exclusive_lock_owner(enum_mdl_namespace mdl_namespace,
+MDL_context::is_exclusive_lock_owner(MDL_key::enum_mdl_namespace mdl_namespace,
                                      const char *db, const char *name)
 {
   MDL_request mdl_request;
@@ -1452,7 +1473,7 @@ MDL_context::is_exclusive_lock_owner(enu
 */
 
 bool
-MDL_context::is_lock_owner(enum_mdl_namespace mdl_namespace,
+MDL_context::is_lock_owner(MDL_key::enum_mdl_namespace mdl_namespace,
                            const char *db, const char *name)
 {
   MDL_key key(mdl_namespace, db, name);
@@ -1526,7 +1547,7 @@ MDL_ticket::set_cached_object(void *cach
 {
   DBUG_ENTER("mdl_set_cached_object");
   DBUG_PRINT("enter", ("db=%s name=%s cached_object=%p",
-                        m_lock->key.db_name(), m_lock->key.table_name(),
+                        m_lock->key.db_name(), m_lock->key.name(),
                         cached_object));
   /*
     TODO: This assumption works now since we do get_cached_object()

=== modified file 'sql/mdl.h'
--- a/sql/mdl.h	2009-08-25 07:22:47 +0000
+++ b/sql/mdl.h	2009-09-23 06:32:02 +0000
@@ -47,15 +47,6 @@ enum enum_mdl_type {MDL_SHARED=0, MDL_SH
 
 enum enum_mdl_state { MDL_PENDING, MDL_ACQUIRED };
 
-/**
-  Object namespaces
- 
-  Different types of objects exist in different namespaces
-   - MDL_TABLE is for tables and views.
-   - MDL_PROCEDURE is for stored procedures, stored functions and UDFs.
-*/
-enum enum_mdl_namespace { MDL_TABLE=0, MDL_PROCEDURE };
-
 /** Maximal length of key for metadata locking subsystem. */
 #define MAX_MDLKEY_LENGTH (1 + NAME_LEN + 1 + NAME_LEN + 1)
 
@@ -72,14 +63,34 @@ enum enum_mdl_namespace { MDL_TABLE=0, M
 class MDL_key
 {
 public:
+  /**
+    Object namespaces
+
+    Different types of objects exist in different namespaces
+     - TABLE is for tables and views.
+     - FUNCTION is for stored functions.
+     - PROCEDURE is for stored procedures.
+     - TRIGGER is for triggers.
+    Note that although there isn't metadata locking on triggers,
+    it's necessary to have a separate namespace for them since
+    MDL_key is also used outside of the MDL subsystem.
+  */
+  enum enum_mdl_namespace { TABLE=0,
+                            FUNCTION,
+                            PROCEDURE,
+                            TRIGGER };
+
   const uchar *ptr() const { return (uchar*) m_ptr; }
   uint length() const { return m_length; }
 
   const char *db_name() const { return m_ptr + 1; }
   uint db_name_length() const { return m_db_name_length; }
 
-  const char *table_name() const { return m_ptr + m_db_name_length + 2; }
-  uint table_name_length() const { return m_length - m_db_name_length - 3; }
+  const char *name() const { return m_ptr + m_db_name_length + 2; }
+  uint name_length() const { return m_length - m_db_name_length - 3; }
+
+  enum_mdl_namespace mdl_namespace() const
+  { return (enum_mdl_namespace)(m_ptr[0]); }
 
   /**
     Construct a metadata lock key from a triplet (mdl_namespace, database and name).
@@ -177,8 +188,10 @@ public:
   MDL_key key;
 
 public:
-  void init(enum_mdl_namespace namespace_arg, const char *db_arg, const char *name_arg,
+  void init(MDL_key::enum_mdl_namespace namespace_arg,
+            const char *db_arg, const char *name_arg,
             enum_mdl_type mdl_type_arg);
+  void init(const MDL_key *key_arg, enum_mdl_type mdl_type_arg);
   /** Set type of lock request. Can be only applied to pending locks. */
   inline void set_type(enum_mdl_type type_arg)
   {
@@ -187,9 +200,9 @@ public:
   }
   bool is_shared() const { return type < MDL_EXCLUSIVE; }
 
-  static MDL_request *create(enum_mdl_namespace mdl_namespace, const char *db,
-                             const char *name, enum_mdl_type mdl_type,
-                             MEM_ROOT *root);
+  static MDL_request *create(MDL_key::enum_mdl_namespace mdl_namespace,
+                             const char *db, const char *name,
+                             enum_mdl_type mdl_type, MEM_ROOT *root);
 
   /*
     This is to work around the ugliness of TABLE_LIST
@@ -254,6 +267,10 @@ public:
                          mdl_cached_object_release_hook release_hook);
   const MDL_context *get_ctx() const { return m_ctx; }
   bool is_shared() const { return m_type < MDL_EXCLUSIVE; }
+  bool is_upgradable_or_exclusive() const
+  {
+    return m_type == MDL_SHARED_UPGRADABLE || m_type == MDL_EXCLUSIVE;
+  }
   bool upgrade_shared_lock_to_exclusive();
   void downgrade_exclusive_lock();
 private:
@@ -327,10 +344,11 @@ public:
   void release_lock(MDL_ticket *ticket);
   void release_global_shared_lock();
 
-  bool is_exclusive_lock_owner(enum_mdl_namespace mdl_namespace,
+  bool is_exclusive_lock_owner(MDL_key::enum_mdl_namespace mdl_namespace,
                                const char *db,
                                const char *name);
-  bool is_lock_owner(enum_mdl_namespace mdl_namespace, const char *db, const char *name);
+  bool is_lock_owner(MDL_key::enum_mdl_namespace mdl_namespace,
+                     const char *db, const char *name);
 
   inline bool has_locks() const
   {

=== modified file 'sql/mysql_priv.h'
--- a/sql/mysql_priv.h	2009-09-29 08:40:52 +0000
+++ b/sql/mysql_priv.h	2009-09-29 15:03:12 +0000
@@ -337,7 +337,7 @@ enum open_table_mode
 #define TABLE_OPEN_CACHE_DEFAULT 400
 #define TABLE_DEF_CACHE_DEFAULT 400
 /**
-  We must have room for at least 256 table definitions in the table
+  We must have room for at least 400 table definitions in the table
   cache, since otherwise there is no chance prepared
   statements that use these many tables can work.
   Prepared statements use table definition cache ids (table_map_id)

=== modified file 'sql/protocol.cc'
--- a/sql/protocol.cc	2009-07-30 16:22:41 +0000
+++ b/sql/protocol.cc	2009-09-25 14:15:30 +0000
@@ -827,12 +827,16 @@ bool Protocol::send_result_set_row(List<
 
   for (Item *item= it++; item; item= it++)
   {
-    if (item->send(this, &str_buffer) || thd->is_error())
+    if (item->send(this, &str_buffer))
     {
-      this->free();				// Free used buffer
-      my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0));
+      // If we're out of memory, reclaim some, to help us recover.
+      this->free();
       DBUG_RETURN(TRUE);
     }
+    // Item::send() may generate an error. If so, abort the loop.
+    if (thd->is_error())
+      DBUG_RETURN(TRUE);
+
     /*
       Reset str_buffer to its original state, as it may have been altered in
       Item::send().

=== modified file 'sql/si_objects.cc'
--- a/sql/si_objects.cc	2009-08-27 18:34:09 +0000
+++ b/sql/si_objects.cc	2009-09-16 13:25:29 +0000
@@ -1618,8 +1618,8 @@ Obj *View_base_obj_iterator::next()
   db_name.str= (char*) table_name_key->db_name();
   db_name.length= table_name_key->db_name_length();
 
-  table_name.str= (char*) table_name_key->table_name();
-  table_name.length= table_name_key->table_name_length();
+  table_name.str= (char*) table_name_key->name();
+  table_name.length= table_name_key->name_length();
 
   return create_obj(&db_name, &table_name);
 }

=== modified file 'sql/sp.cc'
--- a/sql/sp.cc	2009-08-14 15:22:05 +0000
+++ b/sql/sp.cc	2009-09-25 14:15:30 +0000
@@ -1396,8 +1396,8 @@ extern "C" uchar* sp_sroutine_key(const 
                                   my_bool first)
 {
   Sroutine_hash_entry *rn= (Sroutine_hash_entry *)ptr;
-  *plen= rn->key.length;
-  return (uchar *)rn->key.str;
+  *plen= rn->mdl_request.key.length();
+  return (uchar *)rn->mdl_request.key.ptr();
 }
 
 
@@ -1435,23 +1435,19 @@ extern "C" uchar* sp_sroutine_key(const 
 */
 
 bool sp_add_used_routine(Query_tables_list *prelocking_ctx, Query_arena *arena,
-                         const LEX_STRING *key, TABLE_LIST *belong_to_view)
+                         const MDL_key *key, TABLE_LIST *belong_to_view)
 {
   my_hash_init_opt(&prelocking_ctx->sroutines, system_charset_info,
                    Query_tables_list::START_SROUTINES_HASH_SIZE,
                    0, 0, sp_sroutine_key, 0, 0);
 
-  if (!my_hash_search(&prelocking_ctx->sroutines, (uchar *)key->str,
-                      key->length))
+  if (!my_hash_search(&prelocking_ctx->sroutines, key->ptr(), key->length()))
   {
     Sroutine_hash_entry *rn=
-      (Sroutine_hash_entry *)arena->alloc(sizeof(Sroutine_hash_entry) +
-                                          key->length + 1);
+      (Sroutine_hash_entry *)arena->alloc(sizeof(Sroutine_hash_entry));
     if (!rn)              // OOM. Error will be reported using fatal_error().
       return FALSE;
-    rn->key.length= key->length;
-    rn->key.str= (char *)rn + sizeof(Sroutine_hash_entry);
-    memcpy(rn->key.str, key->str, key->length + 1);
+    rn->mdl_request.init(key, MDL_SHARED);
     my_hash_insert(&prelocking_ctx->sroutines, (uchar *)rn);
     prelocking_ctx->sroutines_list.link_in_list((uchar *)rn, (uchar **)&rn->next);
     rn->belong_to_view= belong_to_view;
@@ -1482,8 +1478,10 @@ bool sp_add_used_routine(Query_tables_li
 void sp_add_used_routine(Query_tables_list *prelocking_ctx, Query_arena *arena,
                          sp_name *rt, char rt_type)
 {
-  rt->set_routine_type(rt_type);
-  (void)sp_add_used_routine(prelocking_ctx, arena, &rt->m_sroutines_key, 0);
+  MDL_key key((rt_type == TYPE_ENUM_FUNCTION) ? MDL_key::FUNCTION :
+                                                MDL_key::PROCEDURE,
+              rt->m_db.str, rt->m_name.str);
+  (void)sp_add_used_routine(prelocking_ctx, arena, &key, 0);
   prelocking_ctx->sroutines_list_own_last= prelocking_ctx->sroutines_list.next;
   prelocking_ctx->sroutines_list_own_elements=
                     prelocking_ctx->sroutines_list.elements;
@@ -1540,7 +1538,8 @@ void sp_update_sp_used_routines(HASH *ds
   for (uint i=0 ; i < src->records ; i++)
   {
     Sroutine_hash_entry *rt= (Sroutine_hash_entry *)my_hash_element(src, i);
-    if (!my_hash_search(dst, (uchar *)rt->key.str, rt->key.length))
+    if (!my_hash_search(dst, (uchar *)rt->mdl_request.key.ptr(),
+                        rt->mdl_request.key.length()))
       my_hash_insert(dst, (uchar *)rt);
   }
 }
@@ -1567,8 +1566,8 @@ sp_update_stmt_used_routines(THD *thd, Q
   for (uint i=0 ; i < src->records ; i++)
   {
     Sroutine_hash_entry *rt= (Sroutine_hash_entry *)my_hash_element(src, i);
-    (void)sp_add_used_routine(prelocking_ctx, thd->stmt_arena, &rt->key,
-                              belong_to_view);
+    (void)sp_add_used_routine(prelocking_ctx, thd->stmt_arena,
+                              &rt->mdl_request.key, belong_to_view);
   }
 }
 
@@ -1592,8 +1591,8 @@ void sp_update_stmt_used_routines(THD *t
 {
   for (Sroutine_hash_entry *rt= (Sroutine_hash_entry *)src->first;
        rt; rt= rt->next)
-    (void)sp_add_used_routine(prelocking_ctx, thd->stmt_arena, &rt->key,
-                              belong_to_view);
+    (void)sp_add_used_routine(prelocking_ctx, thd->stmt_arena,
+                              &rt->mdl_request.key, belong_to_view);
 }
 
 

=== modified file 'sql/sp.h'
--- a/sql/sp.h	2009-08-18 11:27:35 +0000
+++ b/sql/sp.h	2009-09-16 13:25:29 +0000
@@ -101,9 +101,10 @@ class Sroutine_hash_entry
 {
 public:
   /**
-    Set key consisting of one-byte routine type and quoted routine name.
+    Metadata lock request for routine.
+    MDL_key in this request is also used as a key for set.
   */
-  LEX_STRING key;
+  MDL_request mdl_request;
   /**
     Next element in list linking all routines in set. See also comments
     for LEX::sroutine/sroutine_list and sp_head::m_sroutines.
@@ -124,7 +125,7 @@ public:
 void sp_add_used_routine(Query_tables_list *prelocking_ctx, Query_arena *arena,
                          sp_name *rt, char rt_type);
 bool sp_add_used_routine(Query_tables_list *prelocking_ctx, Query_arena *arena,
-                         const LEX_STRING *key, TABLE_LIST *belong_to_view);
+                         const MDL_key *key, TABLE_LIST *belong_to_view);
 void sp_remove_not_own_routines(Query_tables_list *prelocking_ctx);
 void sp_update_sp_used_routines(HASH *dst, HASH *src);
 void sp_update_stmt_used_routines(THD *thd, Query_tables_list *prelocking_ctx,

=== modified file 'sql/sp_head.cc'
--- a/sql/sp_head.cc	2009-09-16 06:09:09 +0000
+++ b/sql/sp_head.cc	2009-09-25 14:15:30 +0000
@@ -381,31 +381,34 @@ sp_eval_expr(THD *thd, Field *result_fie
 }
 
 
-/*
- *
- *  sp_name
- *
- */
+/**
+  Create temporary sp_name object from MDL key.
+
+  @note The lifetime of this object is bound to the lifetime of the MDL_key.
+        This should be fine as sp_name objects created by this constructor
+        are mainly used for SP-cache lookups.
 
-sp_name::sp_name(THD *thd, char *key, uint key_len)
+  @param key         MDL key containing database and routine name.
+  @param qname_buff  Buffer to be used for storing quoted routine name
+                     (should be at least 2*NAME_LEN+1+1 bytes).
+*/
+
+sp_name::sp_name(const MDL_key *key, char *qname_buff)
 {
-  m_sroutines_key.str= key;
-  m_sroutines_key.length= key_len;
-  m_qname.str= ++key;
-  m_qname.length= key_len - 1;
-  if ((m_name.str= strchr(m_qname.str, '.')))
-  {
-    m_db.length= m_name.str - key;
-    m_db.str= strmake_root(thd->mem_root, key, m_db.length);
-    m_name.str++;
-    m_name.length= m_qname.length - m_db.length - 1;
+  m_db.str= (char*)key->db_name();
+  m_db.length= key->db_name_length();
+  m_name.str= (char*)key->name();
+  m_name.length= key->name_length();
+  m_qname.str= qname_buff;
+  if (m_db.length)
+  {
+    strxmov(qname_buff, m_db.str, ".", m_name.str, NullS);
+    m_qname.length= m_db.length + 1 + m_name.length;
   }
   else
   {
-    m_name.str= m_qname.str;
-    m_name.length= m_qname.length;
-    m_db.str= 0;
-    m_db.length= 0;
+    strmov(qname_buff, m_name.str);
+    m_qname.length= m_name.length;
   }
   m_explicit_name= false;
 }
@@ -418,12 +421,10 @@ void
 sp_name::init_qname(THD *thd)
 {
   const uint dot= !!m_db.length;
-  /* m_sroutines format: m_type + [database + dot] + name + nul */
-  m_sroutines_key.length= 1 + m_db.length + dot + m_name.length;
-  if (!(m_sroutines_key.str= (char*) thd->alloc(m_sroutines_key.length + 1)))
+  /* m_qname format: [database + dot] + name + '\0' */
+  m_qname.length= m_db.length + dot + m_name.length;
+  if (!(m_qname.str= (char*) thd->alloc(m_qname.length + 1)))
     return;
-  m_qname.length= m_sroutines_key.length - 1;
-  m_qname.str= m_sroutines_key.str + 1;
   sprintf(m_qname.str, "%.*s%.*s%.*s",
           (int) m_db.length, (m_db.length ? m_db.str : ""),
           dot, ".",
@@ -579,9 +580,6 @@ sp_head::init(LEX *lex)
   m_defstr.str= NULL;
   m_defstr.length= 0;
 
-  m_sroutines_key.str= NULL;
-  m_sroutines_key.length= 0;
-
   m_return_field_def.charset= NULL;
 
   DBUG_VOID_RETURN;
@@ -611,14 +609,10 @@ sp_head::init_sp_name(THD *thd, sp_name 
   if (spname->m_qname.length == 0)
     spname->init_qname(thd);
 
-  m_sroutines_key.length= spname->m_sroutines_key.length;
-  m_sroutines_key.str= (char*) memdup_root(thd->mem_root,
-                                           spname->m_sroutines_key.str,
-                                           spname->m_sroutines_key.length + 1);
-  m_sroutines_key.str[0]= static_cast<char>(m_type);
-
-  m_qname.length= m_sroutines_key.length - 1;
-  m_qname.str= m_sroutines_key.str + 1;
+  m_qname.length= spname->m_qname.length;
+  m_qname.str= (char*) memdup_root(thd->mem_root,
+                                   spname->m_qname.str,
+                                   spname->m_qname.length + 1);
 
   DBUG_VOID_RETURN;
 }
@@ -3975,7 +3969,8 @@ sp_head::add_used_tables_to_table_list(T
       table->prelocking_placeholder= 1;
       table->belong_to_view= belong_to_view;
       table->trg_event_map= stab->trg_event_map;
-      table->mdl_request.init(MDL_TABLE, table->db, table->table_name, MDL_SHARED);
+      table->mdl_request.init(MDL_key::TABLE, table->db, table->table_name,
+                              MDL_SHARED);
 
       /* Everyting else should be zeroed */
 
@@ -4019,7 +4014,8 @@ sp_add_to_query_tables(THD *thd, LEX *le
   table->lock_transactional= 1; /* allow transactional locks */
   table->select_lex= lex->current_select;
   table->cacheable_table= 1;
-  table->mdl_request.init(MDL_TABLE, table->db, table->table_name, MDL_SHARED);
+  table->mdl_request.init(MDL_key::TABLE, table->db, table->table_name,
+                          MDL_SHARED);
 
   lex->add_to_query_tables(table);
   return table;

=== modified file 'sql/sp_head.h'
--- a/sql/sp_head.h	2009-08-14 15:22:05 +0000
+++ b/sql/sp_head.h	2009-09-16 13:25:29 +0000
@@ -109,36 +109,21 @@ public:
   LEX_STRING m_db;
   LEX_STRING m_name;
   LEX_STRING m_qname;
-  /**
-    Key representing routine in the set of stored routines used by statement.
-    Consists of 1-byte routine type and m_qname (which usually refences to
-    same buffer). Note that one must complete initialization of the key by
-    calling set_routine_type().
-  */
-  LEX_STRING m_sroutines_key;
   bool       m_explicit_name;                   /**< Prepend the db name? */
 
   sp_name(LEX_STRING db, LEX_STRING name, bool use_explicit_name)
     : m_db(db), m_name(name), m_explicit_name(use_explicit_name)
   {
-    m_qname.str= m_sroutines_key.str= 0;
-    m_qname.length= m_sroutines_key.length= 0;
+    m_qname.str= 0;
+    m_qname.length= 0;
   }
 
-  /**
-    Creates temporary sp_name object from key, used mainly
-    for SP-cache lookups.
-  */
-  sp_name(THD *thd, char *key, uint key_len);
+  /** Create temporary sp_name object from MDL key. */
+  sp_name(const MDL_key *key, char *qname_buff);
 
   // Init. the qualified name from the db and name.
   void init_qname(THD *thd);	// thd for memroot allocation
 
-  void set_routine_type(char type)
-  {
-    m_sroutines_key.str[0]= type;
-  }
-
   ~sp_name()
   {}
 };
@@ -181,12 +166,6 @@ public:
   ulong m_sql_mode;		///< For SHOW CREATE and execution
   LEX_STRING m_qname;		///< db.name
   bool m_explicit_name;         ///< Prepend the db name? */
-  /**
-    Key representing routine in the set of stored routines used by statement.
-    [routine_type]db.name
-    @sa sp_name::m_sroutines_key
-  */
-  LEX_STRING m_sroutines_key;
   LEX_STRING m_db;
   LEX_STRING m_name;
   LEX_STRING m_params;

=== modified file 'sql/sql_acl.cc'
--- a/sql/sql_acl.cc	2009-08-31 20:25:11 +0000
+++ b/sql/sql_acl.cc	2009-09-29 15:12:18 +0000
@@ -4262,8 +4262,7 @@ bool check_column_grant_in_table_ref(THD
     db_name= table_ref->view_db.str;
     table_name= table_ref->view_name.str;
     if (table_ref->belong_to_view && 
-        (thd->lex->sql_command == SQLCOM_SHOW_FIELDS ||
-         thd->lex->sql_command == SQLCOM_SHOW_CREATE))
+        thd->lex->sql_command == SQLCOM_SHOW_FIELDS)
     {
       view_privs= get_column_grant(thd, grant, db_name, table_name, name);
       if (view_privs & VIEW_ANY_ACL)

=== modified file 'sql/sql_base.cc'
--- a/sql/sql_base.cc	2009-09-28 08:18:52 +0000
+++ b/sql/sql_base.cc	2009-09-29 15:03:12 +0000
@@ -125,6 +125,8 @@ static bool tdc_wait_for_old_versions(TH
 static bool
 has_two_write_locked_tables_with_auto_increment(TABLE_LIST *tables);
 
+TABLE *find_table_for_mdl_upgrade(TABLE *list, const char *db,
+                                  const char *table_name);
 
 uint cached_open_tables(void)
 {
@@ -469,7 +471,7 @@ TABLE_SHARE *get_table_share(THD *thd, T
     To be able perform any operation on table we should own
     some kind of metadata lock on it.
   */
-  DBUG_ASSERT(thd->mdl_context.is_lock_owner(MDL_TABLE, table_list->db,
+  DBUG_ASSERT(thd->mdl_context.is_lock_owner(MDL_key::TABLE, table_list->db,
                                              table_list->table_name));
 
   /* Read table definition from cache */
@@ -993,8 +995,8 @@ bool close_cached_tables(THD *thd, TABLE
          table_list= table_list->next_global)
     {
       /* A check that the table was locked for write is done by the caller. */
-      TABLE *table= find_locked_table(thd->open_tables, table_list->db,
-                                      table_list->table_name);
+      TABLE *table= find_table_for_mdl_upgrade(thd->open_tables, table_list->db,
+                                               table_list->table_name);
 
       /* May return NULL if this table has already been closed via an alias. */
       if (! table)
@@ -1526,8 +1528,8 @@ bool close_thread_table(THD *thd, TABLE 
   *table_ptr=table->next;
 
   table->mdl_ticket= NULL;
-  if (table->needs_reopen() ||
-      thd->version != refresh_version || !table->db_stat ||
+  if (table->s->needs_reopen() ||
+      thd->version != refresh_version || table->needs_reopen() ||
       table_def_shutdown_in_progress)
   {
     free_cache_entry(table);
@@ -2564,7 +2566,7 @@ bool open_table(THD *thd, TABLE_LIST *ta
       TABLES breaks metadata locking protocol (potentially can lead
       to deadlocks) it should be disallowed.
     */
-    if (thd->mdl_context.is_lock_owner(MDL_TABLE, table_list->db,
+    if (thd->mdl_context.is_lock_owner(MDL_key::TABLE, table_list->db,
                                        table_list->table_name))
     {
       char path[FN_REFLEN + 1];
@@ -2971,6 +2973,34 @@ TABLE *find_write_locked_table(TABLE *li
 }
 
 
+/**
+   Find instance of TABLE with MDL_SHARED_UPGRADABLE or
+   MDL_EXCLUSIVE lock from the list of open tables.
+
+   @param list       List of TABLE objects to be searched
+   @param db         Database name.
+   @param table_name Name of table.
+
+   @return Pointer to MDL_SHARED_UPGRADABLE or MDL_EXCLUSIVE
+           TABLE instance, NULL otherwise.
+*/
+
+TABLE *find_table_for_mdl_upgrade(TABLE *list, const char *db,
+                                  const char *table_name)
+{
+  TABLE *tab= find_locked_table(list, db, table_name);
+
+  while (tab != NULL)
+  {
+    if (tab->mdl_ticket != NULL &&
+        tab->mdl_ticket->is_upgradable_or_exclusive())
+      return tab;
+    tab= find_locked_table(tab->next, db, table_name);
+  }
+  return NULL;
+}
+
+
 /***********************************************************************
   class Locked_tables_list implementation. Declared in sql_class.h
 ************************************************************************/
@@ -3742,16 +3772,13 @@ thr_lock_type read_lock_type_for_table(T
 
 
 /*
-  Perform steps of prelocking algorithm for elements of the
-  prelocking set other than tables. E.g. cache routines and, if
-  prelocking strategy prescribes so, extend the prelocking set with
-  tables and routines used by them.
+  Handle element of prelocking set other than table. E.g. cache routine
+  and, if prelocking strategy prescribes so, extend the prelocking set
+  with tables and routines used by it.
 
   @param[in]  thd                  Thread context.
   @param[in]  prelocking_ctx       Prelocking context.
-  @param[in]  start                First element in the list representing
-                                   subset of the prelocking set to be
-                                   processed.
+  @param[in]  rt                   Element of prelocking set to be processed.
   @param[in]  prelocking_strategy  Strategy which specifies how the
                                    prelocking set should be extended when
                                    one of its elements is processed.
@@ -3764,47 +3791,295 @@ thr_lock_type read_lock_type_for_table(T
 */
 
 static bool
-open_routines(THD *thd, Query_tables_list *prelocking_ctx,
-              Sroutine_hash_entry *start,
-              Prelocking_strategy *prelocking_strategy,
-              bool *need_prelocking)
+open_and_process_routine(THD *thd, Query_tables_list *prelocking_ctx,
+                         Sroutine_hash_entry *rt,
+                         Prelocking_strategy *prelocking_strategy,
+                         bool *need_prelocking)
 {
-  DBUG_ENTER("open_routines");
+  DBUG_ENTER("open_and_process_routine");
 
-  for (Sroutine_hash_entry *rt= start; rt; rt= rt->next)
+  switch (rt->mdl_request.key.mdl_namespace())
   {
-    int type= rt->key.str[0];
-
-    switch (type)
+  case MDL_key::FUNCTION:
+  case MDL_key::PROCEDURE:
     {
-    case TYPE_ENUM_FUNCTION:
-    case TYPE_ENUM_PROCEDURE:
-      {
-        sp_name name(thd, rt->key.str, rt->key.length);
-        sp_head *sp;
+      char qname_buff[NAME_LEN*2+1+1];
+      sp_name name(&rt->mdl_request.key, qname_buff);
+      sp_head *sp;
+      int type= (rt->mdl_request.key.mdl_namespace() == MDL_key::FUNCTION) ?
+                TYPE_ENUM_FUNCTION : TYPE_ENUM_PROCEDURE;
 
-        if (sp_cache_routine(thd, type, &name, &sp))
-          DBUG_RETURN(TRUE);
+      if (sp_cache_routine(thd, type, &name, &sp))
+        DBUG_RETURN(TRUE);
 
-        if (sp)
-        {
-          prelocking_strategy->handle_routine(thd, prelocking_ctx, rt, sp,
-                                              need_prelocking);
-        }
+      if (sp)
+      {
+        prelocking_strategy->handle_routine(thd, prelocking_ctx, rt, sp,
+                                            need_prelocking);
       }
-      break;
-    case TYPE_ENUM_TRIGGER:
-      break;
-    default:
-      /* Impossible type value. */
-      DBUG_ASSERT(0);
     }
+    break;
+  case MDL_key::TRIGGER:
+    break;
+  default:
+    /* Impossible type value. */
+    DBUG_ASSERT(0);
   }
   DBUG_RETURN(FALSE);
 }
 
 
 /**
+  Handle table list element by obtaining metadata lock, opening table or view
+  and, if prelocking strategy prescribes so, extending the prelocking set with
+  tables and routines used by it.
+
+  @param[in]     thd                  Thread context.
+  @param[in]     lex                  LEX structure for statement.
+  @param[in]     tables               Table list element to be processed.
+  @param[in,out] counter              Number of tables which are open.
+  @param[in]     flags                Bitmap of flags to modify how the tables
+                                      will be open, see open_table() description
+                                      for details.
+  @param[in]     prelocking_strategy  Strategy which specifies how the
+                                      prelocking set should be extended
+                                      when table or view is processed.
+  @param[in]     has_prelocking_list  Indicates that prelocking set/list for
+                                      this statement has already been built.
+  @param[in]     ot_ctx               Context used to recover from a failed
+                                      open_table() attempt.
+  @param[in]     new_frm_mem          Temporary MEM_ROOT to be used for
+                                      parsing .FRMs for views.
+
+  @retval  FALSE  Success.
+  @retval  TRUE   Error, reported unless there is a chance to recover from it.
+*/
+
+static bool
+open_and_process_table(THD *thd, LEX *lex, TABLE_LIST *tables,
+                       uint *counter, uint flags,
+                       Prelocking_strategy *prelocking_strategy,
+                       bool has_prelocking_list,
+                       Open_table_context *ot_ctx,
+                       MEM_ROOT *new_frm_mem)
+{
+  bool error= FALSE;
+  bool safe_to_ignore_table= FALSE;
+  DBUG_ENTER("open_and_process_table");
+
+  /*
+    Ignore placeholders for derived tables. After derived tables
+    processing, link to created temporary table will be put here.
+    If this is derived table for view then we still want to process
+    routines used by this view.
+  */
+  if (tables->derived)
+  {
+    if (!tables->view)
+      goto end;
+    /*
+      We restore view's name and database wiped out by derived tables
+      processing and fall back to standard open process in order to
+      obtain proper metadata locks and do other necessary steps like
+      stored routine processing.
+    */
+    tables->db= tables->view_db.str;
+    tables->db_length= tables->view_db.length;
+    tables->table_name= tables->view_name.str;
+    tables->table_name_length= tables->view_name.length;
+  }
+  /*
+    If this TABLE_LIST object is a placeholder for an information_schema
+    table, create a temporary table to represent the information_schema
+    table in the query. Do not fill it yet - will be filled during
+    execution.
+  */
+  if (tables->schema_table)
+  {
+    /*
+      If this information_schema table is merged into a mergeable
+      view, ignore it for now -- it will be filled when its respective
+      TABLE_LIST is processed. This code works only during re-execution.
+    */
+    if (tables->view)
+      goto process_view_routines;
+    if (!mysql_schema_table(thd, lex, tables) &&
+        !check_and_update_table_version(thd, tables, tables->table->s))
+    {
+      goto end;
+    }
+    error= TRUE;
+    goto end;
+  }
+  DBUG_PRINT("tcache", ("opening table: '%s'.'%s'  item: %p",
+                        tables->db, tables->table_name, tables)); //psergey: invalid read of size 1 here
+  (*counter)++;
+
+  /* Not a placeholder: must be a base table or a view. Let us open it. */
+  DBUG_ASSERT(!tables->table);
+
+  if (tables->prelocking_placeholder)
+  {
+    /*
+      For the tables added by the pre-locking code, attempt to open
+      the table but fail silently if the table does not exist.
+      The real failure will occur when/if a statement attempts to use
+      that table.
+    */
+    Prelock_error_handler prelock_handler;
+    thd->push_internal_handler(& prelock_handler);
+    error= open_table(thd, tables, new_frm_mem, ot_ctx, flags);
+    thd->pop_internal_handler();
+    safe_to_ignore_table= prelock_handler.safely_trapped_errors();
+  }
+  else
+    error= open_table(thd, tables, new_frm_mem, ot_ctx, flags);
+
+  free_root(new_frm_mem, MYF(MY_KEEP_PREALLOC));
+
+  if (error)
+  {
+    if (! ot_ctx->can_recover_from_failed_open_table() && safe_to_ignore_table)
+    {
+      DBUG_PRINT("info", ("open_table: ignoring table '%s'.'%s'",
+                          tables->db, tables->alias));
+      error= FALSE;
+    }
+    goto end;
+  }
+
+  /*
+    We can't rely on simple check for TABLE_LIST::view to determine
+    that this is a view since during re-execution we might reopen
+    ordinary table in place of view and thus have TABLE_LIST::view
+    set from repvious execution and TABLE_LIST::table set from
+    current.
+  */
+  if (!tables->table && tables->view)
+  {
+    /* VIEW placeholder */
+    (*counter)--;
+
+    /*
+      tables->next_global list consists of two parts:
+      1) Query tables and underlying tables of views.
+      2) Tables used by all stored routines that this statement invokes on
+         execution.
+      We need to know where the bound between these two parts is. If we've
+      just opened a view, which was the last table in part #1, and it
+      has added its base tables after itself, adjust the boundary pointer
+      accordingly.
+    */
+    if (lex->query_tables_own_last == &(tables->next_global) &&
+        tables->view->query_tables)
+      lex->query_tables_own_last= tables->view->query_tables_last;
+    /*
+      Let us free memory used by 'sroutines' hash here since we never
+      call destructor for this LEX.
+    */
+    my_hash_free(&tables->view->sroutines);
+    goto process_view_routines;
+  }
+
+  /*
+    Special types of open can succeed but still don't set
+    TABLE_LIST::table to anything.
+  */
+  if (tables->open_strategy && !tables->table)
+    goto end;
+
+  /*
+    If we are not already in prelocked mode and extended table list is not
+    yet built we might have to build the prelocking set for this statement.
+
+    Since currently no prelocking strategy prescribes doing anything for
+    tables which are only read, we do below checks only if table is going
+    to be changed.
+  */
+  if (thd->locked_tables_mode <= LTM_LOCK_TABLES &&
+      ! has_prelocking_list &&
+      tables->lock_type >= TL_WRITE_ALLOW_WRITE)
+  {
+    bool need_prelocking= FALSE;
+    TABLE_LIST **save_query_tables_last= lex->query_tables_last;
+    /*
+      Extend statement's table list and the prelocking set with
+      tables and routines according to the current prelocking
+      strategy.
+
+      For example, for DML statements we need to add tables and routines
+      used by triggers which are going to be invoked for this element of
+      table list and also add tables required for handling of foreign keys.
+    */
+    error= prelocking_strategy->handle_table(thd, lex, tables,
+                                             &need_prelocking);
+
+    if (need_prelocking && ! lex->requires_prelocking())
+      lex->mark_as_requiring_prelocking(save_query_tables_last);
+
+    if (error)
+      goto end;
+  }
+
+  if (tables->lock_type != TL_UNLOCK && ! thd->locked_tables_mode)
+  {
+    if (tables->lock_type == TL_WRITE_DEFAULT)
+      tables->table->reginfo.lock_type= thd->update_lock_default;
+    else if (tables->lock_type == TL_READ_DEFAULT)
+      tables->table->reginfo.lock_type=
+        read_lock_type_for_table(thd, tables->table);
+    else
+      tables->table->reginfo.lock_type= tables->lock_type;
+  }
+  tables->table->grant= tables->grant;
+
+  /* Check and update metadata version of a base table. */
+  error= check_and_update_table_version(thd, tables, tables->table->s);
+
+  if (error)
+    goto end;
+  /*
+    After opening a MERGE table add the children to the query list of
+    tables, so that they are opened too.
+    Note that placeholders don't have the handler open.
+  */
+  /* MERGE tables need to access parent and child TABLE_LISTs. */
+  DBUG_ASSERT(tables->table->pos_in_table_list == tables);
+  /* Non-MERGE tables ignore this call. */
+  if (tables->table->file->extra(HA_EXTRA_ADD_CHILDREN_LIST))
+  {
+    error= TRUE;
+    goto end;
+  }
+
+process_view_routines:
+  /*
+    Again we may need cache all routines used by this view and add
+    tables used by them to table list.
+  */
+  if (tables->view &&
+      thd->locked_tables_mode <= LTM_LOCK_TABLES &&
+      ! has_prelocking_list)
+  {
+    bool need_prelocking= FALSE;
+    TABLE_LIST **save_query_tables_last= lex->query_tables_last;
+
+    error= prelocking_strategy->handle_view(thd, lex, tables,
+                                            &need_prelocking);
+
+    if (need_prelocking && ! lex->requires_prelocking())
+      lex->mark_as_requiring_prelocking(save_query_tables_last);
+
+    if (error)
+      goto end;
+  }
+
+end:
+  DBUG_RETURN(error);
+}
+
+
+/**
   Open all tables in list
 
   @param[in]     thd      Thread context.
@@ -3836,28 +4111,23 @@ open_routines(THD *thd, Query_tables_lis
 bool open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags,
                 Prelocking_strategy *prelocking_strategy)
 {
-  TABLE_LIST *tables= NULL;
+  /*
+    We use pointers to "next_global" member in the last processed TABLE_LIST
+    element and to the "next" member in the last processed Sroutine_hash_entry
+    element as iterators over, correspondingly, the table list and stored routines
+    list which stay valid and allow to continue iteration when new elements are
+    added to the tail of the lists.
+  */
+  TABLE_LIST **table_to_open;
+  Sroutine_hash_entry **sroutine_to_open;
+  TABLE_LIST *tables;
   Open_table_context ot_ctx(thd);
   bool error= FALSE;
   MEM_ROOT new_frm_mem;
-  /* Also used for indicating that prelocking is need */
-  TABLE_LIST **query_tables_last_own;
-  bool safe_to_ignore_table;
+  bool has_prelocking_list= thd->lex->requires_prelocking();
   DBUG_ENTER("open_tables");
 
   /*
-    temporary mem_root for new .frm parsing.
-    TODO: variables for size
-  */
-  init_sql_alloc(&new_frm_mem, 8024, 8024);
-
-  thd->current_tablenr= 0;
- restart:
-  *counter= 0;
-  query_tables_last_own= 0;
-  thd_proc_info(thd, "Opening tables");
-
-  /*
     Close HANDLER tables which are marked for flush or against which there
     are pending exclusive metadata locks. Note that we do this not to avoid
     deadlocks (calls to mysql_ha_flush() in mdl_wait_for_locks() and
@@ -3870,316 +4140,116 @@ bool open_tables(THD *thd, TABLE_LIST **
     mysql_ha_flush(thd);
 
   /*
-    If we are not already executing prelocked statement and don't have
-    statement for which table list for prelocking is already built, let
-    us cache routines and try to build such table list.
+    temporary mem_root for new .frm parsing.
+    TODO: variables for size
   */
+  init_sql_alloc(&new_frm_mem, 8024, 8024);
 
-  if (thd->locked_tables_mode <= LTM_LOCK_TABLES &&
-      !thd->lex->requires_prelocking() &&
-      thd->lex->uses_stored_routines())
-  {
-    bool need_prelocking= FALSE;
-    TABLE_LIST **save_query_tables_last= thd->lex->query_tables_last;
-
-    DBUG_ASSERT(thd->lex->query_tables == *start);
-
-    error= open_routines(thd, thd->lex,
-                         (Sroutine_hash_entry *)thd->lex->sroutines_list.first,
-                         prelocking_strategy, &need_prelocking);
-    if (error)
-    {
-      /*
-        Serious error during reading stored routines from mysql.proc table.
-        Something's wrong with the table or its contents, and an error has
-        been emitted; we must abort.
-      */
-      goto err;
-    }
-    else if (need_prelocking)
-    {
-      query_tables_last_own= save_query_tables_last;
-      *start= thd->lex->query_tables;
-    }
-  }
+  thd->current_tablenr= 0;
+ restart:
+  table_to_open= start;
+  sroutine_to_open= (Sroutine_hash_entry**) &thd->lex->sroutines_list.first;
+  *counter= 0;
+  thd_proc_info(thd, "Opening tables");
 
   /*
-    For every table in the list of tables to open, try to find or open
-    a table.
+    Perform steps of prelocking algorithm until there are unprocessed
+    elements in prelocking list/set.
   */
-  for (tables= *start; tables ;tables= tables->next_global)
+  while (*table_to_open  ||
+         (thd->locked_tables_mode <= LTM_LOCK_TABLES &&
+          ! has_prelocking_list &&
+          *sroutine_to_open))
   {
-    safe_to_ignore_table= FALSE;
-
-    /*
-      Ignore placeholders for derived tables. After derived tables
-      processing, link to created temporary table will be put here.
-      If this is derived table for view then we still want to process
-      routines used by this view.
-     */
-    if (tables->derived)
-    {
-      if (!tables->view)
-        continue;
-      /*
-        We restore view's name and database wiped out by derived tables
-        processing and fall back to standard open process in order to
-        obtain proper metadata locks and do other necessary steps like
-        stored routine processing.
-      */
-      tables->db= tables->view_db.str;
-      tables->db_length= tables->view_db.length;
-      tables->table_name= tables->view_name.str;
-      tables->table_name_length= tables->view_name.length;
-    }
     /*
-      If this TABLE_LIST object is a placeholder for an information_schema
-      table, create a temporary table to represent the information_schema
-      table in the query. Do not fill it yet - will be filled during
-      execution.
+      For every table in the list of tables to open, try to find or open
+      a table.
     */
-    if (tables->schema_table)
+    for (tables= *table_to_open; tables;
+         table_to_open= &tables->next_global, tables= tables->next_global)
     {
-      /*
-        If this information_schema table is merged into a mergeable
-        view, ignore it for now -- it will be filled when its respective
-        TABLE_LIST is processed. This code works only during re-execution.
-      */
-      if (tables->view)
-        goto process_view_routines;
-      if (!mysql_schema_table(thd, thd->lex, tables) &&
-          !check_and_update_table_version(thd, tables, tables->table->s))
-      {
-        continue;
-      }
-      DBUG_RETURN(TRUE);
-    }
-    DBUG_PRINT("tcache", ("opening table: '%s'.'%s'  item: %p",
-                          tables->db, tables->table_name, tables)); //psergey: invalid read of size 1 here
-    (*counter)++;
-
-    /* Not a placeholder: must be a base table or a view. Let us open it. */
-    DBUG_ASSERT(!tables->table);
-
-    if (tables->prelocking_placeholder)
-    {
-      /*
-        For the tables added by the pre-locking code, attempt to open
-        the table but fail silently if the table does not exist.
-        The real failure will occur when/if a statement attempts to use
-        that table.
-      */
-      Prelock_error_handler prelock_handler;
-      thd->push_internal_handler(& prelock_handler);
-      error= open_table(thd, tables, &new_frm_mem, &ot_ctx, flags);
-      thd->pop_internal_handler();
-      safe_to_ignore_table= prelock_handler.safely_trapped_errors();
-    }
-    else
-      error= open_table(thd, tables, &new_frm_mem, &ot_ctx, flags);
+      error= open_and_process_table(thd, thd->lex, tables, counter,
+                                    flags, prelocking_strategy,
+                                    has_prelocking_list, &ot_ctx,
+                                    &new_frm_mem);
 
-    free_root(&new_frm_mem, MYF(MY_KEEP_PREALLOC));
-
-    if (error)
-    {
-      if (ot_ctx.can_recover_from_failed_open_table())
+      if (error)
       {
-        /*
-          We have met exclusive metadata lock or old version of table. Now we
-          have to close all tables which are not up to date/release metadata
-          locks. We also have to throw away set of prelocked tables (and thus
-          close tables from this set that were open by now) since it possible
-          that one of tables which determined its content was changed.
-
-          Instead of implementing complex/non-robust logic mentioned
-          above we simply close and then reopen all tables.
-
-          In order to prepare for recalculation of set of prelocked tables
-          we pretend that we have finished calculation which we were doing
-          currently.
-        */
-        if (query_tables_last_own)
-          thd->lex->mark_as_requiring_prelocking(query_tables_last_own);
-        close_tables_for_reopen(thd, start);
-        /*
-          Here we rely on the fact that 'tables' still points to the valid
-          TABLE_LIST element. Altough currently this assumption is valid
-          it may change in future.
-        */
-        if (ot_ctx.recover_from_failed_open_table_attempt(thd, tables))
-          goto err;
-
-        error= FALSE;
-	goto restart;
-      }
+        if (ot_ctx.can_recover_from_failed_open_table())
+        {
+          /*
+            We have met exclusive metadata lock or old version of table.
+            Now we have to close all tables and release metadata locks.
+            We also have to throw away set of prelocked tables (and thus
+            close tables from this set that were open by now) since it
+            is possible that one of tables which determined its content
+            was changed.
+
+            Instead of implementing complex/non-robust logic mentioned
+            above we simply close and then reopen all tables.
+
+            We have to save pointer to table list element for table which we
+            have failed to open since closing tables can trigger removal of
+            elements from the table list (if MERGE tables are involved),
+          */
+          TABLE_LIST *failed_table= *table_to_open;
+          close_tables_for_reopen(thd, start);
+          /*
+            Here we rely on the fact that 'tables' still points to the valid
+            TABLE_LIST element. Altough currently this assumption is valid
+            it may change in future.
+          */
+          if (ot_ctx.recover_from_failed_open_table_attempt(thd, failed_table))
+            goto err;
 
-      if (safe_to_ignore_table)
-      {
-        DBUG_PRINT("info", ("open_table: ignoring table '%s'.'%s'",
-                            tables->db, tables->alias));
-        error= FALSE;
-        continue;
+          error= FALSE;
+          goto restart;
+        }
+        goto err;
       }
-      goto err;
     }
 
     /*
-      We can't rely on simple check for TABLE_LIST::view to determine
-      that this is a view since during re-execution we might reopen
-      ordinary table in place of view and thus have TABLE_LIST::view
-      set from repvious execution and TABLE_LIST::table set from
-      current.
+      If we are not already in prelocked mode and extended table list is
+      not yet built for our statement we need to cache routines it uses
+      and build the prelocking list for it.
     */
-    if (!tables->table && tables->view)
-    {
-      /* VIEW placeholder */
-      (*counter)--;
-
-      /*
-        tables->next_global list consists of two parts:
-        1) Query tables and underlying tables of views.
-        2) Tables used by all stored routines that this statement invokes on
-           execution.
-        We need to know where the bound between these two parts is. If we've
-        just opened a view, which was the last table in part #1, and it
-        has added its base tables after itself, adjust the boundary pointer
-        accordingly.
-      */
-      if (query_tables_last_own == &(tables->next_global) &&
-          tables->view->query_tables)
-        query_tables_last_own= tables->view->query_tables_last;
-      /*
-        Let us free memory used by 'sroutines' hash here since we never
-        call destructor for this LEX.
-      */
-      my_hash_free(&tables->view->sroutines);
-      goto process_view_routines;
-    }
-
-    /*
-      Special types of open can succeed but still don't set
-      TABLE_LIST::table to anything.
-    */
-    if (tables->open_strategy && !tables->table)
-      continue;
-
-    /*
-      If we are not already in prelocked mode and extended table list is not
-      yet built we might have to build the prelocking set for this statement.
-
-      Since currently no prelocking strategy prescribes doing anything for
-      tables which are only read, we do below checks only if table is going
-      to be changed.
-    */
-    if (thd->locked_tables_mode <= LTM_LOCK_TABLES &&
-        !thd->lex->requires_prelocking() &&
-        tables->lock_type >= TL_WRITE_ALLOW_WRITE)
+    if (thd->locked_tables_mode <= LTM_LOCK_TABLES && ! has_prelocking_list)
     {
       bool need_prelocking= FALSE;
-      bool not_used;
       TABLE_LIST **save_query_tables_last= thd->lex->query_tables_last;
-      Sroutine_hash_entry **sroutines_next= 
-        (Sroutine_hash_entry **)thd->lex->sroutines_list.next;
-
       /*
-        Extend statement's table list and the prelocking set with
-        tables and routines according to the current prelocking
-        strategy.
-
-        For example, for DML statements we need to add tables and routines
-        used by triggers which are going to be invoked for this element of
-        table list and also add tables required for handling of foreign keys.
-      */
-      error= prelocking_strategy->handle_table(thd, thd->lex, tables,
-                                               &need_prelocking);
-
-      if (need_prelocking && ! query_tables_last_own)
-        query_tables_last_own= save_query_tables_last;
-
-      if (error)
-        goto err;
-
-      /*
-        Process elements of the prelocking set which were added
-        by the above invocation of Prelocking_strategy method.
-
-        For example, if new element is a routine, cache it and then, if
-        prelocking strategy prescribes so, add tables it uses to the table
-        list and routines it might invoke to the prelocking set.
-      */
-      error= open_routines(thd, thd->lex, *sroutines_next, prelocking_strategy,
-                           &not_used);
-      if (error)
-        goto err;
-    }
-
-    if (tables->lock_type != TL_UNLOCK && ! thd->locked_tables_mode)
-    {
-      if (tables->lock_type == TL_WRITE_DEFAULT)
-        tables->table->reginfo.lock_type= thd->update_lock_default;
-      else if (tables->lock_type == TL_READ_DEFAULT)
-        tables->table->reginfo.lock_type=
-          read_lock_type_for_table(thd, tables->table);
-      else
-        tables->table->reginfo.lock_type= tables->lock_type;
-    }
-    tables->table->grant= tables->grant;
+        Process elements of the prelocking set which are present there
+        since parsing stage or were added to it by invocations of
+        Prelocking_strategy methods in the above loop over tables.
+
+        For example, if element is a routine, cache it and then,
+        if prelocking strategy prescribes so, add tables it uses to the
+        table list and routines it might invoke to the prelocking set.
+      */
+      for (Sroutine_hash_entry *rt= *sroutine_to_open; rt;
+           sroutine_to_open= &rt->next, rt= rt->next)
+      {
+        error= open_and_process_routine(thd, thd->lex, rt,
+                                        prelocking_strategy,
+                                        &need_prelocking);
 
-    /* Check and update metadata version of a base table. */
-    error= check_and_update_table_version(thd, tables, tables->table->s);
-
-    if (error)
-      goto err;
-    /*
-      After opening a MERGE table add the children to the query list of
-      tables, so that they are opened too.
-      Note that placeholders don't have the handler open.
-    */
-    /* MERGE tables need to access parent and child TABLE_LISTs. */
-    DBUG_ASSERT(tables->table->pos_in_table_list == tables);
-    /* Non-MERGE tables ignore this call. */
-    if (tables->table->file->extra(HA_EXTRA_ADD_CHILDREN_LIST))
-    {
-      error= TRUE;
-      goto err;
-    }
-
-process_view_routines:
-    /*
-      Again we may need cache all routines used by this view and add
-      tables used by them to table list.
-    */
-    if (tables->view &&
-        thd->locked_tables_mode <= LTM_LOCK_TABLES &&
-        !thd->lex->requires_prelocking())
-    {
-      bool need_prelocking= FALSE;
-      bool not_used;
-      TABLE_LIST **save_query_tables_last= thd->lex->query_tables_last;
-      Sroutine_hash_entry **sroutines_next= 
-        (Sroutine_hash_entry **)thd->lex->sroutines_list.next;
-
-      error= prelocking_strategy->handle_view(thd, thd->lex, tables,
-                                              &need_prelocking);
-
-      if (need_prelocking && ! query_tables_last_own)
-        query_tables_last_own= save_query_tables_last;
-
-      if (error)
-        goto err;
+        if (error)
+        {
+          /*
+            Serious error during reading stored routines from mysql.proc table.
+            Something is wrong with the table or its contents, and an error has
+            been emitted; we must abort.
+          */
+          goto err;
+        }
+      }
 
-      error= open_routines(thd, thd->lex, *sroutines_next, prelocking_strategy,
-                           &not_used);
+      if (need_prelocking && ! thd->lex->requires_prelocking())
+        thd->lex->mark_as_requiring_prelocking(save_query_tables_last);
 
-      if (error)
-      {
-        /*
-          Serious error during reading stored routines from mysql.proc table.
-          Something is wrong with the table or its contents, and an error has
-          been emitted; we must abort.
-        */
-        goto err;
-      }
+      if (need_prelocking && ! *start)
+        *start= thd->lex->query_tables;
     }
   }
 
@@ -4210,12 +4280,9 @@ err:
   thd_proc_info(thd, 0);
   free_root(&new_frm_mem, MYF(0));              // Free pre-alloced block
 
-  if (query_tables_last_own)
-    thd->lex->mark_as_requiring_prelocking(query_tables_last_own);
-
-  if (error && tables)
+  if (error && *table_to_open)
   {
-    tables->table= NULL;
+    (*table_to_open)->table= NULL;
   }
   DBUG_PRINT("open_tables", ("returning: %d", (int) error));
   DBUG_RETURN(error);
@@ -4258,7 +4325,7 @@ handle_routine(THD *thd, Query_tables_li
   */
 
   if (rt != (Sroutine_hash_entry*)prelocking_ctx->sroutines_list.first ||
-      rt->key.str[0] != TYPE_ENUM_PROCEDURE)
+      rt->mdl_request.key.mdl_namespace() != MDL_key::PROCEDURE)
   {
     *need_prelocking= TRUE;
     sp_update_stmt_used_routines(thd, prelocking_ctx, &sp->m_sroutines,
@@ -8144,13 +8211,13 @@ bool mysql_notify_thread_having_shared_l
        thd_table= thd_table->next)
   {
     /*
-      Check for TABLE::db_stat is needed since in some places we call
+      Check for TABLE::needs_reopen() is needed since in some places we call
       handler::close() for table instance (and set TABLE::db_stat to 0)
       and do not remove such instances from the THD::open_tables
       for some time, during which other thread can see those instances
       (e.g. see partitioning code).
     */
-    if (thd_table->db_stat)
+    if (!thd_table->needs_reopen())
       signalled|= mysql_lock_abort_for_thread(thd, thd_table);
   }
   pthread_mutex_unlock(&LOCK_open);
@@ -8199,7 +8266,8 @@ void tdc_remove_table(THD *thd, enum_tdc
   safe_mutex_assert_owner(&LOCK_open);
 
   DBUG_ASSERT(remove_type == TDC_RT_REMOVE_UNUSED ||
-              thd->mdl_context.is_exclusive_lock_owner(MDL_TABLE, db, table_name));
+              thd->mdl_context.is_exclusive_lock_owner(MDL_key::TABLE,
+                                                       db, table_name));
 
   key_length=(uint) (strmov(strmov(key,db)+1,table_name)-key)+1;
 
@@ -8268,7 +8336,7 @@ tdc_wait_for_old_versions(THD *thd, MDL_
     while ((mdl_request= it++))
     {
       if ((share= get_cached_table_share(mdl_request->key.db_name(),
-                                         mdl_request->key.table_name())) &&
+                                         mdl_request->key.name())) &&
           share->version != refresh_version)
         break;
     }

=== modified file 'sql/sql_delete.cc'
--- a/sql/sql_delete.cc	2009-09-28 12:43:54 +0000
+++ b/sql/sql_delete.cc	2009-09-29 15:03:12 +0000
@@ -1233,7 +1233,7 @@ bool mysql_truncate(THD *thd, TABLE_LIST
         the table can be re-created as an empty table with TRUNCATE
         TABLE, even if the data or index files have become corrupted.
       */
-      mdl_request.init(MDL_TABLE, table_list->db, table_list->table_name,
+      mdl_request.init(MDL_key::TABLE, table_list->db, table_list->table_name,
                        MDL_EXCLUSIVE);
       if (thd->mdl_context.acquire_exclusive_lock(&mdl_request))
         DBUG_RETURN(TRUE);

=== modified file 'sql/sql_handler.cc'
--- a/sql/sql_handler.cc	2009-09-18 06:22:43 +0000
+++ b/sql/sql_handler.cc	2009-09-22 11:44:58 +0000
@@ -264,7 +264,7 @@ bool mysql_ha_open(THD *thd, TABLE_LIST 
     memcpy(hash_tables->db, tables->db, dblen);
     memcpy(hash_tables->table_name, tables->table_name, namelen);
     memcpy(hash_tables->alias, tables->alias, aliaslen);
-    hash_tables->mdl_request.init(MDL_TABLE, db, name, MDL_SHARED);
+    hash_tables->mdl_request.init(MDL_key::TABLE, db, name, MDL_SHARED);
 
     /* add to hash */
     if (my_hash_insert(&thd->handler_tables_hash, (uchar*) hash_tables))
@@ -321,6 +321,7 @@ bool mysql_ha_open(THD *thd, TABLE_LIST 
         can close a single table only.
       */
       close_thread_tables(thd);
+      thd->mdl_context.release_all_locks();
       my_error(ER_ILLEGAL_HA, MYF(0), hash_tables->alias);
       error= TRUE;
     }
@@ -820,7 +821,7 @@ void mysql_ha_flush(THD *thd)
     if (hash_tables->table &&
         ((hash_tables->table->mdl_ticket &&
          hash_tables->table->mdl_ticket->has_pending_conflicting_lock()) ||
-         hash_tables->table->needs_reopen()))
+         hash_tables->table->s->needs_reopen()))
       mysql_ha_close_table(thd, hash_tables);
   }
 

=== modified file 'sql/sql_insert.cc'
--- a/sql/sql_insert.cc	2009-09-23 13:13:37 +0000
+++ b/sql/sql_insert.cc	2009-09-29 15:03:12 +0000
@@ -2698,7 +2698,7 @@ bool Delayed_insert::handle_inserts(void
 
   thd_proc_info(&thd, "insert");
   max_rows= delayed_insert_limit;
-  if (thd.killed || table->needs_reopen())
+  if (thd.killed || table->s->needs_reopen())
   {
     thd.killed= THD::KILL_CONNECTION;
     max_rows= ULONG_MAX;                     // Do as much as possible
@@ -2836,6 +2836,12 @@ bool Delayed_insert::handle_inserts(void
     thread_safe_increment(delayed_insert_writes,&LOCK_delayed_status);
     pthread_mutex_lock(&mutex);
 
+    /*
+      Reset the table->auto_increment_field_not_null as it is valid for
+      only one row.
+    */
+    table->auto_increment_field_not_null= FALSE;
+
     delete row;
     /*
       Let READ clients do something once in a while

=== modified file 'sql/sql_lex.h'
--- a/sql/sql_lex.h	2009-09-29 12:58:54 +0000
+++ b/sql/sql_lex.h	2009-09-29 15:19:23 +0000
@@ -329,6 +329,8 @@ public:
 struct LEX;
 class st_select_lex;
 class st_select_lex_unit;
+
+
 class st_select_lex_node {
 protected:
   st_select_lex_node *next, **prev,   /* neighbor list */
@@ -366,8 +368,17 @@ public:
   { return (void*) alloc_root(mem_root, (uint) size); }
   static void operator delete(void *ptr,size_t size) { TRASH(ptr, size); }
   static void operator delete(void *ptr, MEM_ROOT *mem_root) {}
-  st_select_lex_node(): linkage(UNSPECIFIED_TYPE) {}
+
+  // Ensures that at least all members used during cleanup() are initialized.
+  st_select_lex_node()
+    : next(NULL), prev(NULL),
+      master(NULL), slave(NULL),
+      link_next(NULL), link_prev(NULL),
+      linkage(UNSPECIFIED_TYPE)
+  {
+  }
   virtual ~st_select_lex_node() {}
+
   inline st_select_lex_node* get_master() { return master; }
   virtual void init_query();
   virtual void init_select();
@@ -413,6 +424,8 @@ class select_result;
 class JOIN;
 class select_union;
 class Procedure;
+
+
 class st_select_lex_unit: public st_select_lex_node {
 protected:
   TABLE_LIST result_table_list;
@@ -424,6 +437,14 @@ protected:
   bool saved_error;
 
 public:
+  // Ensures that at least all members used during cleanup() are initialized.
+  st_select_lex_unit()
+    : union_result(NULL), table(NULL), result(NULL),
+      cleaned(false),
+      fake_select_lex(NULL)
+  {
+  }
+
   bool  prepared, // prepare phase already performed for UNION (unit)
     optimized, // optimize phase already performed for UNION (unit)
     executed, // already executed

=== modified file 'sql/sql_parse.cc'
--- a/sql/sql_parse.cc	2009-09-16 08:23:16 +0000
+++ b/sql/sql_parse.cc	2009-09-25 14:15:30 +0000
@@ -4948,7 +4948,11 @@ static bool execute_sqlcom_select(THD *t
         return 1;                               /* purecov: inspected */
       thd->send_explain_fields(result);
       res= mysql_explain_union(thd, &thd->lex->unit, result);
-      if (lex->describe & DESCRIBE_EXTENDED)
+      /*
+        The code which prints the extended description is not robust
+        against malformed queries, so skip it if we have an error.
+      */
+      if (!res && (lex->describe & DESCRIBE_EXTENDED))
       {
         char buff[1024];
         String str(buff,(uint32) sizeof(buff), system_charset_info);
@@ -6366,7 +6370,7 @@ TABLE_LIST *st_select_lex::add_table_to_
   ptr->next_name_resolution_table= NULL;
   /* Link table in global list (all used tables) */
   lex->add_to_query_tables(ptr);
-  ptr->mdl_request.init(MDL_TABLE, ptr->db, ptr->table_name, MDL_SHARED);
+  ptr->mdl_request.init(MDL_key::TABLE, ptr->db, ptr->table_name, MDL_SHARED);
   DBUG_RETURN(ptr);
 }
 

=== modified file 'sql/sql_partition.cc'
--- a/sql/sql_partition.cc	2009-09-23 15:02:56 +0000
+++ b/sql/sql_partition.cc	2009-09-29 15:03:12 +0000
@@ -3932,15 +3932,13 @@ bool mysql_unpack_partition(THD *thd,
       We need to free any memory objects allocated on item_free_list
       by the parser since we are keeping the old info from the first
       parser call in CREATE TABLE.
-      We'll ensure that this object isn't put into table cache also
-      just to ensure we don't get into strange situations with the
-      item objects.
+
+      This table object can not be used any more. However, since
+      this is CREATE TABLE, we know that it will be destroyed by the
+      caller, and rely on that.
     */
     thd->free_items();
     part_info= thd->work_part_info;
-    tdc_remove_table(thd, TDC_RT_REMOVE_UNUSED,
-                      table->s->db.str,
-                      table->s->table_name.str);
     *work_part_info_used= true;
   }
   table->part_info= part_info;
@@ -4233,17 +4231,11 @@ uint prep_alter_part_table(THD *thd, TAB
 
   /*
     We are going to manipulate the partition info on the table object
-    so we need to ensure that the table instances cached and all other
-    instances are properly closed.
+    so we need to ensure that the table instance is removed from the
+    table cache.
   */
   if (table->part_info)
-  {
-    pthread_mutex_lock(&LOCK_open);
-    tdc_remove_table(thd, TDC_RT_REMOVE_UNUSED,
-                     table->s->db.str,
-                     table->s->table_name.str);
-    pthread_mutex_unlock(&LOCK_open);
-  }
+    table->m_needs_reopen= TRUE;
 
   thd->work_part_info= thd->lex->part_info;
   if (thd->work_part_info &&

=== modified file 'sql/sql_repl.cc'
--- a/sql/sql_repl.cc	2009-09-21 09:04:22 +0000
+++ b/sql/sql_repl.cc	2009-09-25 14:15:30 +0000
@@ -1036,7 +1036,7 @@ void end_slave_start()
 
   @param mi Pointer to Master_info object for the slave's IO thread.
 
-  @param net_report If true, saves the exit status into thd->main_da.
+  @param net_report If true, saves the exit status into thd->stmt_da.
 
   @retval 0 success
   @retval 1 error
@@ -1191,7 +1191,7 @@ int start_slave(THD* thd , Master_info* 
 
   @param mi Pointer to Master_info object for the slave's IO thread.
 
-  @param net_report If true, saves the exit status into thd->main_da.
+  @param net_report If true, saves the exit status into thd->stmt_da.
 
   @retval 0 success
   @retval 1 error

=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc	2009-09-28 14:01:26 +0000
+++ b/sql/sql_select.cc	2009-09-29 15:03:12 +0000
@@ -15788,6 +15788,13 @@ do_select(JOIN *join,List<Item> *fields,
                                  fields);
       rc= join->result->send_data(*columns_list);
     }
+    /*
+      An error can happen when evaluating the conds 
+      (the join condition and piece of where clause 
+      relevant to this join table).
+    */
+    if (join->thd->is_error())
+      error= NESTED_LOOP_ERROR;
   }
   else
   {
@@ -18441,6 +18448,7 @@ test_if_skip_sort_order(JOIN_TAB *tab,OR
   SQL_SELECT *select=tab->select;
   key_map usable_keys;
   QUICK_SELECT_I *save_quick= 0;
+  COND *orig_select_cond= 0;
   DBUG_ENTER("test_if_skip_sort_order");
   LINT_INIT(ref_key_parts);
 
@@ -18548,11 +18556,8 @@ test_if_skip_sort_order(JOIN_TAB *tab,OR
       if (table->covering_keys.is_set(ref_key))
 	usable_keys.intersect(table->covering_keys);
       if (tab->pre_idx_push_select_cond)
-      {
-        tab->select_cond= tab->pre_idx_push_select_cond;
-        if (tab->select)
-          tab->select->cond= tab->select_cond;
-      }
+        orig_select_cond= tab->set_cond(tab->pre_idx_push_select_cond);
+
       if ((new_ref_key= test_if_subkey(order, table, ref_key, ref_key_parts,
 				       &usable_keys)) < MAX_KEY)
       {
@@ -18828,9 +18833,15 @@ test_if_skip_sort_order(JOIN_TAB *tab,OR
           }
           if (tab->pre_idx_push_select_cond)
           {
-            tab->select_cond= tab->pre_idx_push_select_cond;
-            if (tab->select)
-              tab->select->cond= tab->select_cond;
+            COND *tmp_cond= tab->pre_idx_push_select_cond;
+            if (orig_select_cond)
+            {
+              tmp_cond= and_conds(tmp_cond, orig_select_cond);
+              tmp_cond->quick_fix_field();
+            }
+            tab->set_cond(tmp_cond);
+            /* orig_select_cond was merged, no need to restore original one. */
+            orig_select_cond= 0;
           }
           table->file->ha_index_or_rnd_end();
           if (join->select_options & SELECT_DESCRIBE)
@@ -18920,9 +18931,13 @@ check_reverse_order:                  
   }
   else if (select && select->quick)
     select->quick->need_sorted_output();
+  if (orig_select_cond)
+    tab->set_cond(orig_select_cond);
   DBUG_RETURN(1);
 use_filesort:
   table->file->extra(HA_EXTRA_NO_ORDERBY_LIMIT);
+  if (orig_select_cond)
+    tab->set_cond(orig_select_cond);
   DBUG_RETURN(0);
 }
 

=== modified file 'sql/sql_select.h'
--- a/sql/sql_select.h	2009-09-08 08:00:55 +0000
+++ b/sql/sql_select.h	2009-09-25 12:19:01 +0000
@@ -340,6 +340,14 @@ typedef struct st_join_table
       return first_inner;
     return first_sj_inner_tab; 
   }
+  COND *set_cond(COND *new_cond)
+  {
+    COND *tmp_select_cond= select_cond;
+    select_cond= new_cond;
+    if (select)
+      select->cond= new_cond;
+    return tmp_select_cond;
+  }
 } JOIN_TAB;
 
 /* 
@@ -1434,7 +1442,8 @@ public:
   uint     outer_tables;  /**< Number of tables that are not inside semijoin */
   uint     const_tables;
   uint	   send_group_parts;
-  bool	   sort_and_group,first_record,full_join,group, no_field_update;
+  bool	   sort_and_group,first_record,full_join,no_field_update;
+  bool	   group;          /**< If query contains GROUP BY clause */
   bool	   do_send_rows;
   /**
     TRUE when we want to resume nested loop iterations when
@@ -1739,12 +1748,12 @@ public:
   }
   /* 
     Return the table for which an index scan can be used to satisfy 
-    the sort order needed by the ORDER BY/GROUP BY clause 
+    the sort order needed by the ORDER BY/(implicit) GROUP BY clause 
   */
   JOIN_TAB *get_sort_by_join_tab()
   {
     return (need_tmp || !sort_by_table || skip_sort_order ||
-            (group && !group_list)) ?
+            ((group || tmp_table_param.sum_func_count) && !group_list)) ?
               NULL : join_tab+const_tables;
   }
 private:

=== modified file 'sql/sql_show.cc'
--- a/sql/sql_show.cc	2009-09-23 15:02:56 +0000
+++ b/sql/sql_show.cc	2009-09-29 15:12:18 +0000
@@ -494,6 +494,128 @@ find_files(THD *thd, List<LEX_STRING> *f
 }
 
 
+/**
+   An Internal_error_handler that suppresses errors regarding views'
+   underlying tables that occur during privilege checking within SHOW CREATE
+   VIEW commands. This happens in the cases when
+
+   - A view's underlying table (e.g. referenced in its SELECT list) does not
+     exist. There should not be an error as no attempt was made to access it
+     per se.
+
+   - Access is denied for some table, column, function or stored procedure
+     such as mentioned above. This error gets raised automatically, since we
+     can't untangle its access checking from that of the view itself.
+ */
+class Show_create_error_handler : public Internal_error_handler {
+  
+  TABLE_LIST *m_top_view;
+  bool m_handling;
+  Security_context *m_sctx;
+
+  char m_view_access_denied_message[MYSQL_ERRMSG_SIZE];
+  char *m_view_access_denied_message_ptr;
+
+public:
+
+  /**
+     Creates a new Show_create_error_handler for the particular security
+     context and view. 
+
+     @thd Thread context, used for security context information if needed.
+     @top_view The view. We do not verify at this point that top_view is in
+     fact a view since, alas, these things do not stay constant.
+  */
+  explicit Show_create_error_handler(THD *thd, TABLE_LIST *top_view) : 
+    m_top_view(top_view), m_handling(FALSE),
+    m_view_access_denied_message_ptr(NULL) 
+  {
+    
+    m_sctx = test(m_top_view->security_ctx) ?
+      m_top_view->security_ctx : thd->security_ctx;
+  }
+
+  /**
+     Lazy instantiation of 'view access denied' message. The purpose of the
+     Show_create_error_handler is to hide details of underlying tables for
+     which we have no privileges behind ER_VIEW_INVALID messages. But this
+     obviously does not apply if we lack privileges on the view itself.
+     Unfortunately the information about for which table privilege checking
+     failed is not available at this point. The only way for us to check is by
+     reconstructing the actual error message and see if it's the same.
+  */
+  char* get_view_access_denied_message() 
+  {
+    if (!m_view_access_denied_message_ptr)
+    {
+      m_view_access_denied_message_ptr= m_view_access_denied_message;
+      my_snprintf(m_view_access_denied_message, MYSQL_ERRMSG_SIZE,
+                  ER(ER_TABLEACCESS_DENIED_ERROR), "SHOW VIEW",
+                  m_sctx->priv_user,
+                  m_sctx->host_or_ip, m_top_view->get_table_name());
+    }
+    return m_view_access_denied_message_ptr;
+  }
+
+  bool handle_condition(THD *thd, uint sql_errno, const char */* sqlstate */,
+                        MYSQL_ERROR::enum_warning_level level,
+                        const char *message, MYSQL_ERROR **/* cond_hdl */)
+  {
+    /* 
+       The handler does not handle the errors raised by itself.
+       At this point we know if top_view is really a view.
+    */
+    if (m_handling || !m_top_view->view)
+      return FALSE;
+
+    m_handling= TRUE;
+
+    bool is_handled;
+    
+    switch (sql_errno)
+    {
+    case ER_TABLEACCESS_DENIED_ERROR:
+      if (!strcmp(get_view_access_denied_message(), message))
+      {
+        /* Access to top view is not granted, don't interfere. */
+        is_handled= FALSE;
+        break;
+      }
+    case ER_COLUMNACCESS_DENIED_ERROR:
+    case ER_VIEW_NO_EXPLAIN: /* Error was anonymized, ignore all the same. */
+    case ER_PROCACCESS_DENIED_ERROR:
+      is_handled= TRUE;
+      break;
+
+    case ER_NO_SUCH_TABLE:
+      /* Established behavior: warn if underlying tables are missing. */
+      push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 
+                          ER_VIEW_INVALID,
+                          ER(ER_VIEW_INVALID),
+                          m_top_view->get_db_name(),
+                          m_top_view->get_table_name());
+      is_handled= TRUE;
+      break;
+
+    case ER_SP_DOES_NOT_EXIST:
+      /* Established behavior: warn if underlying functions are missing. */
+      push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 
+                          ER_VIEW_INVALID,
+                          ER(ER_VIEW_INVALID),
+                          m_top_view->get_db_name(),
+                          m_top_view->get_table_name());
+      is_handled= TRUE;
+      break;
+    default:
+      is_handled= FALSE;
+    }
+
+    m_handling= FALSE;
+    return is_handled;
+  }
+};
+
+
 bool
 mysqld_show_create(THD *thd, TABLE_LIST *table_list)
 {
@@ -507,26 +629,13 @@ mysqld_show_create(THD *thd, TABLE_LIST 
   /* We want to preserve the tree for views. */
   thd->lex->view_prepare_mode= TRUE;
 
-  /* Only one table for now, but VIEW can involve several tables */
-  if (open_normal_and_derived_tables(thd, table_list, 0))
   {
-    if (!table_list->view ||
-        (thd->is_error() && thd->stmt_da->sql_errno() != ER_VIEW_INVALID))
+    Show_create_error_handler view_error_suppressor(thd, table_list);
+    thd->push_internal_handler(&view_error_suppressor);
+    bool error= open_normal_and_derived_tables(thd, table_list, 0);
+    thd->pop_internal_handler();
+    if (error && thd->is_error())
       DBUG_RETURN(TRUE);
-
-    /*
-      Clear all messages with 'error' level status and
-      issue a warning with 'warning' level status in
-      case of invalid view and last error is ER_VIEW_INVALID
-    */
-    thd->warning_info->clear_warning_info(thd->query_id);
-    thd->clear_error();
-
-    push_warning_printf(thd,MYSQL_ERROR::WARN_LEVEL_WARN,
-                        ER_VIEW_INVALID,
-                        ER(ER_VIEW_INVALID),
-                        table_list->view_db.str,
-                        table_list->view_name.str);
   }
 
   /* TODO: add environment variables show when it become possible */
@@ -3109,7 +3218,7 @@ try_acquire_high_prio_shared_mdl_lock(TH
                                       bool can_deadlock)
 {
   bool error;
-  table->mdl_request.init(MDL_TABLE, table->db, table->table_name,
+  table->mdl_request.init(MDL_key::TABLE, table->db, table->table_name,
                           MDL_SHARED_HIGH_PRIO);
   while (!(error=
            thd->mdl_context.try_acquire_shared_lock(&table->mdl_request)) &&

=== modified file 'sql/sql_table.cc'
--- a/sql/sql_table.cc	2009-09-29 08:40:52 +0000
+++ b/sql/sql_table.cc	2009-09-29 15:03:12 +0000
@@ -4323,7 +4323,8 @@ static int prepare_for_repair(THD *thd, 
     uint key_length;
 
     key_length= create_table_def_key(thd, key, table_list, 0);
-    table_list->mdl_request.init(MDL_TABLE, table_list->db, table_list->table_name,
+    table_list->mdl_request.init(MDL_key::TABLE,
+                                 table_list->db, table_list->table_name,
                                  MDL_EXCLUSIVE);
     if (thd->mdl_context.acquire_exclusive_lock(&table_list->mdl_request))
       DBUG_RETURN(0);
@@ -4844,6 +4845,7 @@ send_result_message:
       close_thread_tables(thd);
       if (!thd->locked_tables_mode)
         thd->mdl_context.release_all_locks();
+      DEBUG_SYNC(thd, "ha_admin_try_alter");
       protocol->store(STRING_WITH_LEN("note"), system_charset_info);
       protocol->store(STRING_WITH_LEN(
           "Table does not support optimize, doing recreate + analyze instead"),
@@ -4877,6 +4879,8 @@ send_result_message:
         if ((table->table= open_ltable(thd, table, lock_type, 0)) &&
             ((result_code= table->table->file->ha_analyze(thd, check_opt)) > 0))
           result_code= 0; // analyze went ok
+        if (result_code)  // analyze failed
+          table->table->file->print_error(result_code, MYF(0));
       }
       /* Start a new row for the final status row */
       protocol->prepare_for_resend();
@@ -5194,7 +5198,8 @@ bool mysql_create_like_table(THD* thd, T
   */
   DBUG_ASSERT((create_info->options & HA_LEX_CREATE_TMP_TABLE) ||
               local_create_info.table_existed ||
-              thd->mdl_context.is_exclusive_lock_owner(MDL_TABLE, table->db,
+              thd->mdl_context.is_exclusive_lock_owner(MDL_key::TABLE,
+                                                       table->db,
                                                        table->table_name));
 
   /*
@@ -6983,7 +6988,8 @@ view_err:
       }
       else
       {
-        target_mdl_request.init(MDL_TABLE, new_db, new_name, MDL_EXCLUSIVE);
+        target_mdl_request.init(MDL_key::TABLE, new_db, new_name,
+                                MDL_EXCLUSIVE);
         if (thd->mdl_context.try_acquire_exclusive_lock(&target_mdl_request))
           DBUG_RETURN(TRUE);
         if (target_mdl_request.ticket == NULL)
@@ -7430,6 +7436,10 @@ view_err:
     new_table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET;
     new_table->next_number_field=new_table->found_next_number_field;
     thd_proc_info(thd, "copy to tmp table");
+    DBUG_EXECUTE_IF("abort_copy_table", {
+        my_error(ER_LOCK_WAIT_TIMEOUT, MYF(0));
+        goto err_new_table_cleanup;
+      });
     error= copy_data_between_tables(table, new_table,
                                     alter_info->create_list, ignore,
                                    order_num, order, &copied, &deleted,

=== modified file 'sql/sql_trigger.cc'
--- a/sql/sql_trigger.cc	2009-09-03 07:11:55 +0000
+++ b/sql/sql_trigger.cc	2009-09-16 14:26:50 +0000
@@ -1886,7 +1886,7 @@ bool Table_triggers_list::change_table_n
     In the future, only an exclusive metadata lock will be enough.
   */
 #ifndef DBUG_OFF
-  if (thd->mdl_context.is_exclusive_lock_owner(MDL_TABLE, db, old_table))
+  if (thd->mdl_context.is_exclusive_lock_owner(MDL_key::TABLE, db, old_table))
     safe_mutex_assert_owner(&LOCK_open);
 #endif
 
@@ -2053,17 +2053,21 @@ add_tables_and_routines_for_triggers(THD
         /* We can have only one trigger per action type currently */
         sp_head *trigger= table_list->table->triggers->bodies[i][j];
 
-        if (trigger && sp_add_used_routine(prelocking_ctx, thd->stmt_arena,
-                                           &trigger->m_sroutines_key,
-                                           table_list->belong_to_view))
+        if (trigger)
         {
-          trigger->add_used_tables_to_table_list(thd,
-                                            &prelocking_ctx->query_tables_last,
-                                            table_list->belong_to_view);
-          sp_update_stmt_used_routines(thd, prelocking_ctx,
-                                       &trigger->m_sroutines,
-                                       table_list->belong_to_view);
-          trigger->propagate_attributes(prelocking_ctx);
+          MDL_key key(MDL_key::TRIGGER, trigger->m_db.str, trigger->m_name.str);
+
+          if (sp_add_used_routine(prelocking_ctx, thd->stmt_arena,
+                                  &key, table_list->belong_to_view))
+          {
+            trigger->add_used_tables_to_table_list(thd,
+                       &prelocking_ctx->query_tables_last,
+                       table_list->belong_to_view);
+            sp_update_stmt_used_routines(thd, prelocking_ctx,
+                                         &trigger->m_sroutines,
+                                         table_list->belong_to_view);
+            trigger->propagate_attributes(prelocking_ctx);
+          }
         }
       }
     }

=== modified file 'sql/sql_view.cc'
--- a/sql/sql_view.cc	2009-08-31 20:25:11 +0000
+++ b/sql/sql_view.cc	2009-09-24 07:46:37 +0000
@@ -397,6 +397,7 @@ bool mysql_create_view(THD *thd, TABLE_L
   lex->link_first_table_back(view, link_to_local);
   view->open_strategy= TABLE_LIST::OPEN_STUB;
   view->lock_strategy= TABLE_LIST::EXCLUSIVE_MDL;
+  view->open_type= OT_BASE_ONLY;
 
   if (open_and_lock_tables(thd, lex->query_tables))
   {

=== modified file 'sql/sql_yacc.yy'
--- a/sql/sql_yacc.yy	2009-09-29 12:58:54 +0000
+++ b/sql/sql_yacc.yy	2009-09-29 15:19:23 +0000
@@ -1018,7 +1018,7 @@ bool my_yyoverflow(short **a, YYSTYPE **
 %token  PREV_SYM
 %token  PRIMARY_SYM                   /* SQL-2003-R */
 %token  PRIVILEGES                    /* SQL-2003-N */
-%token  PROCEDURE                     /* SQL-2003-R */
+%token  PROCEDURE_SYM                 /* SQL-2003-R */
 %token  PROCESS
 %token  PROCESSLIST_SYM
 %token  PROFILE_SYM
@@ -6068,7 +6068,7 @@ alter:
             lex->sql_command= SQLCOM_ALTER_DB_UPGRADE;
             lex->name= $3;
           }
-        | ALTER PROCEDURE sp_name
+        | ALTER PROCEDURE_SYM sp_name
           {
             LEX *lex= Lex;
 
@@ -9985,7 +9985,7 @@ dec_num:
 
 procedure_clause:
           /* empty */
-        | PROCEDURE ident /* Procedure name */
+        | PROCEDURE_SYM ident /* Procedure name */
           {
             LEX *lex=Lex;
 
@@ -10242,7 +10242,7 @@ drop:
             spname->init_qname(thd);
             lex->spname= spname;
           }
-        | DROP PROCEDURE if_exists sp_name
+        | DROP PROCEDURE_SYM if_exists sp_name
           {
             LEX *lex=Lex;
             if (lex->sphead)
@@ -11008,7 +11008,7 @@ show_param:
           {
             Lex->sql_command = SQLCOM_SHOW_SLAVE_STAT;
           }
-        | CREATE PROCEDURE sp_name
+        | CREATE PROCEDURE_SYM sp_name
           {
             LEX *lex= Lex;
 
@@ -11028,7 +11028,7 @@ show_param:
             lex->sql_command= SQLCOM_SHOW_CREATE_TRIGGER;
             lex->spname= $3;
           }
-        | PROCEDURE STATUS_SYM wild_and_where
+        | PROCEDURE_SYM STATUS_SYM wild_and_where
           {
             LEX *lex= Lex;
             lex->sql_command= SQLCOM_SHOW_STATUS_PROC;
@@ -11042,7 +11042,7 @@ show_param:
             if (prepare_schema_table(YYTHD, lex, 0, SCH_PROCEDURES))
               MYSQL_YYABORT;
           }
-        | PROCEDURE CODE_SYM sp_name
+        | PROCEDURE_SYM CODE_SYM sp_name
           {
             Lex->sql_command= SQLCOM_SHOW_PROC_CODE;
             Lex->spname= $3;
@@ -13334,7 +13334,7 @@ revoke_command:
             lex->sql_command= SQLCOM_REVOKE;
             lex->type= TYPE_ENUM_FUNCTION;
           }
-        | grant_privileges ON PROCEDURE grant_ident FROM grant_list
+        | grant_privileges ON PROCEDURE_SYM grant_ident FROM grant_list
           {
             LEX *lex= Lex;
             if (lex->columns.elements)
@@ -13376,7 +13376,7 @@ grant_command:
             lex->sql_command= SQLCOM_GRANT;
             lex->type= TYPE_ENUM_FUNCTION;
           }
-        | grant_privileges ON PROCEDURE grant_ident TO_SYM grant_list
+        | grant_privileges ON PROCEDURE_SYM grant_ident TO_SYM grant_list
           require_clause grant_options
           {
             LEX *lex= Lex;
@@ -14419,7 +14419,7 @@ sf_tail:
         ;
 
 sp_tail:
-          PROCEDURE remember_name sp_name
+          PROCEDURE_SYM remember_name sp_name
           {
             LEX *lex= Lex;
             sp_head *sp;

=== modified file 'sql/table.cc'
--- a/sql/table.cc	2009-09-16 06:17:59 +0000
+++ b/sql/table.cc	2009-09-29 15:12:18 +0000
@@ -3465,7 +3465,12 @@ bool TABLE_LIST::prep_check_option(THD *
 
 
 /**
-  Hide errors which show view underlying table information
+  Hide errors which show view underlying table information. 
+  There are currently two mechanisms at work that handle errors for views,
+  this one and a more general mechanism based on an Internal_error_handler,
+  see Show_create_error_handler. The latter handles errors encountered during
+  execution of SHOW CREATE VIEW, while the machanism using this method is
+  handles SELECT from views. The two methods should not clash.
 
   @param[in,out]  thd     thread handler
 
@@ -3474,6 +3479,8 @@ bool TABLE_LIST::prep_check_option(THD *
 
 void TABLE_LIST::hide_view_error(THD *thd)
 {
+  if (thd->get_internal_handler())
+    return;
   /* Hide "Unknown column" or "Unknown function" error */
   DBUG_ASSERT(thd->is_error());
 
@@ -4937,7 +4944,8 @@ size_t max_row_length(TABLE *table, cons
 void init_mdl_requests(TABLE_LIST *table_list)
 {
   for ( ; table_list ; table_list= table_list->next_global)
-    table_list->mdl_request.init(MDL_TABLE, table_list->db, table_list->table_name,
+    table_list->mdl_request.init(MDL_key::TABLE,
+                                 table_list->db, table_list->table_name,
                                  MDL_SHARED);
 }
 

=== modified file 'sql/table.h'
--- a/sql/table.h	2009-08-31 20:25:11 +0000
+++ b/sql/table.h	2009-09-22 11:44:58 +0000
@@ -294,6 +294,8 @@ TABLE_CATEGORY get_table_category(const 
 
 struct TABLE_share;
 
+extern ulong refresh_version;
+
 /*
   This structure is shared between different table objects. There is one
   instance of table share per one table in the database.
@@ -503,6 +505,14 @@ struct TABLE_SHARE
     return table_map_id;
   }
 
+
+  /*
+    Must all TABLEs be reopened?
+  */
+  inline bool needs_reopen()
+  {
+    return version != refresh_version;
+  }
   /**
     Convert unrelated members of TABLE_SHARE to one enum
     representing its type.
@@ -605,8 +615,6 @@ struct TABLE_SHARE
 };
 
 
-extern ulong refresh_version;
-
 /* Information for one open table */
 enum index_hint_type
 {
@@ -788,6 +796,7 @@ public:
   my_bool auto_increment_field_not_null;
   my_bool alias_name_used;		/* true if table_name is alias */
   my_bool get_fields_in_item_tree;      /* Signal to fix_field */
+  my_bool m_needs_reopen;
 
   REGINFO reginfo;			/* field connections */
   MEM_ROOT mem_root;
@@ -837,7 +846,7 @@ public:
     Is this instance of the table should be reopen?
   */
   inline bool needs_reopen()
-  { return s->version != refresh_version; }
+  { return !db_stat || m_needs_reopen; }
 };
 
 
@@ -1084,7 +1093,7 @@ struct TABLE_LIST
     table_name_length= table_name_length_arg;
     alias= (char*) alias_arg;
     lock_type= lock_type_arg;
-    mdl_request.init(MDL_TABLE, db, table_name, MDL_SHARED);
+    mdl_request.init(MDL_key::TABLE, db, table_name, MDL_SHARED);
   }
 
   /*

=== modified file 'storage/innobase/handler/ha_innodb.cc'
--- a/storage/innobase/handler/ha_innodb.cc	2009-09-18 06:22:43 +0000
+++ b/storage/innobase/handler/ha_innodb.cc	2009-09-22 20:18:14 +0000
@@ -8421,19 +8421,17 @@ static MYSQL_SYSVAR_BOOL(adaptive_hash_i
 static MYSQL_SYSVAR_LONG(additional_mem_pool_size, innobase_additional_mem_pool_size,
   PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
   "Size of a memory pool InnoDB uses to store data dictionary information and other internal data structures.",
-  NULL, NULL, (long)8*1024*1024L, (long)2*1024*1024L, LONG_MAX, (long)1024);
+  NULL, NULL, 1*1024*1024L, 512*1024L, LONG_MAX, 1024);
 
 static MYSQL_SYSVAR_ULONG(autoextend_increment, srv_auto_extend_increment,
   PLUGIN_VAR_RQCMDARG,
   "Data file autoextend increment in megabytes",
-  NULL, NULL, (unsigned long)64L, (unsigned long)1L, (unsigned long)1000L,
-  (unsigned long)0);
+  NULL, NULL, 8L, 1L, 1000L, 0);
 
 static MYSQL_SYSVAR_LONGLONG(buffer_pool_size, innobase_buffer_pool_size,
   PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
   "The size of the memory buffer InnoDB uses to cache data and indexes of its tables.",
-  NULL, NULL, (long long)1024*1024*1024L, (long long)64*1024*1024L,
-  LONGLONG_MAX, (long long)1024*1024L);
+  NULL, NULL, 8*1024*1024L, 1024*1024L, LONGLONG_MAX, 1024*1024L);
 
 static MYSQL_SYSVAR_ULONG(commit_concurrency, srv_commit_concurrency,
   PLUGIN_VAR_RQCMDARG,
@@ -8475,18 +8473,17 @@ static MYSQL_SYSVAR_LONG(lock_wait_timeo
 static MYSQL_SYSVAR_LONG(log_buffer_size, innobase_log_buffer_size,
   PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
   "The size of the buffer which InnoDB uses to write log to the log files on disk.",
-  NULL, NULL, (long)16*1024*1024L, (long)2*1024*1024L, LONG_MAX, (long)1024);
+  NULL, NULL, 1024*1024L, 256*1024L, LONG_MAX, 1024);
 
 static MYSQL_SYSVAR_LONGLONG(log_file_size, innobase_log_file_size,
   PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
   "Size of each log file in a log group.",
-  NULL, NULL, (long long)128*1024*1024L, (long long)32*1024*1024L,
-  LONGLONG_MAX, (long long)1024*1024L);
+  NULL, NULL, 5*1024*1024L, 1*1024*1024L, LONGLONG_MAX, 1024*1024L);
 
 static MYSQL_SYSVAR_LONG(log_files_in_group, innobase_log_files_in_group,
   PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
   "Number of log files in the log group. InnoDB writes to the files in a circular fashion. Value 3 is recommended here.",
-  NULL, NULL, (long)3, (long)2, (long)100, (long)0);
+  NULL, NULL, 2, 2, 100, 0);
 
 static MYSQL_SYSVAR_LONG(mirrored_log_groups, innobase_mirrored_log_groups,
   PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,

=== modified file 'storage/innobase/handler/ha_innodb.h'
--- a/storage/innobase/handler/ha_innodb.h	2009-06-18 08:20:27 +0000
+++ b/storage/innobase/handler/ha_innodb.h	2009-09-16 13:31:23 +0000
@@ -160,17 +160,16 @@ class ha_innobase: public handler
         int lock_table(THD *thd, int lock_type, int lock_timeout)
         {
           /*
-            Preliminarily call the pre-existing internal method for
-            transactional locking and ignore non-transactional locks.
+            Transactional locks in NOWAIT mode is not
+            currently supported by InnoDB
           */
           if (!lock_timeout)
-          {
-            /* Preliminarily show both possible errors for NOWAIT. */
-            if (lock_type == F_WRLCK)
               return HA_ERR_UNSUPPORTED;
-            else
-              return HA_ERR_LOCK_WAIT_TIMEOUT;
-          }
+
+          /*
+            Preliminarily call the pre-existing internal method for
+            transactional locking and ignore non-transactional locks.
+          */
           return transactional_table_lock(thd, lock_type);
         }
 	int external_lock(THD *thd, int lock_type);

=== modified file 'storage/myisammrg/ha_myisammrg.cc'
--- a/storage/myisammrg/ha_myisammrg.cc	2009-09-16 08:23:16 +0000
+++ b/storage/myisammrg/ha_myisammrg.cc	2009-09-25 14:15:30 +0000
@@ -453,6 +453,13 @@ int ha_myisammrg::add_children_list(void
   *this->children_last_l= parent_l->next_global;
   parent_l->next_global= this->children_l;
   this->children_l->prev_global= &parent_l->next_global;
+  /*
+    We have to update LEX::query_tables_last if children are added to
+    the tail of the table list in order to be able correctly add more
+    elements to it (e.g. as part of prelocking process).
+  */
+  if (thd->lex->query_tables_last == &parent_l->next_global)
+    thd->lex->query_tables_last= this->children_last_l;
 
 end:
   DBUG_RETURN(0);
@@ -837,6 +844,8 @@ int ha_myisammrg::detach_children(void)
 
   if (this->children_l)
   {
+    THD *thd= table->in_use;
+
     /* Clear TABLE references. */
     for (child_l= this->children_l; ; child_l= child_l->next_global)
     {
@@ -874,6 +883,14 @@ int ha_myisammrg::detach_children(void)
     if (*this->children_last_l)
       (*this->children_last_l)->prev_global= this->children_l->prev_global;
 
+    /*
+      If table elements being removed are at the end of table list we
+      need to adjust LEX::query_tables_last member to point to the
+      new last element of the list.
+    */
+    if (thd->lex->query_tables_last == this->children_last_l)
+      thd->lex->query_tables_last= this->children_l->prev_global;
+
     /* Terminate child list. So it cannot be tried to remove again. */
     *this->children_last_l= NULL;
     this->children_l->prev_global= NULL;


Attachment: [text/bzr-bundle] bzr/azundris@mysql.com-20090929151923-91u2s620j7n25b8s.bundle
Thread
bzr commit into mysql-pe branch (azundris:3608)Tatiana A. Nurnberg29 Sep