summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.bzrignore5
-rwxr-xr-xBUILD/compile-pentium-gcov5
-rw-r--r--CMakeLists.txt2
-rw-r--r--Makefile.am14
-rw-r--r--client/mysql.cc7
-rw-r--r--client/mysqldump.c69
-rw-r--r--client/mysqltest.c85
-rw-r--r--configure.in16
-rw-r--r--extra/yassl/include/openssl/ssl.h2
-rw-r--r--extra/yassl/include/yassl_int.hpp3
-rw-r--r--extra/yassl/src/ssl.cpp18
-rw-r--r--extra/yassl/src/yassl_int.cpp14
-rw-r--r--include/Makefile.am2
-rw-r--r--include/m_string.h12
-rw-r--r--include/my_base.h8
-rw-r--r--include/my_bitmap.h11
-rw-r--r--include/my_global.h18
-rw-r--r--include/my_md5.h (renamed from include/md5.h)0
-rw-r--r--include/mysql/plugin.h124
-rw-r--r--libmysql/libmysql.c17
-rw-r--r--mysql-test/Makefile.am12
-rw-r--r--mysql-test/extra/binlog_tests/binlog.test63
-rw-r--r--mysql-test/extra/rpl_tests/rpl_loaddata.test4
-rw-r--r--mysql-test/include/have_ndb.inc14
-rw-r--r--mysql-test/include/have_outfile.inc2
-rw-r--r--mysql-test/include/index_merge1.inc48
-rw-r--r--mysql-test/include/innodb_trx_weight.inc51
-rw-r--r--mysql-test/include/mix1.inc166
-rw-r--r--mysql-test/include/ndb_master-slave.inc7
-rw-r--r--mysql-test/lib/mtr_cases.pl241
-rw-r--r--mysql-test/lib/mtr_process.pl35
-rw-r--r--mysql-test/lib/mtr_report.pl37
-rw-r--r--mysql-test/lib/mtr_timer.pl9
-rwxr-xr-xmysql-test/mysql-test-run.pl81
-rw-r--r--mysql-test/ndb/ndb_config_2_node.ini3
-rw-r--r--mysql-test/r/archive-big.result19
-rw-r--r--mysql-test/r/archive.result7
-rw-r--r--mysql-test/r/backup.result2
-rw-r--r--mysql-test/r/binlog_row_binlog.result339
-rw-r--r--mysql-test/r/binlog_stm_binlog.result237
-rw-r--r--mysql-test/r/cast.result11
-rw-r--r--mysql-test/r/create.result16
-rw-r--r--mysql-test/r/csv.result55
-rw-r--r--mysql-test/r/ctype_collate.result8
-rw-r--r--mysql-test/r/events_bugs.result20
-rw-r--r--mysql-test/r/events_trans.result2
-rw-r--r--mysql-test/r/federated.result39
-rw-r--r--mysql-test/r/federated_innodb.result34
-rw-r--r--mysql-test/r/fulltext.result12
-rw-r--r--mysql-test/r/fulltext3.result17
-rw-r--r--mysql-test/r/func_gconcat.result9
-rw-r--r--mysql-test/r/gis-rtree.result13
-rw-r--r--mysql-test/r/gis.result3
-rw-r--r--mysql-test/r/index_merge_myisam.result61
-rw-r--r--mysql-test/r/information_schema.result6
-rw-r--r--mysql-test/r/innodb.result13
-rw-r--r--mysql-test/r/innodb_mysql.result138
-rw-r--r--mysql-test/r/innodb_trx_weight.result1
-rw-r--r--mysql-test/r/join_nested.result111
-rw-r--r--mysql-test/r/loaddata.result68
-rw-r--r--mysql-test/r/log_state.result2
-rw-r--r--mysql-test/r/mysqldump.result37
-rw-r--r--mysql-test/r/mysqltest.result2
-rw-r--r--mysql-test/r/ndb_update.result42
-rw-r--r--mysql-test/r/partition.result10
-rw-r--r--mysql-test/r/partition_bug18198.result173
-rw-r--r--mysql-test/r/partition_charset.result4
-rw-r--r--mysql-test/r/partition_error.result10
-rw-r--r--mysql-test/r/partition_hash.result14
-rw-r--r--mysql-test/r/partition_list.result4
-rw-r--r--mysql-test/r/partition_mgm.result6
-rw-r--r--mysql-test/r/partition_pruning.result66
-rw-r--r--mysql-test/r/partition_range.result78
-rw-r--r--mysql-test/r/query_cache.result42
-rw-r--r--mysql-test/r/rpl_truncate_7ndb.result91
-rw-r--r--mysql-test/r/select.result2
-rw-r--r--mysql-test/r/show_check.result73
-rw-r--r--mysql-test/r/sp-prelocking.result22
-rw-r--r--mysql-test/r/sp.result33
-rw-r--r--mysql-test/r/sp_gis.result4
-rw-r--r--mysql-test/r/sp_trans.result2
-rw-r--r--mysql-test/r/ssl-big.result3
-rw-r--r--mysql-test/r/symlink.result22
-rw-r--r--mysql-test/r/trigger-trans.result59
-rw-r--r--mysql-test/r/trigger.result489
-rw-r--r--mysql-test/r/type_enum.result20
-rw-r--r--mysql-test/r/type_newdecimal.result28
-rw-r--r--mysql-test/r/type_ranges.result4
-rw-r--r--mysql-test/r/type_time.result43
-rw-r--r--mysql-test/r/type_timestamp.result14
-rw-r--r--mysql-test/r/view.result47
-rw-r--r--mysql-test/r/warnings.result2
-rw-r--r--mysql-test/r/windows_shm.result2
-rw-r--r--mysql-test/r/xml.result18
-rw-r--r--mysql-test/suite/binlog/r/binlog_innodb.result (renamed from mysql-test/r/binlog_innodb.result)0
-rw-r--r--mysql-test/suite/binlog/r/binlog_killed.result (renamed from mysql-test/r/binlog_killed.result)0
-rw-r--r--mysql-test/suite/binlog/r/binlog_multi_engine.result (renamed from mysql-test/r/binlog_multi_engine.result)0
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_binlog.result1177
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_ctype_cp932.result (renamed from mysql-test/r/binlog_row_ctype_cp932.result)0
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result (renamed from mysql-test/r/binlog_row_ctype_ucs.result)0
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result (renamed from mysql-test/r/binlog_row_drop_tmp_tbl.result)0
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_innodb_stat.result (renamed from mysql-test/r/binlog_row_innodb_stat.result)0
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_insert_select.result (renamed from mysql-test/r/binlog_row_insert_select.result)0
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result (renamed from mysql-test/r/binlog_row_mix_innodb_myisam.result)0
-rw-r--r--mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result (renamed from mysql-test/r/binlog_statement_insert_delayed.result)0
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_binlog.result672
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_blackhole.result (renamed from mysql-test/r/binlog_stm_blackhole.result)0
-rwxr-xr-xmysql-test/suite/binlog/r/binlog_stm_ctype_cp932.result (renamed from mysql-test/r/binlog_stm_ctype_cp932.result)0
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result (renamed from mysql-test/r/binlog_stm_ctype_ucs.result)0
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result (renamed from mysql-test/r/binlog_stm_drop_tmp_tbl.result)0
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_innodb_stat.result (renamed from mysql-test/r/binlog_stm_innodb_stat.result)0
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_insert_select.result (renamed from mysql-test/r/binlog_stm_insert_select.result)0
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result (renamed from mysql-test/r/binlog_stm_mix_innodb_myisam.result)0
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_ps.result (renamed from mysql-test/r/binlog_stm_ps.result)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_innodb.test (renamed from mysql-test/t/binlog_innodb.test)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_killed.test (renamed from mysql-test/t/binlog_killed.test)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_multi_engine.test (renamed from mysql-test/t/binlog_multi_engine.test)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_row_binlog-master.opt (renamed from mysql-test/t/binlog_row_binlog-master.opt)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_row_binlog.test (renamed from mysql-test/t/binlog_row_binlog.test)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_row_ctype_cp932.test (renamed from mysql-test/t/binlog_row_ctype_cp932.test)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_row_ctype_ucs.test (renamed from mysql-test/t/binlog_row_ctype_ucs.test)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_row_drop_tmp_tbl.test (renamed from mysql-test/t/binlog_row_drop_tmp_tbl.test)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_row_innodb_stat-master.opt (renamed from mysql-test/t/binlog_row_innodb_stat-master.opt)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_row_innodb_stat.test (renamed from mysql-test/t/binlog_row_innodb_stat.test)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_row_insert_select.test (renamed from mysql-test/t/binlog_row_insert_select.test)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_row_mix_innodb_myisam-master.opt (renamed from mysql-test/t/binlog_row_mix_innodb_myisam-master.opt)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_row_mix_innodb_myisam.test (renamed from mysql-test/t/binlog_row_mix_innodb_myisam.test)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_statement_insert_delayed.test (renamed from mysql-test/t/binlog_statement_insert_delayed.test)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_binlog-master.opt (renamed from mysql-test/t/binlog_stm_binlog-master.opt)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_binlog.test (renamed from mysql-test/t/binlog_stm_binlog.test)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_blackhole.test (renamed from mysql-test/t/binlog_stm_blackhole.test)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_ctype_cp932.test (renamed from mysql-test/t/binlog_stm_ctype_cp932.test)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_ctype_ucs.test (renamed from mysql-test/t/binlog_stm_ctype_ucs.test)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_drop_tmp_tbl.test (renamed from mysql-test/t/binlog_stm_drop_tmp_tbl.test)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_innodb_stat-master.opt (renamed from mysql-test/t/binlog_stm_innodb_stat-master.opt)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_innodb_stat.test (renamed from mysql-test/t/binlog_stm_innodb_stat.test)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_insert_select.test (renamed from mysql-test/t/binlog_stm_insert_select.test)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam-master.opt (renamed from mysql-test/t/binlog_stm_mix_innodb_myisam-master.opt)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam.test (renamed from mysql-test/t/binlog_stm_mix_innodb_myisam.test)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_ps.test (renamed from mysql-test/t/binlog_stm_ps.test)0
-rw-r--r--mysql-test/suite/binlog/t/disabled.def14
-rw-r--r--mysql-test/suite/funcs_1/t/suite.opt2
-rw-r--r--mysql-test/suite/funcs_2/t/suite.opt2
-rw-r--r--mysql-test/suite/ndb/r/loaddata_autocom_ndb.result (renamed from mysql-test/r/loaddata_autocom_ndb.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_alter_table.result (renamed from mysql-test/r/ndb_alter_table.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_alter_table2.result (renamed from mysql-test/r/ndb_alter_table2.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_alter_table3.result (renamed from mysql-test/r/ndb_alter_table3.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_autodiscover.result (renamed from mysql-test/r/ndb_autodiscover.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_autodiscover2.result (renamed from mysql-test/r/ndb_autodiscover2.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_autodiscover3.result (renamed from mysql-test/r/ndb_autodiscover3.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_backup_print.result (renamed from mysql-test/r/ndb_backup_print.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_basic.result (renamed from mysql-test/r/ndb_basic.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_binlog_basic.result (renamed from mysql-test/r/ndb_binlog_basic.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_binlog_ddl_multi.result (renamed from mysql-test/r/ndb_binlog_ddl_multi.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_binlog_discover.result (renamed from mysql-test/r/ndb_binlog_discover.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_binlog_format.result (renamed from mysql-test/r/ndb_binlog_format.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_binlog_ignore_db.result (renamed from mysql-test/r/ndb_binlog_ignore_db.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_binlog_log_bin.result (renamed from mysql-test/r/ndb_binlog_log_bin.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_binlog_multi.result (renamed from mysql-test/r/ndb_binlog_multi.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_bitfield.result (renamed from mysql-test/r/ndb_bitfield.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_blob.result (renamed from mysql-test/r/ndb_blob.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_blob_partition.result (renamed from mysql-test/r/ndb_blob_partition.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_cache.result (renamed from mysql-test/r/ndb_cache.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_cache2.result (renamed from mysql-test/r/ndb_cache2.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_cache_multi.result (renamed from mysql-test/r/ndb_cache_multi.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_cache_multi2.result (renamed from mysql-test/r/ndb_cache_multi2.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_charset.result (renamed from mysql-test/r/ndb_charset.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_condition_pushdown.result (renamed from mysql-test/r/ndb_condition_pushdown.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_config.result (renamed from mysql-test/r/ndb_config.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_config2.result (renamed from mysql-test/r/ndb_config2.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_cursor.result (renamed from mysql-test/r/ndb_cursor.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_database.result (renamed from mysql-test/r/ndb_database.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_dd_alter.result (renamed from mysql-test/r/ndb_dd_alter.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_dd_backuprestore.result (renamed from mysql-test/r/ndb_dd_backuprestore.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_dd_basic.result (renamed from mysql-test/r/ndb_dd_basic.result)6
-rw-r--r--mysql-test/suite/ndb/r/ndb_dd_ddl.result (renamed from mysql-test/r/ndb_dd_ddl.result)2
-rw-r--r--mysql-test/suite/ndb/r/ndb_dd_disk2memory.result (renamed from mysql-test/r/ndb_dd_disk2memory.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_dd_dump.result (renamed from mysql-test/r/ndb_dd_dump.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_dd_sql_features.result (renamed from mysql-test/r/ndb_dd_sql_features.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_gis.result (renamed from mysql-test/r/ndb_gis.result)4
-rw-r--r--mysql-test/suite/ndb/r/ndb_grant.result (renamed from mysql-test/r/ndb_grant.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_index.result (renamed from mysql-test/r/ndb_index.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_index_ordered.result (renamed from mysql-test/r/ndb_index_ordered.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_index_unique.result (renamed from mysql-test/r/ndb_index_unique.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_insert.result (renamed from mysql-test/r/ndb_insert.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_limit.result (renamed from mysql-test/r/ndb_limit.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_load.result (renamed from mysql-test/r/ndb_load.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_loaddatalocal.result (renamed from mysql-test/r/ndb_loaddatalocal.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_lock.result (renamed from mysql-test/r/ndb_lock.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_minmax.result (renamed from mysql-test/r/ndb_minmax.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_multi.result (renamed from mysql-test/r/ndb_multi.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_multi_row.result (renamed from mysql-test/r/ndb_multi_row.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_partition_error.result (renamed from mysql-test/r/ndb_partition_error.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_partition_error2.result (renamed from mysql-test/r/ndb_partition_error2.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_partition_key.result (renamed from mysql-test/r/ndb_partition_key.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_partition_list.result (renamed from mysql-test/r/ndb_partition_list.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_partition_range.result (renamed from mysql-test/r/ndb_partition_range.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_read_multi_range.result (renamed from mysql-test/r/ndb_read_multi_range.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_rename.result (renamed from mysql-test/r/ndb_rename.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_replace.result (renamed from mysql-test/r/ndb_replace.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_restore.result (renamed from mysql-test/r/ndb_restore.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_restore_compat.result (renamed from mysql-test/r/ndb_restore_compat.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_restore_partition.result (renamed from mysql-test/r/ndb_restore_partition.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_restore_print.result (renamed from mysql-test/r/ndb_restore_print.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_row_format.result (renamed from mysql-test/r/ndb_row_format.result)2
-rw-r--r--mysql-test/suite/ndb/r/ndb_single_user.result (renamed from mysql-test/r/ndb_single_user.result)10
-rw-r--r--mysql-test/suite/ndb/r/ndb_sp.result (renamed from mysql-test/r/ndb_sp.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_subquery.result (renamed from mysql-test/r/ndb_subquery.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_temporary.result (renamed from mysql-test/r/ndb_temporary.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_transaction.result (renamed from mysql-test/r/ndb_transaction.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_trigger.result (renamed from mysql-test/r/ndb_trigger.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_truncate.result (renamed from mysql-test/r/ndb_truncate.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_types.result (renamed from mysql-test/r/ndb_types.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndb_update.result88
-rw-r--r--mysql-test/suite/ndb/r/ndb_view.result (renamed from mysql-test/r/ndb_view.result)0
-rw-r--r--mysql-test/suite/ndb/r/ndbapi.result (renamed from mysql-test/r/ndbapi.result)0
-rw-r--r--mysql-test/suite/ndb/r/partition_03ndb.result (renamed from mysql-test/r/partition_03ndb.result)0
-rw-r--r--mysql-test/suite/ndb/r/ps_7ndb.result (renamed from mysql-test/r/ps_7ndb.result)0
-rw-r--r--mysql-test/suite/ndb/r/strict_autoinc_5ndb.result (renamed from mysql-test/r/strict_autoinc_5ndb.result)0
-rw-r--r--mysql-test/suite/ndb/t/disabled.def25
-rw-r--r--mysql-test/suite/ndb/t/loaddata_autocom_ndb.test (renamed from mysql-test/t/loaddata_autocom_ndb.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_alter_table.test (renamed from mysql-test/t/ndb_alter_table.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_alter_table2.test (renamed from mysql-test/t/ndb_alter_table2.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_alter_table3.test (renamed from mysql-test/t/ndb_alter_table3.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_autodiscover.test (renamed from mysql-test/t/ndb_autodiscover.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_autodiscover2-master.opt (renamed from mysql-test/t/ndb_autodiscover2-master.opt)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_autodiscover2.test (renamed from mysql-test/t/ndb_autodiscover2.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_autodiscover3.test (renamed from mysql-test/t/ndb_autodiscover3.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_backup_print.test (renamed from mysql-test/t/ndb_backup_print.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_basic.test (renamed from mysql-test/t/ndb_basic.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_binlog_basic.test (renamed from mysql-test/t/ndb_binlog_basic.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_binlog_ddl_multi.test (renamed from mysql-test/t/ndb_binlog_ddl_multi.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_binlog_discover.test (renamed from mysql-test/t/ndb_binlog_discover.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_binlog_format.test (renamed from mysql-test/t/ndb_binlog_format.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_binlog_ignore_db-master.opt (renamed from mysql-test/t/ndb_binlog_ignore_db-master.opt)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_binlog_ignore_db.test (renamed from mysql-test/t/ndb_binlog_ignore_db.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_binlog_log_bin.test (renamed from mysql-test/t/ndb_binlog_log_bin.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_binlog_multi.test (renamed from mysql-test/t/ndb_binlog_multi.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_bitfield.test (renamed from mysql-test/t/ndb_bitfield.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_blob.test (renamed from mysql-test/t/ndb_blob.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_blob_partition.test (renamed from mysql-test/t/ndb_blob_partition.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_cache.test (renamed from mysql-test/t/ndb_cache.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_cache2.test (renamed from mysql-test/t/ndb_cache2.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_cache_multi.test (renamed from mysql-test/t/ndb_cache_multi.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_cache_multi2.test (renamed from mysql-test/t/ndb_cache_multi2.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_charset.test (renamed from mysql-test/t/ndb_charset.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_condition_pushdown.test (renamed from mysql-test/t/ndb_condition_pushdown.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_config.test (renamed from mysql-test/t/ndb_config.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_config2.test (renamed from mysql-test/t/ndb_config2.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_cursor.test (renamed from mysql-test/t/ndb_cursor.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_database.test (renamed from mysql-test/t/ndb_database.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_dd_alter.test (renamed from mysql-test/t/ndb_dd_alter.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_dd_backuprestore.test (renamed from mysql-test/t/ndb_dd_backuprestore.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_dd_basic.test (renamed from mysql-test/t/ndb_dd_basic.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_dd_ddl.test (renamed from mysql-test/t/ndb_dd_ddl.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_dd_disk2memory.test (renamed from mysql-test/t/ndb_dd_disk2memory.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_dd_dump.test (renamed from mysql-test/t/ndb_dd_dump.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_dd_sql_features.test (renamed from mysql-test/t/ndb_dd_sql_features.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_gis.test (renamed from mysql-test/t/ndb_gis.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_grant.later (renamed from mysql-test/t/ndb_grant.later)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_index.test (renamed from mysql-test/t/ndb_index.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_index_ordered.test (renamed from mysql-test/t/ndb_index_ordered.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_index_unique.test (renamed from mysql-test/t/ndb_index_unique.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_insert.test (renamed from mysql-test/t/ndb_insert.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_limit.test (renamed from mysql-test/t/ndb_limit.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_load.test (renamed from mysql-test/t/ndb_load.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_loaddatalocal.test (renamed from mysql-test/t/ndb_loaddatalocal.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_lock.test (renamed from mysql-test/t/ndb_lock.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_minmax.test (renamed from mysql-test/t/ndb_minmax.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_multi.test (renamed from mysql-test/t/ndb_multi.test)1
-rw-r--r--mysql-test/suite/ndb/t/ndb_multi_row.test (renamed from mysql-test/t/ndb_multi_row.test)1
-rw-r--r--mysql-test/suite/ndb/t/ndb_partition_error.test (renamed from mysql-test/t/ndb_partition_error.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_partition_error2-master.opt (renamed from mysql-test/t/ndb_partition_error2-master.opt)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_partition_error2.test (renamed from mysql-test/t/ndb_partition_error2.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_partition_key.test (renamed from mysql-test/t/ndb_partition_key.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_partition_list.test (renamed from mysql-test/t/ndb_partition_list.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_partition_range.test (renamed from mysql-test/t/ndb_partition_range.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_read_multi_range.test (renamed from mysql-test/t/ndb_read_multi_range.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_rename.test (renamed from mysql-test/t/ndb_rename.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_replace.test (renamed from mysql-test/t/ndb_replace.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_restore.test (renamed from mysql-test/t/ndb_restore.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_restore_compat.test (renamed from mysql-test/t/ndb_restore_compat.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_restore_partition-master.opt (renamed from mysql-test/t/ndb_restore_partition-master.opt)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_restore_partition.test (renamed from mysql-test/t/ndb_restore_partition.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_restore_print.test (renamed from mysql-test/t/ndb_restore_print.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_row_format.test (renamed from mysql-test/t/ndb_row_format.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_single_user.test (renamed from mysql-test/t/ndb_single_user.test)2
-rw-r--r--mysql-test/suite/ndb/t/ndb_sp.test (renamed from mysql-test/t/ndb_sp.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_subquery.test (renamed from mysql-test/t/ndb_subquery.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_temporary.test (renamed from mysql-test/t/ndb_temporary.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_transaction.test (renamed from mysql-test/t/ndb_transaction.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_trigger.test (renamed from mysql-test/t/ndb_trigger.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_truncate.test (renamed from mysql-test/t/ndb_truncate.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_types.test (renamed from mysql-test/t/ndb_types.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndb_update.test89
-rw-r--r--mysql-test/suite/ndb/t/ndb_view.test (renamed from mysql-test/t/ndb_view.test)0
-rw-r--r--mysql-test/suite/ndb/t/ndbapi.test (renamed from mysql-test/t/ndbapi.test)0
-rw-r--r--mysql-test/suite/ndb/t/partition_03ndb.test (renamed from mysql-test/t/partition_03ndb.test)0
-rw-r--r--mysql-test/suite/ndb/t/ps_7ndb.test (renamed from mysql-test/t/ps_7ndb.test)0
-rw-r--r--mysql-test/suite/ndb/t/strict_autoinc_5ndb.test (renamed from mysql-test/t/strict_autoinc_5ndb.test)0
-rw-r--r--mysql-test/suite/parts/r/rpl_partition.result (renamed from mysql-test/r/rpl_partition.result)22
-rw-r--r--mysql-test/suite/parts/t/disabled.def1
-rw-r--r--mysql-test/suite/parts/t/rpl_partition.test (renamed from mysql-test/t/rpl_partition.test)4
-rw-r--r--mysql-test/suite/rpl/r/rpl000001.a.result (renamed from mysql-test/r/rpl000001.a.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl000001.b.result (renamed from mysql-test/r/rpl000001.b.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl000010.result (renamed from mysql-test/r/rpl000010.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl000011.result (renamed from mysql-test/r/rpl000011.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl000013.result (renamed from mysql-test/r/rpl000013.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl000017.result (renamed from mysql-test/r/rpl000017.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_000015.result (renamed from mysql-test/r/rpl_000015.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_EE_err.result (renamed from mysql-test/r/rpl_EE_err.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_LD_INFILE.result (renamed from mysql-test/r/rpl_LD_INFILE.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_alter.result (renamed from mysql-test/r/rpl_alter.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_alter_db.result (renamed from mysql-test/r/rpl_alter_db.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_auto_increment.result (renamed from mysql-test/r/rpl_auto_increment.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_auto_increment_11932.result (renamed from mysql-test/r/rpl_auto_increment_11932.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_bit.result (renamed from mysql-test/r/rpl_bit.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_bit_npk.result (renamed from mysql-test/r/rpl_bit_npk.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_change_master.result (renamed from mysql-test/r/rpl_change_master.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_charset_sjis.result (renamed from mysql-test/r/rpl_charset_sjis.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_commit_after_flush.result (renamed from mysql-test/r/rpl_commit_after_flush.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_create_database.result (renamed from mysql-test/r/rpl_create_database.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_critical_errors.result (renamed from mysql-test/r/rpl_critical_errors.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_critical_errors.result.txt (renamed from mysql-test/r/rpl_critical_errors.result.txt)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_ddl.result (renamed from mysql-test/r/rpl_ddl.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_deadlock_innodb.result (renamed from mysql-test/r/rpl_deadlock_innodb.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_delete_no_where.result (renamed from mysql-test/r/rpl_delete_no_where.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_do_grant.result (renamed from mysql-test/r/rpl_do_grant.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_drop.result (renamed from mysql-test/r/rpl_drop.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_drop_db.result (renamed from mysql-test/r/rpl_drop_db.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_drop_temp.result (renamed from mysql-test/r/rpl_drop_temp.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_dual_pos_advance.result (renamed from mysql-test/r/rpl_dual_pos_advance.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_empty_master_crash.result (renamed from mysql-test/r/rpl_empty_master_crash.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_err_ignoredtable.result (renamed from mysql-test/r/rpl_err_ignoredtable.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_events.result (renamed from mysql-test/r/rpl_events.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_extraCol_innodb.result (renamed from mysql-test/r/rpl_extraCol_innodb.result)28
-rw-r--r--mysql-test/suite/rpl/r/rpl_extraCol_myisam.result (renamed from mysql-test/r/rpl_extraCol_myisam.result)28
-rw-r--r--mysql-test/suite/rpl/r/rpl_failed_optimize.result (renamed from mysql-test/r/rpl_failed_optimize.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_flushlog_loop.result (renamed from mysql-test/r/rpl_flushlog_loop.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result (renamed from mysql-test/r/rpl_foreign_key_innodb.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_free_items.result (renamed from mysql-test/r/rpl_free_items.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_get_lock.result (renamed from mysql-test/r/rpl_get_lock.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_grant.result (renamed from mysql-test/r/rpl_grant.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_ignore_grant.result (renamed from mysql-test/r/rpl_ignore_grant.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_ignore_revoke.result (renamed from mysql-test/r/rpl_ignore_revoke.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_ignore_table.result (renamed from mysql-test/r/rpl_ignore_table.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_ignore_table_update.result (renamed from mysql-test/r/rpl_ignore_table_update.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_incident.result (renamed from mysql-test/r/rpl_incident.result)4
-rw-r--r--mysql-test/suite/rpl/r/rpl_init_slave.result (renamed from mysql-test/r/rpl_init_slave.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_innodb.result (renamed from mysql-test/r/rpl_innodb.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_insert.result (renamed from mysql-test/r/rpl_insert.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_insert_id.result (renamed from mysql-test/r/rpl_insert_id.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_insert_id_pk.result (renamed from mysql-test/r/rpl_insert_id_pk.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_insert_ignore.result (renamed from mysql-test/r/rpl_insert_ignore.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_insert_select.result (renamed from mysql-test/r/rpl_insert_select.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_invoked_features.result (renamed from mysql-test/r/rpl_invoked_features.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_known_bugs_detection.result (renamed from mysql-test/r/rpl_known_bugs_detection.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_load_from_master.result (renamed from mysql-test/r/rpl_load_from_master.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_load_table_from_master.result (renamed from mysql-test/r/rpl_load_table_from_master.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata.result (renamed from mysql-test/r/rpl_loaddata.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_charset.result (renamed from mysql-test/r/rpl_loaddata_charset.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_fatal.result (renamed from mysql-test/r/rpl_loaddata_fatal.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_m.result (renamed from mysql-test/r/rpl_loaddata_m.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_s.result (renamed from mysql-test/r/rpl_loaddata_s.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_simple.result (renamed from mysql-test/r/rpl_loaddata_simple.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddatalocal.result (renamed from mysql-test/r/rpl_loaddatalocal.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_loadfile.result (renamed from mysql-test/r/rpl_loadfile.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_locale.result (renamed from mysql-test/r/rpl_locale.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_log_pos.result (renamed from mysql-test/r/rpl_log_pos.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_many_optimize.result (renamed from mysql-test/r/rpl_many_optimize.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_master_pos_wait.result (renamed from mysql-test/r/rpl_master_pos_wait.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_misc_functions.result (renamed from mysql-test/r/rpl_misc_functions.result)29
-rw-r--r--mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result (renamed from mysql-test/r/rpl_mixed_ddl_dml.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_multi_delete.result (renamed from mysql-test/r/rpl_multi_delete.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_multi_delete2.result (renamed from mysql-test/r/rpl_multi_delete2.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_multi_engine.result (renamed from mysql-test/r/rpl_multi_engine.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_multi_update.result (renamed from mysql-test/r/rpl_multi_update.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_multi_update2.result (renamed from mysql-test/r/rpl_multi_update2.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_multi_update3.result (renamed from mysql-test/r/rpl_multi_update3.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_multi_update4.result (renamed from mysql-test/r/rpl_multi_update4.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_optimize.result (renamed from mysql-test/r/rpl_optimize.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_packet.result (renamed from mysql-test/r/rpl_packet.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_ps.result (renamed from mysql-test/r/rpl_ps.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result (renamed from mysql-test/r/rpl_rbr_to_sbr.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_read_only.result (renamed from mysql-test/r/rpl_read_only.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_redirect.result (renamed from mysql-test/r/rpl_redirect.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_relay_space_innodb.result (renamed from mysql-test/r/rpl_relay_space_innodb.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_relay_space_myisam.result (renamed from mysql-test/r/rpl_relay_space_myisam.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_relayrotate.result (renamed from mysql-test/r/rpl_relayrotate.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_relayspace.result (renamed from mysql-test/r/rpl_relayspace.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_replicate_do.result (renamed from mysql-test/r/rpl_replicate_do.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_replicate_ignore_db.result (renamed from mysql-test/r/rpl_replicate_ignore_db.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_rewrt_db.result (renamed from mysql-test/r/rpl_rewrt_db.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_rotate_logs.result (renamed from mysql-test/r/rpl_rotate_logs.result)8
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_001.result (renamed from mysql-test/r/rpl_row_001.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_4_bytes.result (renamed from mysql-test/r/rpl_row_4_bytes.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_NOW.result (renamed from mysql-test/r/rpl_row_NOW.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_USER.result (renamed from mysql-test/r/rpl_row_USER.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_UUID.result (renamed from mysql-test/r/rpl_row_UUID.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_basic_11bugs-master.opt (renamed from mysql-test/r/rpl_row_basic_11bugs-master.opt)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_basic_11bugs-slave.opt (renamed from mysql-test/r/rpl_row_basic_11bugs-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result (renamed from mysql-test/r/rpl_row_basic_11bugs.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result (renamed from mysql-test/r/rpl_row_basic_2myisam.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result (renamed from mysql-test/r/rpl_row_basic_3innodb.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_basic_8partition.result (renamed from mysql-test/r/rpl_row_basic_8partition.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_blob_innodb.result (renamed from mysql-test/r/rpl_row_blob_innodb.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_blob_myisam.result (renamed from mysql-test/r/rpl_row_blob_myisam.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_charset.result (renamed from mysql-test/r/rpl_row_charset.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_create_table.result (renamed from mysql-test/r/rpl_row_create_table.result)28
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_delayed_ins.result (renamed from mysql-test/r/rpl_row_delayed_ins.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_drop.result (renamed from mysql-test/r/rpl_row_drop.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_err_ignoredtable.result (renamed from mysql-test/r/rpl_row_err_ignoredtable.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result (renamed from mysql-test/r/rpl_row_flsh_tbls.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_func001.result (renamed from mysql-test/r/rpl_row_func001.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_func002.result (renamed from mysql-test/r/rpl_row_func002.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_func003.result (renamed from mysql-test/r/rpl_row_func003.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result (renamed from mysql-test/r/rpl_row_inexist_tbl.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_insert_delayed.result (renamed from mysql-test/r/rpl_row_insert_delayed.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_loaddata_m.result (renamed from mysql-test/r/rpl_row_loaddata_m.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_log.result (renamed from mysql-test/r/rpl_row_log.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_log_innodb.result (renamed from mysql-test/r/rpl_row_log_innodb.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_max_relay_size.result (renamed from mysql-test/r/rpl_row_max_relay_size.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_multi_query.result (renamed from mysql-test/r/rpl_row_multi_query.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result (renamed from mysql-test/r/rpl_row_mysqlbinlog.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_mystery22.result (renamed from mysql-test/r/rpl_row_mystery22.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_reset_slave.result (renamed from mysql-test/r/rpl_row_reset_slave.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp001.result (renamed from mysql-test/r/rpl_row_sp001.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp002_innodb.result (renamed from mysql-test/r/rpl_row_sp002_innodb.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp003.result (renamed from mysql-test/r/rpl_row_sp003.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp005.result (renamed from mysql-test/r/rpl_row_sp005.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp006_InnoDB.result (renamed from mysql-test/r/rpl_row_sp006_InnoDB.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp007_innodb.result (renamed from mysql-test/r/rpl_row_sp007_innodb.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp008.result (renamed from mysql-test/r/rpl_row_sp008.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp009.result (renamed from mysql-test/r/rpl_row_sp009.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp010.result (renamed from mysql-test/r/rpl_row_sp010.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp011.result (renamed from mysql-test/r/rpl_row_sp011.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp012.result (renamed from mysql-test/r/rpl_row_sp012.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_stop_middle.result (renamed from mysql-test/r/rpl_row_stop_middle.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_stop_middle_update.result (renamed from mysql-test/r/rpl_row_stop_middle_update.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result (renamed from mysql-test/r/rpl_row_tabledefs_2myisam.result)20
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result (renamed from mysql-test/r/rpl_row_tabledefs_3innodb.result)20
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_tabledefs_7ndb.result (renamed from mysql-test/r/rpl_row_tabledefs_7ndb.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_trig001.result (renamed from mysql-test/r/rpl_row_trig001.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_trig002.result (renamed from mysql-test/r/rpl_row_trig002.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_trig003.result (renamed from mysql-test/r/rpl_row_trig003.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_trig004.result (renamed from mysql-test/r/rpl_row_trig004.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_until.result (renamed from mysql-test/r/rpl_row_until.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_view01.result (renamed from mysql-test/r/rpl_row_view01.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_server_id1.result (renamed from mysql-test/r/rpl_server_id1.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_server_id2.result (renamed from mysql-test/r/rpl_server_id2.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_session_var.result (renamed from mysql-test/r/rpl_session_var.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_set_charset.result (renamed from mysql-test/r/rpl_set_charset.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_sf.result (renamed from mysql-test/r/rpl_sf.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_skip_error.result (renamed from mysql-test/r/rpl_skip_error.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_slave_skip.result (renamed from mysql-test/r/rpl_slave_skip.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_slave_status.result (renamed from mysql-test/r/rpl_slave_status.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_sp.result (renamed from mysql-test/r/rpl_sp.result)2
-rw-r--r--mysql-test/suite/rpl/r/rpl_sp004.result (renamed from mysql-test/r/rpl_sp004.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_sp_effects.result (renamed from mysql-test/r/rpl_sp_effects.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_sporadic_master.result (renamed from mysql-test/r/rpl_sporadic_master.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_ssl.result (renamed from mysql-test/r/rpl_ssl.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_ssl1.result (renamed from mysql-test/r/rpl_ssl1.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_start_stop_slave.result (renamed from mysql-test/r/rpl_start_stop_slave.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_000001.result (renamed from mysql-test/r/rpl_stm_000001.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_EE_err2.result (renamed from mysql-test/r/rpl_stm_EE_err2.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_charset.result (renamed from mysql-test/r/rpl_stm_charset.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result (renamed from mysql-test/r/rpl_stm_flsh_tbls.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result (renamed from mysql-test/r/rpl_stm_insert_delayed.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_log.result (renamed from mysql-test/r/rpl_stm_log.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result (renamed from mysql-test/r/rpl_stm_max_relay_size.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_multi_query.result (renamed from mysql-test/r/rpl_stm_multi_query.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_mystery22.result (renamed from mysql-test/r/rpl_stm_mystery22.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_no_op.result (renamed from mysql-test/r/rpl_stm_no_op.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_reset_slave.result (renamed from mysql-test/r/rpl_stm_reset_slave.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_until.result (renamed from mysql-test/r/rpl_stm_until.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result (renamed from mysql-test/r/rpl_switch_stm_row_mixed.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_temp_table.result (renamed from mysql-test/r/rpl_temp_table.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_temporary.result (renamed from mysql-test/r/rpl_temporary.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_timezone.result (renamed from mysql-test/r/rpl_timezone.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_trigger.result (renamed from mysql-test/r/rpl_trigger.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_trunc_temp.result (renamed from mysql-test/r/rpl_trunc_temp.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_truncate_2myisam.result (renamed from mysql-test/r/rpl_truncate_2myisam.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_truncate_3innodb.result (renamed from mysql-test/r/rpl_truncate_3innodb.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_truncate_7ndb_2.result (renamed from mysql-test/r/rpl_truncate_7ndb_2.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_udf.result (renamed from mysql-test/r/rpl_udf.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_user_variables.result (renamed from mysql-test/r/rpl_user_variables.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_variables.result (renamed from mysql-test/r/rpl_variables.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_view.result (renamed from mysql-test/r/rpl_view.result)0
-rw-r--r--mysql-test/suite/rpl/t/disabled.def32
-rw-r--r--mysql-test/suite/rpl/t/rpl000010-slave.opt (renamed from mysql-test/t/rpl000010-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl000010.test (renamed from mysql-test/t/rpl000010.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl000011.test (renamed from mysql-test/t/rpl000011.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl000013.test (renamed from mysql-test/t/rpl000013.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl000017-slave.opt (renamed from mysql-test/t/rpl000017-slave.opt)0
-rwxr-xr-xmysql-test/suite/rpl/t/rpl000017-slave.sh (renamed from mysql-test/t/rpl000017-slave.sh)0
-rw-r--r--mysql-test/suite/rpl/t/rpl000017.test (renamed from mysql-test/t/rpl000017.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl000018-master.opt (renamed from mysql-test/t/rpl000018-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl000018-slave.opt (renamed from mysql-test/t/rpl000018-slave.opt)0
-rwxr-xr-xmysql-test/suite/rpl/t/rpl_000015-slave.sh (renamed from mysql-test/t/rpl_000015-slave.sh)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_000015.slave-mi (renamed from mysql-test/t/rpl_000015.slave-mi)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_000015.test (renamed from mysql-test/t/rpl_000015.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_EE_err.test (renamed from mysql-test/t/rpl_EE_err.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_LD_INFILE.test (renamed from mysql-test/t/rpl_LD_INFILE.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_alter.test (renamed from mysql-test/t/rpl_alter.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_alter_db.test (renamed from mysql-test/t/rpl_alter_db.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_auto_increment-master.opt (renamed from mysql-test/t/rpl_auto_increment-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_auto_increment-slave.opt (renamed from mysql-test/t/rpl_auto_increment-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_auto_increment.test (renamed from mysql-test/t/rpl_auto_increment.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_auto_increment_11932.test (renamed from mysql-test/t/rpl_auto_increment_11932.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_bit.test (renamed from mysql-test/t/rpl_bit.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_bit_npk.test (renamed from mysql-test/t/rpl_bit_npk.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_change_master.test (renamed from mysql-test/t/rpl_change_master.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_charset_sjis.test (renamed from mysql-test/t/rpl_charset_sjis.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_commit_after_flush.test (renamed from mysql-test/t/rpl_commit_after_flush.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_create_database-master.opt (renamed from mysql-test/t/rpl_create_database-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_create_database-slave.opt (renamed from mysql-test/t/rpl_create_database-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_create_database.test (renamed from mysql-test/t/rpl_create_database.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_critical_errors.test (renamed from mysql-test/t/rpl_critical_errors.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_ddl.test (renamed from mysql-test/t/rpl_ddl.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_deadlock_innodb-slave.opt (renamed from mysql-test/t/rpl_deadlock_innodb-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_deadlock_innodb.test (renamed from mysql-test/t/rpl_deadlock_innodb.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_delete_no_where.test (renamed from mysql-test/t/rpl_delete_no_where.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_do_grant.test (renamed from mysql-test/t/rpl_do_grant.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_drop.test (renamed from mysql-test/t/rpl_drop.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_drop_db.test (renamed from mysql-test/t/rpl_drop_db.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_drop_temp-slave.opt (renamed from mysql-test/t/rpl_drop_temp-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_drop_temp.test (renamed from mysql-test/t/rpl_drop_temp.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_dual_pos_advance-master.opt (renamed from mysql-test/t/rpl_dual_pos_advance-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_dual_pos_advance.test (renamed from mysql-test/t/rpl_dual_pos_advance.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_empty_master_crash-master.opt (renamed from mysql-test/t/rpl_empty_master_crash-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_empty_master_crash.test (renamed from mysql-test/t/rpl_empty_master_crash.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_err_ignoredtable-slave.opt (renamed from mysql-test/t/rpl_err_ignoredtable-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_err_ignoredtable.test (renamed from mysql-test/t/rpl_err_ignoredtable.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_events.test (renamed from mysql-test/t/rpl_events.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_extraCol_innodb-master.opt (renamed from mysql-test/t/rpl_extraCol_innodb-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_extraCol_innodb-slave.opt (renamed from mysql-test/t/rpl_extraCol_innodb-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_extraCol_innodb.test (renamed from mysql-test/t/rpl_extraCol_innodb.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_extraCol_myisam.test (renamed from mysql-test/t/rpl_extraCol_myisam.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_failed_optimize-master.opt (renamed from mysql-test/t/rpl_failed_optimize-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_failed_optimize.test (renamed from mysql-test/t/rpl_failed_optimize.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_flushlog_loop-master.opt (renamed from mysql-test/t/rpl_flushlog_loop-master.opt)0
-rwxr-xr-xmysql-test/suite/rpl/t/rpl_flushlog_loop-master.sh (renamed from mysql-test/t/rpl_flushlog_loop-master.sh)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.opt (renamed from mysql-test/t/rpl_flushlog_loop-slave.opt)0
-rwxr-xr-xmysql-test/suite/rpl/t/rpl_flushlog_loop-slave.sh (renamed from mysql-test/t/rpl_flushlog_loop-slave.sh)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_flushlog_loop.test (renamed from mysql-test/t/rpl_flushlog_loop.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_foreign_key_innodb-slave.opt (renamed from mysql-test/t/rpl_foreign_key_innodb-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_foreign_key_innodb.test (renamed from mysql-test/t/rpl_foreign_key_innodb.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_free_items-slave.opt (renamed from mysql-test/t/rpl_free_items-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_free_items.test (renamed from mysql-test/t/rpl_free_items.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_get_lock.test (renamed from mysql-test/t/rpl_get_lock.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_grant.test (renamed from mysql-test/t/rpl_grant.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_ignore_grant-slave.opt (renamed from mysql-test/t/rpl_ignore_grant-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_ignore_grant.test (renamed from mysql-test/t/rpl_ignore_grant.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_ignore_revoke-slave.opt (renamed from mysql-test/t/rpl_ignore_revoke-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_ignore_revoke.test (renamed from mysql-test/t/rpl_ignore_revoke.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_ignore_table-slave.opt (renamed from mysql-test/t/rpl_ignore_table-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_ignore_table.test (renamed from mysql-test/t/rpl_ignore_table.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_ignore_table_update-slave.opt (renamed from mysql-test/t/rpl_ignore_table_update-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_ignore_table_update.test (renamed from mysql-test/t/rpl_ignore_table_update.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_incident-master.opt (renamed from mysql-test/t/rpl_incident-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_incident.test (renamed from mysql-test/t/rpl_incident.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_init_slave-slave.opt (renamed from mysql-test/t/rpl_init_slave-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_init_slave.test (renamed from mysql-test/t/rpl_init_slave.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_innodb.test (renamed from mysql-test/t/rpl_innodb.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert.test (renamed from mysql-test/t/rpl_insert.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert_id-slave.opt (renamed from mysql-test/t/rpl_insert_id-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert_id.test (renamed from mysql-test/t/rpl_insert_id.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert_id_pk-slave.opt (renamed from mysql-test/t/rpl_insert_id_pk-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert_id_pk.test (renamed from mysql-test/t/rpl_insert_id_pk.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert_ignore-slave.opt (renamed from mysql-test/t/rpl_insert_ignore-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert_ignore.test (renamed from mysql-test/t/rpl_insert_ignore.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert_select.test (renamed from mysql-test/t/rpl_insert_select.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_invoked_features-master.opt (renamed from mysql-test/t/rpl_invoked_features-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_invoked_features-slave.opt (renamed from mysql-test/t/rpl_invoked_features-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_invoked_features.test (renamed from mysql-test/t/rpl_invoked_features.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_known_bugs_detection-master.opt (renamed from mysql-test/t/rpl_known_bugs_detection-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_known_bugs_detection.test (renamed from mysql-test/t/rpl_known_bugs_detection.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_load_from_master-slave.opt (renamed from mysql-test/t/rpl_load_from_master-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_load_from_master.test (renamed from mysql-test/t/rpl_load_from_master.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_load_table_from_master.test (renamed from mysql-test/t/rpl_load_table_from_master.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata.test (renamed from mysql-test/t/rpl_loaddata.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_charset.test (renamed from mysql-test/t/rpl_loaddata_charset.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_fatal-slave.opt (renamed from mysql-test/t/rpl_loaddata_fatal-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_fatal.test (renamed from mysql-test/t/rpl_loaddata_fatal.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_m-master.opt (renamed from mysql-test/t/rpl_loaddata_m-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_m.test (renamed from mysql-test/t/rpl_loaddata_m.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_s-slave.opt (renamed from mysql-test/t/rpl_loaddata_s-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_s.test (renamed from mysql-test/t/rpl_loaddata_s.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_simple.test (renamed from mysql-test/t/rpl_loaddata_simple.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddatalocal.test (renamed from mysql-test/t/rpl_loaddatalocal.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_loadfile.test (renamed from mysql-test/t/rpl_loadfile.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_locale.test (renamed from mysql-test/t/rpl_locale.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_log_pos.test (renamed from mysql-test/t/rpl_log_pos.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_many_optimize.test (renamed from mysql-test/t/rpl_many_optimize.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_master_pos_wait.test (renamed from mysql-test/t/rpl_master_pos_wait.test)0
-rwxr-xr-xmysql-test/suite/rpl/t/rpl_misc_functions-slave.sh (renamed from mysql-test/t/rpl_misc_functions-slave.sh)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_misc_functions.test (renamed from mysql-test/t/rpl_misc_functions.test)55
-rw-r--r--mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test (renamed from mysql-test/t/rpl_mixed_ddl_dml.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_delete-slave.opt (renamed from mysql-test/t/rpl_multi_delete-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_delete.test (renamed from mysql-test/t/rpl_multi_delete.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_delete2-slave.opt (renamed from mysql-test/t/rpl_multi_delete2-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_delete2.test (renamed from mysql-test/t/rpl_multi_delete2.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_engine-slave.opt (renamed from mysql-test/t/rpl_multi_engine-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_engine.test (renamed from mysql-test/t/rpl_multi_engine.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_update.test (renamed from mysql-test/t/rpl_multi_update.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_update2-slave.opt (renamed from mysql-test/t/rpl_multi_update2-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_update2.test (renamed from mysql-test/t/rpl_multi_update2.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_update3.test (renamed from mysql-test/t/rpl_multi_update3.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_update4-slave.opt (renamed from mysql-test/t/rpl_multi_update4-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_update4.test (renamed from mysql-test/t/rpl_multi_update4.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_optimize.test (renamed from mysql-test/t/rpl_optimize.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_packet-master.opt (renamed from mysql-test/t/rpl_packet-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_packet-slave.opt (renamed from mysql-test/t/rpl_packet-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_packet.test (renamed from mysql-test/t/rpl_packet.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_ps.test (renamed from mysql-test/t/rpl_ps.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test (renamed from mysql-test/t/rpl_rbr_to_sbr.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_read_only-slave.opt (renamed from mysql-test/t/rpl_read_only-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_read_only.test (renamed from mysql-test/t/rpl_read_only.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_redirect.test (renamed from mysql-test/t/rpl_redirect.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_relay_space_innodb-master.opt (renamed from mysql-test/t/rpl_relay_space_innodb-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_relay_space_innodb-slave.opt (renamed from mysql-test/t/rpl_relay_space_innodb-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_relay_space_innodb.test (renamed from mysql-test/t/rpl_relay_space_innodb.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_relay_space_myisam.test (renamed from mysql-test/t/rpl_relay_space_myisam.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_relayrotate-slave.opt (renamed from mysql-test/t/rpl_relayrotate-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_relayrotate.test (renamed from mysql-test/t/rpl_relayrotate.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_relayspace-slave.opt (renamed from mysql-test/t/rpl_relayspace-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_relayspace.test (renamed from mysql-test/t/rpl_relayspace.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_replicate_do-slave.opt (renamed from mysql-test/t/rpl_replicate_do-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_replicate_do.test (renamed from mysql-test/t/rpl_replicate_do.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_replicate_ignore_db-slave.opt (renamed from mysql-test/t/rpl_replicate_ignore_db-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_replicate_ignore_db.test (renamed from mysql-test/t/rpl_replicate_ignore_db.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_rewrt_db-slave.opt (renamed from mysql-test/t/rpl_rewrt_db-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_rewrt_db.test (renamed from mysql-test/t/rpl_rewrt_db.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_rotate_logs-master.opt (renamed from mysql-test/t/rpl_rotate_logs-master.opt)0
-rwxr-xr-xmysql-test/suite/rpl/t/rpl_rotate_logs-slave.sh (renamed from mysql-test/t/rpl_rotate_logs-slave.sh)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_rotate_logs.slave-mi (renamed from mysql-test/t/rpl_rotate_logs.slave-mi)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_rotate_logs.test (renamed from mysql-test/t/rpl_rotate_logs.test)14
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_001.test (renamed from mysql-test/t/rpl_row_001.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_4_bytes-master.opt (renamed from mysql-test/t/rpl_row_4_bytes-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_4_bytes.test (renamed from mysql-test/t/rpl_row_4_bytes.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_NOW.test (renamed from mysql-test/t/rpl_row_NOW.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_USER.test (renamed from mysql-test/t/rpl_row_USER.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_UUID.test (renamed from mysql-test/t/rpl_row_UUID.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_basic_11bugs-master.opt (renamed from mysql-test/t/rpl_row_basic_11bugs-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_basic_11bugs-slave.opt (renamed from mysql-test/t/rpl_row_basic_11bugs-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test (renamed from mysql-test/t/rpl_row_basic_11bugs.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_basic_2myisam.test (renamed from mysql-test/t/rpl_row_basic_2myisam.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_basic_3innodb-slave.opt (renamed from mysql-test/t/rpl_row_basic_3innodb-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_basic_3innodb.test (renamed from mysql-test/t/rpl_row_basic_3innodb.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_basic_8partition.test (renamed from mysql-test/t/rpl_row_basic_8partition.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_blob_innodb-slave.opt (renamed from mysql-test/t/rpl_row_blob_innodb-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_blob_innodb.test (renamed from mysql-test/t/rpl_row_blob_innodb.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_blob_myisam.test (renamed from mysql-test/t/rpl_row_blob_myisam.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_charset.test (renamed from mysql-test/t/rpl_row_charset.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_create_table-slave.opt (renamed from mysql-test/t/rpl_row_create_table-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_create_table.test (renamed from mysql-test/t/rpl_row_create_table.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_delayed_ins.test (renamed from mysql-test/t/rpl_row_delayed_ins.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_drop.test (renamed from mysql-test/t/rpl_row_drop.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_err_daisychain-master.opt (renamed from mysql-test/t/rpl_row_err_daisychain-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_err_daisychain-slave.opt (renamed from mysql-test/t/rpl_row_err_daisychain-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test (renamed from mysql-test/t/rpl_row_flsh_tbls.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_func001.test (renamed from mysql-test/t/rpl_row_func001.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_func002.test (renamed from mysql-test/t/rpl_row_func002.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_func003-slave.opt (renamed from mysql-test/t/rpl_row_func003-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_func003.test (renamed from mysql-test/t/rpl_row_func003.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_inexist_tbl-slave.opt (renamed from mysql-test/t/rpl_row_inexist_tbl-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test (renamed from mysql-test/t/rpl_row_inexist_tbl.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_insert_delayed.test (renamed from mysql-test/t/rpl_row_insert_delayed.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_log-master.opt (renamed from mysql-test/t/rpl_row_log-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_log-slave.opt (renamed from mysql-test/t/rpl_row_log-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_log.test (renamed from mysql-test/t/rpl_row_log.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_log_innodb-master.opt (renamed from mysql-test/t/rpl_row_log_innodb-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_log_innodb-slave.opt (renamed from mysql-test/t/rpl_row_log_innodb-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_log_innodb.test (renamed from mysql-test/t/rpl_row_log_innodb.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_max_relay_size.test (renamed from mysql-test/t/rpl_row_max_relay_size.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_mysqlbinlog-master.opt (renamed from mysql-test/t/rpl_row_mysqlbinlog-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test (renamed from mysql-test/t/rpl_row_mysqlbinlog.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_mystery22.test (renamed from mysql-test/t/rpl_row_mystery22.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_reset_slave.test (renamed from mysql-test/t/rpl_row_reset_slave.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp001.test (renamed from mysql-test/t/rpl_row_sp001.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp002_innodb-master.opt (renamed from mysql-test/t/rpl_row_sp002_innodb-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp002_innodb-slave.opt (renamed from mysql-test/t/rpl_row_sp002_innodb-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp002_innodb.test (renamed from mysql-test/t/rpl_row_sp002_innodb.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp003-master.opt (renamed from mysql-test/t/rpl_row_sp003-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp003-slave.opt (renamed from mysql-test/t/rpl_row_sp003-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp003.test (renamed from mysql-test/t/rpl_row_sp003.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp005.test (renamed from mysql-test/t/rpl_row_sp005.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB-slave.opt (renamed from mysql-test/t/rpl_row_sp006_InnoDB-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB.test (renamed from mysql-test/t/rpl_row_sp006_InnoDB.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp007_innodb-slave.opt (renamed from mysql-test/t/rpl_row_sp007_innodb-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp007_innodb.test (renamed from mysql-test/t/rpl_row_sp007_innodb.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp008.test (renamed from mysql-test/t/rpl_row_sp008.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp009.test (renamed from mysql-test/t/rpl_row_sp009.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp010.test (renamed from mysql-test/t/rpl_row_sp010.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp011.test (renamed from mysql-test/t/rpl_row_sp011.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp012.test (renamed from mysql-test/t/rpl_row_sp012.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_stop_middle.test (renamed from mysql-test/t/rpl_row_stop_middle.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_stop_middle_update-master.opt (renamed from mysql-test/t/rpl_row_stop_middle_update-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_stop_middle_update-slave.opt (renamed from mysql-test/t/rpl_row_stop_middle_update-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_stop_middle_update.test (renamed from mysql-test/t/rpl_row_stop_middle_update.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_tabledefs_2myisam.test (renamed from mysql-test/t/rpl_row_tabledefs_2myisam.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb-slave.opt (renamed from mysql-test/t/rpl_row_tabledefs_3innodb-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb.test (renamed from mysql-test/t/rpl_row_tabledefs_3innodb.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_trig001.test (renamed from mysql-test/t/rpl_row_trig001.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_trig002.test (renamed from mysql-test/t/rpl_row_trig002.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_trig003.test (renamed from mysql-test/t/rpl_row_trig003.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_trig004.test (renamed from mysql-test/t/rpl_row_trig004.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_until.test (renamed from mysql-test/t/rpl_row_until.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_view01.test (renamed from mysql-test/t/rpl_row_view01.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_server_id1.test (renamed from mysql-test/t/rpl_server_id1.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_server_id2-slave.opt (renamed from mysql-test/t/rpl_server_id2-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_server_id2.test (renamed from mysql-test/t/rpl_server_id2.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_session_var.test (renamed from mysql-test/t/rpl_session_var.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_set_charset.test (renamed from mysql-test/t/rpl_set_charset.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_sf.test (renamed from mysql-test/t/rpl_sf.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_skip_error-slave.opt (renamed from mysql-test/t/rpl_skip_error-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_skip_error.test (renamed from mysql-test/t/rpl_skip_error.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_skip.test (renamed from mysql-test/t/rpl_slave_skip.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_status.test (renamed from mysql-test/t/rpl_slave_status.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_sp-master.opt (renamed from mysql-test/t/rpl_sp-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_sp-slave.opt (renamed from mysql-test/t/rpl_sp-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_sp.test (renamed from mysql-test/t/rpl_sp.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_sp004.test (renamed from mysql-test/t/rpl_sp004.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_sp_effects-master.opt (renamed from mysql-test/t/rpl_sp_effects-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_sp_effects-slave.opt (renamed from mysql-test/t/rpl_sp_effects-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_sp_effects.test (renamed from mysql-test/t/rpl_sp_effects.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_sporadic_master-master.opt (renamed from mysql-test/t/rpl_sporadic_master-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_sporadic_master.test (renamed from mysql-test/t/rpl_sporadic_master.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_ssl.test (renamed from mysql-test/t/rpl_ssl.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_ssl1.test (renamed from mysql-test/t/rpl_ssl1.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_start_stop_slave.test (renamed from mysql-test/t/rpl_start_stop_slave.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_000001-slave.opt (renamed from mysql-test/t/rpl_stm_000001-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_000001.test (renamed from mysql-test/t/rpl_stm_000001.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_EE_err2.test (renamed from mysql-test/t/rpl_stm_EE_err2.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_charset.test (renamed from mysql-test/t/rpl_stm_charset.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test (renamed from mysql-test/t/rpl_stm_flsh_tbls.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_insert_delayed.test (renamed from mysql-test/t/rpl_stm_insert_delayed.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_log-master.opt (renamed from mysql-test/t/rpl_stm_log-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_log-slave.opt (renamed from mysql-test/t/rpl_stm_log-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_log.test (renamed from mysql-test/t/rpl_stm_log.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_max_relay_size.test (renamed from mysql-test/t/rpl_stm_max_relay_size.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_multi_query.test (renamed from mysql-test/t/rpl_stm_multi_query.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_mystery22.test (renamed from mysql-test/t/rpl_stm_mystery22.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_no_op.test (renamed from mysql-test/t/rpl_stm_no_op.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_reset_slave.test (renamed from mysql-test/t/rpl_stm_reset_slave.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_until.test (renamed from mysql-test/t/rpl_stm_until.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test (renamed from mysql-test/t/rpl_switch_stm_row_mixed.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_temp_table.test (renamed from mysql-test/t/rpl_temp_table.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_temporary.test (renamed from mysql-test/t/rpl_temporary.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_timezone-master.opt (renamed from mysql-test/t/rpl_timezone-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_timezone-slave.opt (renamed from mysql-test/t/rpl_timezone-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_timezone.test (renamed from mysql-test/t/rpl_timezone.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_trigger.test (renamed from mysql-test/t/rpl_trigger.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_trunc_temp.test (renamed from mysql-test/t/rpl_trunc_temp.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_truncate_2myisam.test (renamed from mysql-test/t/rpl_truncate_2myisam.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_truncate_3innodb.test (renamed from mysql-test/t/rpl_truncate_3innodb.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_truncate_7ndb_2-master.opt (renamed from mysql-test/t/rpl_truncate_7ndb_2-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_truncate_7ndb_2.test (renamed from mysql-test/t/rpl_truncate_7ndb_2.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_udf-master.opt (renamed from mysql-test/t/rpl_udf-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_udf-slave.opt (renamed from mysql-test/t/rpl_udf-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_udf.test (renamed from mysql-test/t/rpl_udf.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_user_variables.test (renamed from mysql-test/t/rpl_user_variables.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_variables-master.opt (renamed from mysql-test/t/rpl_variables-master.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_variables.test (renamed from mysql-test/t/rpl_variables.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_view-slave.opt (renamed from mysql-test/t/rpl_view-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_view.test (renamed from mysql-test/t/rpl_view.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_2innodb.result (renamed from mysql-test/r/rpl_ndb_2innodb.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_2myisam.result (renamed from mysql-test/r/rpl_ndb_2myisam.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_UUID.result (renamed from mysql-test/r/rpl_ndb_UUID.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_auto_inc.result (renamed from mysql-test/r/rpl_ndb_auto_inc.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_bank.result (renamed from mysql-test/r/rpl_ndb_bank.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result (renamed from mysql-test/r/rpl_ndb_basic.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_blob.result (renamed from mysql-test/r/rpl_ndb_blob.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_blob2.result (renamed from mysql-test/r/rpl_ndb_blob2.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_charset.result (renamed from mysql-test/r/rpl_ndb_charset.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result (renamed from mysql-test/r/rpl_ndb_circular.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result (renamed from mysql-test/r/rpl_ndb_circular_simplex.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_commit_afterflush.result (renamed from mysql-test/r/rpl_ndb_commit_afterflush.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_ctype_ucs2_def.result (renamed from mysql-test/r/rpl_ndb_ctype_ucs2_def.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_advance.result (renamed from mysql-test/r/rpl_ndb_dd_advance.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_basic.result (renamed from mysql-test/r/rpl_ndb_dd_basic.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_partitions.result (renamed from mysql-test/r/rpl_ndb_dd_partitions.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_ddl.result (renamed from mysql-test/r/rpl_ndb_ddl.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_delete_nowhere.result (renamed from mysql-test/r/rpl_ndb_delete_nowhere.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_do_db.result (renamed from mysql-test/r/rpl_ndb_do_db.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_do_table.result (renamed from mysql-test/r/rpl_ndb_do_table.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result (renamed from mysql-test/r/rpl_ndb_extraCol.result)28
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_func003.result (renamed from mysql-test/r/rpl_ndb_func003.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_idempotent.result (renamed from mysql-test/r/rpl_ndb_idempotent.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb_trans.result (renamed from mysql-test/r/rpl_ndb_innodb_trans.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_insert_ignore.result (renamed from mysql-test/r/rpl_ndb_insert_ignore.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_load.result (renamed from mysql-test/r/rpl_ndb_load.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result (renamed from mysql-test/r/rpl_ndb_log.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_mix_innodb.result (renamed from mysql-test/r/rpl_ndb_mix_innodb.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_multi.result (renamed from mysql-test/r/rpl_ndb_multi.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update2.result (renamed from mysql-test/r/rpl_ndb_multi_update2.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update3.result (renamed from mysql-test/r/rpl_ndb_multi_update3.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_relayrotate.result (renamed from mysql-test/r/rpl_ndb_relayrotate.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_rep_ignore.result (renamed from mysql-test/r/rpl_ndb_rep_ignore.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_row_001.result (renamed from mysql-test/r/rpl_ndb_row_001.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_sp003.result (renamed from mysql-test/r/rpl_ndb_sp003.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_sp006.result (renamed from mysql-test/r/rpl_ndb_sp006.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_stm_innodb.result (renamed from mysql-test/r/rpl_ndb_stm_innodb.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result (renamed from mysql-test/r/rpl_ndb_sync.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_trig004.result (renamed from mysql-test/r/rpl_ndb_trig004.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndbapi_multi.result (renamed from mysql-test/r/rpl_ndbapi_multi.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result (renamed from mysql-test/r/rpl_row_basic_7ndb.result)0
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb.result95
-rw-r--r--mysql-test/suite/rpl_ndb/t/disabled.def29
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb-master.opt (renamed from mysql-test/t/rpl_ndb_2innodb-master.opt)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb-slave.opt (renamed from mysql-test/t/rpl_ndb_2innodb-slave.opt)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test (renamed from mysql-test/t/rpl_ndb_2innodb.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam-master.opt (renamed from mysql-test/t/rpl_ndb_2myisam-master.opt)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam-slave.opt (renamed from mysql-test/t/rpl_ndb_2myisam-slave.opt)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test (renamed from mysql-test/t/rpl_ndb_2myisam.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_UUID.test (renamed from mysql-test/t/rpl_ndb_UUID.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_auto_inc.test (renamed from mysql-test/t/rpl_ndb_auto_inc.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_bank.test (renamed from mysql-test/t/rpl_ndb_bank.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test (renamed from mysql-test/t/rpl_ndb_basic.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_blob.test (renamed from mysql-test/t/rpl_ndb_blob.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_blob2.test (renamed from mysql-test/t/rpl_ndb_blob2.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_charset.test (renamed from mysql-test/t/rpl_ndb_charset.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test (renamed from mysql-test/t/rpl_ndb_circular.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test (renamed from mysql-test/t/rpl_ndb_circular_simplex.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_commit_afterflush.test (renamed from mysql-test/t/rpl_ndb_commit_afterflush.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def-master.opt (renamed from mysql-test/t/rpl_ndb_ctype_ucs2_def-master.opt)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def.test (renamed from mysql-test/t/rpl_ndb_ctype_ucs2_def.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_advance.test (renamed from mysql-test/t/rpl_ndb_dd_advance.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_basic.test (renamed from mysql-test/t/rpl_ndb_dd_basic.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_partitions.test (renamed from mysql-test/t/rpl_ndb_dd_partitions.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_ddl.test (renamed from mysql-test/t/rpl_ndb_ddl.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_delete_nowhere.test (renamed from mysql-test/t/rpl_ndb_delete_nowhere.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db-slave.opt (renamed from mysql-test/t/rpl_ndb_do_db-slave.opt)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db.test (renamed from mysql-test/t/rpl_ndb_do_db.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table-slave.opt (renamed from mysql-test/t/rpl_ndb_do_table-slave.opt)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table.test (renamed from mysql-test/t/rpl_ndb_do_table.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_extraCol.test (renamed from mysql-test/t/rpl_ndb_extraCol.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_func003.test (renamed from mysql-test/t/rpl_ndb_func003.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_idempotent.test (renamed from mysql-test/t/rpl_ndb_idempotent.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb-master.opt (renamed from mysql-test/t/rpl_ndb_innodb2ndb-master.opt)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb-slave.opt (renamed from mysql-test/t/rpl_ndb_innodb2ndb-slave.opt)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb.test (renamed from mysql-test/t/rpl_ndb_innodb2ndb.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans-slave.opt (renamed from mysql-test/t/rpl_ndb_innodb_trans-slave.opt)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans.test (renamed from mysql-test/t/rpl_ndb_innodb_trans.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_insert_ignore.test (renamed from mysql-test/t/rpl_ndb_insert_ignore.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_load.test (renamed from mysql-test/t/rpl_ndb_load.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_log-master.opt (renamed from mysql-test/t/rpl_ndb_log-master.opt)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_log.test (renamed from mysql-test/t/rpl_ndb_log.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_mix_innodb-master.opt (renamed from mysql-test/t/rpl_ndb_mix_innodb-master.opt)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_mix_innodb.test (renamed from mysql-test/t/rpl_ndb_mix_innodb.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_multi.test (renamed from mysql-test/t/rpl_ndb_multi.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update2-slave.opt (renamed from mysql-test/t/rpl_ndb_multi_update2-slave.opt)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update2.test (renamed from mysql-test/t/rpl_ndb_multi_update2.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update3.test (renamed from mysql-test/t/rpl_ndb_multi_update3.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb-master.opt (renamed from mysql-test/t/rpl_ndb_myisam2ndb-master.opt)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb-slave.opt (renamed from mysql-test/t/rpl_ndb_myisam2ndb-slave.opt)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb.test (renamed from mysql-test/t/rpl_ndb_myisam2ndb.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_relayrotate-slave.opt (renamed from mysql-test/t/rpl_ndb_relayrotate-slave.opt)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_relayrotate.test (renamed from mysql-test/t/rpl_ndb_relayrotate.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore-slave.opt (renamed from mysql-test/t/rpl_ndb_rep_ignore-slave.opt)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore.test (renamed from mysql-test/t/rpl_ndb_rep_ignore.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_row_001.test (renamed from mysql-test/t/rpl_ndb_row_001.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_sp003.test (renamed from mysql-test/t/rpl_ndb_sp003.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_sp006.test (renamed from mysql-test/t/rpl_ndb_sp006.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb-master.opt (renamed from mysql-test/t/rpl_ndb_stm_innodb-master.opt)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb.test (renamed from mysql-test/t/rpl_ndb_stm_innodb.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test (renamed from mysql-test/t/rpl_ndb_sync.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_trig004.test (renamed from mysql-test/t/rpl_ndb_trig004.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndbapi_multi.test (renamed from mysql-test/t/rpl_ndbapi_multi.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_row_basic_7ndb.test (renamed from mysql-test/t/rpl_row_basic_7ndb.test)0
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb.test (renamed from mysql-test/t/rpl_truncate_7ndb.test)0
-rw-r--r--mysql-test/suite/stress/include/ddl.cln4
-rw-r--r--mysql-test/suite/stress/include/ddl.pre21
-rw-r--r--mysql-test/suite/stress/include/ddl1.inc277
-rw-r--r--mysql-test/suite/stress/include/ddl2.inc259
-rw-r--r--mysql-test/suite/stress/include/ddl3.inc242
-rw-r--r--mysql-test/suite/stress/include/ddl4.inc339
-rw-r--r--mysql-test/suite/stress/include/ddl5.inc227
-rw-r--r--mysql-test/suite/stress/include/ddl6.inc266
-rw-r--r--mysql-test/suite/stress/include/ddl7.inc274
-rw-r--r--mysql-test/suite/stress/include/ddl8.inc302
-rw-r--r--mysql-test/suite/stress/r/ddl_archive.result79
-rw-r--r--mysql-test/suite/stress/r/ddl_csv.result55
-rw-r--r--mysql-test/suite/stress/r/ddl_innodb.result251
-rw-r--r--mysql-test/suite/stress/r/ddl_memory.result251
-rw-r--r--mysql-test/suite/stress/r/ddl_myisam.result251
-rw-r--r--mysql-test/suite/stress/r/ddl_ndb.result216
-rw-r--r--mysql-test/suite/stress/t/ddl_archive.test51
-rw-r--r--mysql-test/suite/stress/t/ddl_csv.test51
-rw-r--r--mysql-test/suite/stress/t/ddl_innodb.test49
-rw-r--r--mysql-test/suite/stress/t/ddl_memory.test48
-rw-r--r--mysql-test/suite/stress/t/ddl_myisam.test48
-rw-r--r--mysql-test/suite/stress/t/ddl_ndb.test56
-rw-r--r--mysql-test/t/archive-big.test25
-rw-r--r--mysql-test/t/archive.test9
-rw-r--r--mysql-test/t/bigint.test2
-rw-r--r--mysql-test/t/cast.test9
-rw-r--r--mysql-test/t/create.test19
-rw-r--r--mysql-test/t/create_not_windows.test1
-rw-r--r--mysql-test/t/csv.test49
-rw-r--r--mysql-test/t/ctype_collate.test11
-rw-r--r--mysql-test/t/ctype_uca.test2
-rw-r--r--mysql-test/t/ddl_i18n_koi8r.test2
-rw-r--r--mysql-test/t/ddl_i18n_utf8.test2
-rw-r--r--mysql-test/t/disabled.def33
-rw-r--r--mysql-test/t/federated.test53
-rw-r--r--mysql-test/t/federated_innodb-slave.opt1
-rw-r--r--mysql-test/t/federated_innodb.test34
-rw-r--r--mysql-test/t/fulltext.test10
-rw-r--r--mysql-test/t/fulltext3.test34
-rw-r--r--mysql-test/t/func_gconcat.test11
-rw-r--r--mysql-test/t/gis-rtree.test19
-rw-r--r--mysql-test/t/gis.test20
-rw-r--r--mysql-test/t/grant.test2
-rw-r--r--mysql-test/t/information_schema.test10
-rw-r--r--mysql-test/t/innodb.test17
-rw-r--r--mysql-test/t/innodb_trx_weight.test108
-rw-r--r--mysql-test/t/join_nested.test114
-rw-r--r--mysql-test/t/loaddata.test60
-rw-r--r--mysql-test/t/mysqldump.test13
-rw-r--r--mysql-test/t/mysqltest.test2
-rw-r--r--mysql-test/t/ndb_update.test41
-rw-r--r--mysql-test/t/partition.test12
-rw-r--r--mysql-test/t/partition_bug18198.test219
-rw-r--r--mysql-test/t/partition_charset.test8
-rw-r--r--mysql-test/t/partition_error.test11
-rw-r--r--mysql-test/t/partition_grant.test4
-rw-r--r--mysql-test/t/partition_hash.test12
-rw-r--r--mysql-test/t/partition_list.test4
-rw-r--r--mysql-test/t/partition_mgm.test2
-rw-r--r--mysql-test/t/partition_pruning.test68
-rw-r--r--mysql-test/t/partition_range.test128
-rw-r--r--mysql-test/t/query_cache.test78
-rw-r--r--mysql-test/t/show_check.test82
-rw-r--r--mysql-test/t/sp-prelocking.test23
-rw-r--r--mysql-test/t/sp.test49
-rw-r--r--mysql-test/t/ssl-big.test56
-rw-r--r--mysql-test/t/status.test5
-rw-r--r--mysql-test/t/subselect.test2
-rw-r--r--mysql-test/t/symlink.test39
-rw-r--r--mysql-test/t/trigger-trans.test82
-rw-r--r--mysql-test/t/trigger.test392
-rw-r--r--mysql-test/t/type_enum.test17
-rw-r--r--mysql-test/t/type_newdecimal.test33
-rw-r--r--mysql-test/t/type_time.test37
-rw-r--r--mysql-test/t/view.test54
-rw-r--r--mysql-test/t/windows_shm-master.opt1
-rw-r--r--mysql-test/t/windows_shm.test9
-rw-r--r--mysys/hash.c19
-rw-r--r--mysys/md5.c2
-rw-r--r--mysys/my_conio.c8
-rw-r--r--mysys/my_symlink2.c2
-rw-r--r--scripts/make_binary_distribution.sh3
-rwxr-xr-xscripts/make_win_bin_dist10
-rw-r--r--scripts/mysqld_safe.sh39
-rw-r--r--sql/CMakeLists.txt20
-rw-r--r--sql/Makefile.am3
-rw-r--r--sql/events.cc3
-rw-r--r--sql/field.cc18
-rw-r--r--sql/field.h4
-rw-r--r--sql/field_conv.cc17
-rw-r--r--sql/filesort.cc21
-rw-r--r--sql/ha_ndbcluster.cc21
-rw-r--r--sql/ha_partition.cc81
-rw-r--r--sql/ha_partition.h1
-rw-r--r--sql/handler.h57
-rw-r--r--sql/item.cc2
-rw-r--r--sql/item.h26
-rw-r--r--sql/item_cmpfunc.cc110
-rw-r--r--sql/item_cmpfunc.h16
-rw-r--r--sql/item_create.cc14
-rw-r--r--sql/item_func.h32
-rw-r--r--sql/item_strfunc.cc2
-rw-r--r--sql/item_strfunc.h14
-rw-r--r--sql/item_sum.cc1
-rw-r--r--sql/item_timefunc.cc5
-rw-r--r--sql/item_timefunc.h17
-rw-r--r--sql/item_xmlfunc.h1
-rw-r--r--sql/lock.cc96
-rw-r--r--sql/log.cc145
-rw-r--r--sql/log_event.cc17
-rw-r--r--sql/mysql_priv.h118
-rw-r--r--sql/mysqld.cc3
-rw-r--r--sql/opt_range.cc40
-rw-r--r--sql/partition_info.cc44
-rw-r--r--sql/partition_info.h7
-rw-r--r--sql/rpl_utility.h2
-rw-r--r--sql/set_var.cc8
-rw-r--r--sql/share/errmsg.txt72
-rw-r--r--sql/slave.cc320
-rw-r--r--sql/sp.cc63
-rw-r--r--sql/sp_head.cc56
-rw-r--r--sql/sp_head.h6
-rw-r--r--sql/spatial.cc23
-rw-r--r--sql/sql_base.cc8
-rw-r--r--sql/sql_cache.cc741
-rw-r--r--sql/sql_cache.h73
-rw-r--r--sql/sql_class.cc150
-rw-r--r--sql/sql_class.h81
-rw-r--r--sql/sql_db.cc10
-rw-r--r--sql/sql_insert.cc151
-rw-r--r--sql/sql_lex.cc78
-rw-r--r--sql/sql_lex.h50
-rw-r--r--sql/sql_load.cc1
-rw-r--r--sql/sql_parse.cc19
-rw-r--r--sql/sql_partition.cc45
-rw-r--r--sql/sql_prepare.cc59
-rw-r--r--sql/sql_rename.cc26
-rw-r--r--sql/sql_repl.cc6
-rw-r--r--sql/sql_select.cc14
-rw-r--r--sql/sql_show.cc63
-rw-r--r--sql/sql_show.h3
-rw-r--r--sql/sql_sort.h9
-rw-r--r--sql/sql_table.cc85
-rw-r--r--sql/sql_trigger.cc80
-rw-r--r--sql/sql_trigger.h8
-rw-r--r--sql/sql_udf.h1
-rw-r--r--sql/sql_update.cc105
-rw-r--r--sql/sql_view.cc13
-rw-r--r--sql/sql_yacc.yy27
-rw-r--r--sql/stacktrace.c9
-rw-r--r--sql/table.cc229
-rw-r--r--sql/table.h79
-rw-r--r--sql/uniques.cc13
-rw-r--r--sql/unireg.cc2
-rw-r--r--sql/unireg.h2
-rw-r--r--storage/archive/ha_archive.cc20
-rw-r--r--storage/csv/ha_tina.cc163
-rw-r--r--storage/csv/ha_tina.h4
-rw-r--r--storage/federated/ha_federated.cc512
-rw-r--r--storage/federated/ha_federated.h24
-rw-r--r--storage/heap/ha_heap.cc20
-rw-r--r--storage/heap/ha_heap.h9
-rw-r--r--storage/innobase/Makefile.am224
-rw-r--r--storage/innobase/btr/Makefile.am25
-rw-r--r--storage/innobase/btr/btr0btr.c7
-rw-r--r--storage/innobase/buf/Makefile.am25
-rw-r--r--storage/innobase/data/Makefile.am25
-rw-r--r--storage/innobase/data/data0data.c2
-rw-r--r--storage/innobase/data/data0type.c3
-rw-r--r--storage/innobase/dict/Makefile.am26
-rw-r--r--storage/innobase/dict/dict0crea.c3
-rw-r--r--storage/innobase/dict/dict0dict.c19
-rw-r--r--storage/innobase/dyn/Makefile.am25
-rw-r--r--storage/innobase/eval/Makefile.am25
-rw-r--r--storage/innobase/fil/Makefile.am25
-rw-r--r--storage/innobase/fsp/Makefile.am26
-rw-r--r--storage/innobase/fsp/fsp0fsp.c11
-rw-r--r--storage/innobase/fut/Makefile.am25
-rw-r--r--storage/innobase/ha/Makefile.am25
-rw-r--r--storage/innobase/handler/Makefile.am28
-rw-r--r--storage/innobase/handler/ha_innodb.cc826
-rw-r--r--storage/innobase/handler/ha_innodb.h63
-rw-r--r--storage/innobase/ibuf/Makefile.am25
-rw-r--r--storage/innobase/ibuf/ibuf0ibuf.c86
-rw-r--r--storage/innobase/include/Makefile.i10
-rw-r--r--storage/innobase/include/db0err.h5
-rw-r--r--storage/innobase/include/dict0dict.h11
-rw-r--r--storage/innobase/include/dict0dict.ic24
-rw-r--r--storage/innobase/include/dict0mem.h11
-rw-r--r--storage/innobase/include/ha_prototypes.h29
-rw-r--r--storage/innobase/include/os0file.h3
-rw-r--r--storage/innobase/include/rem0rec.ic6
-rw-r--r--storage/innobase/include/row0mysql.h13
-rw-r--r--storage/innobase/include/trx0trx.h36
-rw-r--r--storage/innobase/include/trx0undo.h13
-rw-r--r--storage/innobase/include/ut0ut.h5
-rw-r--r--storage/innobase/lock/Makefile.am25
-rw-r--r--storage/innobase/lock/lock0lock.c17
-rw-r--r--storage/innobase/log/Makefile.am25
-rw-r--r--storage/innobase/log/log0log.c34
-rw-r--r--storage/innobase/mach/Makefile.am25
-rw-r--r--storage/innobase/mem/Makefile.am27
-rw-r--r--storage/innobase/mtr/Makefile.am25
-rw-r--r--storage/innobase/os/Makefile.am25
-rw-r--r--storage/innobase/os/os0file.c16
-rw-r--r--storage/innobase/page/Makefile.am25
-rw-r--r--storage/innobase/pars/Makefile.am27
-rw-r--r--storage/innobase/plug.in33
-rw-r--r--storage/innobase/que/Makefile.am25
-rw-r--r--storage/innobase/read/Makefile.am25
-rw-r--r--storage/innobase/rem/Makefile.am25
-rw-r--r--storage/innobase/rem/rem0rec.c40
-rw-r--r--storage/innobase/row/Makefile.am26
-rw-r--r--storage/innobase/row/row0ins.c46
-rw-r--r--storage/innobase/row/row0mysql.c25
-rw-r--r--storage/innobase/row/row0row.c23
-rw-r--r--storage/innobase/row/row0sel.c26
-rw-r--r--storage/innobase/srv/Makefile.am25
-rw-r--r--storage/innobase/srv/srv0srv.c50
-rw-r--r--storage/innobase/srv/srv0start.c6
-rw-r--r--storage/innobase/sync/Makefile.am25
-rw-r--r--storage/innobase/sync/sync0arr.c4
-rw-r--r--storage/innobase/thr/Makefile.am25
-rw-r--r--storage/innobase/trx/Makefile.am26
-rw-r--r--storage/innobase/trx/trx0rec.c19
-rw-r--r--storage/innobase/trx/trx0trx.c60
-rw-r--r--storage/innobase/trx/trx0undo.c101
-rw-r--r--storage/innobase/usr/Makefile.am25
-rw-r--r--storage/innobase/ut/Makefile.am25
-rw-r--r--storage/innobase/ut/ut0ut.c1
-rw-r--r--storage/myisam/ft_boolean_search.c36
-rw-r--r--storage/myisam/ft_parser.c16
-rw-r--r--storage/myisam/ha_myisam.cc77
-rw-r--r--storage/myisam/ha_myisam.h7
-rw-r--r--storage/myisam/mi_create.c4
-rw-r--r--storage/myisam/sp_key.c71
-rw-r--r--storage/ndb/include/ndb_version.h.in57
-rw-r--r--storage/ndb/include/ndbapi/Ndb.hpp34
-rw-r--r--storage/ndb/include/util/version.h23
-rw-r--r--storage/ndb/ndbapi-examples/ndbapi_simple/ndbapi_simple.cpp12
-rw-r--r--storage/ndb/src/common/util/version.c23
-rw-r--r--storage/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp2
-rw-r--r--storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp24
-rw-r--r--storage/ndb/src/kernel/blocks/diskpage.cpp2
-rw-r--r--storage/ndb/src/kernel/blocks/lgman.cpp17
-rw-r--r--storage/ndb/src/kernel/blocks/lgman.hpp3
-rw-r--r--storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp2
-rw-r--r--storage/ndb/src/kernel/blocks/restore.cpp2
-rw-r--r--storage/ndb/src/kernel/vm/SimulatedBlock.hpp2
-rw-r--r--storage/ndb/src/mgmsrv/ConfigInfo.cpp6
-rw-r--r--storage/ndb/src/mgmsrv/Services.cpp2
-rw-r--r--storage/ndb/src/ndbapi/ClusterMgr.cpp2
-rw-r--r--storage/ndb/src/ndbapi/Ndb.cpp176
-rw-r--r--storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp2
-rw-r--r--storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp2
-rw-r--r--storage/ndb/tools/restore/restore_main.cpp6
-rw-r--r--strings/ctype-simple.c2
-rw-r--r--support-files/Makefile.am5
-rw-r--r--tests/mysql_client_test.c66
-rw-r--r--vio/viossl.c10
-rw-r--r--win/configure.js1
-rwxr-xr-xwin/create_manifest.js10
-rwxr-xr-xwin/mysql_manifest.cmake2
1134 files changed, 15539 insertions, 4635 deletions
diff --git a/.bzrignore b/.bzrignore
index bc7a7a6429d..329c5e227ca 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -38,9 +38,9 @@
*/.libs/*
*/.pure
*/debug/*
+*/minsizerel/*
*/release/*
*/relwithdebinfo/*
-*/minsizerel/*
*~
.*.swp
./CMakeCache.txt
@@ -584,6 +584,7 @@ heap/hp_test2
help
help.c
help.h
+include/abi_check
include/check_abi
include/link_sources
include/my_config.h
@@ -1021,8 +1022,8 @@ libmysqld/.deps/unireg.Po
libmysqld/backup_dir
libmysqld/client.c
libmysqld/client_settings.h
-libmysqld/convert.cc
libmysqld/cmake_dummy.c
+libmysqld/convert.cc
libmysqld/derror.cc
libmysqld/discover.cc
libmysqld/emb_qcache.cpp
diff --git a/BUILD/compile-pentium-gcov b/BUILD/compile-pentium-gcov
index 5ee3c071f61..77de5867d48 100755
--- a/BUILD/compile-pentium-gcov
+++ b/BUILD/compile-pentium-gcov
@@ -26,8 +26,9 @@ export LDFLAGS="-fprofile-arcs -ftest-coverage"
# The -fprofile-arcs and -ftest-coverage options cause GCC to instrument the
# code with profiling information used by gcov.
-# the -DDISABLE_TAO_ASM is needed to avoid build failures in Yassl.
-extra_flags="$pentium_cflags -fprofile-arcs -ftest-coverage -DDISABLE_TAO_ASM -DHAVE_MUTEX_THREAD_ONLY $debug_extra_flags $debug_cflags $max_cflags -DMYSQL_SERVER_SUFFIX=-gcov"
+# The -DDISABLE_TAO_ASM is needed to avoid build failures in Yassl.
+# The -DHAVE_gcov enables code to write out coverage info even when crashing.
+extra_flags="$pentium_cflags -fprofile-arcs -ftest-coverage -DDISABLE_TAO_ASM -DHAVE_MUTEX_THREAD_ONLY $debug_extra_flags $debug_cflags $max_cflags -DMYSQL_SERVER_SUFFIX=-gcov -DHAVE_gcov"
extra_configs="$pentium_configs $debug_configs --disable-shared $static_link"
extra_configs="$extra_configs $max_configs"
c_warnings="$c_warnings $debug_extra_warnings"
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 538c5cb122e..1bdb1e01612 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -174,7 +174,7 @@ IF(EMBED_MANIFESTS)
ENDIF(NOT tmp_manifest)
# Set the processor architecture.
IF(CMAKE_GENERATOR MATCHES "Visual Studio 8 2005 Win64")
- SET(PROCESSOR_ARCH "X64")
+ SET(PROCESSOR_ARCH "amd64")
ELSE(CMAKE_GENERATOR MATCHES "Visual Studio 8 2005 Win64")
SET(PROCESSOR_ARCH "X86")
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 8 2005 Win64")
diff --git a/Makefile.am b/Makefile.am
index 88e0f949657..18477afb398 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -58,7 +58,8 @@ tags:
test test-force test-full test-force-full test-force-mem \
test-pl test-force-pl test-full-pl test-force-full-pl test-force-pl-mem \
test-unit test-ps test-nr test-pr test-ns test-binlog-statement \
- test-ext-funcs test-ext-rpl test-ext-partitions test-ext \
+ test-ext-funcs test-ext-rpl test-ext-partitions test-ext-jp \
+ test-ext-stress test-ext \
test-fast test-fast-cursor test-fast-view test-fast-prepare \
test-full-qa
@@ -144,6 +145,8 @@ test-bt:
cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --comment=NIST+ps --force --suite=nist --ps-protocol ; \
fi
+ -cd mysql-test ; MTR_BUILD_THREAD=auto \
+ @PERL@ ./mysql-test-run.pl --force --comment=stress --suite=stress
# Re-enable the "rowlock" suite when bug#28685 is fixed
# -cd mysql-test ; MTR_BUILD_THREAD=auto \
@@ -182,12 +185,17 @@ test-ext-jp:
cd mysql-test ; \
@PERL@ ./mysql-test-run.pl --force --suite=jp
-test-ext: test-ext-funcs test-ext-rpl test-ext-partitions test-ext-jp
+test-ext-stress:
+ cd mysql-test ; \
+ @PERL@ ./mysql-test-run.pl --force --big-test --suite=stress
+
+test-ext: test-ext-funcs test-ext-rpl test-ext-partitions test-ext-jp test-ext-stress
test-fast:
cd mysql-test ; \
@PERL@ ./mysql-test-run.pl $(subset) --force --skip-ndb --skip-innodb --skip-im --skip-rpl ; \
- @PERL@ ./mysql-test-run.pl $(subset) --force --suite=funcs_1 --do-test=myisam
+ @PERL@ ./mysql-test-run.pl $(subset) --force --suite=funcs_1 --do-test=myisam ; \
+ @PERL@ ./mysql-test-run.pl $(subset) --force --suite=stress --do-test=ddl_myisam
test-fast-view:
$(MAKE) subset=--view-protocol test-fast
diff --git a/client/mysql.cc b/client/mysql.cc
index 7970fa4db2f..fe057c8b8a4 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -1089,7 +1089,12 @@ static int read_and_execute(bool interactive)
something else is still in console input buffer
*/
} while (tmpbuf.alloced_length() <= clen);
- line= buffer.c_ptr();
+ /*
+ An empty line is returned from my_cgets when there's error reading :
+ Ctrl-c for example
+ */
+ if (line)
+ line= buffer.c_ptr();
#endif /* __NETWARE__ */
#else
if (opt_outfile)
diff --git a/client/mysqldump.c b/client/mysqldump.c
index 812a158048e..0f30ebddacc 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -709,6 +709,18 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
break;
case 'T':
opt_disable_keys=0;
+
+ if (strlen(argument) >= FN_REFLEN)
+ {
+ /*
+ This check is made because the some the file functions below
+ have FN_REFLEN sized stack allocated buffers and will cause
+ a crash even if the input destination buffer is large enough
+ to hold the output.
+ */
+ die(EX_USAGE, "Input filename too long: %s", argument);
+ }
+
break;
case '#':
DBUG_PUSH(argument ? argument : default_dbug_option);
@@ -1201,6 +1213,20 @@ static void restore_time_zone(FILE *sql_file,
(const char *) delimiter);
}
+
+static int switch_character_set_results(MYSQL *mysql, const char *cs_name)
+{
+ char query_buffer[QUERY_LENGTH];
+ size_t query_length;
+
+ query_length= my_snprintf(query_buffer,
+ sizeof (query_buffer),
+ "SET SESSION character_set_results = '%s'",
+ (const char *) cs_name);
+
+ return mysql_real_query(mysql, query_buffer, query_length);
+}
+
/*
Open a new .sql file to dump the table or view into
@@ -1706,6 +1732,9 @@ static uint dump_events_for_db(char *db)
if (fetch_db_collation(db_name_buff, db_cl_name, sizeof (db_cl_name)))
DBUG_RETURN(1);
+ if (switch_character_set_results(mysql, "binary"))
+ DBUG_RETURN(1);
+
while ((event_list_row= mysql_fetch_row(event_list_res)) != NULL)
{
event_name= quote_name(event_list_row[1], name_buff, 0);
@@ -1774,6 +1803,9 @@ static uint dump_events_for_db(char *db)
} /* end of list of events */
fprintf(sql_file, "DELIMITER ;\n");
fprintf(sql_file, "/*!50106 SET TIME_ZONE= @save_time_zone */ ;\n");
+
+ if (switch_character_set_results(mysql, default_charset))
+ DBUG_RETURN(1);
}
mysql_free_result(event_list_res);
@@ -1853,6 +1885,9 @@ static uint dump_routines_for_db(char *db)
if (fetch_db_collation(db_name_buff, db_cl_name, sizeof (db_cl_name)))
DBUG_RETURN(1);
+ if (switch_character_set_results(mysql, "binary"))
+ DBUG_RETURN(1);
+
/* 0, retrieve and dump functions, 1, procedures */
for (i= 0; i <= 1; i++)
{
@@ -1990,6 +2025,9 @@ static uint dump_routines_for_db(char *db)
mysql_free_result(routine_list_res);
} /* end of for i (0 .. 1) */
+ if (switch_character_set_results(mysql, default_charset))
+ DBUG_RETURN(1);
+
if (lock_tables)
VOID(mysql_query_with_error_report(mysql, 0, "UNLOCK TABLES"));
DBUG_RETURN(0);
@@ -2542,6 +2580,9 @@ static void dump_triggers_for_table(char *table, char *db_name)
if (fetch_db_collation(db_name, db_cl_name, sizeof (db_cl_name)))
DBUG_VOID_RETURN;
+ if (switch_character_set_results(mysql, "binary"))
+ DBUG_VOID_RETURN;
+
/* Dump triggers. */
while ((row= mysql_fetch_row(result)))
@@ -2637,6 +2678,9 @@ static void dump_triggers_for_table(char *table, char *db_name)
mysql_free_result(result);
+ if (switch_character_set_results(mysql, default_charset))
+ DBUG_VOID_RETURN;
+
/*
make sure to set back opt_compatible mode to
original value
@@ -2803,17 +2847,6 @@ static void dump_table(char *table, char *db)
{
char filename[FN_REFLEN], tmp_path[FN_REFLEN];
- if (strlen(path) >= FN_REFLEN)
- {
- /*
- This check is made because the some the file functions below
- have FN_REFLEN sized stack allocated buffers and will cause
- a crash even if the input destination buffer is large enough
- to hold the output.
- */
- die(EX_USAGE, "Input filename or options too long: %s", path);
- }
-
/*
Convert the path to native os format
and resolve to the full filepath.
@@ -4390,14 +4423,22 @@ static my_bool get_view_structure(char *table, char* db)
result_table= quote_name(table, table_buff, 1);
opt_quoted_table= quote_name(table, table_buff2, 0);
+ if (switch_character_set_results(mysql, "binary"))
+ DBUG_RETURN(1);
+
my_snprintf(query, sizeof(query), "SHOW CREATE TABLE %s", result_table);
+
if (mysql_query_with_error_report(mysql, &table_res, query))
+ {
+ switch_character_set_results(mysql, default_charset);
DBUG_RETURN(0);
+ }
/* Check if this is a view */
field= mysql_fetch_field_direct(table_res, 0);
if (strcmp(field->name, "View") != 0)
{
+ switch_character_set_results(mysql, default_charset);
verbose_msg("-- It's base table, skipped\n");
DBUG_RETURN(0);
}
@@ -4417,10 +4458,9 @@ static my_bool get_view_structure(char *table, char* db)
result_table);
check_io(sql_file);
}
+ fprintf(sql_file, "/*!50001 DROP TABLE %s*/;\n", opt_quoted_table);
if (opt_drop)
{
- fprintf(sql_file, "/*!50001 DROP TABLE IF EXISTS %s*/;\n",
- opt_quoted_table);
fprintf(sql_file, "/*!50001 DROP VIEW IF EXISTS %s*/;\n",
opt_quoted_table);
check_io(sql_file);
@@ -4540,6 +4580,9 @@ static my_bool get_view_structure(char *table, char* db)
dynstr_free(&ds_view);
}
+ if (switch_character_set_results(mysql, default_charset))
+ DBUG_RETURN(1);
+
/* If a separate .sql file was opened, close it now */
if (sql_file != md_result_file)
{
diff --git a/client/mysqltest.c b/client/mysqltest.c
index 0a1b57ff80a..e5b9a2eaf12 100644
--- a/client/mysqltest.c
+++ b/client/mysqltest.c
@@ -264,6 +264,7 @@ enum enum_commands {
Q_REPLACE_REGEX, Q_REMOVE_FILE, Q_FILE_EXIST,
Q_WRITE_FILE, Q_COPY_FILE, Q_PERL, Q_DIE, Q_EXIT, Q_SKIP,
Q_CHMOD_FILE, Q_APPEND_FILE, Q_CAT_FILE, Q_DIFF_FILES,
+ Q_SEND_QUIT,
Q_UNKNOWN, /* Unknown command. */
Q_COMMENT, /* Comments, ignored. */
@@ -351,6 +352,7 @@ const char *command_names[]=
"append_file",
"cat_file",
"diff_files",
+ "send_quit",
0
};
@@ -2541,6 +2543,48 @@ void do_diff_files(struct st_command *command)
DBUG_VOID_RETURN;
}
+ /*
+ SYNOPSIS
+ do_send_quit
+ command called command
+
+ DESCRIPTION
+ Sends a simple quit command to the server for the named connection.
+
+ */
+
+void do_send_quit(struct st_command *command)
+{
+ char *p= command->first_argument, *name;
+ struct st_connection *con;
+
+ DBUG_ENTER("do_send_quit");
+ DBUG_PRINT("enter",("name: '%s'",p));
+
+ if (!*p)
+ die("Missing connection name in do_send_quit");
+ name= p;
+ while (*p && !my_isspace(charset_info,*p))
+ p++;
+
+ if (*p)
+ *p++= 0;
+ command->last_argument= p;
+
+ /* Loop through connection pool for connection to close */
+ for (con= connections; con < next_con; con++)
+ {
+ DBUG_PRINT("info", ("con->name: %s", con->name));
+ if (!strcmp(con->name, name))
+ {
+ simple_command(&con->mysql,COM_QUIT,NullS,0,1);
+ DBUG_VOID_RETURN;
+ }
+ }
+ die("connection '%s' not found in connection pool", name);
+}
+
+
/*
SYNOPSIS
do_perl
@@ -3454,11 +3498,10 @@ void do_close_connection(struct st_command *command)
my_free(con->name, MYF(0));
/*
- When the connection is closed set name to "closed_connection"
+ When the connection is closed set name to "-closed_connection-"
to make it possible to reuse the connection name.
- The connection slot will not be reused
*/
- if (!(con->name = my_strdup("closed_connection", MYF(MY_WME))))
+ if (!(con->name = my_strdup("-closed_connection-", MYF(MY_WME))))
die("Out of memory");
DBUG_VOID_RETURN;
@@ -3636,6 +3679,7 @@ void do_connect(struct st_command *command)
int con_port= opt_port;
char *con_options;
bool con_ssl= 0, con_compress= 0;
+ struct st_connection* con_slot;
static DYNAMIC_STRING ds_connection_name;
static DYNAMIC_STRING ds_host;
@@ -3717,19 +3761,24 @@ void do_connect(struct st_command *command)
con_options= end;
}
- if (next_con == connections_end)
- die("Connection limit exhausted, you can have max %d connections",
- (int) (sizeof(connections)/sizeof(struct st_connection)));
-
if (find_connection_by_name(ds_connection_name.str))
die("Connection %s already exists", ds_connection_name.str);
+
+ if (next_con != connections_end)
+ con_slot= next_con;
+ else
+ {
+ if (!(con_slot= find_connection_by_name("-closed_connection-")))
+ die("Connection limit exhausted, you can have max %d connections",
+ (int) (sizeof(connections)/sizeof(struct st_connection)));
+ }
- if (!mysql_init(&next_con->mysql))
+ if (!mysql_init(&con_slot->mysql))
die("Failed on mysql_init()");
if (opt_compress || con_compress)
- mysql_options(&next_con->mysql, MYSQL_OPT_COMPRESS, NullS);
- mysql_options(&next_con->mysql, MYSQL_OPT_LOCAL_INFILE, 0);
- mysql_options(&next_con->mysql, MYSQL_SET_CHARSET_NAME,
+ mysql_options(&con_slot->mysql, MYSQL_OPT_COMPRESS, NullS);
+ mysql_options(&con_slot->mysql, MYSQL_OPT_LOCAL_INFILE, 0);
+ mysql_options(&con_slot->mysql, MYSQL_SET_CHARSET_NAME,
charset_info->csname);
if (opt_charsets_dir)
mysql_options(&cur_con->mysql, MYSQL_SET_CHARSET_DIR,
@@ -3738,12 +3787,12 @@ void do_connect(struct st_command *command)
#ifdef HAVE_OPENSSL
if (opt_use_ssl || con_ssl)
{
- mysql_ssl_set(&next_con->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
+ mysql_ssl_set(&con_slot->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher);
#if MYSQL_VERSION_ID >= 50000
/* Turn on ssl_verify_server_cert only if host is "localhost" */
opt_ssl_verify_server_cert= !strcmp(ds_host.str, "localhost");
- mysql_options(&next_con->mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
+ mysql_options(&con_slot->mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
&opt_ssl_verify_server_cert);
#endif
}
@@ -3757,16 +3806,19 @@ void do_connect(struct st_command *command)
if (ds_database.length && !strcmp(ds_database.str,"*NO-ONE*"))
dynstr_set(&ds_database, "");
- if (connect_n_handle_errors(command, &next_con->mysql,
+ if (connect_n_handle_errors(command, &con_slot->mysql,
ds_host.str,ds_user.str,
ds_password.str, ds_database.str,
con_port, ds_sock.str))
{
DBUG_PRINT("info", ("Inserting connection %s in connection pool",
ds_connection_name.str));
- if (!(next_con->name= my_strdup(ds_connection_name.str, MYF(MY_WME))))
+ if (!(con_slot->name= my_strdup(ds_connection_name.str, MYF(MY_WME))))
die("Out of memory");
- cur_con= next_con++;
+ cur_con= con_slot;
+
+ if (con_slot == next_con)
+ next_con++; /* if we used the next_con slot, advance the pointer */
}
dynstr_free(&ds_connection_name);
@@ -6335,6 +6387,7 @@ int main(int argc, char **argv)
case Q_WRITE_FILE: do_write_file(command); break;
case Q_APPEND_FILE: do_append_file(command); break;
case Q_DIFF_FILES: do_diff_files(command); break;
+ case Q_SEND_QUIT: do_send_quit(command); break;
case Q_CAT_FILE: do_cat_file(command); break;
case Q_COPY_FILE: do_copy_file(command); break;
case Q_CHMOD_FILE: do_chmod_file(command); break;
diff --git a/configure.in b/configure.in
index 04a8d045053..e2857cf43e3 100644
--- a/configure.in
+++ b/configure.in
@@ -71,14 +71,22 @@ AC_SUBST(AVAILABLE_LANGUAGES)
# Canonicalize the configuration name.
-SYSTEM_TYPE="$host_vendor-$host_os"
-MACHINE_TYPE="$host_cpu"
+
+# Check whether --with-system-type or --without-system-type was given.
+AC_ARG_WITH(system-type,
+ [ --with-system-type Set the system type, like "sun-solaris10"],
+ [SYSTEM_TYPE="$withval"],
+ [SYSTEM_TYPE="$host_vendor-$host_os"])
+AC_ARG_WITH(machine-type,
+ [ --with-machine-type Set the machine type, like "powerpc"],
+ [MACHINE_TYPE="$withval"],
+ [MACHINE_TYPE="$host_cpu"])
AC_SUBST(SYSTEM_TYPE)
AC_DEFINE_UNQUOTED([SYSTEM_TYPE], ["$SYSTEM_TYPE"],
- [Name of system, eg solaris])
+ [Name of system, eg sun-solaris])
AC_SUBST(MACHINE_TYPE)
AC_DEFINE_UNQUOTED([MACHINE_TYPE], ["$MACHINE_TYPE"],
- [Machine type name, eg sun10])
+ [Machine type name, eg sparc])
# Detect intel x86 like processor
BASE_MACHINE_TYPE=$MACHINE_TYPE
diff --git a/extra/yassl/include/openssl/ssl.h b/extra/yassl/include/openssl/ssl.h
index 7dd33e3fcad..efd0dec75b6 100644
--- a/extra/yassl/include/openssl/ssl.h
+++ b/extra/yassl/include/openssl/ssl.h
@@ -277,6 +277,8 @@ int SSL_session_reused(SSL*);
int SSL_set_rfd(SSL*, int);
int SSL_set_wfd(SSL*, int);
void SSL_set_shutdown(SSL*, int);
+void SSL_set_quiet_shutdown(SSL *ssl,int mode);
+int SSL_get_quiet_shutdown(SSL *ssl);
int SSL_want_read(SSL*);
int SSL_want_write(SSL*);
diff --git a/extra/yassl/include/yassl_int.hpp b/extra/yassl/include/yassl_int.hpp
index 94cb85c3300..b7bd35f5fa2 100644
--- a/extra/yassl/include/yassl_int.hpp
+++ b/extra/yassl/include/yassl_int.hpp
@@ -584,6 +584,7 @@ class SSL {
Socket socket_; // socket wrapper
Buffers buffers_; // buffered handshakes and data
Log log_; // logger
+ bool quietShutdown_; // shutdown without handshakes
// optimization variables
bool has_data_; // buffered data ready?
@@ -610,6 +611,7 @@ public:
Buffers& useBuffers();
bool HasData() const;
+ bool GetQuietShutdown() const;
// sets
void set_pending(Cipher suite);
@@ -621,6 +623,7 @@ public:
void SetError(YasslError);
int SetCompression();
void UnSetCompression();
+ void SetQuietShutdown(bool mode);
// helpers
bool isTLS() const;
diff --git a/extra/yassl/src/ssl.cpp b/extra/yassl/src/ssl.cpp
index 86dfa1c6ebd..c3d580a93ab 100644
--- a/extra/yassl/src/ssl.cpp
+++ b/extra/yassl/src/ssl.cpp
@@ -411,8 +411,10 @@ int SSL_clear(SSL* ssl)
int SSL_shutdown(SSL* ssl)
{
- Alert alert(warning, close_notify);
- sendAlert(*ssl, alert);
+ if (!ssl->GetQuietShutdown()) {
+ Alert alert(warning, close_notify);
+ sendAlert(*ssl, alert);
+ }
ssl->useLog().ShowTCP(ssl->getSocket().get_fd(), true);
GetErrors().Remove();
@@ -421,6 +423,18 @@ int SSL_shutdown(SSL* ssl)
}
+void SSL_set_quiet_shutdown(SSL *ssl,int mode)
+{
+ ssl->SetQuietShutdown(mode != 0);
+}
+
+
+int SSL_get_quiet_shutdown(SSL *ssl)
+{
+ return ssl->GetQuietShutdown();
+}
+
+
/* on by default but allow user to turn off */
long SSL_CTX_set_session_cache_mode(SSL_CTX* ctx, long mode)
{
diff --git a/extra/yassl/src/yassl_int.cpp b/extra/yassl/src/yassl_int.cpp
index ae16abf9e49..f5ab2f200a5 100644
--- a/extra/yassl/src/yassl_int.cpp
+++ b/extra/yassl/src/yassl_int.cpp
@@ -291,7 +291,7 @@ const ClientKeyFactory& sslFactory::getClientKey() const
SSL::SSL(SSL_CTX* ctx)
: secure_(ctx->getMethod()->getVersion(), crypto_.use_random(),
ctx->getMethod()->getSide(), ctx->GetCiphers(), ctx,
- ctx->GetDH_Parms().set_), has_data_(false)
+ ctx->GetDH_Parms().set_), quietShutdown_(false), has_data_(false)
{
if (int err = crypto_.get_random().GetError()) {
SetError(YasslError(err));
@@ -773,6 +773,12 @@ void SSL::SetError(YasslError ye)
// TODO: add string here
}
+// set the quiet shutdown mode (close_nofiy not sent or received on shutdown)
+void SSL::SetQuietShutdown(bool mode)
+{
+ quietShutdown_ = mode;
+}
+
Buffers& SSL::useBuffers()
{
@@ -1330,6 +1336,12 @@ YasslError SSL::GetError() const
}
+bool SSL::GetQuietShutdown() const
+{
+ return quietShutdown_;
+}
+
+
bool SSL::GetMultiProtocol() const
{
return secure_.GetContext()->getMethod()->multipleProtocol();
diff --git a/include/Makefile.am b/include/Makefile.am
index b803f614a93..0796341cc91 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -33,7 +33,7 @@ noinst_HEADERS = config-win.h config-netware.h \
mysys_err.h my_base.h help_start.h help_end.h \
my_nosys.h my_alarm.h queues.h rijndael.h sha1.h \
my_aes.h my_tree.h my_trie.h hash.h thr_alarm.h \
- thr_lock.h t_ctype.h violite.h md5.h base64.h \
+ thr_lock.h t_ctype.h violite.h my_md5.h base64.h \
mysql_version.h.in my_handler.h my_time.h \
my_vle.h my_user.h my_atomic.h atomic/nolock.h \
atomic/rwlock.h atomic/x86-gcc.h atomic/x86-msvc.h \
diff --git a/include/m_string.h b/include/m_string.h
index 715720df294..00fb4cb0656 100644
--- a/include/m_string.h
+++ b/include/m_string.h
@@ -246,17 +246,17 @@ extern size_t my_snprintf(char *to, size_t n, const char *fmt, ...)
/*
LEX_STRING -- a pair of a C-string and its length.
-
- NOTE: this exactly form of declaration is required for some C-compilers
- (for one, Sun C 5.7 2005/01/07). Unfortunately with such declaration
- LEX_STRING can not be forward declared.
*/
-typedef struct
+#ifndef _my_plugin_h
+/* This definition must match the one given in mysql/plugin.h */
+struct st_mysql_lex_string
{
char *str;
size_t length;
-} LEX_STRING;
+};
+#endif
+typedef struct st_mysql_lex_string LEX_STRING;
#define STRING_WITH_LEN(X) (X), ((size_t) (sizeof(X) - 1))
#define USTRING_WITH_LEN(X) ((uchar*) X), ((size_t) (sizeof(X) - 1))
diff --git a/include/my_base.h b/include/my_base.h
index bb5fdfc8392..04127b81b78 100644
--- a/include/my_base.h
+++ b/include/my_base.h
@@ -180,7 +180,12 @@ enum ha_extra_function {
These flags are reset by the handler::extra(HA_EXTRA_RESET) call.
*/
HA_EXTRA_DELETE_CANNOT_BATCH,
- HA_EXTRA_UPDATE_CANNOT_BATCH
+ HA_EXTRA_UPDATE_CANNOT_BATCH,
+ /*
+ Inform handler that an "INSERT...ON DUPLICATE KEY UPDATE" will be
+ executed. This condition is unset by HA_EXTRA_NO_IGNORE_DUP_KEY.
+ */
+ HA_EXTRA_INSERT_WITH_UPDATE
};
/* The following is parameter to ha_panic() */
@@ -294,6 +299,7 @@ enum ha_base_keytype {
#define HA_PACK_RECORD 2 /* Request packed record format */
#define HA_CREATE_TMP_TABLE 4
#define HA_CREATE_CHECKSUM 8
+#define HA_CREATE_KEEP_FILES 16 /* don't overwrite .MYD and MYI */
#define HA_CREATE_DELAY_KEY_WRITE 64
#define HA_CREATE_RELIES_ON_SQL_LAYER 128
diff --git a/include/my_bitmap.h b/include/my_bitmap.h
index b2a24f98149..ab69b2d671d 100644
--- a/include/my_bitmap.h
+++ b/include/my_bitmap.h
@@ -104,6 +104,17 @@ extern void bitmap_lock_invert(MY_BITMAP *map);
&= ~ (1 << ((BIT) & 7)))
#define _bitmap_is_set(MAP, BIT) (uint) (((uchar*)(MAP)->bitmap)[(BIT) / 8] \
& (1 << ((BIT) & 7)))
+/*
+ WARNING!
+
+ The below symbols are inline functions in DEBUG builds and macros in
+ non-DEBUG builds. The latter evaluate their 'bit' argument twice.
+
+ NEVER use an increment/decrement operator with the 'bit' argument.
+ It would work with DEBUG builds, but fails later in production builds!
+
+ FORBIDDEN: bitmap_set_bit($my_bitmap, (field++)->field_index);
+*/
#ifndef DBUG_OFF
static inline void
bitmap_set_bit(MY_BITMAP *map,uint bit)
diff --git a/include/my_global.h b/include/my_global.h
index d6f331019f6..91860f6e7a9 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -23,6 +23,17 @@
#define HAVE_EXTERNAL_CLIENT
#endif
+/*
+ InnoDB depends on some MySQL internals which other plugins should not
+ need. This is because of InnoDB's foreign key support, "safe" binlog
+ truncation, and other similar legacy features.
+
+ We define accessors for these internals unconditionally, but do not
+ expose them in mysql/plugin.h. They are declared in ha_innodb.h for
+ InnoDB's use.
+*/
+#define INNODB_COMPATIBILITY_HOOKS
+
#ifdef __CYGWIN__
/* We use a Unix API, so pretend it's not Windows */
#undef WIN
@@ -968,7 +979,12 @@ typedef unsigned long uint32;
typedef unsigned long ulong; /* Short for unsigned long */
#endif
#ifndef longlong_defined
-#if defined(HAVE_LONG_LONG) && SIZEOF_LONG != 8
+/*
+ Using [unsigned] long long is preferable as [u]longlong because we use
+ [unsigned] long long unconditionally in many places,
+ for example in constants with [U]LL suffix.
+*/
+#if defined(HAVE_LONG_LONG) && SIZEOF_LONG_LONG == 8
typedef unsigned long long int ulonglong; /* ulong or unsigned long long */
typedef long long int longlong;
#else
diff --git a/include/md5.h b/include/my_md5.h
index f92976b3beb..f92976b3beb 100644
--- a/include/md5.h
+++ b/include/my_md5.h
diff --git a/include/mysql/plugin.h b/include/mysql/plugin.h
index 7b224695324..b87fcc60692 100644
--- a/include/mysql/plugin.h
+++ b/include/mysql/plugin.h
@@ -24,6 +24,32 @@ class Item;
#define MYSQL_THD void*
#endif
+#ifndef _m_string_h
+/* This definition must match the one given in m_string.h */
+struct st_mysql_lex_string
+{
+ char *str;
+ unsigned int length;
+};
+#endif /* _m_string_h */
+typedef struct st_mysql_lex_string MYSQL_LEX_STRING;
+
+#define MYSQL_XIDDATASIZE 128
+/**
+ struct st_mysql_xid is binary compatible with the XID structure as
+ in the X/Open CAE Specification, Distributed Transaction Processing:
+ The XA Specification, X/Open Company Ltd., 1991.
+ http://www.opengroup.org/bookstore/catalog/c193.htm
+
+ @see XID in sql/handler.h
+*/
+struct st_mysql_xid {
+ long formatID;
+ long gtrid_length;
+ long bqual_length;
+ char data[MYSQL_XIDDATASIZE]; /* Not \0-terminated */
+};
+typedef struct st_mysql_xid MYSQL_XID;
/*************************************************************************
Plugin API. Common for all plugin types.
@@ -655,7 +681,105 @@ void **thd_ha_data(const MYSQL_THD thd, const struct handlerton *hton);
int thd_tx_isolation(const MYSQL_THD thd);
char *thd_security_context(MYSQL_THD thd, char *buffer, unsigned int length,
unsigned int max_query_len);
+/* Increments the row counter, see THD::row_count */
+void thd_inc_row_count(MYSQL_THD thd);
+
+/**
+ Create a temporary file.
+
+ @details
+ The temporary file is created in a location specified by the mysql
+ server configuration (--tmpdir option). The caller does not need to
+ delete the file, it will be deleted automatically.
+
+ @param prefix prefix for temporary file name
+ @retval -1 error
+ @retval >= 0 a file handle that can be passed to dup or my_close
+*/
+int mysql_tmpfile(const char *prefix);
+
+/**
+ Check the killed state of a connection
+
+ @details
+ In MySQL support for the KILL statement is cooperative. The KILL
+ statement only sets a "killed" flag. This function returns the value
+ of that flag. A thread should check it often, especially inside
+ time-consuming loops, and gracefully abort the operation if it is
+ non-zero.
+
+ @param thd user thread connection handle
+ @retval 0 the connection is active
+ @retval 1 the connection has been killed
+*/
+int thd_killed(const MYSQL_THD thd);
+
+/**
+ Allocate memory in the connection's local memory pool
+
+ @details
+ When properly used in place of @c my_malloc(), this can significantly
+ improve concurrency. Don't use this or related functions to allocate
+ large chunks of memory. Use for temporary storage only. The memory
+ will be freed automatically at the end of the statement; no explicit
+ code is required to prevent memory leaks.
+ @see alloc_root()
+*/
+void *thd_alloc(MYSQL_THD thd, unsigned int size);
+/**
+ @see thd_alloc()
+*/
+void *thd_calloc(MYSQL_THD thd, unsigned int size);
+/**
+ @see thd_alloc()
+*/
+char *thd_strdup(MYSQL_THD thd, const char *str);
+/**
+ @see thd_alloc()
+*/
+char *thd_strmake(MYSQL_THD thd, const char *str, unsigned int size);
+/**
+ @see thd_alloc()
+*/
+void *thd_memdup(MYSQL_THD thd, const void* str, unsigned int size);
+
+/**
+ Create a LEX_STRING in this connection's local memory pool
+
+ @param thd user thread connection handle
+ @param lex_str pointer to LEX_STRING object to be initialized
+ @param str initializer to be copied into lex_str
+ @param length length of str, in bytes
+ @param allocate_lex_string flag: if TRUE, allocate new LEX_STRING object,
+ instead of using lex_str value
+ @return NULL on failure, or pointer to the LEX_STRING object
+
+ @see thd_alloc()
+*/
+MYSQL_LEX_STRING *thd_make_lex_string(MYSQL_THD thd, MYSQL_LEX_STRING *lex_str,
+ const char *str, unsigned int size,
+ int allocate_lex_string);
+
+/**
+ Get the XID for this connection's transaction
+
+ @param thd user thread connection handle
+ @param xid location where identifier is stored
+*/
+void thd_get_xid(const MYSQL_THD thd, MYSQL_XID *xid);
+
+/**
+ Invalidate the query cache for a given table.
+
+ @param thd user thread connection handle
+ @param key databasename\0tablename\0
+ @param key_length length of key in bytes, including the NUL bytes
+ @param using_trx flag: TRUE if using transactions, FALSE otherwise
+*/
+void mysql_query_cache_invalidate4(MYSQL_THD thd,
+ const char *key, unsigned int key_length,
+ int using_trx);
#ifdef __cplusplus
}
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index f994397b8fd..46d0c8f1037 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -168,8 +168,23 @@ int STDCALL mysql_server_init(int argc __attribute__((unused)),
}
+/*
+ Free all memory and resources used by the client library
+
+ NOTES
+ When calling this there should not be any other threads using
+ the library.
+
+ To make things simpler when used with windows dll's (which calls this
+ function automaticly), it's safe to call this function multiple times.
+*/
+
+
void STDCALL mysql_server_end()
{
+ if (!mysql_client_init)
+ return;
+
#ifdef EMBEDDED_LIBRARY
end_embedded_server();
#endif
@@ -4924,7 +4939,7 @@ static my_bool reset_stmt_handle(MYSQL_STMT *stmt, uint flags)
Reset stored result set if so was requested or it's a part
of cursor fetch.
*/
- if (result->data && (flags & RESET_STORE_RESULT))
+ if (flags & RESET_STORE_RESULT)
{
/* Result buffered */
free_root(&result->alloc, MYF(MY_KEEP_PREALLOC));
diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am
index 0a6dbc3663a..c783158b46c 100644
--- a/mysql-test/Makefile.am
+++ b/mysql-test/Makefile.am
@@ -26,7 +26,7 @@ EXTRA_SCRIPTS = mysql-test-run-shell.sh install_test_db.sh \
valgrind.supp $(PRESCRIPTS)
EXTRA_DIST = $(EXTRA_SCRIPTS) suite
GENSCRIPTS = mysql-test-run-shell install_test_db mtr mysql-test-run
-PRESCRIPTS = mysql-test-run.pl
+PRESCRIPTS = mysql-test-run.pl mysql-stress-test.pl
test_SCRIPTS = $(GENSCRIPTS) $(PRESCRIPTS)
test_DATA = std_data/client-key.pem std_data/client-cert.pem \
std_data/cacert.pem std_data/server-cert.pem \
@@ -52,8 +52,8 @@ dist-hook:
-$(INSTALL_DATA) $(srcdir)/t/*.imtest $(distdir)/t
$(INSTALL_DATA) $(srcdir)/t/*.sql $(distdir)/t
-$(INSTALL_DATA) $(srcdir)/t/*.disabled $(distdir)/t
- $(INSTALL_DATA) $(srcdir)/t/*.opt $(srcdir)/t/*.slave-mi $(distdir)/t
- $(INSTALL_SCRIPT) $(srcdir)/t/*.sh $(distdir)/t
+ -$(INSTALL_DATA) $(srcdir)/t/*.opt $(srcdir)/t/*.slave-mi $(distdir)/t
+ -$(INSTALL_SCRIPT) $(srcdir)/t/*.sh $(distdir)/t
$(INSTALL_DATA) $(srcdir)/extra/binlog_tests/*.test $(distdir)/extra/binlog_tests
$(INSTALL_DATA) $(srcdir)/extra/rpl_tests/*.test $(distdir)/extra/rpl_tests
-$(INSTALL_DATA) $(srcdir)/extra/binlog_tests/*.opt $(distdir)/extra/binlog_tests
@@ -91,9 +91,9 @@ install-data-local:
-$(INSTALL_DATA) $(srcdir)/t/*.imtest $(DESTDIR)$(testdir)/t
$(INSTALL_DATA) $(srcdir)/t/*.sql $(DESTDIR)$(testdir)/t
-$(INSTALL_DATA) $(srcdir)/t/*.disabled $(DESTDIR)$(testdir)/t
- $(INSTALL_DATA) $(srcdir)/t/*.opt $(DESTDIR)$(testdir)/t
- $(INSTALL_SCRIPT) $(srcdir)/t/*.sh $(DESTDIR)$(testdir)/t
- $(INSTALL_DATA) $(srcdir)/t/*.slave-mi $(DESTDIR)$(testdir)/t
+ -$(INSTALL_DATA) $(srcdir)/t/*.opt $(DESTDIR)$(testdir)/t
+ -$(INSTALL_SCRIPT) $(srcdir)/t/*.sh $(DESTDIR)$(testdir)/t
+ -$(INSTALL_DATA) $(srcdir)/t/*.slave-mi $(DESTDIR)$(testdir)/t
$(INSTALL_DATA) $(srcdir)/r/*.result $(DESTDIR)$(testdir)/r
$(INSTALL_DATA) $(srcdir)/r/*.require $(DESTDIR)$(testdir)/r
$(INSTALL_DATA) $(srcdir)/extra/binlog_tests/*.test $(DESTDIR)$(testdir)/extra/binlog_tests
diff --git a/mysql-test/extra/binlog_tests/binlog.test b/mysql-test/extra/binlog_tests/binlog.test
index e838acbed35..0d2ed7ad509 100644
--- a/mysql-test/extra/binlog_tests/binlog.test
+++ b/mysql-test/extra/binlog_tests/binlog.test
@@ -5,7 +5,6 @@
-- source include/have_log_bin.inc
-- source include/not_embedded.inc
-- source include/have_innodb.inc
--- source include/have_log_bin.inc
-- source include/have_debug.inc
--disable_warnings
@@ -49,6 +48,68 @@ show binlog events in 'master-bin.000001' from 106;
--replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\//
show binlog events in 'master-bin.000002' from 106;
+
+#
+# Bug#22540 - Incorrect value in column End_log_pos of
+# SHOW BINLOG EVENTS using InnoDB
+#
+
+# the following tests will show that certain queries now return
+# absolute offsets (from binlog start, rather than relative to
+# the beginning of the current transaction). under what
+# conditions it should be allowed / is sensible to put the
+# slider into the middle of a transaction is not our concern
+# here; we just guarantee that if and when it's done, the
+# user has valid offsets to use. if the setter function still
+# wants to throw a "positioning into middle of transaction"
+# warning, that's its prerogative and handled elsewhere.
+
+set @ac = @@autocommit;
+
+# first show this to work for SHOW BINLOG EVENTS
+
+set autocommit= 0;
+reset master;
+create table t1(n int) engine=innodb;
+begin;
+insert into t1 values (1);
+insert into t1 values (2);
+insert into t1 values (3);
+commit;
+drop table t1;
+--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/
+show binlog events from 0;
+
+# now show that nothing breaks if we need to read from the cache more
+# than once, resulting in split event-headers
+
+set @bcs = @@binlog_cache_size;
+set global binlog_cache_size=4096;
+reset master;
+
+create table t1 (a int) engine=innodb;
+
+let $1=400;
+disable_query_log;
+begin;
+while ($1)
+{
+ eval insert into t1 values( $1 );
+ dec $1;
+}
+commit;
+enable_query_log;
+
+--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/
+show binlog events from 0;
+
+drop table t1;
+
+set global binlog_cache_size=@bcs;
+set session autocommit = @ac;
+
+--echo End of 5.0 tests
+
# Test of a too big SET INSERT_ID: see if the truncated value goes
# into binlog (right), or the too big value (wrong); we look at the
# binlog further down with SHOW BINLOG EVENTS.
diff --git a/mysql-test/extra/rpl_tests/rpl_loaddata.test b/mysql-test/extra/rpl_tests/rpl_loaddata.test
index acd8fd48234..bb6afd73034 100644
--- a/mysql-test/extra/rpl_tests/rpl_loaddata.test
+++ b/mysql-test/extra/rpl_tests/rpl_loaddata.test
@@ -164,8 +164,8 @@ CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB;
--error ER_DUP_ENTRY
LOAD DATA INFILE "../std_data_ln/words.dat" INTO TABLE t1;
---disable warnings
+--disable_warnings
DROP TABLE IF EXISTS t1;
---enable warnings
+--enable_warnings
# End of 4.1 tests
diff --git a/mysql-test/include/have_ndb.inc b/mysql-test/include/have_ndb.inc
index 3d9cbf5a379..cfc5b5d0ff8 100644
--- a/mysql-test/include/have_ndb.inc
+++ b/mysql-test/include/have_ndb.inc
@@ -1,6 +1,10 @@
# Check that server is compiled and started with support for NDB
-disable_query_log;
---require r/true.require
-select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schema.engines where engine = 'ndbcluster';
---source include/ndb_not_readonly.inc
-enable_query_log;
+#disable_query_log;
+#--require r/true.require
+#select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schema.engines where engine = 'ndbcluster';
+#--source include/ndb_not_readonly.inc
+#enable_query_log;
+# always make sure we have both mysql servers started ok before test starts
+# there are some initial startup bugs that are avoided by doing this, avoiding sporadic
+# failures in mysql-test-run
+--source include/have_multi_ndb.inc
diff --git a/mysql-test/include/have_outfile.inc b/mysql-test/include/have_outfile.inc
index 10f093ec3ef..ae4a2723840 100644
--- a/mysql-test/include/have_outfile.inc
+++ b/mysql-test/include/have_outfile.inc
@@ -1,5 +1,5 @@
-- require r/have_outfile.require
disable_query_log;
select load_file(concat(@tmpdir,"/outfile.test"));
---exec rm $MYSQLTEST_VARDIR/tmp/outfile.test
+--remove_file $MYSQLTEST_VARDIR/tmp/outfile.test
enable_query_log;
diff --git a/mysql-test/include/index_merge1.inc b/mysql-test/include/index_merge1.inc
index a3a874a8ed2..2ecdbe583c2 100644
--- a/mysql-test/include/index_merge1.inc
+++ b/mysql-test/include/index_merge1.inc
@@ -439,3 +439,51 @@ INSERT INTO t2(a,b) VALUES(1,2);
SELECT t2.a FROM t1,t2 WHERE t2.b=2 AND t2.a=1;
UNLOCK TABLES;
DROP TABLE t1, t2;
+
+#
+# BUG#29740: HA_KEY_SCAN_NOT_ROR wasn't set for HEAP engine
+#
+CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `filler` char(200) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ KEY `a` (`a`),
+ KEY `b` (`b`)
+) ENGINE=MEMORY DEFAULT CHARSET=latin1;
+
+insert into t1 values
+(0, 'filler', 0), (1, 'filler', 1), (2, 'filler', 2), (3, 'filler', 3),
+(4, 'filler', 4), (5, 'filler', 5), (6, 'filler', 6), (7, 'filler', 7),
+(8, 'filler', 8), (9, 'filler', 9), (0, 'filler', 0), (1, 'filler', 1),
+(2, 'filler', 2), (3, 'filler', 3), (4, 'filler', 4), (5, 'filler', 5),
+(6, 'filler', 6), (7, 'filler', 7), (8, 'filler', 8), (9, 'filler', 9),
+(10, 'filler', 10), (11, 'filler', 11), (12, 'filler', 12), (13, 'filler', 13),
+(14, 'filler', 14), (15, 'filler', 15), (16, 'filler', 16), (17, 'filler', 17),
+(18, 'filler', 18), (19, 'filler', 19), (4, '5 ', 0), (5, '4 ', 0),
+(4, '4 ', 0), (4, 'qq ', 5), (5, 'qq ', 4), (4, 'zz ', 4);
+
+create table t2(
+ `a` int(11) DEFAULT NULL,
+ `filler` char(200) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ KEY USING BTREE (`a`),
+ KEY USING BTREE (`b`)
+) ENGINE=MEMORY DEFAULT CHARSET=latin1;
+insert into t2 select * from t1;
+
+--echo must use sort-union rather than union:
+--replace_column 9 #
+explain select * from t1 where a=4 or b=4;
+--sorted_result
+select * from t1 where a=4 or b=4;
+--sorted_result
+select * from t1 ignore index(a,b) where a=4 or b=4;
+
+--echo must use union, not sort-union:
+--replace_column 9 #
+explain select * from t2 where a=4 or b=4;
+--sorted_result
+select * from t2 where a=4 or b=4;
+
+drop table t1, t2;
+
diff --git a/mysql-test/include/innodb_trx_weight.inc b/mysql-test/include/innodb_trx_weight.inc
new file mode 100644
index 00000000000..56d3d47da36
--- /dev/null
+++ b/mysql-test/include/innodb_trx_weight.inc
@@ -0,0 +1,51 @@
+-- connect (con1,localhost,root,,)
+-- connect (con2,localhost,root,,)
+
+-- connection con1
+SET autocommit=0;
+SELECT * FROM t1 FOR UPDATE;
+-- if ($con1_extra_sql_present) {
+ -- eval $con1_extra_sql
+-- }
+
+-- connection con2
+SET autocommit=0;
+SELECT * FROM t2 FOR UPDATE;
+-- if ($con2_extra_sql_present) {
+ -- eval $con2_extra_sql
+-- }
+
+-- if ($con1_should_be_rolledback) {
+ -- connection con1
+ -- send
+ INSERT INTO t2 VALUES (0);
+
+ -- connection con2
+ INSERT INTO t1 VALUES (0);
+ ROLLBACK;
+
+ -- connection con1
+ -- error ER_LOCK_DEADLOCK
+ -- reap
+-- }
+# else
+-- if (!$con1_should_be_rolledback) {
+ -- connection con2
+ -- send
+ INSERT INTO t1 VALUES (0);
+
+ -- connection con1
+ INSERT INTO t2 VALUES (0);
+ ROLLBACK;
+
+ -- connection con2
+ -- error ER_LOCK_DEADLOCK
+ -- reap
+-- }
+
+-- connection default
+
+DELETE FROM t5_nontrans;
+
+-- disconnect con1
+-- disconnect con2
diff --git a/mysql-test/include/mix1.inc b/mysql-test/include/mix1.inc
index 2aca2ba3698..e863e59fad6 100644
--- a/mysql-test/include/mix1.inc
+++ b/mysql-test/include/mix1.inc
@@ -28,7 +28,7 @@
eval SET SESSION STORAGE_ENGINE = $engine_type;
--disable_warnings
-drop table if exists t1,t2,t1m,t1i,t2m,t2i,t4;
+drop table if exists t1,t2,t3,t1m,t1i,t2m,t2i,t4;
--enable_warnings
@@ -222,9 +222,6 @@ t1.a4='UNcT5pIde4I6c2SheTo4gt92OV1jgJCVkXmzyf325R1DwLURkbYHwhydANIZMbKTgdcR5xS';
DROP TABLE t1;
---echo End of 4.1 tests
-
-
#
# Bug #12882 min/max inconsistent on empty table
#
@@ -424,24 +421,6 @@ SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id
DROP TABLE t1,t2;
#
-# Bug#22781: SQL_BIG_RESULT fails to influence sort plan
-#
-CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c FLOAT, KEY b(b)) ENGINE = INNODB;
-
-INSERT INTO t1 VALUES ( 1 , 1 , 1);
-INSERT INTO t1 SELECT a + 1 , MOD(a + 1 , 20), 1 FROM t1;
-INSERT INTO t1 SELECT a + 2 , MOD(a + 2 , 20), 1 FROM t1;
-INSERT INTO t1 SELECT a + 4 , MOD(a + 4 , 20), 1 FROM t1;
-INSERT INTO t1 SELECT a + 8 , MOD(a + 8 , 20), 1 FROM t1;
-INSERT INTO t1 SELECT a + 16, MOD(a + 16, 20), 1 FROM t1;
-INSERT INTO t1 SELECT a + 32, MOD(a + 32, 20), 1 FROM t1;
-INSERT INTO t1 SELECT a + 64, MOD(a + 64, 20), 1 FROM t1;
-
-EXPLAIN SELECT b, SUM(c) FROM t1 GROUP BY b;
-EXPLAIN SELECT SQL_BIG_RESULT b, SUM(c) FROM t1 GROUP BY b;
-DROP TABLE t1;
-
-#
# Bug#26159: crash for a loose scan of a table that has been emptied
#
@@ -502,40 +481,6 @@ set global query_cache_size=@save_qcache_size;
--source include/innodb_rollback_on_timeout.inc
#
-# Bug #27210: INNODB ON DUPLICATE KEY UPDATE
-#
-
-set @save_qcache_size=@@global.query_cache_size;
-set @save_qcache_type=@@global.query_cache_type;
-set global query_cache_size=10*1024*1024;
-set global query_cache_type=1;
-connect (con1,localhost,root,,);
-connection con1;
-drop table if exists `test`;
-CREATE TABLE `test` (`test1` varchar(3) NOT NULL,
- `test2` varchar(4) NOT NULL,PRIMARY KEY (`test1`))
- ENGINE=InnoDB DEFAULT CHARSET=latin1;
-INSERT INTO `test` (`test1`, `test2`) VALUES ('tes', '5678');
-disconnect con1;
-connect (con2,localhost,root,,);
-connection con2;
-select * from test;
-INSERT INTO `test` (`test1`, `test2`) VALUES ('tes', '1234')
- ON DUPLICATE KEY UPDATE `test2` = '1234';
-select * from test;
-flush tables;
-select * from test;
-disconnect con2;
-connection default;
-drop table test;
-set global query_cache_type=@save_qcache_type;
-set global query_cache_size=@save_qcache_size;
-
---echo End of 5.0 tests
-
--- source include/have_innodb.inc
-
-#
# Bug #27650: INSERT fails after multi-row INSERT of the form:
# INSERT INTO t (id...) VALUES (NULL...) ON DUPLICATE KEY UPDATE id=VALUES(id)
#
@@ -672,6 +617,20 @@ SELECT * FROM t3 WHERE a = 'uk';
DROP TABLE t1,t2,t3;
+#
+# Test bug when trying to drop data file which no InnoDB directory entry
+#
+
+create table t1 (a int) engine=innodb;
+copy_file $MYSQLTEST_VARDIR/master-data/test/t1.frm $MYSQLTEST_VARDIR/master-data/test/bug29807.frm;
+--error 1146
+select * from bug29807;
+drop table t1;
+--error 1051
+drop table bug29807;
+create table bug29807 (a int);
+drop table bug29807;
+
#
# Bug #29154: LOCK TABLES is not atomic when >1 InnoDB tables are locked
@@ -706,8 +665,62 @@ DISCONNECT c1;
DISCONNECT c2;
DROP TABLE t1,t2;
+#
+# Bug #25798: a query with forced index merge returns wrong result
+#
---echo End of 5.0 tests
+CREATE TABLE t1 (
+ id int NOT NULL auto_increment PRIMARY KEY,
+ b int NOT NULL,
+ c datetime NOT NULL,
+ INDEX idx_b(b),
+ INDEX idx_c(c)
+) ENGINE=InnoDB;
+
+CREATE TABLE t2 (
+ b int NOT NULL auto_increment PRIMARY KEY,
+ c datetime NOT NULL
+) ENGINE= MyISAM;
+
+INSERT INTO t2(c) VALUES ('2007-01-01');
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+
+INSERT INTO t1(b,c) SELECT b,c FROM t2;
+UPDATE t2 SET c='2007-01-02';
+INSERT INTO t1(b,c) SELECT b,c FROM t2;
+UPDATE t2 SET c='2007-01-03';
+INSERT INTO t1(b,c) SELECT b,c FROM t2;
+
+set @@sort_buffer_size=8192;
+
+SELECT COUNT(*) FROM t1;
+
+--replace_column 9 #
+EXPLAIN
+SELECT COUNT(*) FROM t1
+ WHERE (c >= '2007-01-02' AND c <= '2007-01-03') OR b >= 1;
+SELECT COUNT(*) FROM t1
+ WHERE (c >= '2007-01-02' AND c <= '2007-01-03') OR b >= 1;
+
+--replace_column 9 #
+EXPLAIN
+SELECT COUNT(*) FROM t1 FORCE INDEX(idx_b, idx_c)
+ WHERE (c >= '2007-01-02' AND c <= '2007-01-03') OR b >= 1;
+SELECT COUNT(*) FROM t1 FORCE INDEX(idx_b, idx_c)
+ WHERE (c >= '2007-01-02' AND c <= '2007-01-03') OR b >= 1;
+
+set @@sort_buffer_size=default;
+
+DROP TABLE t1,t2;
#
# Test of behaviour with CREATE ... SELECT
@@ -786,6 +799,21 @@ DROP TABLE t1;
--source include/innodb_rollback_on_timeout.inc
+#
+# Bug#27296 Assertion in ALTER TABLE SET DEFAULT in Linux Debug build
+# (possible deadlock).
+#
+# The bug is applicable only to a transactoinal table.
+# Cover with tests behavior that no longer causes an
+# assertion.
+#
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (a int) engine=innodb;
+alter table t1 alter a set default 1;
+drop table t1;
+
--echo End of 5.0 tests
@@ -889,5 +917,29 @@ unlock tables;
select * from t1;
drop tables t1;
+#
+# Bug#29310: An InnoDB table was updated when the data wasn't actually changed.
+#
+create table t1(f1 varchar(5) unique, f2 timestamp NOT NULL DEFAULT
+ CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
+insert into t1(f1) values(1);
+--replace_column 1 #
+select @a:=f2 from t1;
+--sleep 5
+update t1 set f1=1;
+--replace_column 1 #
+select @b:=f2 from t1;
+select if(@a=@b,"ok","wrong");
+--sleep 5
+insert into t1(f1) values (1) on duplicate key update f1="1";
+--replace_column 1 #
+select @b:=f2 from t1;
+select if(@a=@b,"ok","wrong");
+--sleep 5
+insert into t1(f1) select f1 from t1 on duplicate key update f1="1";
+--replace_column 1 #
+select @b:=f2 from t1;
+select if(@a=@b,"ok","wrong");
+drop table t1;
--echo End of 5.1 tests
diff --git a/mysql-test/include/ndb_master-slave.inc b/mysql-test/include/ndb_master-slave.inc
index 81dd63be78a..1568072202b 100644
--- a/mysql-test/include/ndb_master-slave.inc
+++ b/mysql-test/include/ndb_master-slave.inc
@@ -4,7 +4,12 @@ connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT,);
connect (slave1,127.0.0.1,root,,test,$SLAVE_MYPORT,);
connection slave;
--- source include/have_ndb.inc
+# Check that server is compiled and started with support for NDB
+disable_query_log;
+--require r/true.require
+select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schema.engines where engine = 'ndbcluster';
+--source include/ndb_not_readonly.inc
+enable_query_log;
-- source include/master-slave-reset.inc
diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl
index 120947c84a7..2becb7f9865 100644
--- a/mysql-test/lib/mtr_cases.pl
+++ b/mysql-test/lib/mtr_cases.pl
@@ -23,7 +23,8 @@ use IO::File();
use strict;
sub collect_test_cases ($);
-sub collect_one_test_case ($$$$$$$);
+sub collect_one_suite ($$);
+sub collect_one_test_case ($$$$$$$$$);
sub mtr_options_from_test_file($$);
@@ -34,7 +35,120 @@ sub mtr_options_from_test_file($$);
##############################################################################
sub collect_test_cases ($) {
- my $suite= shift; # Test suite name
+ my $suites= shift; # Semicolon separated list of test suites
+ my $cases = []; # Array of hash
+
+ foreach my $suite (split(",", $suites))
+ {
+ collect_one_suite($suite, $cases);
+ }
+
+
+ if ( @::opt_cases )
+ {
+ # Check that the tests specified was found
+ # in at least one suite
+ foreach my $tname ( @::opt_cases )
+ {
+ my $found= 0;
+ foreach my $test ( @$cases )
+ {
+ if ( mtr_match_extension($test->{'name'}, $tname) )
+ {
+ $found= 1;
+ }
+ }
+ if ( not $found )
+ {
+ mtr_error("Could not find $tname in any suite");
+ }
+ }
+ }
+
+ if ( $::opt_reorder )
+ {
+ # Reorder the test cases in an order that will make them faster to run
+ my %sort_criteria;
+
+ # Make a mapping of test name to a string that represents how that test
+ # should be sorted among the other tests. Put the most important criterion
+ # first, then a sub-criterion, then sub-sub-criterion, et c.
+ foreach my $tinfo (@$cases)
+ {
+ my @criteria = ();
+
+ # Look for tests that muct be in run in a defined order
+ # that is defined by test having the same name except for
+ # the ending digit
+
+ # Put variables into hash
+ my $test_name= $tinfo->{'name'};
+ my $depend_on_test_name;
+ if ( $test_name =~ /^([\D]+)([0-9]{1})$/ )
+ {
+ my $base_name= $1;
+ my $idx= $2;
+ mtr_verbose("$test_name => $base_name idx=$idx");
+ if ( $idx > 1 )
+ {
+ $idx-= 1;
+ $base_name= "$base_name$idx";
+ mtr_verbose("New basename $base_name");
+ }
+
+ foreach my $tinfo2 (@$cases)
+ {
+ if ( $tinfo2->{'name'} eq $base_name )
+ {
+ mtr_verbose("found dependent test $tinfo2->{'name'}");
+ $depend_on_test_name=$base_name;
+ }
+ }
+ }
+
+ if ( defined $depend_on_test_name )
+ {
+ mtr_verbose("Giving $test_name same critera as $depend_on_test_name");
+ $sort_criteria{$test_name} = $sort_criteria{$depend_on_test_name};
+ }
+ else
+ {
+ #
+ # Append the criteria for sorting, in order of importance.
+ #
+ push(@criteria, "ndb=" . ($tinfo->{'ndb_test'} ? "1" : "0"));
+ # Group test with equal options together.
+ # Ending with "~" makes empty sort later than filled
+ push(@criteria, join("!", sort @{$tinfo->{'master_opt'}}) . "~");
+
+ $sort_criteria{$test_name} = join(" ", @criteria);
+ }
+ }
+
+ @$cases = sort {
+ $sort_criteria{$a->{'name'}} . $a->{'name'} cmp
+ $sort_criteria{$b->{'name'}} . $b->{'name'}; } @$cases;
+
+ if ( $::opt_script_debug )
+ {
+ # For debugging the sort-order
+ foreach my $tinfo (@$cases)
+ {
+ print("$sort_criteria{$tinfo->{'name'}} -> \t$tinfo->{'name'}\n");
+ }
+ }
+ }
+
+ return $cases;
+
+}
+
+sub collect_one_suite($$)
+{
+ my $suite= shift; # Test suite name
+ my $cases= shift; # List of test cases
+
+ mtr_verbose("Collecting: $suite");
my $testdir;
my $resdir;
@@ -50,12 +164,8 @@ sub collect_test_cases ($) {
$resdir= "$::glob_mysql_test_dir/suite/$suite/r";
}
- my $cases = []; # Array of hash, will be array of C struct
-
- opendir(TESTDIR, $testdir) or mtr_error("Can't open dir \"$testdir\": $!");
-
# ----------------------------------------------------------------------
- # Disable some tests listed in disabled.def
+ # Build a hash of disabled testcases for this suite
# ----------------------------------------------------------------------
my %disabled;
if ( open(DISABLED, "$testdir/disabled.def" ) )
@@ -71,11 +181,19 @@ sub collect_test_cases ($) {
close DISABLED;
}
+ # Read suite.opt file
+ my $suite_opt_file= "$testdir/suite.opt";
+ my $suite_opts= [];
+ if ( -f $suite_opt_file )
+ {
+ $suite_opts= mtr_get_opts_from_file($suite_opt_file);
+ }
+
if ( @::opt_cases )
{
+ # Collect in specified order, no sort
foreach my $tname ( @::opt_cases )
{
- # Run in specified order, no sort
my $elem= undef;
my $component_id= undef;
@@ -122,7 +240,8 @@ sub collect_test_cases ($) {
}
elsif ( ! $mysqld_test_exists and ! $im_test_exists )
{
- mtr_error("Test case $tname is not found");
+ # Silently skip, could exist in another suite
+ next;
}
elsif ( $mysqld_test_exists )
{
@@ -136,13 +255,15 @@ sub collect_test_cases ($) {
}
}
- collect_one_test_case($testdir,$resdir,$tname,$elem,$cases,\%disabled,
- $component_id);
+ collect_one_test_case($testdir,$resdir,$suite,$tname,
+ $elem,$cases,\%disabled,$component_id,
+ $suite_opts);
}
- closedir TESTDIR;
}
else
{
+ opendir(TESTDIR, $testdir) or mtr_error("Can't open dir \"$testdir\": $!");
+
foreach my $elem ( sort readdir(TESTDIR) )
{
my $component_id= undef;
@@ -165,87 +286,13 @@ sub collect_test_cases ($) {
next if $::opt_do_test and
! defined mtr_match_prefix($elem,$::opt_do_test);
- collect_one_test_case($testdir,$resdir,$tname,$elem,$cases,\%disabled,
- $component_id);
+ collect_one_test_case($testdir,$resdir,$suite,$tname,
+ $elem,$cases,\%disabled,$component_id,
+ $suite_opts);
}
closedir TESTDIR;
}
- # Reorder the test cases in an order that will make them faster to run
- if ( $::opt_reorder )
- {
-
- my %sort_criteria;
-
- # Make a mapping of test name to a string that represents how that test
- # should be sorted among the other tests. Put the most important criterion
- # first, then a sub-criterion, then sub-sub-criterion, et c.
- foreach my $tinfo (@$cases)
- {
- my @criteria = ();
-
- # Look for tests that muct be in run in a defined order
- # that is defined by test having the same name except for
- # the ending digit
-
- # Put variables into hash
- my $test_name= $tinfo->{'name'};
- my $depend_on_test_name;
- if ( $test_name =~ /^([\D]+)([0-9]{1})$/ )
- {
- my $base_name= $1;
- my $idx= $2;
- mtr_verbose("$test_name => $base_name idx=$idx");
- if ( $idx > 1 )
- {
- $idx-= 1;
- $base_name= "$base_name$idx";
- mtr_verbose("New basename $base_name");
- }
-
- foreach my $tinfo2 (@$cases)
- {
- if ( $tinfo2->{'name'} eq $base_name )
- {
- mtr_verbose("found dependent test $tinfo2->{'name'}");
- $depend_on_test_name=$base_name;
- }
- }
- }
-
- if ( defined $depend_on_test_name )
- {
- mtr_verbose("Giving $test_name same critera as $depend_on_test_name");
- $sort_criteria{$test_name} = $sort_criteria{$depend_on_test_name};
- }
- else
- {
- #
- # Append the criteria for sorting, in order of importance.
- #
- push(@criteria, "ndb=" . ($tinfo->{'ndb_test'} ? "1" : "0"));
- # Group test with equal options together.
- # Ending with "~" makes empty sort later than filled
- push(@criteria, join("!", sort @{$tinfo->{'master_opt'}}) . "~");
-
- $sort_criteria{$test_name} = join(" ", @criteria);
- }
- }
-
- @$cases = sort {
- $sort_criteria{$a->{'name'}} . $a->{'name'} cmp
- $sort_criteria{$b->{'name'}} . $b->{'name'}; } @$cases;
-
- if ( $::opt_script_debug )
- {
- # For debugging the sort-order
- foreach my $tinfo (@$cases)
- {
- print("$sort_criteria{$tinfo->{'name'}} -> \t$tinfo->{'name'}\n");
- }
- }
- }
-
return $cases;
}
@@ -257,14 +304,16 @@ sub collect_test_cases ($) {
##############################################################################
-sub collect_one_test_case($$$$$$$) {
+sub collect_one_test_case($$$$$$$$$) {
my $testdir= shift;
my $resdir= shift;
+ my $suite= shift;
my $tname= shift;
my $elem= shift;
my $cases= shift;
my $disabled=shift;
my $component_id= shift;
+ my $suite_opts= shift;
my $path= "$testdir/$elem";
@@ -279,7 +328,7 @@ sub collect_one_test_case($$$$$$$) {
my $tinfo= {};
- $tinfo->{'name'}= $tname;
+ $tinfo->{'name'}= "$suite.$tname";
$tinfo->{'result_file'}= "$resdir/$tname.result";
$tinfo->{'component_id'} = $component_id;
push(@$cases, $tinfo);
@@ -334,6 +383,15 @@ sub collect_one_test_case($$$$$$$) {
$tinfo->{'slave_opt'}= [];
$tinfo->{'slave_mi'}= [];
+ # Add suite opts
+ foreach my $opt ( @$suite_opts )
+ {
+ mtr_verbose($opt);
+ push(@{$tinfo->{'master_opt'}}, $opt);
+ push(@{$tinfo->{'slave_opt'}}, $opt);
+ }
+
+ # Add master opts
if ( -f $master_opt_file )
{
@@ -394,6 +452,7 @@ sub collect_one_test_case($$$$$$$) {
}
}
+ # Add slave opts
if ( -f $slave_opt_file )
{
my $slave_opt= mtr_get_opts_from_file($slave_opt_file);
diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl
index 0c77174e0bd..69026d2c72f 100644
--- a/mysql-test/lib/mtr_process.pl
+++ b/mysql-test/lib/mtr_process.pl
@@ -142,6 +142,7 @@ sub spawn_impl ($$$$$$$) {
if ( $pid )
{
+ select(STDOUT) if $::glob_win32_perl;
return spawn_parent_impl($pid,$mode,$path);
}
else
@@ -163,9 +164,6 @@ sub spawn_impl ($$$$$$$) {
{
# Don't redirect stdout on ActiveState perl since this is
# just another thread in the same process.
- # Should be fixed so that the thread that is created with fork
- # executes the exe in another process and wait's for it to return.
- # In the meanwhile, we get all the output from mysqld's to screen
}
elsif ( ! open(STDOUT,$log_file_open_mode,$output) )
{
@@ -175,7 +173,7 @@ sub spawn_impl ($$$$$$$) {
if ( $error )
{
- if ( $output eq $error )
+ if ( !$::glob_win32_perl and $output eq $error )
{
if ( ! open(STDERR,">&STDOUT") )
{
@@ -184,15 +182,7 @@ sub spawn_impl ($$$$$$$) {
}
else
{
- if ( $::glob_win32_perl )
- {
- # Don't redirect stdout on ActiveState perl since this is
- # just another thread in the same process.
- # Should be fixed so that the thread that is created with fork
- # executes the exe in another process and wait's for it to return.
- # In the meanwhile, we get all the output from mysqld's to screen
- }
- elsif ( ! open(STDERR,$log_file_open_mode,$error) )
+ if ( ! open(STDERR,$log_file_open_mode,$error) )
{
mtr_child_error("can't redirect STDERR to \"$error\": $!");
}
@@ -369,7 +359,7 @@ sub mtr_kill_leftovers () {
"socket: '$srv->{path_sock}'; ".
"port: $srv->{port})");
- my $pid= mtr_mysqladmin_start($srv, "shutdown", 70);
+ my $pid= mtr_mysqladmin_start($srv, "shutdown", 20);
# Save the pid of the mysqladmin process
$admin_pids{$pid}= 1;
@@ -613,6 +603,11 @@ sub mtr_check_stop_servers ($) {
if ( $pid )
{
# Server is still alive, put it in list to be hard killed
+ if ($::glob_win32_perl)
+ {
+ # Kill the real process if it's known
+ $pid= $srv->{'real_pid'} if ($srv->{'real_pid'});
+ }
$kill_pids{$pid}= 1;
# Write a message to the process's error log (if it has one)
@@ -666,6 +661,16 @@ sub mtr_check_stop_servers ($) {
}
}
+ if ($::glob_win32_perl and $srv->{'real_pid'})
+ {
+ # Wait for the pseudo pid - if the real_pid was known
+ # the pseudo pid has not been waited for yet, wai blocking
+ # since it's "such a simple program"
+ mtr_verbose("Wait for pseudo process $srv->{'pid'}");
+ my $ret_pid= waitpid($srv->{'pid'}, 0);
+ mtr_verbose("Pseudo process $ret_pid died");
+ }
+
$srv->{'pid'}= 0;
}
}
@@ -1043,7 +1048,7 @@ sub sleep_until_file_created ($$$) {
{
if ( -r $pidfile )
{
- return $pid;
+ return 1;
}
# Check if it died after the fork() was successful
diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl
index a9d6d17d870..306a0fe5d9d 100644
--- a/mysql-test/lib/mtr_report.pl
+++ b/mysql-test/lib/mtr_report.pl
@@ -48,30 +48,15 @@ sub mtr_verbose (@);
# We can't use diff -u or diff -a as these are not portable
sub mtr_show_failed_diff ($) {
- my $result_file_name= shift;
+ my $tinfo= shift;
# The reject and log files have been dumped to
# to filenames based on the result_file's name
- my $tname= basename($result_file_name);
- $tname=~ s/\..*$//;
-
- my $reject_file= "r/$tname.reject";
- my $result_file= "r/$tname.result";
- my $log_file= "$::opt_vardir/log/$tname.log";
- my $eval_file= "r/$tname.eval";
-
- if ( $::opt_suite ne "main" )
- {
- $reject_file= "$::glob_mysql_test_dir/suite/$::opt_suite/$reject_file";
- $result_file= "$::glob_mysql_test_dir/suite/$::opt_suite/$result_file";
- $eval_file= "$::glob_mysql_test_dir/suite/$::opt_suite/$eval_file";
- $log_file= "$::glob_mysql_test_dir/suite/$::opt_suite/$log_file";
- }
-
- if ( -f $eval_file )
- {
- $result_file= $eval_file;
- }
+ my $base_file= mtr_match_extension($tinfo->{'result_file'},
+ "result"); # Trim extension
+ my $reject_file= "$base_file.reject";
+ my $result_file= "$base_file.result";
+ my $log_file= "$base_file.log";
my $diffopts= $::opt_udiff ? "-u" : "-c";
@@ -360,6 +345,10 @@ sub mtr_report_stats ($) {
/skip-name-resolve mode/ or
/slave SQL thread aborted/ or
/Slave: .*Duplicate entry/ or
+ # Special case for Bug #26402 in show_check.test
+ # Question marks are not valid file name parts
+ # on Windows platforms. Ignore this error message.
+ /\QCan't find file: '.\test\????????.frm'\E/ or
# Special case, made as specific as possible, for:
# Bug #28436: Incorrect position in SHOW BINLOG EVENTS causes
# server coredump
@@ -369,7 +358,11 @@ sub mtr_report_stats ($) {
# Test case for Bug#14233 produces the following warnings:
/Stored routine 'test'.'bug14233_1': invalid value in column mysql.proc/ or
/Stored routine 'test'.'bug14233_2': invalid value in column mysql.proc/ or
- /Stored routine 'test'.'bug14233_3': invalid value in column mysql.proc/
+ /Stored routine 'test'.'bug14233_3': invalid value in column mysql.proc/ or
+
+ # BUG#29807 - innodb_mysql.test: Cannot find table test/t2
+ # from the internal data dictionary
+ /Cannot find table test\/bug29807 from the internal data dictionary/
)
{
next; # Skip these lines
diff --git a/mysql-test/lib/mtr_timer.pl b/mysql-test/lib/mtr_timer.pl
index 523799f7cf5..86a9f58514f 100644
--- a/mysql-test/lib/mtr_timer.pl
+++ b/mysql-test/lib/mtr_timer.pl
@@ -97,9 +97,14 @@ sub mtr_timer_start($$$) {
# clearing the signal handler.
$SIG{INT}= 'DEFAULT';
+ $SIG{TERM}= sub {
+ mtr_verbose("timer woke up, exiting!");
+ exit(0);
+ };
+
$0= "mtr_timer(timers,$name,$duration)";
- mtr_verbose("timer child $name, sleep $duration");
sleep($duration);
+ mtr_verbose("timer expired after $duration seconds");
exit(0);
}
}
@@ -118,7 +123,7 @@ sub mtr_timer_stop ($$) {
# FIXME as Cygwin reuses pids fast, maybe check that is
# the expected process somehow?!
- kill(9, $tpid);
+ kill(15, $tpid);
# As the timers are so simple programs, we trust them to terminate,
# and use blocking wait for it. We wait just to avoid a zombie.
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 5f07d84ad98..6ec4045bb43 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -132,7 +132,7 @@ our $opt_vs_config = $ENV{'MTR_VS_CONFIG'};
our $default_vardir;
our $opt_usage;
-our $opt_suite;
+our $opt_suites= "main,binlog,rpl,rpl_ndb,ndb"; # Default suites to run
our $opt_script_debug= 0; # Script debugging, enable with --script-debug
our $opt_verbose= 0; # Verbose output, enable with --verbose
@@ -404,7 +404,7 @@ sub main () {
else
{
# Figure out which tests we are going to run
- my $tests= collect_test_cases($opt_suite);
+ my $tests= collect_test_cases($opt_suites);
# Turn off NDB and other similar options if no tests use it
my ($need_ndbcluster,$need_im);
@@ -458,7 +458,7 @@ sub main () {
run_report_features();
}
- run_suite($opt_suite, $tests);
+ run_tests($tests);
}
mtr_exit(0);
@@ -474,7 +474,6 @@ sub command_line_setup () {
# These are defaults for things that are set on the command line
- $opt_suite= "main"; # Special default suite
my $opt_comment;
$opt_master_myport= 9306;
@@ -534,7 +533,7 @@ sub command_line_setup () {
'skip-slave-binlog' => \$opt_skip_slave_binlog,
'do-test=s' => \$opt_do_test,
'start-from=s' => \$opt_start_from,
- 'suite=s' => \$opt_suite,
+ 'suite|suites=s' => \$opt_suites,
'skip-rpl' => \$opt_skip_rpl,
'skip-im' => \$opt_skip_im,
'skip-test=s' => \$opt_skip_test,
@@ -2593,10 +2592,19 @@ sub ndbcluster_wait_started($$){
sub mysqld_wait_started($){
my $mysqld= shift;
- my $res= sleep_until_file_created($mysqld->{'path_pid'},
- $mysqld->{'start_timeout'},
- $mysqld->{'pid'});
- return $res == 0;
+ if (sleep_until_file_created($mysqld->{'path_pid'},
+ $mysqld->{'start_timeout'},
+ $mysqld->{'pid'}) == 0)
+ {
+ # Failed to wait for pid file
+ return 1;
+ }
+
+ # Get the "real pid" of the process, it will be used for killing
+ # the process in ActiveState's perl on windows
+ $mysqld->{'real_pid'}= mtr_get_pid_from_file($mysqld->{'path_pid'});
+
+ return 0;
}
@@ -2797,19 +2805,17 @@ sub run_benchmarks ($) {
##############################################################################
#
-# Run the test suite
+# Run the tests
#
##############################################################################
-sub run_suite () {
- my ($suite, $tests)= @_;
+sub run_tests () {
+ my ($tests)= @_;
mtr_print_thick_line();
mtr_timer_start($glob_timers,"suite", 60 * $opt_suite_timeout);
- mtr_report("Starting Tests in the '$suite' suite");
-
mtr_report_tests_not_skipped_though_disabled($tests);
mtr_print_header();
@@ -3272,18 +3278,14 @@ sub run_testcase_check_skip_test($)
sub do_before_run_mysqltest($)
{
my $tinfo= shift;
- my $tname= $tinfo->{'name'};
# Remove old files produced by mysqltest
- my $result_dir= "r";
- if ( $opt_suite ne "main" )
- {
- $result_dir= "suite/$opt_suite/r";
- }
- unlink("$result_dir/$tname.reject");
- unlink("$result_dir/$tname.progress");
- unlink("$result_dir/$tname.log");
- unlink("$result_dir/$tname.warnings");
+ my $base_file= mtr_match_extension($tinfo->{'result_file'},
+ "result"); # Trim extension
+ unlink("$base_file.reject");
+ unlink("$base_file.progress");
+ unlink("$base_file.log");
+ unlink("$base_file.warnings");
if (!$opt_extern)
{
@@ -3302,7 +3304,6 @@ sub do_before_run_mysqltest($)
sub do_after_run_mysqltest($)
{
my $tinfo= shift;
- my $tname= $tinfo->{'name'};
# Save info from this testcase run to mysqltest.log
mtr_appendfile_to_file($path_current_test_log, $path_mysqltest_log)
@@ -3626,7 +3627,7 @@ sub report_failure_and_restart ($) {
my $tinfo= shift;
mtr_report_test_failed($tinfo);
- mtr_show_failed_diff($tinfo->{'result_file'});
+ mtr_show_failed_diff($tinfo);
print "\n";
if ( $opt_force )
{
@@ -3759,22 +3760,13 @@ sub mysqld_arguments ($$$$) {
mtr_add_arg($args, "%s--no-defaults", $prefix);
- mtr_add_arg($args, "%s--console", $prefix);
mtr_add_arg($args, "%s--basedir=%s", $prefix, $path_my_basedir);
mtr_add_arg($args, "%s--character-sets-dir=%s", $prefix, $path_charsetsdir);
if ( $mysql_version_id >= 50036)
{
# By default, prevent the started mysqld to access files outside of vardir
- my $secure_file_dir= $opt_vardir;
- if ( $opt_suite ne "main" )
- {
- # When running a suite other than default allow the mysqld
- # access to subdirs of mysql-test/ in order to make it possible
- # to "load data" from the suites data/ directory.
- $secure_file_dir= $glob_mysql_test_dir;
- }
- mtr_add_arg($args, "%s--secure-file-priv=%s", $prefix, $secure_file_dir);
+ mtr_add_arg($args, "%s--secure-file-priv=%s", $prefix, $opt_vardir);
}
if ( $mysql_version_id >= 50000 )
@@ -4134,6 +4126,7 @@ sub stop_all_servers () {
push(@kill_pids,{
pid => $mysqld->{'pid'},
+ real_pid => $mysqld->{'real_pid'},
pidfile => $mysqld->{'path_pid'},
sockfile => $mysqld->{'path_sock'},
port => $mysqld->{'port'},
@@ -4335,12 +4328,13 @@ sub run_testcase_stop_servers($$$) {
{
if ( $mysqld->{'pid'} )
{
- $pid= mtr_mysqladmin_start($mysqld, "shutdown", 70);
+ $pid= mtr_mysqladmin_start($mysqld, "shutdown", 20);
$admin_pids{$pid}= 1;
push(@kill_pids,{
pid => $mysqld->{'pid'},
+ real_pid => $mysqld->{'real_pid'},
pidfile => $mysqld->{'path_pid'},
sockfile => $mysqld->{'path_sock'},
port => $mysqld->{'port'},
@@ -4386,12 +4380,13 @@ sub run_testcase_stop_servers($$$) {
{
if ( $mysqld->{'pid'} )
{
- $pid= mtr_mysqladmin_start($mysqld, "shutdown", 70);
+ $pid= mtr_mysqladmin_start($mysqld, "shutdown", 20);
$admin_pids{$pid}= 1;
push(@kill_pids,{
pid => $mysqld->{'pid'},
+ real_pid => $mysqld->{'real_pid'},
pidfile => $mysqld->{'path_pid'},
sockfile => $mysqld->{'path_sock'},
port => $mysqld->{'port'},
@@ -4818,12 +4813,10 @@ sub run_mysqltest ($) {
mtr_add_arg($args, "%s", $_) for @args_saved;
}
- mtr_add_arg($args, "--test-file");
- mtr_add_arg($args, $tinfo->{'path'});
+ mtr_add_arg($args, "--test-file=%s", $tinfo->{'path'});
if ( defined $tinfo->{'result_file'} ) {
- mtr_add_arg($args, "--result-file");
- mtr_add_arg($args, $tinfo->{'result_file'});
+ mtr_add_arg($args, "--result-file=%s", $tinfo->{'result_file'});
}
if ( $opt_record )
@@ -5150,7 +5143,9 @@ Options to control what test suites or cases to run
ndb-extra Run extra tests from ndb directory
do-test=PREFIX Run test cases which name are prefixed with PREFIX
start-from=PREFIX Run test cases starting from test prefixed with PREFIX
- suite=NAME Run the test suite named NAME. The default is "main"
+ suite[s]=NAME1,..,NAMEN Collect tests in suites from the comma separated
+ list of suite names.
+ The default is: "$opt_suites"
skip-rpl Skip the replication test cases.
skip-im Don't start IM, and skip the IM test cases
skip-test=PREFIX Skip test cases which name are prefixed with PREFIX
diff --git a/mysql-test/ndb/ndb_config_2_node.ini b/mysql-test/ndb/ndb_config_2_node.ini
index 6bcb148d471..57e4d049ad6 100644
--- a/mysql-test/ndb/ndb_config_2_node.ini
+++ b/mysql-test/ndb/ndb_config_2_node.ini
@@ -13,7 +13,8 @@ TimeBetweenGlobalCheckpoints= 500
NoOfFragmentLogFiles= 4
FragmentLogFileSize=12M
DiskPageBufferMemory= CHOOSE_DiskPageBufferMemory
-ODirect= 1
+# O_DIRECT has issues on 2.4 whach have not been handled, Bug #29612
+#ODirect= 1
# the following parametes just function as a small regression
# test that the parameter exists
InitialNoOfOpenFiles= 27
diff --git a/mysql-test/r/archive-big.result b/mysql-test/r/archive-big.result
new file mode 100644
index 00000000000..7dbdb490017
--- /dev/null
+++ b/mysql-test/r/archive-big.result
@@ -0,0 +1,19 @@
+CREATE TABLE t1(a BLOB) ENGINE=ARCHIVE;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+DROP TABLE t1;
diff --git a/mysql-test/r/archive.result b/mysql-test/r/archive.result
index 59462e848d2..36b013703d8 100644
--- a/mysql-test/r/archive.result
+++ b/mysql-test/r/archive.result
@@ -12675,3 +12675,10 @@ select * from t1;
i
1
drop table t1;
+create table t1(a longblob) engine=archive;
+insert into t1 set a='';
+insert into t1 set a='a';
+check table t1 extended;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+drop table t1;
diff --git a/mysql-test/r/backup.result b/mysql-test/r/backup.result
index 154b577e61f..4de599f3af7 100644
--- a/mysql-test/r/backup.result
+++ b/mysql-test/r/backup.result
@@ -36,7 +36,7 @@ restore table t1 from '../bogus';
Table Op Msg_type Msg_text
t1 restore error Failed copying .frm file
Warnings:
-Warning 1543 The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
+Warning 1287 The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead
Error 29 File 'MYSQLTEST_VARDIR/bogus/t1.frm' not found (Errcode: X)
restore table t1 from '../tmp';
Table Op Msg_type Msg_text
diff --git a/mysql-test/r/binlog_row_binlog.result b/mysql-test/r/binlog_row_binlog.result
deleted file mode 100644
index 6fcaad010d2..00000000000
--- a/mysql-test/r/binlog_row_binlog.result
+++ /dev/null
@@ -1,339 +0,0 @@
-drop table if exists t1, t2;
-reset master;
-create table t1 (a int) engine=innodb;
-create table t2 (a int) engine=innodb;
-begin;
-insert t1 values (5);
-commit;
-begin;
-insert t2 values (5);
-commit;
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; create table t1 (a int) engine=innodb
-master-bin.000001 # Query # # use `test`; create table t2 (a int) engine=innodb
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Xid # # COMMIT /* XID */
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.t2)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Xid # # COMMIT /* XID */
-drop table t1,t2;
-reset master;
-create table t1 (n int) engine=innodb;
-begin;
-commit;
-drop table t1;
-show binlog events in 'master-bin.000001' from 106;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query 1 # use `test`; create table t1 (n int) engine=innodb
-master-bin.000001 # Query 1 # use `test`; BEGIN
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map 1 # table_id: # (test.t1)
-master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-master-bin.000001 # Xid 1 # COMMIT /* xid= */
-master-bin.000001 # Rotate 1 # master-bin.000002;pos=4
-show binlog events in 'master-bin.000002' from 106;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000002 # Query 1 # use `test`; drop table t1
-reset master;
-create table t1 (id tinyint auto_increment primary key);
-set insert_id=128;
-insert into t1 values(null);
-Warnings:
-Warning 1264 Out of range value for column 'id' at row 1
-select * from t1;
-id
-127
-drop table t1;
-create table t1 (a int);
-create table if not exists t2 select * from t1;
-create temporary table tt1 (a int);
-create table if not exists t3 like tt1;
-USE mysql;
-INSERT INTO user SET host='localhost', user='@#@', password=password('Just a test');
-UPDATE user SET password=password('Another password') WHERE host='localhost' AND user='@#@';
-DELETE FROM user WHERE host='localhost' AND user='@#@';
-use test;
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; create table t1 (id tinyint auto_increment primary key)
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `test`; drop table t1
-master-bin.000001 # Query # # use `test`; create table t1 (a int)
-master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t2` (
- `a` int(11) DEFAULT NULL
-)
-master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t3` (
- `a` int(11) DEFAULT NULL
-)
-master-bin.000001 # Table_map # # table_id: # (mysql.user)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysql.user)
-master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysql.user)
-master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F
-drop table t1,t2,t3,tt1;
-create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
-set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
-insert delayed into t1 values (207);
-insert delayed into t1 values (null);
-insert delayed into t1 values (300);
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; create table t1 (id tinyint auto_increment primary key)
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `test`; drop table t1
-master-bin.000001 # Query # # use `test`; create table t1 (a int)
-master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t2` (
- `a` int(11) DEFAULT NULL
-)
-master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t3` (
- `a` int(11) DEFAULT NULL
-)
-master-bin.000001 # Table_map # # table_id: # (mysql.user)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysql.user)
-master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (mysql.user)
-master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # use `test`; DROP TABLE `t1`,`t2`,`t3` /* generated by server */
-master-bin.000001 # Query # # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-insert delayed into t1 values (null),(null),(null),(null);
-insert delayed into t1 values (null),(null),(400),(null);
-11 == 11
-select * from t1;
-a
-207
-208
-300
-301
-302
-303
-304
-305
-306
-400
-401
-drop table t1;
-reset master;
-drop table if exists t3;
-create table t3 (a int(11) NOT NULL AUTO_INCREMENT, b text, PRIMARY KEY (a) ) engine=innodb;
-show master status;
-File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 346
-insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
-insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
-insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
-insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
-show master status /* must show new binlog index after rotating */;
-File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000002 106
-drop table t3;
diff --git a/mysql-test/r/binlog_stm_binlog.result b/mysql-test/r/binlog_stm_binlog.result
deleted file mode 100644
index 66fe3e40270..00000000000
--- a/mysql-test/r/binlog_stm_binlog.result
+++ /dev/null
@@ -1,237 +0,0 @@
-create table t1 (a int, b int) engine=innodb;
-begin;
-insert into t1 values (1,2);
-commit;
-show binlog events;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 4 Format_desc 1 106 Server ver: #, Binlog ver: #
-master-bin.000001 106 Query 1 213 use `test`; create table t1 (a int, b int) engine=innodb
-master-bin.000001 213 Query 1 281 use `test`; BEGIN
-master-bin.000001 281 Query 1 90 use `test`; insert into t1 values (1,2)
-master-bin.000001 371 Xid 1 398 COMMIT /* XID */
-drop table t1;
-drop table if exists t1, t2;
-reset master;
-create table t1 (a int) engine=innodb;
-create table t2 (a int) engine=innodb;
-begin;
-insert t1 values (5);
-commit;
-begin;
-insert t2 values (5);
-commit;
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; create table t1 (a int) engine=innodb
-master-bin.000001 # Query # # use `test`; create table t2 (a int) engine=innodb
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Query # # use `test`; insert t1 values (5)
-master-bin.000001 # Xid # # COMMIT /* XID */
-master-bin.000001 # Query # # use `test`; BEGIN
-master-bin.000001 # Query # # use `test`; insert t2 values (5)
-master-bin.000001 # Xid # # COMMIT /* XID */
-drop table t1,t2;
-reset master;
-create table t1 (n int) engine=innodb;
-begin;
-commit;
-drop table t1;
-show binlog events in 'master-bin.000001' from 106;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query 1 # use `test`; create table t1 (n int) engine=innodb
-master-bin.000001 # Query 1 # use `test`; BEGIN
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(100 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(99 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(98 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(97 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(96 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(95 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(94 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(93 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(92 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(91 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(90 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(89 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(88 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(87 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(86 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(85 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(84 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(83 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(82 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(81 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(80 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(79 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(78 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(77 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(76 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(75 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(74 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(73 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(72 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(71 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(70 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(69 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(68 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(67 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(66 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(65 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(64 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(63 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(62 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(61 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(60 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(59 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(58 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(57 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(56 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(55 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(54 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(53 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(52 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(51 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(50 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(49 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(48 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(47 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(46 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(45 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(44 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(43 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(42 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(41 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(40 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(39 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(38 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(37 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(36 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(35 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(34 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(33 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(32 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(31 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(30 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(29 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(28 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(27 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(26 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(25 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(24 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(23 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(22 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(21 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(20 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(19 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(18 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(17 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(16 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(15 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(14 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(13 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(12 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(11 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(10 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(9 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(8 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(7 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(6 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(5 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(4 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(3 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(2 + 4)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values(1 + 4)
-master-bin.000001 # Xid 1 # COMMIT /* xid= */
-master-bin.000001 # Rotate 1 # master-bin.000002;pos=4
-show binlog events in 'master-bin.000002' from 106;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000002 # Query 1 # use `test`; drop table t1
-reset master;
-create table t1 (id tinyint auto_increment primary key);
-set insert_id=128;
-insert into t1 values(null);
-Warnings:
-Warning 1264 Out of range value for column 'id' at row 1
-select * from t1;
-id
-127
-drop table t1;
-create table t1 (a int);
-create table if not exists t2 select * from t1;
-create temporary table tt1 (a int);
-create table if not exists t3 like tt1;
-USE mysql;
-INSERT INTO user SET host='localhost', user='@#@', password=password('Just a test');
-UPDATE user SET password=password('Another password') WHERE host='localhost' AND user='@#@';
-DELETE FROM user WHERE host='localhost' AND user='@#@';
-use test;
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; create table t1 (id tinyint auto_increment primary key)
-master-bin.000001 # Intvar # # INSERT_ID=127
-master-bin.000001 # Query # # use `test`; insert into t1 values(null)
-master-bin.000001 # Query # # use `test`; drop table t1
-master-bin.000001 # Query # # use `test`; create table t1 (a int)
-master-bin.000001 # Query # # use `test`; create table if not exists t2 select * from t1
-master-bin.000001 # Query # # use `test`; create temporary table tt1 (a int)
-master-bin.000001 # Query # # use `test`; create table if not exists t3 like tt1
-master-bin.000001 # Query # # use `mysql`; INSERT INTO user SET host='localhost', user='@#@', password=password('Just a test')
-master-bin.000001 # Query # # use `mysql`; UPDATE user SET password=password('Another password') WHERE host='localhost' AND user='@#@'
-master-bin.000001 # Query # # use `mysql`; DELETE FROM user WHERE host='localhost' AND user='@#@'
-drop table t1,t2,t3,tt1;
-create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
-set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
-insert delayed into t1 values (207);
-insert delayed into t1 values (null);
-insert delayed into t1 values (300);
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; create table t1 (id tinyint auto_increment primary key)
-master-bin.000001 # Intvar # # INSERT_ID=127
-master-bin.000001 # Query # # use `test`; insert into t1 values(null)
-master-bin.000001 # Query # # use `test`; drop table t1
-master-bin.000001 # Query # # use `test`; create table t1 (a int)
-master-bin.000001 # Query # # use `test`; create table if not exists t2 select * from t1
-master-bin.000001 # Query # # use `test`; create temporary table tt1 (a int)
-master-bin.000001 # Query # # use `test`; create table if not exists t3 like tt1
-master-bin.000001 # Query # # use `mysql`; INSERT INTO user SET host='localhost', user='@#@', password=password('Just a test')
-master-bin.000001 # Query # # use `mysql`; UPDATE user SET password=password('Another password') WHERE host='localhost' AND user='@#@'
-master-bin.000001 # Query # # use `mysql`; DELETE FROM user WHERE host='localhost' AND user='@#@'
-master-bin.000001 # Query # # use `test`; drop table t1,t2,t3,tt1
-master-bin.000001 # Query # # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-insert delayed into t1 values (null),(null),(null),(null);
-insert delayed into t1 values (null),(null),(400),(null);
-11 == 11
-select * from t1;
-a
-207
-208
-300
-301
-302
-303
-304
-305
-306
-400
-401
-drop table t1;
-reset master;
-drop table if exists t3;
-create table t3 (a int(11) NOT NULL AUTO_INCREMENT, b text, PRIMARY KEY (a) ) engine=innodb;
-show master status;
-File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 346
-insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
-insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
-insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
-insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
-show master status /* must show new binlog index after rotating */;
-File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000002 106
-drop table t3;
diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result
index c538d8d55e1..afd0a5a990e 100644
--- a/mysql-test/r/cast.result
+++ b/mysql-test/r/cast.result
@@ -403,4 +403,15 @@ hex(cast('a' as binary(2)))
select hex(cast('a' as char(2) binary));
hex(cast('a' as char(2) binary))
61
+CREATE TABLE t1 (d1 datetime);
+INSERT INTO t1(d1) VALUES ('2007-07-19 08:30:00'), (NULL),
+('2007-07-19 08:34:00'), (NULL), ('2007-07-19 08:36:00');
+SELECT cast(date(d1) as signed) FROM t1;
+cast(date(d1) as signed)
+20070719
+NULL
+20070719
+NULL
+20070719
+drop table t1;
End of 5.0 tests
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index cdbb767dd9f..de25fb754e4 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -1516,6 +1516,22 @@ t1 CREATE TABLE `t1` (
`c17` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
+
+Bug #26104 Bug on foreign key class constructor
+
+Check that ref_columns is initalized correctly in the constructor
+and semantic checks in mysql_prepare_table work.
+
+We do not need a storage engine that supports foreign keys
+for this test, as the checks are purely syntax-based, and the
+syntax is supported for all engines.
+
+drop table if exists t1,t2;
+create table t1(a int not null, b int not null, primary key (a, b));
+create table t2(a int not null, b int not null, c int not null, primary key (a),
+foreign key fk_bug26104 (b,c) references t1(a));
+ERROR 42000: Incorrect foreign key definition for 'fk_bug26104': Key reference and table reference don't match
+drop table t1;
End of 5.0 tests
CREATE TABLE t1 (a int, b int);
insert into t1 values (1,1),(1,2);
diff --git a/mysql-test/r/csv.result b/mysql-test/r/csv.result
index 34dc1cb5b2e..86ba5002af8 100644
--- a/mysql-test/r/csv.result
+++ b/mysql-test/r/csv.result
@@ -5261,3 +5261,58 @@ CREATE TABLE `bug21328` (
insert into bug21328 values (1,NULL,NULL);
alter table bug21328 engine=myisam;
drop table bug21328;
+create table t1(a blob, b int) engine=csv;
+insert into t1 values('a', 1);
+flush tables;
+update t1 set b=2;
+select * from t1;
+a b
+a 2
+drop table t1;
+create table t1(a int) engine=csv;
+insert into t1 values(-1), (-123.34), (2), (-23);
+select * from t1;
+a
+-1
+-123
+2
+-23
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+drop table t1;
+create table t1(a int, b int) engine=csv;
+repair table t1;
+Table Op Msg_type Msg_text
+test.t1 repair Warning Data truncated for column 'a' at row 5
+test.t1 repair status OK
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+select * from t1;
+a b
+1 0
+-200 1
+-1 -1
+-1 -100
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+drop table t1;
+create table t1(a int) engine=csv;
+insert into t1 values (0), (1), (2);
+delete from t1 limit 2;
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+select * from t1;
+a
+2
+delete from t1;
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+select * from t1;
+a
+drop table t1;
+End of 5.1 tests
diff --git a/mysql-test/r/ctype_collate.result b/mysql-test/r/ctype_collate.result
index 5417c9da47e..f476ec68371 100644
--- a/mysql-test/r/ctype_collate.result
+++ b/mysql-test/r/ctype_collate.result
@@ -603,3 +603,11 @@ check table t1 extended;
Table Op Msg_type Msg_text
test.t1 check status OK
drop table t1;
+create table t1 (a varchar(2) character set latin7 collate latin7_general_ci,key(a));
+insert into t1 set a=0x4c20;
+insert into t1 set a=0x6c;
+insert into t1 set a=0x4c98;
+check table t1 extended;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+drop table t1;
diff --git a/mysql-test/r/events_bugs.result b/mysql-test/r/events_bugs.result
index a01f098affb..557c8e0b477 100644
--- a/mysql-test/r/events_bugs.result
+++ b/mysql-test/r/events_bugs.result
@@ -31,7 +31,7 @@ create event e_55 on schedule at 10000101000000 do drop table t;
ERROR HY000: Incorrect AT value: '10000101000000'
create event e_55 on schedule at 20000101000000 do drop table t;
Warnings:
-Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created
+Note 1585 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation.
show events;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
create event e_55 on schedule at 20200101000000 starts 10000101000000 do drop table t;
@@ -447,32 +447,32 @@ e3 +00:00 CREATE EVENT `e3` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00
The following should fail, and nothing should be altered.
ALTER EVENT e1 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00'
ENDS '1999-01-02 00:00:00';
-ERROR HY000: Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been altered
+ERROR HY000: Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation.
ALTER EVENT e1 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00'
ENDS '1999-01-02 00:00:00' DISABLE;
-ERROR HY000: Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been altered
+ERROR HY000: Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation.
The following should give warnings, and nothing should be created.
CREATE EVENT e4 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00'
ENDS '1999-01-02 00:00:00'
DO
SELECT 1;
Warnings:
-Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created
+Note 1585 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation.
CREATE EVENT e4 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00'
ENDS '1999-01-02 00:00:00' DISABLE
DO
SELECT 1;
Warnings:
-Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created
+Note 1585 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation.
CREATE EVENT e4 ON SCHEDULE AT '1999-01-01 00:00:00' DO
SELECT 1;
Warnings:
-Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created
+Note 1585 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation.
CREATE EVENT e4 ON SCHEDULE AT '1999-01-01 00:00:00' DISABLE
DO
SELECT 1;
Warnings:
-Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created
+Note 1585 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation.
SHOW EVENTS;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
events_test e1 root@localhost +05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
@@ -482,19 +482,19 @@ The following should succeed giving a warning.
ALTER EVENT e1 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00'
ENDS '1999-01-02 00:00:00' ON COMPLETION PRESERVE;
Warnings:
-Note 1533 Event execution time is in the past. Event has been disabled
+Note 1541 Event execution time is in the past. Event has been disabled
CREATE EVENT e4 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00'
ENDS '1999-01-02 00:00:00' ON COMPLETION PRESERVE
DO
SELECT 1;
Warnings:
-Note 1533 Event execution time is in the past. Event has been disabled
+Note 1541 Event execution time is in the past. Event has been disabled
CREATE EVENT e5 ON SCHEDULE AT '1999-01-01 00:00:00'
ON COMPLETION PRESERVE
DO
SELECT 1;
Warnings:
-Note 1533 Event execution time is in the past. Event has been disabled
+Note 1541 Event execution time is in the past. Event has been disabled
The following should succeed without warnings.
ALTER EVENT e2 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00';
ALTER EVENT e3 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00'
diff --git a/mysql-test/r/events_trans.result b/mysql-test/r/events_trans.result
index a9829db0c61..1f87bcea68e 100644
--- a/mysql-test/r/events_trans.result
+++ b/mysql-test/r/events_trans.result
@@ -63,7 +63,7 @@ begin work;
insert into t1 (a) values ("OK: create event if not exists");
create event if not exists e1 on schedule every 2 day do select 2;
Warnings:
-Note 1526 Event 'e1' already exists
+Note 1534 Event 'e1' already exists
rollback work;
select * from t1;
a
diff --git a/mysql-test/r/federated.result b/mysql-test/r/federated.result
index 6e0c139ee14..42228fac2c9 100644
--- a/mysql-test/r/federated.result
+++ b/mysql-test/r/federated.result
@@ -1843,6 +1843,45 @@ C3A4C3B6C3BCC39F
D18DD184D184D0B5D0BAD182D0B8D0B2D0BDD183D18E
drop table federated.t1;
drop table federated.t1;
+create table federated.t1 (a int primary key, b varchar(64))
+DEFAULT CHARSET=utf8;
+create table federated.t1 (a int primary key, b varchar(64))
+ENGINE=FEDERATED
+connection='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1'
+ DEFAULT CHARSET=utf8;
+insert ignore into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe");
+select * from federated.t1;
+a b
+1 Larry
+2 Curly
+truncate federated.t1;
+replace into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe");
+select * from federated.t1;
+a b
+1 Moe
+2 Curly
+update ignore federated.t1 set a=a+1;
+select * from federated.t1;
+a b
+1 Moe
+3 Curly
+drop table federated.t1;
+drop table federated.t1;
+create table federated.t1 (a int primary key, b varchar(64))
+DEFAULT CHARSET=utf8;
+create table federated.t1 (a int primary key, b varchar(64))
+ENGINE=FEDERATED
+connection='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1'
+ DEFAULT CHARSET=utf8;
+insert into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe")
+on duplicate key update a=a+100;
+ERROR 23000: Can't write; duplicate key in table 't1'
+select * from federated.t1;
+a b
+1 Larry
+2 Curly
+drop table federated.t1;
+drop table federated.t1;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
DROP TABLE IF EXISTS federated.t1;
diff --git a/mysql-test/r/federated_innodb.result b/mysql-test/r/federated_innodb.result
new file mode 100644
index 00000000000..70ba3acb279
--- /dev/null
+++ b/mysql-test/r/federated_innodb.result
@@ -0,0 +1,34 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+stop slave;
+DROP DATABASE IF EXISTS federated;
+CREATE DATABASE federated;
+DROP DATABASE IF EXISTS federated;
+CREATE DATABASE federated;
+create table federated.t1 (a int primary key, b varchar(64))
+engine=myisam;
+create table federated.t1 (a int primary key, b varchar(64))
+engine=federated
+connection='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
+insert into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe");
+ERROR 23000: Can't write; duplicate key in table 't1'
+select * from federated.t1;
+a b
+1 Larry
+2 Curly
+truncate federated.t1;
+alter table federated.t1 engine=innodb;
+insert into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe");
+ERROR 23000: Can't write; duplicate key in table 't1'
+select * from federated.t1;
+a b
+drop table federated.t1;
+drop table federated.t1;
+DROP TABLE IF EXISTS federated.t1;
+DROP DATABASE IF EXISTS federated;
+DROP TABLE IF EXISTS federated.t1;
+DROP DATABASE IF EXISTS federated;
diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result
index d8e3d53f7b1..96ebb9bf254 100644
--- a/mysql-test/r/fulltext.result
+++ b/mysql-test/r/fulltext.result
@@ -476,3 +476,15 @@ ALTER TABLE t1 DISABLE KEYS;
SELECT * FROM t1 WHERE MATCH(a) AGAINST('test');
ERROR HY000: Can't find FULLTEXT index matching the column list
DROP TABLE t1;
+CREATE TABLE t1(a VARCHAR(20), FULLTEXT(a));
+INSERT INTO t1 VALUES('Offside'),('City Of God');
+SELECT a FROM t1 WHERE MATCH a AGAINST ('+city of*' IN BOOLEAN MODE);
+a
+City Of God
+SELECT a FROM t1 WHERE MATCH a AGAINST ('+city (of*)' IN BOOLEAN MODE);
+a
+City Of God
+SELECT a FROM t1 WHERE MATCH a AGAINST ('+city* of*' IN BOOLEAN MODE);
+a
+City Of God
+DROP TABLE t1;
diff --git a/mysql-test/r/fulltext3.result b/mysql-test/r/fulltext3.result
new file mode 100644
index 00000000000..4ec48369ad1
--- /dev/null
+++ b/mysql-test/r/fulltext3.result
@@ -0,0 +1,17 @@
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(a VARCHAR(255) CHARACTER SET gbk, FULLTEXT(a));
+SET NAMES utf8;
+INSERT INTO t1 VALUES(0xF043616161),(0xBEF361616197C22061616161);
+SELECT HEX(a) FROM t1 WHERE MATCH(a) AGAINST(0x97C22061616161 IN BOOLEAN MODE);
+HEX(a)
+BEF361616197C22061616161
+DELETE FROM t1 LIMIT 1;
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+SET NAMES latin1;
+DROP TABLE t1;
+CREATE TABLE t1(a VARCHAR(2) CHARACTER SET big5 COLLATE big5_chinese_ci,
+FULLTEXT(a));
+INSERT INTO t1 VALUES(0xA3C2);
+DROP TABLE t1;
diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result
index 3fd204c84c9..b17c5e5409c 100644
--- a/mysql-test/r/func_gconcat.result
+++ b/mysql-test/r/func_gconcat.result
@@ -816,4 +816,13 @@ LENGTH( GROUP_CONCAT( a ) )
65535
SET group_concat_max_len= DEFAULT;
DROP TABLE t1, t2, t3;
+set names latin1;
+create table t1 (id int, name varchar(20)) DEFAULT CHARSET=utf8;
+insert into t1 (id, name) values (1, "óra");
+insert into t1 (id, name) values (2, "óra");
+select b.id, group_concat(b.name) from t1 a, t1 b group by b.id;
+id group_concat(b.name)
+1 óra,óra
+2 óra,óra
+drop table t1;
End of 5.0 tests
diff --git a/mysql-test/r/gis-rtree.result b/mysql-test/r/gis-rtree.result
index a3955e8c008..6e3aebe8d47 100644
--- a/mysql-test/r/gis-rtree.result
+++ b/mysql-test/r/gis-rtree.result
@@ -1444,3 +1444,16 @@ OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
DROP TABLE t1;
+CREATE TABLE t1 (a INT, b GEOMETRY NOT NULL, SPATIAL KEY b(b));
+INSERT INTO t1 VALUES (1, GEOMFROMTEXT('LINESTRING(1102218.456 1,2000000 2)'));
+INSERT INTO t1 VALUES (2, GEOMFROMTEXT('LINESTRING(1102218.456 1,2000000 2)'));
+SELECT COUNT(*) FROM t1 WHERE
+MBRINTERSECTS(b, GEOMFROMTEXT('LINESTRING(1 1,1102219 2)') );
+COUNT(*)
+2
+SELECT COUNT(*) FROM t1 IGNORE INDEX (b) WHERE
+MBRINTERSECTS(b, GEOMFROMTEXT('LINESTRING(1 1,1102219 2)') );
+COUNT(*)
+2
+DROP TABLE t1;
+End of 5.0 tests.
diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result
index 1529fe77ac4..f68559fa8ea 100644
--- a/mysql-test/r/gis.result
+++ b/mysql-test/r/gis.result
@@ -886,6 +886,9 @@ AsText(a)
POINT(1 1)
LINESTRING(0 0,1 1,2 2)
drop table t1, t2;
+SELECT 1;
+1
+1
End of 5.0 tests
create table t1 (f1 tinyint(1), f2 char(1), f3 varchar(1), f4 geometry, f5 datetime);
create view v1 as select * from t1;
diff --git a/mysql-test/r/index_merge_myisam.result b/mysql-test/r/index_merge_myisam.result
index f135d849f76..9d7d06f7f1b 100644
--- a/mysql-test/r/index_merge_myisam.result
+++ b/mysql-test/r/index_merge_myisam.result
@@ -457,6 +457,67 @@ a
1
UNLOCK TABLES;
DROP TABLE t1, t2;
+CREATE TABLE `t1` (
+`a` int(11) DEFAULT NULL,
+`filler` char(200) DEFAULT NULL,
+`b` int(11) DEFAULT NULL,
+KEY `a` (`a`),
+KEY `b` (`b`)
+) ENGINE=MEMORY DEFAULT CHARSET=latin1;
+insert into t1 values
+(0, 'filler', 0), (1, 'filler', 1), (2, 'filler', 2), (3, 'filler', 3),
+(4, 'filler', 4), (5, 'filler', 5), (6, 'filler', 6), (7, 'filler', 7),
+(8, 'filler', 8), (9, 'filler', 9), (0, 'filler', 0), (1, 'filler', 1),
+(2, 'filler', 2), (3, 'filler', 3), (4, 'filler', 4), (5, 'filler', 5),
+(6, 'filler', 6), (7, 'filler', 7), (8, 'filler', 8), (9, 'filler', 9),
+(10, 'filler', 10), (11, 'filler', 11), (12, 'filler', 12), (13, 'filler', 13),
+(14, 'filler', 14), (15, 'filler', 15), (16, 'filler', 16), (17, 'filler', 17),
+(18, 'filler', 18), (19, 'filler', 19), (4, '5 ', 0), (5, '4 ', 0),
+(4, '4 ', 0), (4, 'qq ', 5), (5, 'qq ', 4), (4, 'zz ', 4);
+create table t2(
+`a` int(11) DEFAULT NULL,
+`filler` char(200) DEFAULT NULL,
+`b` int(11) DEFAULT NULL,
+KEY USING BTREE (`a`),
+KEY USING BTREE (`b`)
+) ENGINE=MEMORY DEFAULT CHARSET=latin1;
+insert into t2 select * from t1;
+must use sort-union rather than union:
+explain select * from t1 where a=4 or b=4;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index_merge a,b a,b 5,5 NULL # Using sort_union(a,b); Using where
+select * from t1 where a=4 or b=4;
+a filler b
+4 4 0
+4 5 0
+4 filler 4
+4 filler 4
+4 qq 5
+4 zz 4
+5 qq 4
+select * from t1 ignore index(a,b) where a=4 or b=4;
+a filler b
+4 4 0
+4 5 0
+4 filler 4
+4 filler 4
+4 qq 5
+4 zz 4
+5 qq 4
+must use union, not sort-union:
+explain select * from t2 where a=4 or b=4;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 index_merge a,b a,b 5,5 NULL # Using union(a,b); Using where
+select * from t2 where a=4 or b=4;
+a filler b
+4 4 0
+4 5 0
+4 filler 4
+4 filler 4
+4 qq 5
+4 zz 4
+5 qq 4
+drop table t1, t2;
#---------------- ROR-index_merge tests -----------------------
SET SESSION STORAGE_ENGINE = MyISAM;
drop table if exists t0,t1,t2;
diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result
index e290457d4ee..804c15f6aa1 100644
--- a/mysql-test/r/information_schema.result
+++ b/mysql-test/r/information_schema.result
@@ -1066,7 +1066,7 @@ c int(11) YES NULL
drop view v1;
drop table t1;
alter database information_schema;
-ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
drop database information_schema;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
drop table information_schema.tables;
@@ -1412,6 +1412,10 @@ v2 YES
delete from v1;
drop view v1,v2;
drop table t1,t2;
+alter database;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
+alter database test;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
End of 5.0 tests.
select * from information_schema.engines WHERE ENGINE="MyISAM";
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result
index ad79a2a837a..804c4b81c17 100644
--- a/mysql-test/r/innodb.result
+++ b/mysql-test/r/innodb.result
@@ -1640,7 +1640,7 @@ t2 CREATE TABLE `t2` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t2;
create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = innodb;
-ERROR HY000: Can't create table 'test.t2' (errno: 150)
+ERROR 42000: Incorrect foreign key definition for 't1_id_fk': Key reference and table reference don't match
create table t2 (a int auto_increment primary key, b int, index(b), foreign key (b) references t1(id), unique(b)) engine=innodb;
show create table t2;
Table Create Table
@@ -3211,3 +3211,14 @@ t1 CREATE TABLE `t1` (
CONSTRAINT `t1_t2` FOREIGN KEY (`id`) REFERENCES `t2` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=349 DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
+CREATE TABLE t1 (
+c01 CHAR(255), c02 CHAR(255), c03 CHAR(255), c04 CHAR(255),
+c05 CHAR(255), c06 CHAR(255), c07 CHAR(255), c08 CHAR(255),
+c09 CHAR(255), c10 CHAR(255), c11 CHAR(255), c12 CHAR(255),
+c13 CHAR(255), c14 CHAR(255), c15 CHAR(255), c16 CHAR(255),
+c17 CHAR(255), c18 CHAR(255), c19 CHAR(255), c20 CHAR(255),
+c21 CHAR(255), c22 CHAR(255), c23 CHAR(255), c24 CHAR(255),
+c25 CHAR(255), c26 CHAR(255), c27 CHAR(255), c28 CHAR(255),
+c29 CHAR(255), c30 CHAR(255), c31 CHAR(255), c32 CHAR(255)
+) ENGINE = InnoDB;
+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
diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result
index fb8139e2ce1..3dc134352db 100644
--- a/mysql-test/r/innodb_mysql.result
+++ b/mysql-test/r/innodb_mysql.result
@@ -1,5 +1,5 @@
SET SESSION STORAGE_ENGINE = InnoDB;
-drop table if exists t1,t2,t1m,t1i,t2m,t2i,t4;
+drop table if exists t1,t2,t3,t1m,t1i,t2m,t2i,t4;
create table t1 (
c_id int(11) not null default '0',
org_id int(11) default null,
@@ -166,7 +166,6 @@ t1.a4='UNcT5pIde4I6c2SheTo4gt92OV1jgJCVkXmzyf325R1DwLURkbYHwhydANIZMbKTgdcR5xS';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
DROP TABLE t1;
-End of 4.1 tests
create table t1m (a int) engine = MEMORY;
create table t1i (a int);
create table t2m (a int) engine = MEMORY;
@@ -362,22 +361,6 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index NULL fkey 5 NULL 5 Using index
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.fkey 1 Using where
DROP TABLE t1,t2;
-CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c FLOAT, KEY b(b)) ENGINE = INNODB;
-INSERT INTO t1 VALUES ( 1 , 1 , 1);
-INSERT INTO t1 SELECT a + 1 , MOD(a + 1 , 20), 1 FROM t1;
-INSERT INTO t1 SELECT a + 2 , MOD(a + 2 , 20), 1 FROM t1;
-INSERT INTO t1 SELECT a + 4 , MOD(a + 4 , 20), 1 FROM t1;
-INSERT INTO t1 SELECT a + 8 , MOD(a + 8 , 20), 1 FROM t1;
-INSERT INTO t1 SELECT a + 16, MOD(a + 16, 20), 1 FROM t1;
-INSERT INTO t1 SELECT a + 32, MOD(a + 32, 20), 1 FROM t1;
-INSERT INTO t1 SELECT a + 64, MOD(a + 64, 20), 1 FROM t1;
-EXPLAIN SELECT b, SUM(c) FROM t1 GROUP BY b;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL b 5 NULL 128
-EXPLAIN SELECT SQL_BIG_RESULT b, SUM(c) FROM t1 GROUP BY b;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 128 Using filesort
-DROP TABLE t1;
CREATE TABLE t1 (
id int NOT NULL,
name varchar(20) NOT NULL,
@@ -503,33 +486,6 @@ a
2
5
drop table t1;
-set @save_qcache_size=@@global.query_cache_size;
-set @save_qcache_type=@@global.query_cache_type;
-set global query_cache_size=10*1024*1024;
-set global query_cache_type=1;
-drop table if exists `test`;
-Warnings:
-Note 1051 Unknown table 'test'
-CREATE TABLE `test` (`test1` varchar(3) NOT NULL,
-`test2` varchar(4) NOT NULL,PRIMARY KEY (`test1`))
-ENGINE=InnoDB DEFAULT CHARSET=latin1;
-INSERT INTO `test` (`test1`, `test2`) VALUES ('tes', '5678');
-select * from test;
-test1 test2
-tes 5678
-INSERT INTO `test` (`test1`, `test2`) VALUES ('tes', '1234')
-ON DUPLICATE KEY UPDATE `test2` = '1234';
-select * from test;
-test1 test2
-tes 1234
-flush tables;
-select * from test;
-test1 test2
-tes 1234
-drop table test;
-set global query_cache_type=@save_qcache_type;
-set global query_cache_size=@save_qcache_size;
-End of 5.0 tests
create table t1(
id int auto_increment,
c char(1) not null,
@@ -665,6 +621,14 @@ UPDATE t3 SET a = 'us' WHERE a = 'uk';
SELECT * FROM t3 WHERE a = 'uk';
a
DROP TABLE t1,t2,t3;
+create table t1 (a int) engine=innodb;
+select * from bug29807;
+ERROR 42S02: Table 'test.bug29807' doesn't exist
+drop table t1;
+drop table bug29807;
+ERROR 42S02: Unknown table 'bug29807'
+create table bug29807 (a int);
+drop table bug29807;
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
CREATE TABLE t2 (a INT) ENGINE=InnoDB;
switch to connection c1
@@ -680,7 +644,57 @@ INSERT INTO t1 VALUES (1);
switch to connection default
SET AUTOCOMMIT=default;
DROP TABLE t1,t2;
-End of 5.0 tests
+CREATE TABLE t1 (
+id int NOT NULL auto_increment PRIMARY KEY,
+b int NOT NULL,
+c datetime NOT NULL,
+INDEX idx_b(b),
+INDEX idx_c(c)
+) ENGINE=InnoDB;
+CREATE TABLE t2 (
+b int NOT NULL auto_increment PRIMARY KEY,
+c datetime NOT NULL
+) ENGINE= MyISAM;
+INSERT INTO t2(c) VALUES ('2007-01-01');
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t2(c) SELECT c FROM t2;
+INSERT INTO t1(b,c) SELECT b,c FROM t2;
+UPDATE t2 SET c='2007-01-02';
+INSERT INTO t1(b,c) SELECT b,c FROM t2;
+UPDATE t2 SET c='2007-01-03';
+INSERT INTO t1(b,c) SELECT b,c FROM t2;
+set @@sort_buffer_size=8192;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+3072
+EXPLAIN
+SELECT COUNT(*) FROM t1
+WHERE (c >= '2007-01-02' AND c <= '2007-01-03') OR b >= 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL idx_b,idx_c NULL NULL NULL # Using where
+SELECT COUNT(*) FROM t1
+WHERE (c >= '2007-01-02' AND c <= '2007-01-03') OR b >= 1;
+COUNT(*)
+3072
+EXPLAIN
+SELECT COUNT(*) FROM t1 FORCE INDEX(idx_b, idx_c)
+WHERE (c >= '2007-01-02' AND c <= '2007-01-03') OR b >= 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index_merge idx_b,idx_c idx_c,idx_b 8,4 NULL # Using sort_union(idx_c,idx_b); Using where
+SELECT COUNT(*) FROM t1 FORCE INDEX(idx_b, idx_c)
+WHERE (c >= '2007-01-02' AND c <= '2007-01-03') OR b >= 1;
+COUNT(*)
+3072
+set @@sort_buffer_size=default;
+DROP TABLE t1,t2;
CREATE TABLE t1 (a int, b int);
insert into t1 values (1,1),(1,2);
CREATE TABLE t2 (primary key (a)) select * from t1;
@@ -796,6 +810,10 @@ a
2
5
drop table t1;
+drop table if exists t1;
+create table t1 (a int) engine=innodb;
+alter table t1 alter a set default 1;
+drop table t1;
End of 5.0 tests
CREATE TABLE `t2` (
`k` int(11) NOT NULL auto_increment,
@@ -900,4 +918,32 @@ NULL
1
Two
drop tables t1;
+create table t1(f1 varchar(5) unique, f2 timestamp NOT NULL DEFAULT
+CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
+insert into t1(f1) values(1);
+select @a:=f2 from t1;
+@a:=f2
+#
+update t1 set f1=1;
+select @b:=f2 from t1;
+@b:=f2
+#
+select if(@a=@b,"ok","wrong");
+if(@a=@b,"ok","wrong")
+ok
+insert into t1(f1) values (1) on duplicate key update f1="1";
+select @b:=f2 from t1;
+@b:=f2
+#
+select if(@a=@b,"ok","wrong");
+if(@a=@b,"ok","wrong")
+ok
+insert into t1(f1) select f1 from t1 on duplicate key update f1="1";
+select @b:=f2 from t1;
+@b:=f2
+#
+select if(@a=@b,"ok","wrong");
+if(@a=@b,"ok","wrong")
+ok
+drop table t1;
End of 5.1 tests
diff --git a/mysql-test/r/innodb_trx_weight.result b/mysql-test/r/innodb_trx_weight.result
new file mode 100644
index 00000000000..195775f74c8
--- /dev/null
+++ b/mysql-test/r/innodb_trx_weight.result
@@ -0,0 +1 @@
+SET storage_engine=InnoDB;
diff --git a/mysql-test/r/join_nested.result b/mysql-test/r/join_nested.result
index 2dd9af8719e..2bdac08e7fd 100644
--- a/mysql-test/r/join_nested.result
+++ b/mysql-test/r/join_nested.result
@@ -1632,4 +1632,115 @@ INSERT INTO t3 VALUES (1,1);
SELECT * FROM t1 JOIN (t2 JOIN t3 USING (b)) USING (a);
ERROR 23000: Column 'a' in from clause is ambiguous
DROP TABLE t1,t2,t3;
+CREATE TABLE t1 (
+carrier char(2) default NULL,
+id int NOT NULL auto_increment PRIMARY KEY
+);
+INSERT INTO t1 VALUES
+('CO',235371754),('CO',235376554),('CO',235376884),('CO',235377874),
+('CO',231060394),('CO',231059224),('CO',231059314),('CO',231060484),
+('CO',231060274),('CO',231060124),('CO',231060244),('CO',231058594),
+('CO',231058924),('CO',231058504),('CO',231059344),('CO',231060424),
+('CO',231059554),('CO',231060304),('CO',231059644),('CO',231059464),
+('CO',231059764),('CO',231058294),('CO',231058624),('CO',231058864),
+('CO',231059374),('CO',231059584),('CO',231059734),('CO',231059014),
+('CO',231059854),('CO',231059494),('CO',231059794),('CO',231058534),
+('CO',231058324),('CO',231058684),('CO',231059524),('CO',231059974);
+CREATE TABLE t2 (
+scan_date date default NULL,
+package_id int default NULL,
+INDEX scan_date(scan_date),
+INDEX package_id(package_id)
+);
+INSERT INTO t2 VALUES
+('2008-12-29',231062944),('2008-12-29',231065764),('2008-12-29',231066124),
+('2008-12-29',231060094),('2008-12-29',231061054),('2008-12-29',231065644),
+('2008-12-29',231064384),('2008-12-29',231064444),('2008-12-29',231073774),
+('2008-12-29',231058594),('2008-12-29',231059374),('2008-12-29',231066004),
+('2008-12-29',231068494),('2008-12-29',231070174),('2008-12-29',231071884),
+('2008-12-29',231063274),('2008-12-29',231063754),('2008-12-29',231064144),
+('2008-12-29',231069424),('2008-12-29',231073714),('2008-12-29',231058414),
+('2008-12-29',231060994),('2008-12-29',231069154),('2008-12-29',231068614),
+('2008-12-29',231071464),('2008-12-29',231074014),('2008-12-29',231059614),
+('2008-12-29',231059074),('2008-12-29',231059464),('2008-12-29',231069094),
+('2008-12-29',231067294),('2008-12-29',231070144),('2008-12-29',231073804),
+('2008-12-29',231072634),('2008-12-29',231058294),('2008-12-29',231065344),
+('2008-12-29',231066094),('2008-12-29',231069034),('2008-12-29',231058594),
+('2008-12-29',231059854),('2008-12-29',231059884),('2008-12-29',231059914),
+('2008-12-29',231063664),('2008-12-29',231063814),('2008-12-29',231063904);
+CREATE TABLE t3 (
+package_id int default NULL,
+INDEX package_id(package_id)
+);
+INSERT INTO t3 VALUES
+(231058294),(231058324),(231058354),(231058384),(231058414),(231058444),
+(231058474),(231058504),(231058534),(231058564),(231058594),(231058624),
+(231058684),(231058744),(231058804),(231058864),(231058924),(231058954),
+(231059014),(231059074),(231059104),(231059134),(231059164),(231059194),
+(231059224),(231059254),(231059284),(231059314),(231059344),(231059374),
+(231059404),(231059434),(231059464),(231059494),(231059524),(231059554),
+(231059584),(231059614),(231059644),(231059674),(231059704),(231059734),
+(231059764),(231059794),(231059824),(231059854),(231059884),(231059914),
+(231059944),(231059974),(231060004),(231060034),(231060064),(231060094),
+(231060124),(231060154),(231060184),(231060214),(231060244),(231060274),
+(231060304),(231060334),(231060364),(231060394),(231060424),(231060454),
+(231060484),(231060514),(231060544),(231060574),(231060604),(231060634),
+(231060664),(231060694),(231060724),(231060754),(231060784),(231060814),
+(231060844),(231060874),(231060904),(231060934),(231060964),(231060994),
+(231061024),(231061054),(231061084),(231061144),(231061174),(231061204),
+(231061234),(231061294),(231061354),(231061384),(231061414),(231061474),
+(231061564),(231061594),(231061624),(231061684),(231061714),(231061774),
+(231061804),(231061894),(231061984),(231062074),(231062134),(231062224),
+(231062254),(231062314),(231062374),(231062434),(231062494),(231062554),
+(231062584),(231062614),(231062644),(231062704),(231062734),(231062794),
+(231062854),(231062884),(231062944),(231063004),(231063034),(231063064),
+(231063124),(231063154),(231063184),(231063214),(231063274),(231063334),
+(231063394),(231063424),(231063454),(231063514),(231063574),(231063664);
+CREATE TABLE t4 (
+carrier char(2) NOT NULL default '' PRIMARY KEY,
+id int(11) default NULL,
+INDEX id(id)
+);
+INSERT INTO t4 VALUES
+('99',6),('SK',456),('UA',486),('AI',1081),('OS',1111),('VS',1510);
+CREATE TABLE t5 (
+carrier_id int default NULL,
+INDEX carrier_id(carrier_id)
+);
+INSERT INTO t5 VALUES
+(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),
+(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),
+(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),
+(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),
+(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),
+(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(456),(456),(456),
+(456),(456),(456),(456),(456),(456),(456),(456),(456),(456),(456),(456),
+(456),(486),(1081),(1111),(1111),(1111),(1111),(1510);
+SELECT COUNT(*)
+FROM((t2 JOIN t1 ON t2.package_id = t1.id)
+JOIN t3 ON t3.package_id = t1.id);
+COUNT(*)
+6
+EXPLAIN
+SELECT COUNT(*)
+FROM ((t2 JOIN t1 ON t2.package_id = t1.id)
+JOIN t3 ON t3.package_id = t1.id)
+LEFT JOIN
+(t5 JOIN t4 ON t5.carrier_id = t4.id)
+ON t4.carrier = t1.carrier;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 index package_id package_id 5 NULL 45 Using index
+1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.package_id 1
+1 SIMPLE t4 eq_ref PRIMARY,id PRIMARY 2 test.t1.carrier 1
+1 SIMPLE t5 ref carrier_id carrier_id 5 test.t4.id 22 Using index
+1 SIMPLE t3 ref package_id package_id 5 test.t1.id 1 Using where; Using index
+SELECT COUNT(*)
+FROM ((t2 JOIN t1 ON t2.package_id = t1.id)
+JOIN t3 ON t3.package_id = t1.id)
+LEFT JOIN
+(t5 JOIN t4 ON t5.carrier_id = t4.id)
+ON t4.carrier = t1.carrier;
+COUNT(*)
+6
+DROP TABLE t1,t2,t3,t4,t5;
End of 5.0 tests
diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result
index 82c070d7cc9..98e221b0dea 100644
--- a/mysql-test/r/loaddata.result
+++ b/mysql-test/r/loaddata.result
@@ -86,6 +86,60 @@ field1 field2
a"b cd"ef
a"b c"d"e
drop table t1;
+CREATE TABLE t1 (
+id INT AUTO_INCREMENT PRIMARY KEY,
+c1 VARCHAR(255)
+);
+CREATE TABLE t2 (
+id INT,
+c2 VARCHAR(255)
+);
+INSERT INTO t1 (c1) VALUES
+('r'), ('rr'), ('rrr'), ('rrrr'),
+('.r'), ('.rr'), ('.rrr'), ('.rrrr'),
+('r.'), ('rr.'), ('rrr.'), ('rrrr.'),
+('.r.'), ('.rr.'), ('.rrr.'), ('.rrrr.');
+SELECT * FROM t1;
+id c1
+1 r
+2 rr
+3 rrr
+4 rrrr
+5 .r
+6 .rr
+7 .rrr
+8 .rrrr
+9 r.
+10 rr.
+11 rrr.
+12 rrrr.
+13 .r.
+14 .rr.
+15 .rrr.
+16 .rrrr.
+SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/t1' FIELDS ENCLOSED BY 'r' FROM t1;
+r1r rrrr
+r2r rrrrrr
+r3r rrrrrrrr
+r4r rrrrrrrrrr
+r5r r.rrr
+r6r r.rrrrr
+r7r r.rrrrrrr
+r8r r.rrrrrrrrr
+r9r rrr.r
+r10r rrrrr.r
+r11r rrrrrrr.r
+r12r rrrrrrrrr.r
+r13r r.rr.r
+r14r r.rrrr.r
+r15r r.rrrrrr.r
+r16r r.rrrrrrrr.r
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t1' INTO TABLE t2 FIELDS ENCLOSED BY 'r';
+SELECT t1.id, c1, c2 FROM t1 LEFT JOIN t2 ON t1.id=t2.id WHERE c1 != c2;
+id c1 c2
+SELECT t1.id, c1, c2 FROM t1 RIGHT JOIN t2 ON t1.id=t2.id WHERE c1 != c2;
+id c1 c2
+DROP TABLE t1,t2;
create table t1 (a int default 100, b int, c varchar(60));
load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (a, @b) set b=@b+10, c=concat("b=",@b);
select * from t1;
@@ -193,6 +247,20 @@ f1
1
2
drop table t1,t2;
+CREATE TABLE t1 (c1 INT, c2 TIMESTAMP, c3 REAL, c4 DOUBLE);
+INSERT INTO t1 (c1, c2, c3, c4) VALUES (10, '1970-02-01 01:02:03', 1.1E-100, 1.1E+100);
+SELECT * FROM t1;
+c1 c2 c3 c4
+10 1970-02-01 01:02:03 1.1e-100 1.1e+100
+SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/t1' FIELDS ENCLOSED BY '-' FROM t1;
+-10- -1970\-02\-01 01:02:03- -1.1e\-100- -1.1e+100-
+EOF
+TRUNCATE t1;
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t1' INTO TABLE t1 FIELDS ENCLOSED BY '-';
+SELECT * FROM t1;
+c1 c2 c3 c4
+10 1970-02-01 01:02:03 1.1e-100 1.1e+100
+DROP TABLE t1;
CREATE TABLE t1 (a int);
INSERT INTO t1 VALUES (1);
SET NAMES latin1;
diff --git a/mysql-test/r/log_state.result b/mysql-test/r/log_state.result
index 946797aeec7..38b3ebd6e98 100644
--- a/mysql-test/r/log_state.result
+++ b/mysql-test/r/log_state.result
@@ -131,7 +131,7 @@ set global general_log=ON;
set global log_output=default;
show variables like 'log_output';
Variable_name Value
-log_output TABLE
+log_output FILE
set global general_log=OFF;
set global log_output=FILE;
truncate table mysql.general_log;
diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result
index 007ed57f651..e8c971a41bc 100644
--- a/mysql-test/r/mysqldump.result
+++ b/mysql-test/r/mysqldump.result
@@ -1890,7 +1890,7 @@ DROP TABLE IF EXISTS `v2`;
/*!50001 CREATE TABLE `v2` (
`a` varchar(30)
) */;
-/*!50001 DROP TABLE IF EXISTS `v2`*/;
+/*!50001 DROP TABLE `v2`*/;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
@@ -1981,7 +1981,7 @@ DROP TABLE IF EXISTS `v1`;
/*!50001 CREATE TABLE `v1` (
`a` int(11)
) */;
-/*!50001 DROP TABLE IF EXISTS `v1`*/;
+/*!50001 DROP TABLE `v1`*/;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
@@ -2049,7 +2049,7 @@ DROP TABLE IF EXISTS `v2`;
/*!50001 CREATE TABLE `v2` (
`a` varchar(30)
) */;
-/*!50001 DROP TABLE IF EXISTS `v2`*/;
+/*!50001 DROP TABLE `v2`*/;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
@@ -2168,7 +2168,7 @@ DROP TABLE IF EXISTS `v3`;
`b` int(11),
`c` varchar(30)
) */;
-/*!50001 DROP TABLE IF EXISTS `v1`*/;
+/*!50001 DROP TABLE `v1`*/;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
@@ -2182,7 +2182,7 @@ DROP TABLE IF EXISTS `v3`;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
-/*!50001 DROP TABLE IF EXISTS `v2`*/;
+/*!50001 DROP TABLE `v2`*/;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
@@ -2196,7 +2196,7 @@ DROP TABLE IF EXISTS `v3`;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
-/*!50001 DROP TABLE IF EXISTS `v3`*/;
+/*!50001 DROP TABLE `v3`*/;
/*!50001 DROP VIEW IF EXISTS `v3`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
@@ -2888,7 +2888,7 @@ DROP TABLE IF EXISTS `v2`;
) */;
USE `test`;
-/*!50001 DROP TABLE IF EXISTS `v0`*/;
+/*!50001 DROP TABLE `v0`*/;
/*!50001 DROP VIEW IF EXISTS `v0`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
@@ -2902,7 +2902,7 @@ USE `test`;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
-/*!50001 DROP TABLE IF EXISTS `v1`*/;
+/*!50001 DROP TABLE `v1`*/;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
@@ -2916,7 +2916,7 @@ USE `test`;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 SET collation_connection = @saved_col_connection */;
-/*!50001 DROP TABLE IF EXISTS `v2`*/;
+/*!50001 DROP TABLE `v2`*/;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
@@ -3145,6 +3145,7 @@ insert into t values(5, 51);
create view v1 as select qty, price, qty*price as value from t;
create view v2 as select qty from v1;
mysqldump {
+/*!50001 DROP TABLE `v1`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
@@ -3159,6 +3160,7 @@ mysqldump {
/*!50001 SET collation_connection = @saved_col_connection */;
} mysqldump {
+/*!50001 DROP TABLE `v2`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
@@ -3251,7 +3253,7 @@ DROP TABLE IF EXISTS `v1`;
) */;
USE `mysqldump_test_db`;
-/*!50001 DROP TABLE IF EXISTS `v1`*/;
+/*!50001 DROP TABLE `v1`*/;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
@@ -3307,6 +3309,7 @@ USE `mysqldump_views`;
USE `mysqldump_tables`;
USE `mysqldump_views`;
+/*!50001 DROP TABLE `nasishnasifu`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
@@ -3441,7 +3444,7 @@ DROP TABLE t1;
#
CREATE TABLE t1(a int);
INSERT INTO t1 VALUES (1), (2);
-mysqldump: Input filename or options too long: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+mysqldump: Input filename too long: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
DROP TABLE t1;
CREATE TABLE t2 (a int);
CREATE TABLE t3 (a int);
@@ -3560,6 +3563,16 @@ CREATE TABLE `t1` (
INSERT INTO `t1` VALUES (11,0x7171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171);
DROP TABLE t1;
#
+# Bug #28524: mysqldump --skip-add-drop-table is not
+# compatible with views
+#
+CREATE VIEW v1 AS SELECT 1;
+DROP VIEW v1;
+SELECT * FROM v1;
+1
+1
+DROP VIEW v1;
+#
# End of 5.0 tests
#
drop table if exists t1;
@@ -3862,7 +3875,7 @@ DROP TABLE IF EXISTS `v1`;
) */;
USE `mysqldump_test_db`;
-/*!50001 DROP TABLE IF EXISTS `v1`*/;
+/*!50001 DROP TABLE `v1`*/;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result
index 8cf5f99dca3..55f78d22272 100644
--- a/mysql-test/r/mysqltest.result
+++ b/mysql-test/r/mysqltest.result
@@ -420,7 +420,7 @@ mysqltest: At line 1: query 'connect con2,localhost,root,,illegal_db' failed: 1
mysqltest: At line 1: Illegal argument for port: 'illegal_port'
mysqltest: At line 1: Illegal option to connect: SMTP
OK
-mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest.sql": At line 7: Connection limit exhausted, you can have max 128 connections
+mysqltest: The test didn't produce any output
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest.sql": At line 3: connection 'test_con1' not found in connection pool
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest.sql": At line 2: Connection test_con1 already exists
connect(localhost,root,,test,MASTER_PORT,MASTER_SOCKET);
diff --git a/mysql-test/r/ndb_update.result b/mysql-test/r/ndb_update.result
deleted file mode 100644
index 919b8c44a40..00000000000
--- a/mysql-test/r/ndb_update.result
+++ /dev/null
@@ -1,42 +0,0 @@
-DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 (
-pk1 INT NOT NULL PRIMARY KEY,
-b INT NOT NULL,
-c INT NOT NULL UNIQUE
-) ENGINE=ndbcluster;
-INSERT INTO t1 VALUES (0, 1, 0),(1,2,1),(2,3,2);
-UPDATE t1 set b = c;
-select * from t1 order by pk1;
-pk1 b c
-0 0 0
-1 1 1
-2 2 2
-UPDATE t1 set pk1 = 4 where pk1 = 1;
-select * from t1 order by pk1;
-pk1 b c
-0 0 0
-2 2 2
-4 1 1
-UPDATE t1 set pk1 = 4 where pk1 = 2;
-ERROR 23000: Duplicate entry '4' for key 'PRIMARY'
-UPDATE IGNORE t1 set pk1 = 4 where pk1 = 2;
-select * from t1 order by pk1;
-pk1 b c
-0 0 0
-2 2 2
-4 1 1
-UPDATE t1 set pk1 = 1, c = 2 where pk1 = 4;
-ERROR 23000: Duplicate entry '' for key '*UNKNOWN*'
-UPDATE IGNORE t1 set pk1 = 1, c = 2 where pk1 = 4;
-select * from t1 order by pk1;
-pk1 b c
-0 0 0
-2 2 2
-4 1 1
-UPDATE t1 set pk1 = pk1 + 10;
-select * from t1 order by pk1;
-pk1 b c
-10 0 0
-12 2 2
-14 1 1
-DROP TABLE IF EXISTS t1;
diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result
index bf347aea196..5d985d053fc 100644
--- a/mysql-test/r/partition.result
+++ b/mysql-test/r/partition.result
@@ -1267,14 +1267,4 @@ ALTER TABLE general_log PARTITION BY RANGE (TO_DAYS(event_time))
ERROR HY000: Incorrect usage of PARTITION and log table
ALTER TABLE general_log ENGINE = CSV;
SET GLOBAL general_log = default;
-CREATE TABLE `t1` ( `a` varchar(1)) ENGINE=MyISAM
-PARTITION BY LIST (CASE a WHEN 'a' THEN 1
-WHEN 'b' THEN 2
-WHEN 'c' THEN 3
-END) (
-PARTITION a VALUES IN (1),
-PARTITION b VALUES IN (2),
-PARTITION c VALUES IN (3)
-);
-DROP TABLE t1;
End of 5.1 tests
diff --git a/mysql-test/r/partition_bug18198.result b/mysql-test/r/partition_bug18198.result
new file mode 100644
index 00000000000..18d7d904bb0
--- /dev/null
+++ b/mysql-test/r/partition_bug18198.result
@@ -0,0 +1,173 @@
+drop table if exists t1;
+create table t1 (col1 datetime)
+partition by range(datediff(col1,col1))
+(partition p0 values less than (10), partition p1 values less than (30));
+drop table t1;
+create table t1 (col1 int)
+partition by range(greatest(col1,10))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(isnull(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(least(col1,12))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(case when col1>0 then 10 else 20 end)
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(ifnull(col1,5))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(nullif(col1,5))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(bit_length(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 char(5))
+partition by range(bit_length(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(char_length(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 char(5))
+partition by range(char_length(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 char(5))
+partition by range(character_length(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(find_in_set(col1,1))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 char(5))
+partition by range(find_in_set(col1,'1'))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(instr(col1,3))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 char(5))
+partition by range(instr(col1,'3'))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 char(5))
+partition by range(length(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 char(5))
+partition by range(locate(1,col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(locate(1,col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 char(5))
+partition by range(octet_length(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 char(5))
+partition by range(position(1 in col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(position(1 in col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 char(5))
+partition by range(strcmp(col1,2))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(strcmp(col1,2))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(crc32(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(round(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(sign(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 datetime)
+partition by range(period_add(col1,5))
+(partition p0 values less than (10), partition p1 values less than (30));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 datetime, col2 datetime)
+partition by range(period_diff(col1,col2))
+(partition p0 values less than (10), partition p1 values less than (30));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int, col2 int)
+partition by range(period_diff(col1,col2))
+(partition p0 values less than (10), partition p1 values less than (30));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 datetime)
+partition by range(timestampdiff(day,5,col1))
+(partition p0 values less than (10), partition p1 values less than (30));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 date)
+partition by range(unix_timestamp(col1))
+(partition p0 values less than (10), partition p1 values less than (30));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 datetime)
+partition by range(week(col1))
+(partition p0 values less than (10), partition p1 values less than (30));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 varchar(25))
+partition by range(cast(col1 as signed))
+(partition p0 values less than (10), partition p1 values less than (30));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 varchar(25))
+partition by range(convert(col1,unsigned))
+(partition p0 values less than (10), partition p1 values less than (30));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(col1 | 20)
+(partition p0 values less than (10), partition p1 values less than (30));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(col1 & 20)
+(partition p0 values less than (10), partition p1 values less than (30));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(col1 ^ 20)
+(partition p0 values less than (10), partition p1 values less than (30));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(col1 << 20)
+(partition p0 values less than (10), partition p1 values less than (30));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(col1 >> 20)
+(partition p0 values less than (10), partition p1 values less than (30));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(~col1)
+(partition p0 values less than (10), partition p1 values less than (30));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(bit_count(col1))
+(partition p0 values less than (10), partition p1 values less than (30));
+ERROR HY000: This partition function is not allowed
+create table t1 (col1 int)
+partition by range(inet_aton(col1))
+(partition p0 values less than (10), partition p1 values less than (30));
+ERROR HY000: This partition function is not allowed
diff --git a/mysql-test/r/partition_charset.result b/mysql-test/r/partition_charset.result
index 665e5d55f8f..f8f75e8bee7 100644
--- a/mysql-test/r/partition_charset.result
+++ b/mysql-test/r/partition_charset.result
@@ -16,3 +16,7 @@ s1
1
3
drop table t1;
+create table t1 (a varchar(1), primary key (a))
+partition by list (ascii(a))
+(partition p1 values in (65));
+ERROR HY000: This partition function is not allowed
diff --git a/mysql-test/r/partition_error.result b/mysql-test/r/partition_error.result
index 4b01b759902..7952c8df609 100644
--- a/mysql-test/r/partition_error.result
+++ b/mysql-test/r/partition_error.result
@@ -25,7 +25,7 @@ partitions 3
(partition x1 values in (1,2,9,4) tablespace ts1,
partition x2 values in (3, 11, 5, 7) tablespace ts2,
partition x3 values in (16, 8, 5+19, 70-43) tablespace ts3);
-ERROR HY000: The PARTITION function returns the wrong type
+ERROR HY000: This partition function is not allowed
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -89,7 +89,7 @@ partitions 3
(partition x1 tablespace ts1,
partition x2 tablespace ts2,
partition x3 tablespace ts3);
-ERROR HY000: The PARTITION function returns the wrong type
+ERROR HY000: This partition function is not allowed
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -422,7 +422,7 @@ partition by range (sin(a))
partitions 2
(partition x1 values less than (4),
partition x2 values less than (5));
-ERROR HY000: The PARTITION function returns the wrong type
+ERROR HY000: This partition function is not allowed
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -600,7 +600,7 @@ ERROR HY000: Partition constant is out of partition function domain
create table t1 (v varchar(12))
partition by range (ascii(v))
(partition p0 values less than (10));
-drop table t1;
+ERROR HY000: This partition function is not allowed
create table t1 (a int)
partition by hash (rand(a));
ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')' at line 2
@@ -619,4 +619,4 @@ partition by range (a + (select count(*) from t1))
ERROR HY000: This partition function is not allowed
create table t1 (a char(10))
partition by hash (extractvalue(a,'a'));
-ERROR HY000: The PARTITION function returns the wrong type
+ERROR HY000: This partition function is not allowed
diff --git a/mysql-test/r/partition_hash.result b/mysql-test/r/partition_hash.result
index 7ef3ee5c6c8..9a82a36d902 100644
--- a/mysql-test/r/partition_hash.result
+++ b/mysql-test/r/partition_hash.result
@@ -1,18 +1,4 @@
drop table if exists t1;
-create table t1 (a varchar(10) charset latin1 collate latin1_bin)
-partition by hash(length(a))
-partitions 10;
-insert into t1 values (''),(' '),('a'),('a '),('a ');
-explain partitions select * from t1 where a='a ';
-id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 Using where
-explain partitions select * from t1 where a='a';
-id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 Using where
-explain partitions select * from t1 where a='a ' OR a='a';
-id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 Using where
-drop table t1;
create table t1 (a int unsigned)
partition by hash(a div 2)
partitions 4;
diff --git a/mysql-test/r/partition_list.result b/mysql-test/r/partition_list.result
index e64a7a8d154..a68a67c6386 100644
--- a/mysql-test/r/partition_list.result
+++ b/mysql-test/r/partition_list.result
@@ -295,3 +295,7 @@ select * from t1;
a
100
drop table t1;
+create table t1 (a char(1))
+partition by list (ascii(ucase(a)))
+(partition p1 values in (2));
+ERROR HY000: This partition function is not allowed
diff --git a/mysql-test/r/partition_mgm.result b/mysql-test/r/partition_mgm.result
index 9b5a34bda50..04ac603fea7 100644
--- a/mysql-test/r/partition_mgm.result
+++ b/mysql-test/r/partition_mgm.result
@@ -10,13 +10,13 @@ subpartition sp01, subpartition sp02));
ERROR HY000: Wrong number of subpartitions defined, mismatch with previous setting
drop table t1;
CREATE TABLE t1 (f_date DATE, f_varchar VARCHAR(30))
-PARTITION BY HASH(CAST(YEAR(f_date) AS SIGNED INTEGER)) PARTITIONS 2;
+PARTITION BY HASH(YEAR(f_date)) PARTITIONS 2;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) PARTITIONS 2 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) PARTITIONS 2 */
hello/master-data/test/t1#P#p0.MYD
hello/master-data/test/t1#P#p0.MYI
hello/master-data/test/t1#P#p1.MYD
@@ -29,7 +29,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) PARTITIONS 1 */
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) PARTITIONS 1 */
hello/master-data/test/t1#P#p0.MYD
hello/master-data/test/t1#P#p0.MYI
hello/master-data/test/t1.frm
diff --git a/mysql-test/r/partition_pruning.result b/mysql-test/r/partition_pruning.result
index 5fc0058356d..9595676016c 100644
--- a/mysql-test/r/partition_pruning.result
+++ b/mysql-test/r/partition_pruning.result
@@ -676,25 +676,6 @@ f_int1 f_int2
8 8
9 9
drop table t1;
-create table t1 (a char(10) binary)
-partition by list(length(a))
-(partition p1 values in (1),
-partition p2 values in (2),
-partition p3 values in (3),
-partition p4 values in (4),
-partition p5 values in (5)
-);
-insert into t1 values ('a'),('bb'),('ccc'),('dddd'),('eeEee');
-select * from t1 where a>='a' and a <= 'dddd';
-a
-a
-bb
-ccc
-dddd
-explain partitions select * from t1 where a>='a' and a <= 'dddd';
-id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p1,p2,p3,p4,p5 ALL NULL NULL NULL NULL 5 Using where
-drop table t1;
create table t1 (f_int1 integer) partition by list(abs(mod(f_int1,2)))
subpartition by hash(f_int1) subpartitions 2
(
@@ -847,23 +828,58 @@ explain partitions select * from t1 where a = 18446744073709551614;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
drop table t1;
-create table t1 (a int)
-partition by range((a & 0xFF) << 56) (
-partition p0 values less than (0x40 << 56),
-partition p1 values less than (0x80 << 56),
-partition p2 values less than (0xFF << 56)
+create table t1 (a int)
+partition by range(a) (
+partition p0 values less than (64),
+partition p1 values less than (128),
+partition p2 values less than (255)
+);
+create table t2 (a int)
+partition by range(a+0) (
+partition p0 values less than (64),
+partition p1 values less than (128),
+partition p2 values less than (255)
);
insert into t1 values (0x20), (0x20), (0x41), (0x41), (0xFE), (0xFE);
+insert into t2 values (0x20), (0x20), (0x41), (0x41), (0xFE), (0xFE);
explain partitions select * from t1 where a=0;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 2 Using where
+explain partitions select * from t2 where a=0;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 p0 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t1 where a=0xFE;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p2 ALL NULL NULL NULL NULL 2 Using where
-explain partitions select * from t1 where a>0xFE and a<= 0xFF;
+explain partitions select * from t2 where a=0xFE;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 p2 ALL NULL NULL NULL NULL 2 Using where
+explain partitions select * from t1 where a > 0xFE AND a <= 0xFF;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+explain partitions select * from t2 where a > 0xFE AND a <= 0xFF;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+explain partitions select * from t1 where a >= 0xFE AND a <= 0xFF;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p2 ALL NULL NULL NULL NULL 2 Using where
+explain partitions select * from t2 where a >= 0xFE AND a <= 0xFF;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 p2 ALL NULL NULL NULL NULL 2 Using where
+explain partitions select * from t1 where a < 64 AND a >= 63;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 2 Using where
+explain partitions select * from t2 where a < 64 AND a >= 63;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 p0 ALL NULL NULL NULL NULL 2 Using where
+explain partitions select * from t1 where a <= 64 AND a >= 63;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 4 Using where
+explain partitions select * from t2 where a <= 64 AND a >= 63;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 p0,p1 ALL NULL NULL NULL NULL 4 Using where
drop table t1;
+drop table t2;
create table t1(a bigint unsigned not null) partition by range(a+0) (
partition p1 values less than (10),
partition p2 values less than (20),
diff --git a/mysql-test/r/partition_range.result b/mysql-test/r/partition_range.result
index d39b39f413a..a61006e87a4 100644
--- a/mysql-test/r/partition_range.result
+++ b/mysql-test/r/partition_range.result
@@ -1,38 +1,4 @@
drop table if exists t1;
-create table t1 (a varchar(10) charset latin1 collate latin1_bin, b int)
-partition by range (length(a) * b)
-(partition p0 values less than (2), partition p1 values less than (400));
-insert into t1 values ('a ', 2),('a',3);
-drop table t1;
-create table t1 (a varchar(10) charset latin1 collate latin1_bin, b int)
-partition by range (b* length(a) * b)
-(partition p0 values less than (2), partition p1 values less than (400));
-insert into t1 values ('a ', 2),('a',3);
-drop table t1;
-create table t1 (a varchar(10) charset latin1 collate latin1_bin,
-b varchar(10) charset latin1 collate latin1_bin)
-partition by range (length(b) * length(a))
-(partition p0 values less than (2), partition p1 values less than (400));
-insert into t1 values ('a ', 'b '),('a','b');
-drop table t1;
-create table t1 (a varchar(10) charset latin1 collate latin1_bin,
-b varchar(10) charset latin1 collate latin1_bin)
-partition by range (length(a) * length(b))
-(partition p0 values less than (2), partition p1 values less than (400));
-insert into t1 values ('a ', 'b '),('a','b');
-drop table t1;
-create table t1 (a varchar(10) charset latin1 collate latin1_bin,
-b varchar(10) charset latin1 collate latin1_bin, c int)
-partition by range (length(a) * c)
-(partition p0 values less than (2), partition p1 values less than (400));
-insert into t1 values ('a ', 'b ', 2),('a','b', 3);
-drop table t1;
-create table t1 (a varchar(10) charset latin1 collate latin1_bin,
-b varchar(10) charset latin1 collate latin1_bin, c int)
-partition by range (c * length(a))
-(partition p0 values less than (2), partition p1 values less than (400));
-insert into t1 values ('a ', 'b ', 2),('a','b', 3);
-drop table t1;
create table t1 (a int unsigned)
partition by range (a)
(partition pnull values less than (0),
@@ -109,7 +75,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 pnull_pnullsp0,pnull_pnullsp1,p0_p0sp0,p0_p0sp1 ALL NULL NULL NULL NULL 4 Using where
explain partitions select * from t1 where a > 1;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p1_p1sp0,p1_p1sp1 ALL NULL NULL NULL NULL 2 Using where
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
drop table t1;
CREATE TABLE t1 (
a int not null,
@@ -743,45 +709,3 @@ WHERE (a >= '2004-07-01' AND a <= '2004-09-30') OR
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p407,p408,p409,p507,p508,p509 ALL NULL NULL NULL NULL 18 Using where
DROP TABLE t1;
-create table t1 (a varchar(20))
-partition by range (crc32(md5(a)))
-(partition p0 values less than (100),
-partition p1 values less than maxvalue);
-insert into t1 values ("12345678901234567890");
-insert into t1 values ("A2345678901234567890");
-insert into t1 values ("B2345678901234567890");
-insert into t1 values ("1234567890123456789");
-insert into t1 values ("1234567890123456");
-select * from t1;
-a
-12345678901234567890
-A2345678901234567890
-B2345678901234567890
-1234567890123456789
-1234567890123456
-explain partitions select * from t1 where a = "12345678901234567890";
-id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p1 ALL NULL NULL NULL NULL 5 Using where
-explain partitions select * from t1 where a = "12345678901234567890" OR
-a = "A2345678901234567890" OR
-a = "B2345678901234567890" OR
-a = "C2345678901234567890";
-id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p1 ALL NULL NULL NULL NULL 5 Using where
-explain partitions select * from t1 where a = "01234567890123456";
-id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p1 ALL NULL NULL NULL NULL 5 Using where
-select * from t1 where a = "01234567890123456";
-a
-select * from t1 where a = "12345678901234567890" OR
-a = "A2345678901234567890" OR
-a = "B2345678901234567890" OR
-a = "C2345678901234567890";
-a
-12345678901234567890
-A2345678901234567890
-B2345678901234567890
-select * from t1 where a = "12345678901234567890";
-a
-12345678901234567890
-drop table t1;
diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result
index 680577c495e..7a3cbf26a21 100644
--- a/mysql-test/r/query_cache.result
+++ b/mysql-test/r/query_cache.result
@@ -1301,6 +1301,7 @@ drop procedure f3;
drop procedure f4;
drop table t1;
set GLOBAL query_cache_size=0;
+End of 4.1 tests
SET GLOBAL query_cache_size=102400;
create table t1(a int);
insert into t1 values(0), (1), (4), (5);
@@ -1495,6 +1496,46 @@ insert into t1 values ('c');
a
drop table t1;
set GLOBAL query_cache_size= default;
+Bug#28249 Query Cache returns wrong result with concurrent insert/ certain lock
+set GLOBAL query_cache_type=1;
+set GLOBAL query_cache_limit=10000;
+set GLOBAL query_cache_min_res_unit=0;
+set GLOBAL query_cache_size= 100000;
+flush tables;
+drop table if exists t1, t2;
+create table t1 (a int);
+create table t2 (a int);
+insert into t1 values (1),(2),(3);
+Locking table T2 with a write lock.
+lock table t2 write;
+Select blocked by write lock.
+select *, (select count(*) from t2) from t1;;
+Sleeing is ok, because selecting should be done very fast.
+Inserting into table T1.
+insert into t1 values (4);
+Unlocking the tables.
+unlock tables;
+Collecting result from previously blocked select.
+Next select should contain 4 rows, as the insert is long finished.
+select *, (select count(*) from t2) from t1;
+a (select count(*) from t2)
+1 0
+2 0
+3 0
+4 0
+reset query cache;
+select *, (select count(*) from t2) from t1;
+a (select count(*) from t2)
+1 0
+2 0
+3 0
+4 0
+drop table t1,t2;
+set GLOBAL query_cache_type=default;
+set GLOBAL query_cache_limit=default;
+set GLOBAL query_cache_min_res_unit=default;
+set GLOBAL query_cache_size=default;
+End of 5.0 tests
drop database if exists db1;
drop database if exists db2;
set GLOBAL query_cache_size=15*1024*1024;
@@ -1543,3 +1584,4 @@ Variable_name Value
Qcache_queries_in_cache 1
drop database db2;
drop database db3;
+End of 5.1 tests
diff --git a/mysql-test/r/rpl_truncate_7ndb.result b/mysql-test/r/rpl_truncate_7ndb.result
deleted file mode 100644
index d43704c2ba7..00000000000
--- a/mysql-test/r/rpl_truncate_7ndb.result
+++ /dev/null
@@ -1,91 +0,0 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
-**** On Master ****
-CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB;
-INSERT INTO t1 VALUES (1,1), (2,2);
-SELECT * FROM t1 ORDER BY a,b;
-a b
-1 1
-2 2
-**** On Slave ****
-INSERT INTO t1 VALUE (3,3);
-SELECT * FROM t1 ORDER BY a,b;
-a b
-1 1
-2 2
-3 3
-**** On Master ****
-TRUNCATE TABLE t1;
-SELECT * FROM t1 ORDER BY a,b;
-a b
-**** On Slave ****
-SELECT * FROM t1 ORDER BY a,b;
-a b
-**** On Master ****
-DROP TABLE t1;
-SHOW BINLOG EVENTS;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4
-master-bin.000001 106 Query 1 223 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
-master-bin.000001 223 Query 1 287 BEGIN
-master-bin.000001 287 Table_map 1 40 table_id: # (test.t1)
-master-bin.000001 327 Table_map 1 98 table_id: # (mysql.ndb_apply_status)
-master-bin.000001 385 Write_rows 1 157 table_id: #
-master-bin.000001 444 Write_rows 1 204 table_id: # flags: STMT_END_F
-master-bin.000001 491 Query 1 556 COMMIT
-master-bin.000001 556 Query 1 636 use `test`; TRUNCATE TABLE t1
-master-bin.000001 636 Query 1 712 use `test`; DROP TABLE t1
-**** On Master ****
-CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB;
-INSERT INTO t1 VALUES (1,1), (2,2);
-SELECT * FROM t1 ORDER BY a,b;
-a b
-1 1
-2 2
-**** On Slave ****
-INSERT INTO t1 VALUE (3,3);
-SELECT * FROM t1 ORDER BY a,b;
-a b
-1 1
-2 2
-3 3
-**** On Master ****
-DELETE FROM t1;
-SELECT * FROM t1 ORDER BY a,b;
-a b
-**** On Slave ****
-SELECT * FROM t1 ORDER BY a,b;
-a b
-3 3
-**** On Master ****
-DROP TABLE t1;
-SHOW BINLOG EVENTS;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4
-master-bin.000001 106 Query 1 223 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
-master-bin.000001 223 Query 1 287 BEGIN
-master-bin.000001 287 Table_map 1 40 table_id: # (test.t1)
-master-bin.000001 327 Table_map 1 98 table_id: # (mysql.ndb_apply_status)
-master-bin.000001 385 Write_rows 1 157 table_id: #
-master-bin.000001 444 Write_rows 1 204 table_id: # flags: STMT_END_F
-master-bin.000001 491 Query 1 556 COMMIT
-master-bin.000001 556 Query 1 636 use `test`; TRUNCATE TABLE t1
-master-bin.000001 636 Query 1 712 use `test`; DROP TABLE t1
-master-bin.000001 712 Query 1 829 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
-master-bin.000001 829 Query 1 893 BEGIN
-master-bin.000001 893 Table_map 1 40 table_id: # (test.t1)
-master-bin.000001 933 Table_map 1 98 table_id: # (mysql.ndb_apply_status)
-master-bin.000001 991 Write_rows 1 157 table_id: #
-master-bin.000001 1050 Write_rows 1 204 table_id: # flags: STMT_END_F
-master-bin.000001 1097 Query 1 1162 COMMIT
-master-bin.000001 1162 Query 1 1226 BEGIN
-master-bin.000001 1226 Table_map 1 40 table_id: # (test.t1)
-master-bin.000001 1266 Table_map 1 98 table_id: # (mysql.ndb_apply_status)
-master-bin.000001 1324 Write_rows 1 157 table_id: #
-master-bin.000001 1383 Delete_rows 1 196 table_id: # flags: STMT_END_F
-master-bin.000001 1422 Query 1 1487 COMMIT
-master-bin.000001 1487 Query 1 1563 use `test`; DROP TABLE t1
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index 92ceca2162f..a148d1029df 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -3492,7 +3492,7 @@ SELECT 0.9888889889 * 1.011111411911;
0.9998769417899202067879
prepare stmt from 'select 1 as " a "';
Warnings:
-Warning 1548 Leading spaces are removed from name ' a '
+Warning 1466 Leading spaces are removed from name ' a '
execute stmt;
a
1
diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result
index 9ef10865cd7..2bdd29602fb 100644
--- a/mysql-test/r/show_check.result
+++ b/mysql-test/r/show_check.result
@@ -1148,7 +1148,37 @@ DROP TABLE t1;
DROP VIEW v1;
DROP PROCEDURE p1;
DROP FUNCTION f1;
-End of 5.0 tests.
+flush status;
+show variables like "log_queries_not_using_indexes";
+Variable_name Value
+log_queries_not_using_indexes ON
+select 1 from information_schema.tables limit 1;
+1
+1
+show status like 'slow_queries';
+Variable_name Value
+Slow_queries 2
+set global log_queries_not_using_indexes=OFF;
+show variables like "log_queries_not_using_indexes";
+Variable_name Value
+log_queries_not_using_indexes OFF
+select 1 from information_schema.tables limit 1;
+1
+1
+show status like 'slow_queries';
+Variable_name Value
+Slow_queries 2
+set global log_queries_not_using_indexes=ON;
+show variables like "log_queries_not_using_indexes";
+Variable_name Value
+log_queries_not_using_indexes ON
+select 1 from information_schema.tables limit 1;
+1
+1
+show status like 'slow_queries';
+Variable_name Value
+Slow_queries 4
+End of 5.0 tests
SHOW AUTHORS;
create database mysqltest;
show create database mysqltest;
@@ -1168,7 +1198,7 @@ drop database mysqltest;
show full plugin;
show warnings;
Level Code Message
-Warning 1543 The syntax 'SHOW PLUGIN' is deprecated and will be removed in MySQL 5.2. Please use 'SHOW PLUGINS' instead
+Warning 1287 The syntax 'SHOW PLUGIN' is deprecated and will be removed in MySQL 5.2. Please use 'SHOW PLUGINS' instead
show plugin;
show plugins;
create database `mysqlttest\1`;
@@ -1282,4 +1312,43 @@ t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR E
DROP TABLE t1;
DROP PROCEDURE p1;
DEALLOCATE PREPARE stmt1;
+set names koi8r;
+DROP VIEW IF EXISTS v1;
+DROP PROCEDURE IF EXISTS p1;
+DROP FUNCTION IF EXISTS f1;
+DROP TABLE IF EXISTS t1;
+DROP EVENT IF EXISTS ev1;
+CREATE VIEW v1 AS SELECT 'ÔÅÓÔ' AS test;
+CREATE PROCEDURE p1() SELECT 'ÔÅÓÔ' AS test;
+CREATE FUNCTION f1() RETURNS CHAR(10) RETURN 'ÔÅÓÔ';
+CREATE TABLE t1(c1 CHAR(10));
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1
+FOR EACH ROW
+SET NEW.c1 = 'ÔÅÓÔ';
+CREATE EVENT ev1 ON SCHEDULE AT '2030-01-01 00:00:00' DO SELECT 'ÔÅÓÔ' AS test;
+set names utf8;
+SHOW CREATE VIEW v1;
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select _koi8r'теÑÑ‚' AS `test` koi8r koi8r_general_ci
+SHOW CREATE PROCEDURE p1;
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
+SELECT 'теÑÑ‚' AS test koi8r koi8r_general_ci latin1_swedish_ci
+SHOW CREATE FUNCTION f1;
+Function sql_mode Create Function character_set_client collation_connection Database Collation
+f1 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS char(10) CHARSET latin1
+RETURN 'теÑÑ‚' koi8r koi8r_general_ci latin1_swedish_ci
+SHOW CREATE TRIGGER t1_bi;
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1
+FOR EACH ROW
+SET NEW.c1 = 'теÑÑ‚' koi8r koi8r_general_ci latin1_swedish_ci
+SHOW CREATE EVENT ev1;
+Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
+ev1 SYSTEM CREATE EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 'теÑÑ‚' AS test koi8r koi8r_general_ci latin1_swedish_ci
+DROP VIEW v1;
+DROP PROCEDURE p1;
+DROP FUNCTION f1;
+DROP TABLE t1;
+DROP EVENT ev1;
End of 5.1 tests
diff --git a/mysql-test/r/sp-prelocking.result b/mysql-test/r/sp-prelocking.result
index 5eac54803f0..c19bd1abd26 100644
--- a/mysql-test/r/sp-prelocking.result
+++ b/mysql-test/r/sp-prelocking.result
@@ -267,4 +267,26 @@ drop table bug_27907_logs;
insert into bug_27907_t1(a) values (1);
ERROR 42S02: Table 'test.bug_27907_logs' doesn't exist
drop table bug_27907_t1;
+
+Bug#22427 create table if not exists + stored function results in
+inconsistent behavior
+
+Add a test case, the bug itself was fixed by the patch for
+Bug#20662
+
+drop table if exists t1;
+drop function if exists f_bug22427;
+create table t1 (i int);
+insert into t1 values (1);
+create function f_bug22427() returns int return (select max(i) from t1);
+select f_bug22427();
+f_bug22427()
+1
+create table if not exists t1 select f_bug22427() as i;
+Warnings:
+Note 1050 Table 't1' already exists
+create table t1 select f_bug22427() as i;
+ERROR 42S01: Table 't1' already exists
+drop table t1;
+drop function f_bug22427;
End of 5.0 tests
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index b060bfb081a..273c60110b3 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -5665,7 +5665,7 @@ drop function if exists pi;
create function pi() returns varchar(50)
return "pie, my favorite desert.";
Warnings:
-Note 1581 This function 'pi' has the same name as a native function
+Note 1582 This function 'pi' has the same name as a native function
SET @save_sql_mode=@@sql_mode;
SET SQL_MODE='IGNORE_SPACE';
select pi(), pi ();
@@ -5714,15 +5714,15 @@ use test;
create function `database`() returns varchar(50)
return "Stored function database";
Warnings:
-Note 1581 This function 'database' has the same name as a native function
+Note 1582 This function 'database' has the same name as a native function
create function `current_user`() returns varchar(50)
return "Stored function current_user";
Warnings:
-Note 1581 This function 'current_user' has the same name as a native function
+Note 1582 This function 'current_user' has the same name as a native function
create function md5(x varchar(50)) returns varchar(50)
return "Stored function md5";
Warnings:
-Note 1581 This function 'md5' has the same name as a native function
+Note 1582 This function 'md5' has the same name as a native function
SET SQL_MODE='IGNORE_SPACE';
select database(), database ();
database() database ()
@@ -6281,6 +6281,31 @@ v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
DROP VIEW v1;
DROP FUNCTION metered;
DROP TABLE t1;
+drop database if exists mysqltest_db1;
+create database mysqltest_db1;
+create procedure mysqltest_db1.sp_bug28551() begin end;
+call mysqltest_db1.sp_bug28551();
+show warnings;
+Level Code Message
+drop database mysqltest_db1;
+drop database if exists mysqltest_db1;
+drop table if exists test.t1;
+create database mysqltest_db1;
+use mysqltest_db1;
+drop database mysqltest_db1;
+create table test.t1 (id int);
+insert into test.t1 (id) values (1);
+create procedure test.sp_bug29050() begin select * from t1; end//
+show warnings;
+Level Code Message
+call test.sp_bug29050();
+id
+1
+show warnings;
+Level Code Message
+use test;
+drop procedure sp_bug29050;
+drop table t1;
drop procedure if exists proc_25411_a;
drop procedure if exists proc_25411_b;
drop procedure if exists proc_25411_c;
diff --git a/mysql-test/r/sp_gis.result b/mysql-test/r/sp_gis.result
index fddf2a6bc18..b4fe0872d64 100644
--- a/mysql-test/r/sp_gis.result
+++ b/mysql-test/r/sp_gis.result
@@ -7,11 +7,11 @@ return 1;
create function x() returns int
return 2;
Warnings:
-Note 1581 This function 'x' has the same name as a native function
+Note 1582 This function 'x' has the same name as a native function
create function y() returns int
return 3;
Warnings:
-Note 1581 This function 'y' has the same name as a native function
+Note 1582 This function 'y' has the same name as a native function
select a();
a()
1
diff --git a/mysql-test/r/sp_trans.result b/mysql-test/r/sp_trans.result
index a0d687e565b..abd454ac907 100644
--- a/mysql-test/r/sp_trans.result
+++ b/mysql-test/r/sp_trans.result
@@ -535,7 +535,7 @@ use db_bug7787|
CREATE PROCEDURE p1()
SHOW INNODB STATUS; |
Warnings:
-Warning 1543 The syntax 'SHOW INNODB STATUS' is deprecated and will be removed in MySQL 5.2. Please use 'SHOW ENGINE INNODB STATUS' instead
+Warning 1287 The syntax 'SHOW INNODB STATUS' is deprecated and will be removed in MySQL 5.2. Please use 'SHOW ENGINE INNODB STATUS' instead
GRANT EXECUTE ON PROCEDURE p1 TO user_bug7787@localhost|
DROP DATABASE db_bug7787|
drop user user_bug7787@localhost|
diff --git a/mysql-test/r/ssl-big.result b/mysql-test/r/ssl-big.result
new file mode 100644
index 00000000000..39c4f34e46c
--- /dev/null
+++ b/mysql-test/r/ssl-big.result
@@ -0,0 +1,3 @@
+DROP TABLE IF EXISTS t1, t2;
+create table t1 (a int);
+drop table t1;
diff --git a/mysql-test/r/symlink.result b/mysql-test/r/symlink.result
index 8ffe88acfa4..aba60f757c6 100644
--- a/mysql-test/r/symlink.result
+++ b/mysql-test/r/symlink.result
@@ -133,4 +133,26 @@ a
42
drop table t1;
End of 4.1 tests
+CREATE DATABASE db1;
+CREATE DATABASE db2;
+USE db2;
+INSERT INTO db2.t1 VALUES (1);
+SELECT * FROM db2.t1;
+b
+1
+RESET QUERY CACHE;
+USE db1;
+SET SESSION keep_files_on_create = TRUE;
+CREATE TABLE t1 (a INT) ENGINE MYISAM;
+Got one of the listed errors
+CREATE TABLE t3 (a INT) Engine=MyISAM;
+INSERT INTO t3 VALUES (1),(2),(3);
+TRUNCATE TABLE t3;
+SELECT * from t3;
+a
+SET SESSION keep_files_on_create = DEFAULT;
+DROP TABLE db2.t1, db1.t3;
+DROP DATABASE db1;
+DROP DATABASE db2;
+USE test;
End of 5.0 tests
diff --git a/mysql-test/r/trigger-trans.result b/mysql-test/r/trigger-trans.result
index b56abf1f59a..cd5f629564f 100644
--- a/mysql-test/r/trigger-trans.result
+++ b/mysql-test/r/trigger-trans.result
@@ -82,3 +82,62 @@ ALICE 33 1 0
THE CROWN 43 1 0
THE PIE 53 1 1
drop table t1;
+
+Bug#26141 mixing table types in trigger causes full
+table lock on innodb table
+
+Ensure we do not open and lock tables for the triggers we do not
+fire.
+
+drop table if exists t1, t2, t3;
+drop trigger if exists trg_bug26141_au;
+drop trigger if exists trg_bug26141_ai;
+create table t1 (c int primary key) engine=innodb;
+create table t2 (c int) engine=myisam;
+create table t3 (c int) engine=myisam;
+insert into t1 (c) values (1);
+create trigger trg_bug26141_ai after insert on t1
+for each row
+begin
+insert into t2 (c) values (1);
+# We need the 'sync' lock to synchronously wait in connection 2 till
+# the moment when the trigger acquired all the locks.
+select release_lock("lock_bug26141_sync") into @a;
+# 1000 is time in seconds of lock wait timeout -- this is a way
+# to cause a manageable sleep up to 1000 seconds
+select get_lock("lock_bug26141_wait", 1000) into @a;
+end|
+create trigger trg_bug26141_au after update on t1
+for each row
+begin
+insert into t3 (c) values (1);
+end|
+select get_lock("lock_bug26141_wait", 0);
+get_lock("lock_bug26141_wait", 0)
+1
+select get_lock("lock_bug26141_sync", /* must not be priorly locked */ 0);
+get_lock("lock_bug26141_sync", /* must not be priorly locked */ 0)
+1
+insert into t1 (c) values (2);
+select get_lock("lock_bug26141_sync", 1000);
+get_lock("lock_bug26141_sync", 1000)
+1
+update t1 set c=3 where c=1;
+select release_lock("lock_bug26141_sync");
+release_lock("lock_bug26141_sync")
+1
+select release_lock("lock_bug26141_wait");
+release_lock("lock_bug26141_wait")
+1
+select * from t1;
+c
+2
+3
+select * from t2;
+c
+1
+select * from t3;
+c
+1
+drop table t1, t2, t3;
+End of 5.0 tests
diff --git a/mysql-test/r/trigger.result b/mysql-test/r/trigger.result
index f901fd783e8..189722bfe9b 100644
--- a/mysql-test/r/trigger.result
+++ b/mysql-test/r/trigger.result
@@ -351,7 +351,7 @@ create trigger trg1 before insert on mysqltest.t1 for each row set @a:= 1;
ERROR HY000: Trigger in wrong schema
use mysqltest;
create trigger test.trg1 before insert on t1 for each row set @a:= 1;
-ERROR HY000: Trigger in wrong schema
+ERROR 42S02: Table 'test.t1' doesn't exist
drop database mysqltest;
use test;
create table t1 (i int, j int default 10, k int not null, key (k));
@@ -842,7 +842,7 @@ drop table t1;
create trigger t1_bi before insert on test.t1 for each row set @a:=0;
ERROR 3D000: No database selected
create trigger test.t1_bi before insert on t1 for each row set @a:=0;
-ERROR 3D000: No database selected
+ERROR 42S02: Table 'test.t1' doesn't exist
drop trigger t1_bi;
ERROR 3D000: No database selected
create table t1 (id int);
@@ -1476,6 +1476,491 @@ DROP TRIGGER t1_test;
DROP TABLE t1,t2;
SET SESSION LOW_PRIORITY_UPDATES=DEFAULT;
SET GLOBAL LOW_PRIORITY_UPDATES=DEFAULT;
+
+Bug#28502 Triggers that update another innodb table will block
+on X lock unnecessarily
+
+Ensure we do not open and lock tables for triggers we do not fire.
+
+drop table if exists t1, t2;
+drop trigger if exists trg_bug28502_au;
+create table t1 (id int, count int);
+create table t2 (id int);
+create trigger trg_bug28502_au before update on t2
+for each row
+begin
+if (new.id is not null) then
+update t1 set count= count + 1 where id = old.id;
+end if;
+end|
+insert into t1 (id, count) values (1, 0);
+lock table t1 write;
+insert into t2 set id=1;
+unlock tables;
+update t2 set id=1 where id=1;
+select * from t1;
+id count
+1 1
+select * from t2;
+id
+1
+drop table t1, t2;
+
+Additionally, provide test coverage for triggers and
+all MySQL data changing commands.
+
+drop table if exists t1, t2, t1_op_log;
+drop view if exists v1;
+drop trigger if exists trg_bug28502_bi;
+drop trigger if exists trg_bug28502_ai;
+drop trigger if exists trg_bug28502_bu;
+drop trigger if exists trg_bug28502_au;
+drop trigger if exists trg_bug28502_bd;
+drop trigger if exists trg_bug28502_ad;
+create table t1 (id int primary key auto_increment, operation varchar(255));
+create table t2 (id int primary key);
+create table t1_op_log(operation varchar(255));
+create view v1 as select * from t1;
+create trigger trg_bug28502_bi before insert on t1
+for each row
+insert into t1_op_log (operation)
+values (concat("Before INSERT, new=", new.operation));
+create trigger trg_bug28502_ai after insert on t1
+for each row
+insert into t1_op_log (operation)
+values (concat("After INSERT, new=", new.operation));
+create trigger trg_bug28502_bu before update on t1
+for each row
+insert into t1_op_log (operation)
+values (concat("Before UPDATE, new=", new.operation,
+", old=", old.operation));
+create trigger trg_bug28502_au after update on t1
+for each row
+insert into t1_op_log (operation)
+values (concat("After UPDATE, new=", new.operation,
+", old=", old.operation));
+create trigger trg_bug28502_bd before delete on t1
+for each row
+insert into t1_op_log (operation)
+values (concat("Before DELETE, old=", old.operation));
+create trigger trg_bug28502_ad after delete on t1
+for each row
+insert into t1_op_log (operation)
+values (concat("After DELETE, old=", old.operation));
+insert into t1 (operation) values ("INSERT");
+set @id=last_insert_id();
+select * from t1;
+id operation
+1 INSERT
+select * from t1_op_log;
+operation
+Before INSERT, new=INSERT
+After INSERT, new=INSERT
+truncate t1_op_log;
+update t1 set operation="UPDATE" where id=@id;
+select * from t1;
+id operation
+1 UPDATE
+select * from t1_op_log;
+operation
+Before UPDATE, new=UPDATE, old=INSERT
+After UPDATE, new=UPDATE, old=INSERT
+truncate t1_op_log;
+delete from t1 where id=@id;
+select * from t1;
+id operation
+select * from t1_op_log;
+operation
+Before DELETE, old=UPDATE
+After DELETE, old=UPDATE
+truncate t1;
+truncate t1_op_log;
+insert into t1 (id, operation) values
+(NULL, "INSERT ON DUPLICATE KEY UPDATE, inserting a new key")
+on duplicate key update id=NULL, operation="Should never happen";
+set @id=last_insert_id();
+select * from t1;
+id operation
+1 INSERT ON DUPLICATE KEY UPDATE, inserting a new key
+select * from t1_op_log;
+operation
+Before INSERT, new=INSERT ON DUPLICATE KEY UPDATE, inserting a new key
+After INSERT, new=INSERT ON DUPLICATE KEY UPDATE, inserting a new key
+truncate t1_op_log;
+insert into t1 (id, operation) values
+(@id, "INSERT ON DUPLICATE KEY UPDATE, the key value is the same")
+on duplicate key update id=NULL,
+operation="INSERT ON DUPLICATE KEY UPDATE, updating the duplicate";
+select * from t1;
+id operation
+0 INSERT ON DUPLICATE KEY UPDATE, updating the duplicate
+select * from t1_op_log;
+operation
+Before INSERT, new=INSERT ON DUPLICATE KEY UPDATE, the key value is the same
+Before UPDATE, new=INSERT ON DUPLICATE KEY UPDATE, updating the duplicate, old=INSERT ON DUPLICATE KEY UPDATE, inserting a new key
+After UPDATE, new=INSERT ON DUPLICATE KEY UPDATE, updating the duplicate, old=INSERT ON DUPLICATE KEY UPDATE, inserting a new key
+truncate t1;
+truncate t1_op_log;
+replace into t1 values (NULL, "REPLACE, inserting a new key");
+set @id=last_insert_id();
+select * from t1;
+id operation
+1 REPLACE, inserting a new key
+select * from t1_op_log;
+operation
+Before INSERT, new=REPLACE, inserting a new key
+After INSERT, new=REPLACE, inserting a new key
+truncate t1_op_log;
+replace into t1 values (@id, "REPLACE, deleting the duplicate");
+select * from t1;
+id operation
+1 REPLACE, deleting the duplicate
+select * from t1_op_log;
+operation
+Before INSERT, new=REPLACE, deleting the duplicate
+Before DELETE, old=REPLACE, inserting a new key
+After DELETE, old=REPLACE, inserting a new key
+After INSERT, new=REPLACE, deleting the duplicate
+truncate t1;
+truncate t1_op_log;
+create table if not exists t1
+select NULL, "CREATE TABLE ... SELECT, inserting a new key";
+Warnings:
+Note 1050 Table 't1' already exists
+set @id=last_insert_id();
+select * from t1;
+id operation
+1 CREATE TABLE ... SELECT, inserting a new key
+select * from t1_op_log;
+operation
+Before INSERT, new=CREATE TABLE ... SELECT, inserting a new key
+After INSERT, new=CREATE TABLE ... SELECT, inserting a new key
+truncate t1_op_log;
+create table if not exists t1 replace
+select @id, "CREATE TABLE ... REPLACE SELECT, deleting a duplicate key";
+Warnings:
+Note 1050 Table 't1' already exists
+select * from t1;
+id operation
+1 CREATE TABLE ... REPLACE SELECT, deleting a duplicate key
+select * from t1_op_log;
+operation
+Before INSERT, new=CREATE TABLE ... REPLACE SELECT, deleting a duplicate key
+Before DELETE, old=CREATE TABLE ... SELECT, inserting a new key
+After DELETE, old=CREATE TABLE ... SELECT, inserting a new key
+After INSERT, new=CREATE TABLE ... REPLACE SELECT, deleting a duplicate key
+truncate t1;
+truncate t1_op_log;
+insert into t1 (id, operation)
+select NULL, "INSERT ... SELECT, inserting a new key";
+set @id=last_insert_id();
+select * from t1;
+id operation
+1 INSERT ... SELECT, inserting a new key
+select * from t1_op_log;
+operation
+Before INSERT, new=INSERT ... SELECT, inserting a new key
+After INSERT, new=INSERT ... SELECT, inserting a new key
+truncate t1_op_log;
+insert into t1 (id, operation)
+select @id,
+"INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate"
+on duplicate key update id=NULL,
+operation="INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate";
+select * from t1;
+id operation
+0 INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate
+select * from t1_op_log;
+operation
+Before INSERT, new=INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate
+Before UPDATE, new=INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate, old=INSERT ... SELECT, inserting a new key
+After UPDATE, new=INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate, old=INSERT ... SELECT, inserting a new key
+truncate t1;
+truncate t1_op_log;
+replace into t1 (id, operation)
+select NULL, "REPLACE ... SELECT, inserting a new key";
+set @id=last_insert_id();
+select * from t1;
+id operation
+1 REPLACE ... SELECT, inserting a new key
+select * from t1_op_log;
+operation
+Before INSERT, new=REPLACE ... SELECT, inserting a new key
+After INSERT, new=REPLACE ... SELECT, inserting a new key
+truncate t1_op_log;
+replace into t1 (id, operation)
+select @id, "REPLACE ... SELECT, deleting a duplicate";
+select * from t1;
+id operation
+1 REPLACE ... SELECT, deleting a duplicate
+select * from t1_op_log;
+operation
+Before INSERT, new=REPLACE ... SELECT, deleting a duplicate
+Before DELETE, old=REPLACE ... SELECT, inserting a new key
+After DELETE, old=REPLACE ... SELECT, inserting a new key
+After INSERT, new=REPLACE ... SELECT, deleting a duplicate
+truncate t1;
+truncate t1_op_log;
+insert into t1 (id, operation) values (1, "INSERT for multi-DELETE");
+insert into t2 (id) values (1);
+delete t1.*, t2.* from t1, t2 where t1.id=1;
+select * from t1;
+id operation
+select * from t2;
+id
+select * from t1_op_log;
+operation
+Before INSERT, new=INSERT for multi-DELETE
+After INSERT, new=INSERT for multi-DELETE
+Before DELETE, old=INSERT for multi-DELETE
+After DELETE, old=INSERT for multi-DELETE
+truncate t1;
+truncate t2;
+truncate t1_op_log;
+insert into t1 (id, operation) values (1, "INSERT for multi-UPDATE");
+insert into t2 (id) values (1);
+update t1, t2 set t1.id=2, operation="multi-UPDATE" where t1.id=1;
+update t1, t2
+set t2.id=3, operation="multi-UPDATE, SET for t2, but the trigger is fired" where t1.id=2;
+select * from t1;
+id operation
+2 multi-UPDATE, SET for t2, but the trigger is fired
+select * from t2;
+id
+3
+select * from t1_op_log;
+operation
+Before INSERT, new=INSERT for multi-UPDATE
+After INSERT, new=INSERT for multi-UPDATE
+Before UPDATE, new=multi-UPDATE, old=INSERT for multi-UPDATE
+After UPDATE, new=multi-UPDATE, old=INSERT for multi-UPDATE
+Before UPDATE, new=multi-UPDATE, SET for t2, but the trigger is fired, old=multi-UPDATE
+After UPDATE, new=multi-UPDATE, SET for t2, but the trigger is fired, old=multi-UPDATE
+truncate table t1;
+truncate table t2;
+truncate table t1_op_log;
+
+Now do the same but use a view instead of the base table.
+
+insert into v1 (operation) values ("INSERT");
+set @id=last_insert_id();
+select * from t1;
+id operation
+1 INSERT
+select * from t1_op_log;
+operation
+Before INSERT, new=INSERT
+After INSERT, new=INSERT
+truncate t1_op_log;
+update v1 set operation="UPDATE" where id=@id;
+select * from t1;
+id operation
+1 UPDATE
+select * from t1_op_log;
+operation
+Before UPDATE, new=UPDATE, old=INSERT
+After UPDATE, new=UPDATE, old=INSERT
+truncate t1_op_log;
+delete from v1 where id=@id;
+select * from t1;
+id operation
+select * from t1_op_log;
+operation
+Before DELETE, old=UPDATE
+After DELETE, old=UPDATE
+truncate t1;
+truncate t1_op_log;
+insert into v1 (id, operation) values
+(NULL, "INSERT ON DUPLICATE KEY UPDATE, inserting a new key")
+on duplicate key update id=NULL, operation="Should never happen";
+set @id=last_insert_id();
+select * from t1;
+id operation
+1 INSERT ON DUPLICATE KEY UPDATE, inserting a new key
+select * from t1_op_log;
+operation
+Before INSERT, new=INSERT ON DUPLICATE KEY UPDATE, inserting a new key
+After INSERT, new=INSERT ON DUPLICATE KEY UPDATE, inserting a new key
+truncate t1_op_log;
+insert into v1 (id, operation) values
+(@id, "INSERT ON DUPLICATE KEY UPDATE, the key value is the same")
+on duplicate key update id=NULL,
+operation="INSERT ON DUPLICATE KEY UPDATE, updating the duplicate";
+select * from t1;
+id operation
+0 INSERT ON DUPLICATE KEY UPDATE, updating the duplicate
+select * from t1_op_log;
+operation
+Before INSERT, new=INSERT ON DUPLICATE KEY UPDATE, the key value is the same
+Before UPDATE, new=INSERT ON DUPLICATE KEY UPDATE, updating the duplicate, old=INSERT ON DUPLICATE KEY UPDATE, inserting a new key
+After UPDATE, new=INSERT ON DUPLICATE KEY UPDATE, updating the duplicate, old=INSERT ON DUPLICATE KEY UPDATE, inserting a new key
+truncate t1;
+truncate t1_op_log;
+replace into v1 values (NULL, "REPLACE, inserting a new key");
+set @id=last_insert_id();
+select * from t1;
+id operation
+1 REPLACE, inserting a new key
+select * from t1_op_log;
+operation
+Before INSERT, new=REPLACE, inserting a new key
+After INSERT, new=REPLACE, inserting a new key
+truncate t1_op_log;
+replace into v1 values (@id, "REPLACE, deleting the duplicate");
+select * from t1;
+id operation
+1 REPLACE, deleting the duplicate
+select * from t1_op_log;
+operation
+Before INSERT, new=REPLACE, deleting the duplicate
+Before DELETE, old=REPLACE, inserting a new key
+After DELETE, old=REPLACE, inserting a new key
+After INSERT, new=REPLACE, deleting the duplicate
+truncate t1;
+truncate t1_op_log;
+create table if not exists v1
+select NULL, "CREATE TABLE ... SELECT, inserting a new key";
+Warnings:
+Note 1050 Table 'v1' already exists
+set @id=last_insert_id();
+select * from t1;
+id operation
+1 CREATE TABLE ... SELECT, inserting a new key
+select * from t1_op_log;
+operation
+Before INSERT, new=CREATE TABLE ... SELECT, inserting a new key
+After INSERT, new=CREATE TABLE ... SELECT, inserting a new key
+truncate t1_op_log;
+create table if not exists v1 replace
+select @id, "CREATE TABLE ... REPLACE SELECT, deleting a duplicate key";
+Warnings:
+Note 1050 Table 'v1' already exists
+select * from t1;
+id operation
+1 CREATE TABLE ... REPLACE SELECT, deleting a duplicate key
+select * from t1_op_log;
+operation
+Before INSERT, new=CREATE TABLE ... REPLACE SELECT, deleting a duplicate key
+Before DELETE, old=CREATE TABLE ... SELECT, inserting a new key
+After DELETE, old=CREATE TABLE ... SELECT, inserting a new key
+After INSERT, new=CREATE TABLE ... REPLACE SELECT, deleting a duplicate key
+truncate t1;
+truncate t1_op_log;
+insert into v1 (id, operation)
+select NULL, "INSERT ... SELECT, inserting a new key";
+set @id=last_insert_id();
+select * from t1;
+id operation
+1 INSERT ... SELECT, inserting a new key
+select * from t1_op_log;
+operation
+Before INSERT, new=INSERT ... SELECT, inserting a new key
+After INSERT, new=INSERT ... SELECT, inserting a new key
+truncate t1_op_log;
+insert into v1 (id, operation)
+select @id,
+"INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate"
+on duplicate key update id=NULL,
+operation="INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate";
+select * from t1;
+id operation
+0 INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate
+select * from t1_op_log;
+operation
+Before INSERT, new=INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate
+Before UPDATE, new=INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate, old=INSERT ... SELECT, inserting a new key
+After UPDATE, new=INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate, old=INSERT ... SELECT, inserting a new key
+truncate t1;
+truncate t1_op_log;
+replace into v1 (id, operation)
+select NULL, "REPLACE ... SELECT, inserting a new key";
+set @id=last_insert_id();
+select * from t1;
+id operation
+1 REPLACE ... SELECT, inserting a new key
+select * from t1_op_log;
+operation
+Before INSERT, new=REPLACE ... SELECT, inserting a new key
+After INSERT, new=REPLACE ... SELECT, inserting a new key
+truncate t1_op_log;
+replace into v1 (id, operation)
+select @id, "REPLACE ... SELECT, deleting a duplicate";
+select * from t1;
+id operation
+1 REPLACE ... SELECT, deleting a duplicate
+select * from t1_op_log;
+operation
+Before INSERT, new=REPLACE ... SELECT, deleting a duplicate
+Before DELETE, old=REPLACE ... SELECT, inserting a new key
+After DELETE, old=REPLACE ... SELECT, inserting a new key
+After INSERT, new=REPLACE ... SELECT, deleting a duplicate
+truncate t1;
+truncate t1_op_log;
+insert into v1 (id, operation) values (1, "INSERT for multi-DELETE");
+insert into t2 (id) values (1);
+delete v1.*, t2.* from v1, t2 where v1.id=1;
+select * from t1;
+id operation
+select * from t2;
+id
+select * from t1_op_log;
+operation
+Before INSERT, new=INSERT for multi-DELETE
+After INSERT, new=INSERT for multi-DELETE
+Before DELETE, old=INSERT for multi-DELETE
+After DELETE, old=INSERT for multi-DELETE
+truncate t1;
+truncate t2;
+truncate t1_op_log;
+insert into v1 (id, operation) values (1, "INSERT for multi-UPDATE");
+insert into t2 (id) values (1);
+update v1, t2 set v1.id=2, operation="multi-UPDATE" where v1.id=1;
+update v1, t2
+set t2.id=3, operation="multi-UPDATE, SET for t2, but the trigger is fired" where v1.id=2;
+select * from t1;
+id operation
+2 multi-UPDATE, SET for t2, but the trigger is fired
+select * from t2;
+id
+3
+select * from t1_op_log;
+operation
+Before INSERT, new=INSERT for multi-UPDATE
+After INSERT, new=INSERT for multi-UPDATE
+Before UPDATE, new=multi-UPDATE, old=INSERT for multi-UPDATE
+After UPDATE, new=multi-UPDATE, old=INSERT for multi-UPDATE
+Before UPDATE, new=multi-UPDATE, SET for t2, but the trigger is fired, old=multi-UPDATE
+After UPDATE, new=multi-UPDATE, SET for t2, but the trigger is fired, old=multi-UPDATE
+drop view v1;
+drop table t1, t2, t1_op_log;
+
+Bug#27248 Triggers: error if insert affects temporary table
+
+The bug was fixed by the fix for Bug#26141
+
+drop table if exists t1;
+drop temporary table if exists t2;
+create table t1 (s1 int);
+create temporary table t2 (s1 int);
+create trigger t1_bi before insert on t1 for each row insert into t2 values (0);
+create trigger t1_bd before delete on t1 for each row delete from t2;
+insert into t1 values (0);
+insert into t1 values (0);
+select * from t1;
+s1
+0
+0
+select * from t2;
+s1
+0
+0
+delete from t1;
+select * from t1;
+s1
+select * from t2;
+s1
+drop table t1;
+drop temporary table t2;
End of 5.0 tests
drop table if exists table_25411_a;
drop table if exists table_25411_b;
diff --git a/mysql-test/r/type_enum.result b/mysql-test/r/type_enum.result
index 9535e6dd18a..ec72a6eb995 100644
--- a/mysql-test/r/type_enum.result
+++ b/mysql-test/r/type_enum.result
@@ -1809,4 +1809,24 @@ f1
drop table t1;
+CREATE TABLE t1 (c1 ENUM('a', '', 'b'));
+INSERT INTO t1 (c1) VALUES ('b');
+INSERT INTO t1 (c1) VALUES ('');
+INSERT INTO t1 (c1) VALUES (0);
+Warnings:
+Warning 1265 Data truncated for column 'c1' at row 1
+INSERT INTO t1 (c1) VALUES ('');
+SELECT c1 + 0, COUNT(c1) FROM t1 GROUP BY c1;
+c1 + 0 COUNT(c1)
+0 1
+2 2
+3 1
+CREATE TABLE t2 SELECT * FROM t1;
+SELECT c1 + 0 FROM t2;
+c1 + 0
+3
+2
+0
+2
+DROP TABLE t1,t2;
End of 5.1 tests
diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result
index fc6955f11d2..24be10a7a29 100644
--- a/mysql-test/r/type_newdecimal.result
+++ b/mysql-test/r/type_newdecimal.result
@@ -1481,6 +1481,34 @@ drop table t1;
SELECT 1.000000000000 * 99.999999999998 / 100 a,1.000000000000 * (99.999999999998 / 100) b;
a b
0.9999999999999800000000000000 0.9999999999999800000000000000
+SELECT CAST(1 AS decimal(65,10));
+CAST(1 AS decimal(65,10))
+1.0000000000
+SELECT CAST(1 AS decimal(66,10));
+ERROR 42000: Too big precision 66 specified for column '1'. Maximum is 65.
+SELECT CAST(1 AS decimal(65,30));
+CAST(1 AS decimal(65,30))
+1.000000000000000000000000000000
+SELECT CAST(1 AS decimal(65,31));
+ERROR 42000: Too big scale 31 specified for column '1'. Maximum is 30.
+CREATE TABLE t1 (a int DEFAULT NULL, b int DEFAULT NULL);
+INSERT INTO t1 VALUES (3,30), (1,10), (2,10);
+SELECT a+CAST(1 AS decimal(65,30)) AS aa, SUM(b) FROM t1 GROUP BY aa;
+aa SUM(b)
+2.000000000000000000000000000000 10
+3.000000000000000000000000000000 10
+4.000000000000000000000000000000 30
+SELECT a+CAST(1 AS decimal(65,31)) AS aa, SUM(b) FROM t1 GROUP BY aa;
+ERROR 42000: Too big scale 31 specified for column '1'. Maximum is 30.
+DROP TABLE t1;
+CREATE TABLE t1 (a int DEFAULT NULL, b int DEFAULT NULL);
+INSERT INTO t1 VALUES (3,30), (1,10), (2,10);
+SET @a= CAST(1 AS decimal);
+SELECT 1 FROM t1 GROUP BY @b := @a, @b;
+1
+1
+1
+DROP TABLE t1;
End of 5.0 tests
select cast(143.481 as decimal(4,1));
cast(143.481 as decimal(4,1))
diff --git a/mysql-test/r/type_ranges.result b/mysql-test/r/type_ranges.result
index ce5bb9ceb2f..22580c155f3 100644
--- a/mysql-test/r/type_ranges.result
+++ b/mysql-test/r/type_ranges.result
@@ -208,10 +208,6 @@ options flags
one one
drop table t2;
create table t2 select * from t1;
-Warnings:
-Warning 1265 Data truncated for column 'options' at row 4
-Warning 1265 Data truncated for column 'options' at row 5
-Warning 1265 Data truncated for column 'options' at row 6
update t2 set string="changed" where auto=16;
show full columns from t1;
Field Type Collation Null Key Default Extra Privileges Comment
diff --git a/mysql-test/r/type_time.result b/mysql-test/r/type_time.result
index ce820c0cb8e..d80a3973555 100644
--- a/mysql-test/r/type_time.result
+++ b/mysql-test/r/type_time.result
@@ -85,3 +85,46 @@ sec_to_time(time_to_sec(t))
13:00:00
09:00:00
drop table t1;
+select cast('100:55:50' as time) < cast('24:00:00' as time);
+cast('100:55:50' as time) < cast('24:00:00' as time)
+0
+select cast('100:55:50' as time) < cast('024:00:00' as time);
+cast('100:55:50' as time) < cast('024:00:00' as time)
+0
+select cast('300:55:50' as time) < cast('240:00:00' as time);
+cast('300:55:50' as time) < cast('240:00:00' as time)
+0
+select cast('100:55:50' as time) > cast('24:00:00' as time);
+cast('100:55:50' as time) > cast('24:00:00' as time)
+1
+select cast('100:55:50' as time) > cast('024:00:00' as time);
+cast('100:55:50' as time) > cast('024:00:00' as time)
+1
+select cast('300:55:50' as time) > cast('240:00:00' as time);
+cast('300:55:50' as time) > cast('240:00:00' as time)
+1
+create table t1 (f1 time);
+insert into t1 values ('24:00:00');
+select cast('24:00:00' as time) = (select f1 from t1);
+cast('24:00:00' as time) = (select f1 from t1)
+1
+drop table t1;
+create table t1(f1 time, f2 time);
+insert into t1 values('20:00:00','150:00:00');
+select 1 from t1 where cast('100:00:00' as time) between f1 and f2;
+1
+1
+drop table t1;
+CREATE TABLE t1 (
+f2 date NOT NULL,
+f3 int(11) unsigned NOT NULL default '0',
+PRIMARY KEY (f3, f2)
+);
+insert into t1 values('2007-07-01', 1);
+insert into t1 values('2007-07-01', 2);
+insert into t1 values('2007-07-02', 1);
+insert into t1 values('2007-07-02', 2);
+SELECT sum(f3) FROM t1 where f2='2007-07-01 00:00:00' group by f2;
+sum(f3)
+3
+drop table t1;
diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result
index c075a199dae..7caf7e78fe9 100644
--- a/mysql-test/r/type_timestamp.result
+++ b/mysql-test/r/type_timestamp.result
@@ -101,13 +101,13 @@ create table t1 (t2 timestamp(2), t4 timestamp(4), t6 timestamp(6),
t8 timestamp(8), t10 timestamp(10), t12 timestamp(12),
t14 timestamp(14));
Warnings:
-Warning 1543 The syntax 'TIMESTAMP(2)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead
-Warning 1543 The syntax 'TIMESTAMP(4)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead
-Warning 1543 The syntax 'TIMESTAMP(6)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead
-Warning 1543 The syntax 'TIMESTAMP(8)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead
-Warning 1543 The syntax 'TIMESTAMP(10)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead
-Warning 1543 The syntax 'TIMESTAMP(12)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead
-Warning 1543 The syntax 'TIMESTAMP(14)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead
+Warning 1287 The syntax 'TIMESTAMP(2)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead
+Warning 1287 The syntax 'TIMESTAMP(4)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead
+Warning 1287 The syntax 'TIMESTAMP(6)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead
+Warning 1287 The syntax 'TIMESTAMP(8)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead
+Warning 1287 The syntax 'TIMESTAMP(10)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead
+Warning 1287 The syntax 'TIMESTAMP(12)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead
+Warning 1287 The syntax 'TIMESTAMP(14)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead
insert t1 values (0,0,0,0,0,0,0),
("1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59",
"1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59",
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index cfad70a9bb5..06da93a9cc4 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -3497,6 +3497,53 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
DROP VIEW v1;
DROP TABLE t1;
+CREATE TABLE t1 (
+person_id int NOT NULL PRIMARY KEY,
+username varchar(40) default NULL,
+status_flg char(1) NOT NULL default 'A'
+);
+CREATE TABLE t2 (
+person_role_id int NOT NULL auto_increment PRIMARY KEY,
+role_id int NOT NULL,
+person_id int NOT NULL,
+INDEX idx_person_id (person_id),
+INDEX idx_role_id (role_id)
+);
+CREATE TABLE t3 (
+role_id int NOT NULL auto_increment PRIMARY KEY,
+role_name varchar(100) default NULL,
+app_name varchar(40) NOT NULL,
+INDEX idx_app_name(app_name)
+);
+CREATE VIEW v1 AS
+SELECT profile.person_id AS person_id
+FROM t1 profile, t2 userrole, t3 role
+WHERE userrole.person_id = profile.person_id AND
+role.role_id = userrole.role_id AND
+profile.status_flg = 'A'
+ ORDER BY profile.person_id,role.app_name,role.role_name;
+INSERT INTO t1 VALUES
+(6,'Sw','A'), (-1136332546,'ols','e'), (0,' *\n','0'),
+(-717462680,'ENTS Ta','0'), (-904346964,'ndard SQL\n','0');
+INSERT INTO t2 VALUES
+(1,3,6),(2,4,7),(3,5,8),(4,6,9),(5,1,6),(6,1,7),(7,1,8),(8,1,9),(9,1,10);
+INSERT INTO t3 VALUES
+(1,'NUCANS_APP_USER','NUCANSAPP'),(2,'NUCANS_TRGAPP_USER','NUCANSAPP'),
+(3,'IA_INTAKE_COORDINATOR','IACANS'),(4,'IA_SCREENER','IACANS'),
+(5,'IA_SUPERVISOR','IACANS'),(6,'IA_READONLY','IACANS'),
+(7,'SOC_USER','SOCCANS'),(8,'CAYIT_USER','CAYITCANS'),
+(9,'RTOS_DCFSPOS_SUPERVISOR','RTOS');
+EXPLAIN SELECT t.person_id AS a, t.person_id AS b FROM v1 t WHERE t.person_id=6;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE profile const PRIMARY PRIMARY 4 const 1 Using temporary; Using filesort
+1 SIMPLE userrole ref idx_person_id,idx_role_id idx_person_id 4 const 2
+1 SIMPLE role eq_ref PRIMARY PRIMARY 4 test.userrole.role_id 1
+SELECT t.person_id AS a, t.person_id AS b FROM v1 t WHERE t.person_id=6;
+a b
+6 6
+6 6
+DROP VIEW v1;
+DROP TABLE t1,t2,t3;
End of 5.0 tests.
DROP DATABASE IF EXISTS `d-1`;
CREATE DATABASE `d-1`;
diff --git a/mysql-test/r/warnings.result b/mysql-test/r/warnings.result
index 01b1c77887f..2929328a9b1 100644
--- a/mysql-test/r/warnings.result
+++ b/mysql-test/r/warnings.result
@@ -168,7 +168,7 @@ max_error_count 10
drop table t1;
set table_type=MYISAM;
Warnings:
-Warning 1543 The syntax 'table_type' is deprecated and will be removed in MySQL 5.2. Please use 'storage_engine' instead
+Warning 1287 The syntax 'table_type' is deprecated and will be removed in MySQL 5.2. Please use 'storage_engine' instead
create table t1 (a int);
insert into t1 (a) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
update t1 set a='abc';
diff --git a/mysql-test/r/windows_shm.result b/mysql-test/r/windows_shm.result
new file mode 100644
index 00000000000..c60049bece8
--- /dev/null
+++ b/mysql-test/r/windows_shm.result
@@ -0,0 +1,2 @@
+mysqld is alive
+End of 5.0 tests.
diff --git a/mysql-test/r/xml.result b/mysql-test/r/xml.result
index f71b8cadabb..95ad19a886f 100644
--- a/mysql-test/r/xml.result
+++ b/mysql-test/r/xml.result
@@ -647,32 +647,32 @@ select extractValue('<a>a','/a');
extractValue('<a>a','/a')
NULL
Warnings:
-Warning 1513 Incorrect XML value: 'parse error at line 1 pos 5: unexpected END-OF-INPUT'
+Warning 1522 Incorrect XML value: 'parse error at line 1 pos 5: unexpected END-OF-INPUT'
select extractValue('<a>a<','/a');
extractValue('<a>a<','/a')
NULL
Warnings:
-Warning 1513 Incorrect XML value: 'parse error at line 1 pos 6: END-OF-INPUT unexpected (ident or '/' wanted)'
+Warning 1522 Incorrect XML value: 'parse error at line 1 pos 6: END-OF-INPUT unexpected (ident or '/' wanted)'
select extractValue('<a>a</','/a');
extractValue('<a>a</','/a')
NULL
Warnings:
-Warning 1513 Incorrect XML value: 'parse error at line 1 pos 7: END-OF-INPUT unexpected (ident wanted)'
+Warning 1522 Incorrect XML value: 'parse error at line 1 pos 7: END-OF-INPUT unexpected (ident wanted)'
select extractValue('<a>a</a','/a');
extractValue('<a>a</a','/a')
NULL
Warnings:
-Warning 1513 Incorrect XML value: 'parse error at line 1 pos 8: END-OF-INPUT unexpected ('>' wanted)'
+Warning 1522 Incorrect XML value: 'parse error at line 1 pos 8: END-OF-INPUT unexpected ('>' wanted)'
select extractValue('<a>a</a></b>','/a');
extractValue('<a>a</a></b>','/a')
NULL
Warnings:
-Warning 1513 Incorrect XML value: 'parse error at line 1 pos 12: '</b>' unexpected (END-OF-INPUT wanted)'
+Warning 1522 Incorrect XML value: 'parse error at line 1 pos 12: '</b>' unexpected (END-OF-INPUT wanted)'
select extractValue('<a b=>a</a>','/a');
extractValue('<a b=>a</a>','/a')
NULL
Warnings:
-Warning 1513 Incorrect XML value: 'parse error at line 1 pos 7: '>' unexpected (ident or string wanted)'
+Warning 1522 Incorrect XML value: 'parse error at line 1 pos 7: '>' unexpected (ident or string wanted)'
select extractValue('<e>1</e>','position()');
ERROR HY000: XPATH syntax error: ''
select extractValue('<e>1</e>','last()');
@@ -723,17 +723,17 @@ select extractValue('<zot><tim0><01>10:39:15</01><02>140</02></tim0></zot>','//*
extractValue('<zot><tim0><01>10:39:15</01><02>140</02></tim0></zot>','//*')
NULL
Warnings:
-Warning 1513 Incorrect XML value: 'parse error at line 1 pos 13: unknown token unexpected (ident or '/' wanted)'
+Warning 1522 Incorrect XML value: 'parse error at line 1 pos 13: unknown token unexpected (ident or '/' wanted)'
select extractValue('<.>test</.>','//*');
extractValue('<.>test</.>','//*')
NULL
Warnings:
-Warning 1513 Incorrect XML value: 'parse error at line 1 pos 2: unknown token unexpected (ident or '/' wanted)'
+Warning 1522 Incorrect XML value: 'parse error at line 1 pos 2: unknown token unexpected (ident or '/' wanted)'
select extractValue('<->test</->','//*');
extractValue('<->test</->','//*')
NULL
Warnings:
-Warning 1513 Incorrect XML value: 'parse error at line 1 pos 2: unknown token unexpected (ident or '/' wanted)'
+Warning 1522 Incorrect XML value: 'parse error at line 1 pos 2: unknown token unexpected (ident or '/' wanted)'
select extractValue('<:>test</:>','//*');
extractValue('<:>test</:>','//*')
test
diff --git a/mysql-test/r/binlog_innodb.result b/mysql-test/suite/binlog/r/binlog_innodb.result
index 9dfb6544811..9dfb6544811 100644
--- a/mysql-test/r/binlog_innodb.result
+++ b/mysql-test/suite/binlog/r/binlog_innodb.result
diff --git a/mysql-test/r/binlog_killed.result b/mysql-test/suite/binlog/r/binlog_killed.result
index ba4f38fb4c1..ba4f38fb4c1 100644
--- a/mysql-test/r/binlog_killed.result
+++ b/mysql-test/suite/binlog/r/binlog_killed.result
diff --git a/mysql-test/r/binlog_multi_engine.result b/mysql-test/suite/binlog/r/binlog_multi_engine.result
index 67c3412ec15..67c3412ec15 100644
--- a/mysql-test/r/binlog_multi_engine.result
+++ b/mysql-test/suite/binlog/r/binlog_multi_engine.result
diff --git a/mysql-test/suite/binlog/r/binlog_row_binlog.result b/mysql-test/suite/binlog/r/binlog_row_binlog.result
new file mode 100644
index 00000000000..1d1656889f4
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_row_binlog.result
@@ -0,0 +1,1177 @@
+drop table if exists t1, t2;
+reset master;
+create table t1 (a int) engine=innodb;
+create table t2 (a int) engine=innodb;
+begin;
+insert t1 values (5);
+commit;
+begin;
+insert t2 values (5);
+commit;
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; create table t1 (a int) engine=innodb
+master-bin.000001 # Query # # use `test`; create table t2 (a int) engine=innodb
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t2)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid # # COMMIT /* XID */
+drop table t1,t2;
+reset master;
+create table t1 (n int) engine=innodb;
+begin;
+commit;
+drop table t1;
+show binlog events in 'master-bin.000001' from 106;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query 1 # use `test`; create table t1 (n int) engine=innodb
+master-bin.000001 # Query 1 # use `test`; BEGIN
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map 1 # table_id: # (test.t1)
+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
+master-bin.000001 # Xid 1 # COMMIT /* xid= */
+master-bin.000001 # Rotate 1 # master-bin.000002;pos=4
+show binlog events in 'master-bin.000002' from 106;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Query 1 # use `test`; drop table t1
+set @ac = @@autocommit;
+set autocommit= 0;
+reset master;
+create table t1(n int) engine=innodb;
+begin;
+insert into t1 values (1);
+insert into t1 values (2);
+insert into t1 values (3);
+commit;
+drop table t1;
+show binlog events from 0;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4
+master-bin.000001 106 Query 1 205 use `test`; create table t1(n int) engine=innodb
+master-bin.000001 205 Query 1 273 use `test`; BEGIN
+master-bin.000001 273 Table_map 1 312 table_id: # (test.t1)
+master-bin.000001 312 Write_rows 1 346 table_id: # flags: STMT_END_F
+master-bin.000001 346 Table_map 1 385 table_id: # (test.t1)
+master-bin.000001 385 Write_rows 1 419 table_id: # flags: STMT_END_F
+master-bin.000001 419 Table_map 1 458 table_id: # (test.t1)
+master-bin.000001 458 Write_rows 1 492 table_id: # flags: STMT_END_F
+master-bin.000001 492 Xid 1 519 COMMIT /* XID */
+master-bin.000001 519 Query 1 595 use `test`; drop table t1
+set @bcs = @@binlog_cache_size;
+set global binlog_cache_size=4096;
+reset master;
+create table t1 (a int) engine=innodb;
+show binlog events from 0;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4
+master-bin.000001 106 Query 1 206 use `test`; create table t1 (a int) engine=innodb
+master-bin.000001 206 Query 1 274 use `test`; BEGIN
+master-bin.000001 274 Table_map 1 313 table_id: # (test.t1)
+master-bin.000001 313 Write_rows 1 347 table_id: # flags: STMT_END_F
+master-bin.000001 347 Table_map 1 386 table_id: # (test.t1)
+master-bin.000001 386 Write_rows 1 420 table_id: # flags: STMT_END_F
+master-bin.000001 420 Table_map 1 459 table_id: # (test.t1)
+master-bin.000001 459 Write_rows 1 493 table_id: # flags: STMT_END_F
+master-bin.000001 493 Table_map 1 532 table_id: # (test.t1)
+master-bin.000001 532 Write_rows 1 566 table_id: # flags: STMT_END_F
+master-bin.000001 566 Table_map 1 605 table_id: # (test.t1)
+master-bin.000001 605 Write_rows 1 639 table_id: # flags: STMT_END_F
+master-bin.000001 639 Table_map 1 678 table_id: # (test.t1)
+master-bin.000001 678 Write_rows 1 712 table_id: # flags: STMT_END_F
+master-bin.000001 712 Table_map 1 751 table_id: # (test.t1)
+master-bin.000001 751 Write_rows 1 785 table_id: # flags: STMT_END_F
+master-bin.000001 785 Table_map 1 824 table_id: # (test.t1)
+master-bin.000001 824 Write_rows 1 858 table_id: # flags: STMT_END_F
+master-bin.000001 858 Table_map 1 897 table_id: # (test.t1)
+master-bin.000001 897 Write_rows 1 931 table_id: # flags: STMT_END_F
+master-bin.000001 931 Table_map 1 970 table_id: # (test.t1)
+master-bin.000001 970 Write_rows 1 1004 table_id: # flags: STMT_END_F
+master-bin.000001 1004 Table_map 1 1043 table_id: # (test.t1)
+master-bin.000001 1043 Write_rows 1 1077 table_id: # flags: STMT_END_F
+master-bin.000001 1077 Table_map 1 1116 table_id: # (test.t1)
+master-bin.000001 1116 Write_rows 1 1150 table_id: # flags: STMT_END_F
+master-bin.000001 1150 Table_map 1 1189 table_id: # (test.t1)
+master-bin.000001 1189 Write_rows 1 1223 table_id: # flags: STMT_END_F
+master-bin.000001 1223 Table_map 1 1262 table_id: # (test.t1)
+master-bin.000001 1262 Write_rows 1 1296 table_id: # flags: STMT_END_F
+master-bin.000001 1296 Table_map 1 1335 table_id: # (test.t1)
+master-bin.000001 1335 Write_rows 1 1369 table_id: # flags: STMT_END_F
+master-bin.000001 1369 Table_map 1 1408 table_id: # (test.t1)
+master-bin.000001 1408 Write_rows 1 1442 table_id: # flags: STMT_END_F
+master-bin.000001 1442 Table_map 1 1481 table_id: # (test.t1)
+master-bin.000001 1481 Write_rows 1 1515 table_id: # flags: STMT_END_F
+master-bin.000001 1515 Table_map 1 1554 table_id: # (test.t1)
+master-bin.000001 1554 Write_rows 1 1588 table_id: # flags: STMT_END_F
+master-bin.000001 1588 Table_map 1 1627 table_id: # (test.t1)
+master-bin.000001 1627 Write_rows 1 1661 table_id: # flags: STMT_END_F
+master-bin.000001 1661 Table_map 1 1700 table_id: # (test.t1)
+master-bin.000001 1700 Write_rows 1 1734 table_id: # flags: STMT_END_F
+master-bin.000001 1734 Table_map 1 1773 table_id: # (test.t1)
+master-bin.000001 1773 Write_rows 1 1807 table_id: # flags: STMT_END_F
+master-bin.000001 1807 Table_map 1 1846 table_id: # (test.t1)
+master-bin.000001 1846 Write_rows 1 1880 table_id: # flags: STMT_END_F
+master-bin.000001 1880 Table_map 1 1919 table_id: # (test.t1)
+master-bin.000001 1919 Write_rows 1 1953 table_id: # flags: STMT_END_F
+master-bin.000001 1953 Table_map 1 1992 table_id: # (test.t1)
+master-bin.000001 1992 Write_rows 1 2026 table_id: # flags: STMT_END_F
+master-bin.000001 2026 Table_map 1 2065 table_id: # (test.t1)
+master-bin.000001 2065 Write_rows 1 2099 table_id: # flags: STMT_END_F
+master-bin.000001 2099 Table_map 1 2138 table_id: # (test.t1)
+master-bin.000001 2138 Write_rows 1 2172 table_id: # flags: STMT_END_F
+master-bin.000001 2172 Table_map 1 2211 table_id: # (test.t1)
+master-bin.000001 2211 Write_rows 1 2245 table_id: # flags: STMT_END_F
+master-bin.000001 2245 Table_map 1 2284 table_id: # (test.t1)
+master-bin.000001 2284 Write_rows 1 2318 table_id: # flags: STMT_END_F
+master-bin.000001 2318 Table_map 1 2357 table_id: # (test.t1)
+master-bin.000001 2357 Write_rows 1 2391 table_id: # flags: STMT_END_F
+master-bin.000001 2391 Table_map 1 2430 table_id: # (test.t1)
+master-bin.000001 2430 Write_rows 1 2464 table_id: # flags: STMT_END_F
+master-bin.000001 2464 Table_map 1 2503 table_id: # (test.t1)
+master-bin.000001 2503 Write_rows 1 2537 table_id: # flags: STMT_END_F
+master-bin.000001 2537 Table_map 1 2576 table_id: # (test.t1)
+master-bin.000001 2576 Write_rows 1 2610 table_id: # flags: STMT_END_F
+master-bin.000001 2610 Table_map 1 2649 table_id: # (test.t1)
+master-bin.000001 2649 Write_rows 1 2683 table_id: # flags: STMT_END_F
+master-bin.000001 2683 Table_map 1 2722 table_id: # (test.t1)
+master-bin.000001 2722 Write_rows 1 2756 table_id: # flags: STMT_END_F
+master-bin.000001 2756 Table_map 1 2795 table_id: # (test.t1)
+master-bin.000001 2795 Write_rows 1 2829 table_id: # flags: STMT_END_F
+master-bin.000001 2829 Table_map 1 2868 table_id: # (test.t1)
+master-bin.000001 2868 Write_rows 1 2902 table_id: # flags: STMT_END_F
+master-bin.000001 2902 Table_map 1 2941 table_id: # (test.t1)
+master-bin.000001 2941 Write_rows 1 2975 table_id: # flags: STMT_END_F
+master-bin.000001 2975 Table_map 1 3014 table_id: # (test.t1)
+master-bin.000001 3014 Write_rows 1 3048 table_id: # flags: STMT_END_F
+master-bin.000001 3048 Table_map 1 3087 table_id: # (test.t1)
+master-bin.000001 3087 Write_rows 1 3121 table_id: # flags: STMT_END_F
+master-bin.000001 3121 Table_map 1 3160 table_id: # (test.t1)
+master-bin.000001 3160 Write_rows 1 3194 table_id: # flags: STMT_END_F
+master-bin.000001 3194 Table_map 1 3233 table_id: # (test.t1)
+master-bin.000001 3233 Write_rows 1 3267 table_id: # flags: STMT_END_F
+master-bin.000001 3267 Table_map 1 3306 table_id: # (test.t1)
+master-bin.000001 3306 Write_rows 1 3340 table_id: # flags: STMT_END_F
+master-bin.000001 3340 Table_map 1 3379 table_id: # (test.t1)
+master-bin.000001 3379 Write_rows 1 3413 table_id: # flags: STMT_END_F
+master-bin.000001 3413 Table_map 1 3452 table_id: # (test.t1)
+master-bin.000001 3452 Write_rows 1 3486 table_id: # flags: STMT_END_F
+master-bin.000001 3486 Table_map 1 3525 table_id: # (test.t1)
+master-bin.000001 3525 Write_rows 1 3559 table_id: # flags: STMT_END_F
+master-bin.000001 3559 Table_map 1 3598 table_id: # (test.t1)
+master-bin.000001 3598 Write_rows 1 3632 table_id: # flags: STMT_END_F
+master-bin.000001 3632 Table_map 1 3671 table_id: # (test.t1)
+master-bin.000001 3671 Write_rows 1 3705 table_id: # flags: STMT_END_F
+master-bin.000001 3705 Table_map 1 3744 table_id: # (test.t1)
+master-bin.000001 3744 Write_rows 1 3778 table_id: # flags: STMT_END_F
+master-bin.000001 3778 Table_map 1 3817 table_id: # (test.t1)
+master-bin.000001 3817 Write_rows 1 3851 table_id: # flags: STMT_END_F
+master-bin.000001 3851 Table_map 1 3890 table_id: # (test.t1)
+master-bin.000001 3890 Write_rows 1 3924 table_id: # flags: STMT_END_F
+master-bin.000001 3924 Table_map 1 3963 table_id: # (test.t1)
+master-bin.000001 3963 Write_rows 1 3997 table_id: # flags: STMT_END_F
+master-bin.000001 3997 Table_map 1 4036 table_id: # (test.t1)
+master-bin.000001 4036 Write_rows 1 4070 table_id: # flags: STMT_END_F
+master-bin.000001 4070 Table_map 1 4109 table_id: # (test.t1)
+master-bin.000001 4109 Write_rows 1 4143 table_id: # flags: STMT_END_F
+master-bin.000001 4143 Table_map 1 4182 table_id: # (test.t1)
+master-bin.000001 4182 Write_rows 1 4216 table_id: # flags: STMT_END_F
+master-bin.000001 4216 Table_map 1 4255 table_id: # (test.t1)
+master-bin.000001 4255 Write_rows 1 4289 table_id: # flags: STMT_END_F
+master-bin.000001 4289 Table_map 1 4328 table_id: # (test.t1)
+master-bin.000001 4328 Write_rows 1 4362 table_id: # flags: STMT_END_F
+master-bin.000001 4362 Table_map 1 4401 table_id: # (test.t1)
+master-bin.000001 4401 Write_rows 1 4435 table_id: # flags: STMT_END_F
+master-bin.000001 4435 Table_map 1 4474 table_id: # (test.t1)
+master-bin.000001 4474 Write_rows 1 4508 table_id: # flags: STMT_END_F
+master-bin.000001 4508 Table_map 1 4547 table_id: # (test.t1)
+master-bin.000001 4547 Write_rows 1 4581 table_id: # flags: STMT_END_F
+master-bin.000001 4581 Table_map 1 4620 table_id: # (test.t1)
+master-bin.000001 4620 Write_rows 1 4654 table_id: # flags: STMT_END_F
+master-bin.000001 4654 Table_map 1 4693 table_id: # (test.t1)
+master-bin.000001 4693 Write_rows 1 4727 table_id: # flags: STMT_END_F
+master-bin.000001 4727 Table_map 1 4766 table_id: # (test.t1)
+master-bin.000001 4766 Write_rows 1 4800 table_id: # flags: STMT_END_F
+master-bin.000001 4800 Table_map 1 4839 table_id: # (test.t1)
+master-bin.000001 4839 Write_rows 1 4873 table_id: # flags: STMT_END_F
+master-bin.000001 4873 Table_map 1 4912 table_id: # (test.t1)
+master-bin.000001 4912 Write_rows 1 4946 table_id: # flags: STMT_END_F
+master-bin.000001 4946 Table_map 1 4985 table_id: # (test.t1)
+master-bin.000001 4985 Write_rows 1 5019 table_id: # flags: STMT_END_F
+master-bin.000001 5019 Table_map 1 5058 table_id: # (test.t1)
+master-bin.000001 5058 Write_rows 1 5092 table_id: # flags: STMT_END_F
+master-bin.000001 5092 Table_map 1 5131 table_id: # (test.t1)
+master-bin.000001 5131 Write_rows 1 5165 table_id: # flags: STMT_END_F
+master-bin.000001 5165 Table_map 1 5204 table_id: # (test.t1)
+master-bin.000001 5204 Write_rows 1 5238 table_id: # flags: STMT_END_F
+master-bin.000001 5238 Table_map 1 5277 table_id: # (test.t1)
+master-bin.000001 5277 Write_rows 1 5311 table_id: # flags: STMT_END_F
+master-bin.000001 5311 Table_map 1 5350 table_id: # (test.t1)
+master-bin.000001 5350 Write_rows 1 5384 table_id: # flags: STMT_END_F
+master-bin.000001 5384 Table_map 1 5423 table_id: # (test.t1)
+master-bin.000001 5423 Write_rows 1 5457 table_id: # flags: STMT_END_F
+master-bin.000001 5457 Table_map 1 5496 table_id: # (test.t1)
+master-bin.000001 5496 Write_rows 1 5530 table_id: # flags: STMT_END_F
+master-bin.000001 5530 Table_map 1 5569 table_id: # (test.t1)
+master-bin.000001 5569 Write_rows 1 5603 table_id: # flags: STMT_END_F
+master-bin.000001 5603 Table_map 1 5642 table_id: # (test.t1)
+master-bin.000001 5642 Write_rows 1 5676 table_id: # flags: STMT_END_F
+master-bin.000001 5676 Table_map 1 5715 table_id: # (test.t1)
+master-bin.000001 5715 Write_rows 1 5749 table_id: # flags: STMT_END_F
+master-bin.000001 5749 Table_map 1 5788 table_id: # (test.t1)
+master-bin.000001 5788 Write_rows 1 5822 table_id: # flags: STMT_END_F
+master-bin.000001 5822 Table_map 1 5861 table_id: # (test.t1)
+master-bin.000001 5861 Write_rows 1 5895 table_id: # flags: STMT_END_F
+master-bin.000001 5895 Table_map 1 5934 table_id: # (test.t1)
+master-bin.000001 5934 Write_rows 1 5968 table_id: # flags: STMT_END_F
+master-bin.000001 5968 Table_map 1 6007 table_id: # (test.t1)
+master-bin.000001 6007 Write_rows 1 6041 table_id: # flags: STMT_END_F
+master-bin.000001 6041 Table_map 1 6080 table_id: # (test.t1)
+master-bin.000001 6080 Write_rows 1 6114 table_id: # flags: STMT_END_F
+master-bin.000001 6114 Table_map 1 6153 table_id: # (test.t1)
+master-bin.000001 6153 Write_rows 1 6187 table_id: # flags: STMT_END_F
+master-bin.000001 6187 Table_map 1 6226 table_id: # (test.t1)
+master-bin.000001 6226 Write_rows 1 6260 table_id: # flags: STMT_END_F
+master-bin.000001 6260 Table_map 1 6299 table_id: # (test.t1)
+master-bin.000001 6299 Write_rows 1 6333 table_id: # flags: STMT_END_F
+master-bin.000001 6333 Table_map 1 6372 table_id: # (test.t1)
+master-bin.000001 6372 Write_rows 1 6406 table_id: # flags: STMT_END_F
+master-bin.000001 6406 Table_map 1 6445 table_id: # (test.t1)
+master-bin.000001 6445 Write_rows 1 6479 table_id: # flags: STMT_END_F
+master-bin.000001 6479 Table_map 1 6518 table_id: # (test.t1)
+master-bin.000001 6518 Write_rows 1 6552 table_id: # flags: STMT_END_F
+master-bin.000001 6552 Table_map 1 6591 table_id: # (test.t1)
+master-bin.000001 6591 Write_rows 1 6625 table_id: # flags: STMT_END_F
+master-bin.000001 6625 Table_map 1 6664 table_id: # (test.t1)
+master-bin.000001 6664 Write_rows 1 6698 table_id: # flags: STMT_END_F
+master-bin.000001 6698 Table_map 1 6737 table_id: # (test.t1)
+master-bin.000001 6737 Write_rows 1 6771 table_id: # flags: STMT_END_F
+master-bin.000001 6771 Table_map 1 6810 table_id: # (test.t1)
+master-bin.000001 6810 Write_rows 1 6844 table_id: # flags: STMT_END_F
+master-bin.000001 6844 Table_map 1 6883 table_id: # (test.t1)
+master-bin.000001 6883 Write_rows 1 6917 table_id: # flags: STMT_END_F
+master-bin.000001 6917 Table_map 1 6956 table_id: # (test.t1)
+master-bin.000001 6956 Write_rows 1 6990 table_id: # flags: STMT_END_F
+master-bin.000001 6990 Table_map 1 7029 table_id: # (test.t1)
+master-bin.000001 7029 Write_rows 1 7063 table_id: # flags: STMT_END_F
+master-bin.000001 7063 Table_map 1 7102 table_id: # (test.t1)
+master-bin.000001 7102 Write_rows 1 7136 table_id: # flags: STMT_END_F
+master-bin.000001 7136 Table_map 1 7175 table_id: # (test.t1)
+master-bin.000001 7175 Write_rows 1 7209 table_id: # flags: STMT_END_F
+master-bin.000001 7209 Table_map 1 7248 table_id: # (test.t1)
+master-bin.000001 7248 Write_rows 1 7282 table_id: # flags: STMT_END_F
+master-bin.000001 7282 Table_map 1 7321 table_id: # (test.t1)
+master-bin.000001 7321 Write_rows 1 7355 table_id: # flags: STMT_END_F
+master-bin.000001 7355 Table_map 1 7394 table_id: # (test.t1)
+master-bin.000001 7394 Write_rows 1 7428 table_id: # flags: STMT_END_F
+master-bin.000001 7428 Table_map 1 7467 table_id: # (test.t1)
+master-bin.000001 7467 Write_rows 1 7501 table_id: # flags: STMT_END_F
+master-bin.000001 7501 Table_map 1 7540 table_id: # (test.t1)
+master-bin.000001 7540 Write_rows 1 7574 table_id: # flags: STMT_END_F
+master-bin.000001 7574 Table_map 1 7613 table_id: # (test.t1)
+master-bin.000001 7613 Write_rows 1 7647 table_id: # flags: STMT_END_F
+master-bin.000001 7647 Table_map 1 7686 table_id: # (test.t1)
+master-bin.000001 7686 Write_rows 1 7720 table_id: # flags: STMT_END_F
+master-bin.000001 7720 Table_map 1 7759 table_id: # (test.t1)
+master-bin.000001 7759 Write_rows 1 7793 table_id: # flags: STMT_END_F
+master-bin.000001 7793 Table_map 1 7832 table_id: # (test.t1)
+master-bin.000001 7832 Write_rows 1 7866 table_id: # flags: STMT_END_F
+master-bin.000001 7866 Table_map 1 7905 table_id: # (test.t1)
+master-bin.000001 7905 Write_rows 1 7939 table_id: # flags: STMT_END_F
+master-bin.000001 7939 Table_map 1 7978 table_id: # (test.t1)
+master-bin.000001 7978 Write_rows 1 8012 table_id: # flags: STMT_END_F
+master-bin.000001 8012 Table_map 1 8051 table_id: # (test.t1)
+master-bin.000001 8051 Write_rows 1 8085 table_id: # flags: STMT_END_F
+master-bin.000001 8085 Table_map 1 8124 table_id: # (test.t1)
+master-bin.000001 8124 Write_rows 1 8158 table_id: # flags: STMT_END_F
+master-bin.000001 8158 Table_map 1 8197 table_id: # (test.t1)
+master-bin.000001 8197 Write_rows 1 8231 table_id: # flags: STMT_END_F
+master-bin.000001 8231 Table_map 1 8270 table_id: # (test.t1)
+master-bin.000001 8270 Write_rows 1 8304 table_id: # flags: STMT_END_F
+master-bin.000001 8304 Table_map 1 8343 table_id: # (test.t1)
+master-bin.000001 8343 Write_rows 1 8377 table_id: # flags: STMT_END_F
+master-bin.000001 8377 Table_map 1 8416 table_id: # (test.t1)
+master-bin.000001 8416 Write_rows 1 8450 table_id: # flags: STMT_END_F
+master-bin.000001 8450 Table_map 1 8489 table_id: # (test.t1)
+master-bin.000001 8489 Write_rows 1 8523 table_id: # flags: STMT_END_F
+master-bin.000001 8523 Table_map 1 8562 table_id: # (test.t1)
+master-bin.000001 8562 Write_rows 1 8596 table_id: # flags: STMT_END_F
+master-bin.000001 8596 Table_map 1 8635 table_id: # (test.t1)
+master-bin.000001 8635 Write_rows 1 8669 table_id: # flags: STMT_END_F
+master-bin.000001 8669 Table_map 1 8708 table_id: # (test.t1)
+master-bin.000001 8708 Write_rows 1 8742 table_id: # flags: STMT_END_F
+master-bin.000001 8742 Table_map 1 8781 table_id: # (test.t1)
+master-bin.000001 8781 Write_rows 1 8815 table_id: # flags: STMT_END_F
+master-bin.000001 8815 Table_map 1 8854 table_id: # (test.t1)
+master-bin.000001 8854 Write_rows 1 8888 table_id: # flags: STMT_END_F
+master-bin.000001 8888 Table_map 1 8927 table_id: # (test.t1)
+master-bin.000001 8927 Write_rows 1 8961 table_id: # flags: STMT_END_F
+master-bin.000001 8961 Table_map 1 9000 table_id: # (test.t1)
+master-bin.000001 9000 Write_rows 1 9034 table_id: # flags: STMT_END_F
+master-bin.000001 9034 Table_map 1 9073 table_id: # (test.t1)
+master-bin.000001 9073 Write_rows 1 9107 table_id: # flags: STMT_END_F
+master-bin.000001 9107 Table_map 1 9146 table_id: # (test.t1)
+master-bin.000001 9146 Write_rows 1 9180 table_id: # flags: STMT_END_F
+master-bin.000001 9180 Table_map 1 9219 table_id: # (test.t1)
+master-bin.000001 9219 Write_rows 1 9253 table_id: # flags: STMT_END_F
+master-bin.000001 9253 Table_map 1 9292 table_id: # (test.t1)
+master-bin.000001 9292 Write_rows 1 9326 table_id: # flags: STMT_END_F
+master-bin.000001 9326 Table_map 1 9365 table_id: # (test.t1)
+master-bin.000001 9365 Write_rows 1 9399 table_id: # flags: STMT_END_F
+master-bin.000001 9399 Table_map 1 9438 table_id: # (test.t1)
+master-bin.000001 9438 Write_rows 1 9472 table_id: # flags: STMT_END_F
+master-bin.000001 9472 Table_map 1 9511 table_id: # (test.t1)
+master-bin.000001 9511 Write_rows 1 9545 table_id: # flags: STMT_END_F
+master-bin.000001 9545 Table_map 1 9584 table_id: # (test.t1)
+master-bin.000001 9584 Write_rows 1 9618 table_id: # flags: STMT_END_F
+master-bin.000001 9618 Table_map 1 9657 table_id: # (test.t1)
+master-bin.000001 9657 Write_rows 1 9691 table_id: # flags: STMT_END_F
+master-bin.000001 9691 Table_map 1 9730 table_id: # (test.t1)
+master-bin.000001 9730 Write_rows 1 9764 table_id: # flags: STMT_END_F
+master-bin.000001 9764 Table_map 1 9803 table_id: # (test.t1)
+master-bin.000001 9803 Write_rows 1 9837 table_id: # flags: STMT_END_F
+master-bin.000001 9837 Table_map 1 9876 table_id: # (test.t1)
+master-bin.000001 9876 Write_rows 1 9910 table_id: # flags: STMT_END_F
+master-bin.000001 9910 Table_map 1 9949 table_id: # (test.t1)
+master-bin.000001 9949 Write_rows 1 9983 table_id: # flags: STMT_END_F
+master-bin.000001 9983 Table_map 1 10022 table_id: # (test.t1)
+master-bin.000001 10022 Write_rows 1 10056 table_id: # flags: STMT_END_F
+master-bin.000001 10056 Table_map 1 10095 table_id: # (test.t1)
+master-bin.000001 10095 Write_rows 1 10129 table_id: # flags: STMT_END_F
+master-bin.000001 10129 Table_map 1 10168 table_id: # (test.t1)
+master-bin.000001 10168 Write_rows 1 10202 table_id: # flags: STMT_END_F
+master-bin.000001 10202 Table_map 1 10241 table_id: # (test.t1)
+master-bin.000001 10241 Write_rows 1 10275 table_id: # flags: STMT_END_F
+master-bin.000001 10275 Table_map 1 10314 table_id: # (test.t1)
+master-bin.000001 10314 Write_rows 1 10348 table_id: # flags: STMT_END_F
+master-bin.000001 10348 Table_map 1 10387 table_id: # (test.t1)
+master-bin.000001 10387 Write_rows 1 10421 table_id: # flags: STMT_END_F
+master-bin.000001 10421 Table_map 1 10460 table_id: # (test.t1)
+master-bin.000001 10460 Write_rows 1 10494 table_id: # flags: STMT_END_F
+master-bin.000001 10494 Table_map 1 10533 table_id: # (test.t1)
+master-bin.000001 10533 Write_rows 1 10567 table_id: # flags: STMT_END_F
+master-bin.000001 10567 Table_map 1 10606 table_id: # (test.t1)
+master-bin.000001 10606 Write_rows 1 10640 table_id: # flags: STMT_END_F
+master-bin.000001 10640 Table_map 1 10679 table_id: # (test.t1)
+master-bin.000001 10679 Write_rows 1 10713 table_id: # flags: STMT_END_F
+master-bin.000001 10713 Table_map 1 10752 table_id: # (test.t1)
+master-bin.000001 10752 Write_rows 1 10786 table_id: # flags: STMT_END_F
+master-bin.000001 10786 Table_map 1 10825 table_id: # (test.t1)
+master-bin.000001 10825 Write_rows 1 10859 table_id: # flags: STMT_END_F
+master-bin.000001 10859 Table_map 1 10898 table_id: # (test.t1)
+master-bin.000001 10898 Write_rows 1 10932 table_id: # flags: STMT_END_F
+master-bin.000001 10932 Table_map 1 10971 table_id: # (test.t1)
+master-bin.000001 10971 Write_rows 1 11005 table_id: # flags: STMT_END_F
+master-bin.000001 11005 Table_map 1 11044 table_id: # (test.t1)
+master-bin.000001 11044 Write_rows 1 11078 table_id: # flags: STMT_END_F
+master-bin.000001 11078 Table_map 1 11117 table_id: # (test.t1)
+master-bin.000001 11117 Write_rows 1 11151 table_id: # flags: STMT_END_F
+master-bin.000001 11151 Table_map 1 11190 table_id: # (test.t1)
+master-bin.000001 11190 Write_rows 1 11224 table_id: # flags: STMT_END_F
+master-bin.000001 11224 Table_map 1 11263 table_id: # (test.t1)
+master-bin.000001 11263 Write_rows 1 11297 table_id: # flags: STMT_END_F
+master-bin.000001 11297 Table_map 1 11336 table_id: # (test.t1)
+master-bin.000001 11336 Write_rows 1 11370 table_id: # flags: STMT_END_F
+master-bin.000001 11370 Table_map 1 11409 table_id: # (test.t1)
+master-bin.000001 11409 Write_rows 1 11443 table_id: # flags: STMT_END_F
+master-bin.000001 11443 Table_map 1 11482 table_id: # (test.t1)
+master-bin.000001 11482 Write_rows 1 11516 table_id: # flags: STMT_END_F
+master-bin.000001 11516 Table_map 1 11555 table_id: # (test.t1)
+master-bin.000001 11555 Write_rows 1 11589 table_id: # flags: STMT_END_F
+master-bin.000001 11589 Table_map 1 11628 table_id: # (test.t1)
+master-bin.000001 11628 Write_rows 1 11662 table_id: # flags: STMT_END_F
+master-bin.000001 11662 Table_map 1 11701 table_id: # (test.t1)
+master-bin.000001 11701 Write_rows 1 11735 table_id: # flags: STMT_END_F
+master-bin.000001 11735 Table_map 1 11774 table_id: # (test.t1)
+master-bin.000001 11774 Write_rows 1 11808 table_id: # flags: STMT_END_F
+master-bin.000001 11808 Table_map 1 11847 table_id: # (test.t1)
+master-bin.000001 11847 Write_rows 1 11881 table_id: # flags: STMT_END_F
+master-bin.000001 11881 Table_map 1 11920 table_id: # (test.t1)
+master-bin.000001 11920 Write_rows 1 11954 table_id: # flags: STMT_END_F
+master-bin.000001 11954 Table_map 1 11993 table_id: # (test.t1)
+master-bin.000001 11993 Write_rows 1 12027 table_id: # flags: STMT_END_F
+master-bin.000001 12027 Table_map 1 12066 table_id: # (test.t1)
+master-bin.000001 12066 Write_rows 1 12100 table_id: # flags: STMT_END_F
+master-bin.000001 12100 Table_map 1 12139 table_id: # (test.t1)
+master-bin.000001 12139 Write_rows 1 12173 table_id: # flags: STMT_END_F
+master-bin.000001 12173 Table_map 1 12212 table_id: # (test.t1)
+master-bin.000001 12212 Write_rows 1 12246 table_id: # flags: STMT_END_F
+master-bin.000001 12246 Table_map 1 12285 table_id: # (test.t1)
+master-bin.000001 12285 Write_rows 1 12319 table_id: # flags: STMT_END_F
+master-bin.000001 12319 Table_map 1 12358 table_id: # (test.t1)
+master-bin.000001 12358 Write_rows 1 12392 table_id: # flags: STMT_END_F
+master-bin.000001 12392 Table_map 1 12431 table_id: # (test.t1)
+master-bin.000001 12431 Write_rows 1 12465 table_id: # flags: STMT_END_F
+master-bin.000001 12465 Table_map 1 12504 table_id: # (test.t1)
+master-bin.000001 12504 Write_rows 1 12538 table_id: # flags: STMT_END_F
+master-bin.000001 12538 Table_map 1 12577 table_id: # (test.t1)
+master-bin.000001 12577 Write_rows 1 12611 table_id: # flags: STMT_END_F
+master-bin.000001 12611 Table_map 1 12650 table_id: # (test.t1)
+master-bin.000001 12650 Write_rows 1 12684 table_id: # flags: STMT_END_F
+master-bin.000001 12684 Table_map 1 12723 table_id: # (test.t1)
+master-bin.000001 12723 Write_rows 1 12757 table_id: # flags: STMT_END_F
+master-bin.000001 12757 Table_map 1 12796 table_id: # (test.t1)
+master-bin.000001 12796 Write_rows 1 12830 table_id: # flags: STMT_END_F
+master-bin.000001 12830 Table_map 1 12869 table_id: # (test.t1)
+master-bin.000001 12869 Write_rows 1 12903 table_id: # flags: STMT_END_F
+master-bin.000001 12903 Table_map 1 12942 table_id: # (test.t1)
+master-bin.000001 12942 Write_rows 1 12976 table_id: # flags: STMT_END_F
+master-bin.000001 12976 Table_map 1 13015 table_id: # (test.t1)
+master-bin.000001 13015 Write_rows 1 13049 table_id: # flags: STMT_END_F
+master-bin.000001 13049 Table_map 1 13088 table_id: # (test.t1)
+master-bin.000001 13088 Write_rows 1 13122 table_id: # flags: STMT_END_F
+master-bin.000001 13122 Table_map 1 13161 table_id: # (test.t1)
+master-bin.000001 13161 Write_rows 1 13195 table_id: # flags: STMT_END_F
+master-bin.000001 13195 Table_map 1 13234 table_id: # (test.t1)
+master-bin.000001 13234 Write_rows 1 13268 table_id: # flags: STMT_END_F
+master-bin.000001 13268 Table_map 1 13307 table_id: # (test.t1)
+master-bin.000001 13307 Write_rows 1 13341 table_id: # flags: STMT_END_F
+master-bin.000001 13341 Table_map 1 13380 table_id: # (test.t1)
+master-bin.000001 13380 Write_rows 1 13414 table_id: # flags: STMT_END_F
+master-bin.000001 13414 Table_map 1 13453 table_id: # (test.t1)
+master-bin.000001 13453 Write_rows 1 13487 table_id: # flags: STMT_END_F
+master-bin.000001 13487 Table_map 1 13526 table_id: # (test.t1)
+master-bin.000001 13526 Write_rows 1 13560 table_id: # flags: STMT_END_F
+master-bin.000001 13560 Table_map 1 13599 table_id: # (test.t1)
+master-bin.000001 13599 Write_rows 1 13633 table_id: # flags: STMT_END_F
+master-bin.000001 13633 Table_map 1 13672 table_id: # (test.t1)
+master-bin.000001 13672 Write_rows 1 13706 table_id: # flags: STMT_END_F
+master-bin.000001 13706 Table_map 1 13745 table_id: # (test.t1)
+master-bin.000001 13745 Write_rows 1 13779 table_id: # flags: STMT_END_F
+master-bin.000001 13779 Table_map 1 13818 table_id: # (test.t1)
+master-bin.000001 13818 Write_rows 1 13852 table_id: # flags: STMT_END_F
+master-bin.000001 13852 Table_map 1 13891 table_id: # (test.t1)
+master-bin.000001 13891 Write_rows 1 13925 table_id: # flags: STMT_END_F
+master-bin.000001 13925 Table_map 1 13964 table_id: # (test.t1)
+master-bin.000001 13964 Write_rows 1 13998 table_id: # flags: STMT_END_F
+master-bin.000001 13998 Table_map 1 14037 table_id: # (test.t1)
+master-bin.000001 14037 Write_rows 1 14071 table_id: # flags: STMT_END_F
+master-bin.000001 14071 Table_map 1 14110 table_id: # (test.t1)
+master-bin.000001 14110 Write_rows 1 14144 table_id: # flags: STMT_END_F
+master-bin.000001 14144 Table_map 1 14183 table_id: # (test.t1)
+master-bin.000001 14183 Write_rows 1 14217 table_id: # flags: STMT_END_F
+master-bin.000001 14217 Table_map 1 14256 table_id: # (test.t1)
+master-bin.000001 14256 Write_rows 1 14290 table_id: # flags: STMT_END_F
+master-bin.000001 14290 Table_map 1 14329 table_id: # (test.t1)
+master-bin.000001 14329 Write_rows 1 14363 table_id: # flags: STMT_END_F
+master-bin.000001 14363 Table_map 1 14402 table_id: # (test.t1)
+master-bin.000001 14402 Write_rows 1 14436 table_id: # flags: STMT_END_F
+master-bin.000001 14436 Table_map 1 14475 table_id: # (test.t1)
+master-bin.000001 14475 Write_rows 1 14509 table_id: # flags: STMT_END_F
+master-bin.000001 14509 Table_map 1 14548 table_id: # (test.t1)
+master-bin.000001 14548 Write_rows 1 14582 table_id: # flags: STMT_END_F
+master-bin.000001 14582 Table_map 1 14621 table_id: # (test.t1)
+master-bin.000001 14621 Write_rows 1 14655 table_id: # flags: STMT_END_F
+master-bin.000001 14655 Table_map 1 14694 table_id: # (test.t1)
+master-bin.000001 14694 Write_rows 1 14728 table_id: # flags: STMT_END_F
+master-bin.000001 14728 Table_map 1 14767 table_id: # (test.t1)
+master-bin.000001 14767 Write_rows 1 14801 table_id: # flags: STMT_END_F
+master-bin.000001 14801 Table_map 1 14840 table_id: # (test.t1)
+master-bin.000001 14840 Write_rows 1 14874 table_id: # flags: STMT_END_F
+master-bin.000001 14874 Table_map 1 14913 table_id: # (test.t1)
+master-bin.000001 14913 Write_rows 1 14947 table_id: # flags: STMT_END_F
+master-bin.000001 14947 Table_map 1 14986 table_id: # (test.t1)
+master-bin.000001 14986 Write_rows 1 15020 table_id: # flags: STMT_END_F
+master-bin.000001 15020 Table_map 1 15059 table_id: # (test.t1)
+master-bin.000001 15059 Write_rows 1 15093 table_id: # flags: STMT_END_F
+master-bin.000001 15093 Table_map 1 15132 table_id: # (test.t1)
+master-bin.000001 15132 Write_rows 1 15166 table_id: # flags: STMT_END_F
+master-bin.000001 15166 Table_map 1 15205 table_id: # (test.t1)
+master-bin.000001 15205 Write_rows 1 15239 table_id: # flags: STMT_END_F
+master-bin.000001 15239 Table_map 1 15278 table_id: # (test.t1)
+master-bin.000001 15278 Write_rows 1 15312 table_id: # flags: STMT_END_F
+master-bin.000001 15312 Table_map 1 15351 table_id: # (test.t1)
+master-bin.000001 15351 Write_rows 1 15385 table_id: # flags: STMT_END_F
+master-bin.000001 15385 Table_map 1 15424 table_id: # (test.t1)
+master-bin.000001 15424 Write_rows 1 15458 table_id: # flags: STMT_END_F
+master-bin.000001 15458 Table_map 1 15497 table_id: # (test.t1)
+master-bin.000001 15497 Write_rows 1 15531 table_id: # flags: STMT_END_F
+master-bin.000001 15531 Table_map 1 15570 table_id: # (test.t1)
+master-bin.000001 15570 Write_rows 1 15604 table_id: # flags: STMT_END_F
+master-bin.000001 15604 Table_map 1 15643 table_id: # (test.t1)
+master-bin.000001 15643 Write_rows 1 15677 table_id: # flags: STMT_END_F
+master-bin.000001 15677 Table_map 1 15716 table_id: # (test.t1)
+master-bin.000001 15716 Write_rows 1 15750 table_id: # flags: STMT_END_F
+master-bin.000001 15750 Table_map 1 15789 table_id: # (test.t1)
+master-bin.000001 15789 Write_rows 1 15823 table_id: # flags: STMT_END_F
+master-bin.000001 15823 Table_map 1 15862 table_id: # (test.t1)
+master-bin.000001 15862 Write_rows 1 15896 table_id: # flags: STMT_END_F
+master-bin.000001 15896 Table_map 1 15935 table_id: # (test.t1)
+master-bin.000001 15935 Write_rows 1 15969 table_id: # flags: STMT_END_F
+master-bin.000001 15969 Table_map 1 16008 table_id: # (test.t1)
+master-bin.000001 16008 Write_rows 1 16042 table_id: # flags: STMT_END_F
+master-bin.000001 16042 Table_map 1 16081 table_id: # (test.t1)
+master-bin.000001 16081 Write_rows 1 16115 table_id: # flags: STMT_END_F
+master-bin.000001 16115 Table_map 1 16154 table_id: # (test.t1)
+master-bin.000001 16154 Write_rows 1 16188 table_id: # flags: STMT_END_F
+master-bin.000001 16188 Table_map 1 16227 table_id: # (test.t1)
+master-bin.000001 16227 Write_rows 1 16261 table_id: # flags: STMT_END_F
+master-bin.000001 16261 Table_map 1 16300 table_id: # (test.t1)
+master-bin.000001 16300 Write_rows 1 16334 table_id: # flags: STMT_END_F
+master-bin.000001 16334 Table_map 1 16373 table_id: # (test.t1)
+master-bin.000001 16373 Write_rows 1 16407 table_id: # flags: STMT_END_F
+master-bin.000001 16407 Table_map 1 16446 table_id: # (test.t1)
+master-bin.000001 16446 Write_rows 1 16480 table_id: # flags: STMT_END_F
+master-bin.000001 16480 Table_map 1 16519 table_id: # (test.t1)
+master-bin.000001 16519 Write_rows 1 16553 table_id: # flags: STMT_END_F
+master-bin.000001 16553 Table_map 1 16592 table_id: # (test.t1)
+master-bin.000001 16592 Write_rows 1 16626 table_id: # flags: STMT_END_F
+master-bin.000001 16626 Table_map 1 16665 table_id: # (test.t1)
+master-bin.000001 16665 Write_rows 1 16699 table_id: # flags: STMT_END_F
+master-bin.000001 16699 Table_map 1 16738 table_id: # (test.t1)
+master-bin.000001 16738 Write_rows 1 16772 table_id: # flags: STMT_END_F
+master-bin.000001 16772 Table_map 1 16811 table_id: # (test.t1)
+master-bin.000001 16811 Write_rows 1 16845 table_id: # flags: STMT_END_F
+master-bin.000001 16845 Table_map 1 16884 table_id: # (test.t1)
+master-bin.000001 16884 Write_rows 1 16918 table_id: # flags: STMT_END_F
+master-bin.000001 16918 Table_map 1 16957 table_id: # (test.t1)
+master-bin.000001 16957 Write_rows 1 16991 table_id: # flags: STMT_END_F
+master-bin.000001 16991 Table_map 1 17030 table_id: # (test.t1)
+master-bin.000001 17030 Write_rows 1 17064 table_id: # flags: STMT_END_F
+master-bin.000001 17064 Table_map 1 17103 table_id: # (test.t1)
+master-bin.000001 17103 Write_rows 1 17137 table_id: # flags: STMT_END_F
+master-bin.000001 17137 Table_map 1 17176 table_id: # (test.t1)
+master-bin.000001 17176 Write_rows 1 17210 table_id: # flags: STMT_END_F
+master-bin.000001 17210 Table_map 1 17249 table_id: # (test.t1)
+master-bin.000001 17249 Write_rows 1 17283 table_id: # flags: STMT_END_F
+master-bin.000001 17283 Table_map 1 17322 table_id: # (test.t1)
+master-bin.000001 17322 Write_rows 1 17356 table_id: # flags: STMT_END_F
+master-bin.000001 17356 Table_map 1 17395 table_id: # (test.t1)
+master-bin.000001 17395 Write_rows 1 17429 table_id: # flags: STMT_END_F
+master-bin.000001 17429 Table_map 1 17468 table_id: # (test.t1)
+master-bin.000001 17468 Write_rows 1 17502 table_id: # flags: STMT_END_F
+master-bin.000001 17502 Table_map 1 17541 table_id: # (test.t1)
+master-bin.000001 17541 Write_rows 1 17575 table_id: # flags: STMT_END_F
+master-bin.000001 17575 Table_map 1 17614 table_id: # (test.t1)
+master-bin.000001 17614 Write_rows 1 17648 table_id: # flags: STMT_END_F
+master-bin.000001 17648 Table_map 1 17687 table_id: # (test.t1)
+master-bin.000001 17687 Write_rows 1 17721 table_id: # flags: STMT_END_F
+master-bin.000001 17721 Table_map 1 17760 table_id: # (test.t1)
+master-bin.000001 17760 Write_rows 1 17794 table_id: # flags: STMT_END_F
+master-bin.000001 17794 Table_map 1 17833 table_id: # (test.t1)
+master-bin.000001 17833 Write_rows 1 17867 table_id: # flags: STMT_END_F
+master-bin.000001 17867 Table_map 1 17906 table_id: # (test.t1)
+master-bin.000001 17906 Write_rows 1 17940 table_id: # flags: STMT_END_F
+master-bin.000001 17940 Table_map 1 17979 table_id: # (test.t1)
+master-bin.000001 17979 Write_rows 1 18013 table_id: # flags: STMT_END_F
+master-bin.000001 18013 Table_map 1 18052 table_id: # (test.t1)
+master-bin.000001 18052 Write_rows 1 18086 table_id: # flags: STMT_END_F
+master-bin.000001 18086 Table_map 1 18125 table_id: # (test.t1)
+master-bin.000001 18125 Write_rows 1 18159 table_id: # flags: STMT_END_F
+master-bin.000001 18159 Table_map 1 18198 table_id: # (test.t1)
+master-bin.000001 18198 Write_rows 1 18232 table_id: # flags: STMT_END_F
+master-bin.000001 18232 Table_map 1 18271 table_id: # (test.t1)
+master-bin.000001 18271 Write_rows 1 18305 table_id: # flags: STMT_END_F
+master-bin.000001 18305 Table_map 1 18344 table_id: # (test.t1)
+master-bin.000001 18344 Write_rows 1 18378 table_id: # flags: STMT_END_F
+master-bin.000001 18378 Table_map 1 18417 table_id: # (test.t1)
+master-bin.000001 18417 Write_rows 1 18451 table_id: # flags: STMT_END_F
+master-bin.000001 18451 Table_map 1 18490 table_id: # (test.t1)
+master-bin.000001 18490 Write_rows 1 18524 table_id: # flags: STMT_END_F
+master-bin.000001 18524 Table_map 1 18563 table_id: # (test.t1)
+master-bin.000001 18563 Write_rows 1 18597 table_id: # flags: STMT_END_F
+master-bin.000001 18597 Table_map 1 18636 table_id: # (test.t1)
+master-bin.000001 18636 Write_rows 1 18670 table_id: # flags: STMT_END_F
+master-bin.000001 18670 Table_map 1 18709 table_id: # (test.t1)
+master-bin.000001 18709 Write_rows 1 18743 table_id: # flags: STMT_END_F
+master-bin.000001 18743 Table_map 1 18782 table_id: # (test.t1)
+master-bin.000001 18782 Write_rows 1 18816 table_id: # flags: STMT_END_F
+master-bin.000001 18816 Table_map 1 18855 table_id: # (test.t1)
+master-bin.000001 18855 Write_rows 1 18889 table_id: # flags: STMT_END_F
+master-bin.000001 18889 Table_map 1 18928 table_id: # (test.t1)
+master-bin.000001 18928 Write_rows 1 18962 table_id: # flags: STMT_END_F
+master-bin.000001 18962 Table_map 1 19001 table_id: # (test.t1)
+master-bin.000001 19001 Write_rows 1 19035 table_id: # flags: STMT_END_F
+master-bin.000001 19035 Table_map 1 19074 table_id: # (test.t1)
+master-bin.000001 19074 Write_rows 1 19108 table_id: # flags: STMT_END_F
+master-bin.000001 19108 Table_map 1 19147 table_id: # (test.t1)
+master-bin.000001 19147 Write_rows 1 19181 table_id: # flags: STMT_END_F
+master-bin.000001 19181 Table_map 1 19220 table_id: # (test.t1)
+master-bin.000001 19220 Write_rows 1 19254 table_id: # flags: STMT_END_F
+master-bin.000001 19254 Table_map 1 19293 table_id: # (test.t1)
+master-bin.000001 19293 Write_rows 1 19327 table_id: # flags: STMT_END_F
+master-bin.000001 19327 Table_map 1 19366 table_id: # (test.t1)
+master-bin.000001 19366 Write_rows 1 19400 table_id: # flags: STMT_END_F
+master-bin.000001 19400 Table_map 1 19439 table_id: # (test.t1)
+master-bin.000001 19439 Write_rows 1 19473 table_id: # flags: STMT_END_F
+master-bin.000001 19473 Table_map 1 19512 table_id: # (test.t1)
+master-bin.000001 19512 Write_rows 1 19546 table_id: # flags: STMT_END_F
+master-bin.000001 19546 Table_map 1 19585 table_id: # (test.t1)
+master-bin.000001 19585 Write_rows 1 19619 table_id: # flags: STMT_END_F
+master-bin.000001 19619 Table_map 1 19658 table_id: # (test.t1)
+master-bin.000001 19658 Write_rows 1 19692 table_id: # flags: STMT_END_F
+master-bin.000001 19692 Table_map 1 19731 table_id: # (test.t1)
+master-bin.000001 19731 Write_rows 1 19765 table_id: # flags: STMT_END_F
+master-bin.000001 19765 Table_map 1 19804 table_id: # (test.t1)
+master-bin.000001 19804 Write_rows 1 19838 table_id: # flags: STMT_END_F
+master-bin.000001 19838 Table_map 1 19877 table_id: # (test.t1)
+master-bin.000001 19877 Write_rows 1 19911 table_id: # flags: STMT_END_F
+master-bin.000001 19911 Table_map 1 19950 table_id: # (test.t1)
+master-bin.000001 19950 Write_rows 1 19984 table_id: # flags: STMT_END_F
+master-bin.000001 19984 Table_map 1 20023 table_id: # (test.t1)
+master-bin.000001 20023 Write_rows 1 20057 table_id: # flags: STMT_END_F
+master-bin.000001 20057 Table_map 1 20096 table_id: # (test.t1)
+master-bin.000001 20096 Write_rows 1 20130 table_id: # flags: STMT_END_F
+master-bin.000001 20130 Table_map 1 20169 table_id: # (test.t1)
+master-bin.000001 20169 Write_rows 1 20203 table_id: # flags: STMT_END_F
+master-bin.000001 20203 Table_map 1 20242 table_id: # (test.t1)
+master-bin.000001 20242 Write_rows 1 20276 table_id: # flags: STMT_END_F
+master-bin.000001 20276 Table_map 1 20315 table_id: # (test.t1)
+master-bin.000001 20315 Write_rows 1 20349 table_id: # flags: STMT_END_F
+master-bin.000001 20349 Table_map 1 20388 table_id: # (test.t1)
+master-bin.000001 20388 Write_rows 1 20422 table_id: # flags: STMT_END_F
+master-bin.000001 20422 Table_map 1 20461 table_id: # (test.t1)
+master-bin.000001 20461 Write_rows 1 20495 table_id: # flags: STMT_END_F
+master-bin.000001 20495 Table_map 1 20534 table_id: # (test.t1)
+master-bin.000001 20534 Write_rows 1 20568 table_id: # flags: STMT_END_F
+master-bin.000001 20568 Table_map 1 20607 table_id: # (test.t1)
+master-bin.000001 20607 Write_rows 1 20641 table_id: # flags: STMT_END_F
+master-bin.000001 20641 Table_map 1 20680 table_id: # (test.t1)
+master-bin.000001 20680 Write_rows 1 20714 table_id: # flags: STMT_END_F
+master-bin.000001 20714 Table_map 1 20753 table_id: # (test.t1)
+master-bin.000001 20753 Write_rows 1 20787 table_id: # flags: STMT_END_F
+master-bin.000001 20787 Table_map 1 20826 table_id: # (test.t1)
+master-bin.000001 20826 Write_rows 1 20860 table_id: # flags: STMT_END_F
+master-bin.000001 20860 Table_map 1 20899 table_id: # (test.t1)
+master-bin.000001 20899 Write_rows 1 20933 table_id: # flags: STMT_END_F
+master-bin.000001 20933 Table_map 1 20972 table_id: # (test.t1)
+master-bin.000001 20972 Write_rows 1 21006 table_id: # flags: STMT_END_F
+master-bin.000001 21006 Table_map 1 21045 table_id: # (test.t1)
+master-bin.000001 21045 Write_rows 1 21079 table_id: # flags: STMT_END_F
+master-bin.000001 21079 Table_map 1 21118 table_id: # (test.t1)
+master-bin.000001 21118 Write_rows 1 21152 table_id: # flags: STMT_END_F
+master-bin.000001 21152 Table_map 1 21191 table_id: # (test.t1)
+master-bin.000001 21191 Write_rows 1 21225 table_id: # flags: STMT_END_F
+master-bin.000001 21225 Table_map 1 21264 table_id: # (test.t1)
+master-bin.000001 21264 Write_rows 1 21298 table_id: # flags: STMT_END_F
+master-bin.000001 21298 Table_map 1 21337 table_id: # (test.t1)
+master-bin.000001 21337 Write_rows 1 21371 table_id: # flags: STMT_END_F
+master-bin.000001 21371 Table_map 1 21410 table_id: # (test.t1)
+master-bin.000001 21410 Write_rows 1 21444 table_id: # flags: STMT_END_F
+master-bin.000001 21444 Table_map 1 21483 table_id: # (test.t1)
+master-bin.000001 21483 Write_rows 1 21517 table_id: # flags: STMT_END_F
+master-bin.000001 21517 Table_map 1 21556 table_id: # (test.t1)
+master-bin.000001 21556 Write_rows 1 21590 table_id: # flags: STMT_END_F
+master-bin.000001 21590 Table_map 1 21629 table_id: # (test.t1)
+master-bin.000001 21629 Write_rows 1 21663 table_id: # flags: STMT_END_F
+master-bin.000001 21663 Table_map 1 21702 table_id: # (test.t1)
+master-bin.000001 21702 Write_rows 1 21736 table_id: # flags: STMT_END_F
+master-bin.000001 21736 Table_map 1 21775 table_id: # (test.t1)
+master-bin.000001 21775 Write_rows 1 21809 table_id: # flags: STMT_END_F
+master-bin.000001 21809 Table_map 1 21848 table_id: # (test.t1)
+master-bin.000001 21848 Write_rows 1 21882 table_id: # flags: STMT_END_F
+master-bin.000001 21882 Table_map 1 21921 table_id: # (test.t1)
+master-bin.000001 21921 Write_rows 1 21955 table_id: # flags: STMT_END_F
+master-bin.000001 21955 Table_map 1 21994 table_id: # (test.t1)
+master-bin.000001 21994 Write_rows 1 22028 table_id: # flags: STMT_END_F
+master-bin.000001 22028 Table_map 1 22067 table_id: # (test.t1)
+master-bin.000001 22067 Write_rows 1 22101 table_id: # flags: STMT_END_F
+master-bin.000001 22101 Table_map 1 22140 table_id: # (test.t1)
+master-bin.000001 22140 Write_rows 1 22174 table_id: # flags: STMT_END_F
+master-bin.000001 22174 Table_map 1 22213 table_id: # (test.t1)
+master-bin.000001 22213 Write_rows 1 22247 table_id: # flags: STMT_END_F
+master-bin.000001 22247 Table_map 1 22286 table_id: # (test.t1)
+master-bin.000001 22286 Write_rows 1 22320 table_id: # flags: STMT_END_F
+master-bin.000001 22320 Table_map 1 22359 table_id: # (test.t1)
+master-bin.000001 22359 Write_rows 1 22393 table_id: # flags: STMT_END_F
+master-bin.000001 22393 Table_map 1 22432 table_id: # (test.t1)
+master-bin.000001 22432 Write_rows 1 22466 table_id: # flags: STMT_END_F
+master-bin.000001 22466 Table_map 1 22505 table_id: # (test.t1)
+master-bin.000001 22505 Write_rows 1 22539 table_id: # flags: STMT_END_F
+master-bin.000001 22539 Table_map 1 22578 table_id: # (test.t1)
+master-bin.000001 22578 Write_rows 1 22612 table_id: # flags: STMT_END_F
+master-bin.000001 22612 Table_map 1 22651 table_id: # (test.t1)
+master-bin.000001 22651 Write_rows 1 22685 table_id: # flags: STMT_END_F
+master-bin.000001 22685 Table_map 1 22724 table_id: # (test.t1)
+master-bin.000001 22724 Write_rows 1 22758 table_id: # flags: STMT_END_F
+master-bin.000001 22758 Table_map 1 22797 table_id: # (test.t1)
+master-bin.000001 22797 Write_rows 1 22831 table_id: # flags: STMT_END_F
+master-bin.000001 22831 Table_map 1 22870 table_id: # (test.t1)
+master-bin.000001 22870 Write_rows 1 22904 table_id: # flags: STMT_END_F
+master-bin.000001 22904 Table_map 1 22943 table_id: # (test.t1)
+master-bin.000001 22943 Write_rows 1 22977 table_id: # flags: STMT_END_F
+master-bin.000001 22977 Table_map 1 23016 table_id: # (test.t1)
+master-bin.000001 23016 Write_rows 1 23050 table_id: # flags: STMT_END_F
+master-bin.000001 23050 Table_map 1 23089 table_id: # (test.t1)
+master-bin.000001 23089 Write_rows 1 23123 table_id: # flags: STMT_END_F
+master-bin.000001 23123 Table_map 1 23162 table_id: # (test.t1)
+master-bin.000001 23162 Write_rows 1 23196 table_id: # flags: STMT_END_F
+master-bin.000001 23196 Table_map 1 23235 table_id: # (test.t1)
+master-bin.000001 23235 Write_rows 1 23269 table_id: # flags: STMT_END_F
+master-bin.000001 23269 Table_map 1 23308 table_id: # (test.t1)
+master-bin.000001 23308 Write_rows 1 23342 table_id: # flags: STMT_END_F
+master-bin.000001 23342 Table_map 1 23381 table_id: # (test.t1)
+master-bin.000001 23381 Write_rows 1 23415 table_id: # flags: STMT_END_F
+master-bin.000001 23415 Table_map 1 23454 table_id: # (test.t1)
+master-bin.000001 23454 Write_rows 1 23488 table_id: # flags: STMT_END_F
+master-bin.000001 23488 Table_map 1 23527 table_id: # (test.t1)
+master-bin.000001 23527 Write_rows 1 23561 table_id: # flags: STMT_END_F
+master-bin.000001 23561 Table_map 1 23600 table_id: # (test.t1)
+master-bin.000001 23600 Write_rows 1 23634 table_id: # flags: STMT_END_F
+master-bin.000001 23634 Table_map 1 23673 table_id: # (test.t1)
+master-bin.000001 23673 Write_rows 1 23707 table_id: # flags: STMT_END_F
+master-bin.000001 23707 Table_map 1 23746 table_id: # (test.t1)
+master-bin.000001 23746 Write_rows 1 23780 table_id: # flags: STMT_END_F
+master-bin.000001 23780 Table_map 1 23819 table_id: # (test.t1)
+master-bin.000001 23819 Write_rows 1 23853 table_id: # flags: STMT_END_F
+master-bin.000001 23853 Table_map 1 23892 table_id: # (test.t1)
+master-bin.000001 23892 Write_rows 1 23926 table_id: # flags: STMT_END_F
+master-bin.000001 23926 Table_map 1 23965 table_id: # (test.t1)
+master-bin.000001 23965 Write_rows 1 23999 table_id: # flags: STMT_END_F
+master-bin.000001 23999 Table_map 1 24038 table_id: # (test.t1)
+master-bin.000001 24038 Write_rows 1 24072 table_id: # flags: STMT_END_F
+master-bin.000001 24072 Table_map 1 24111 table_id: # (test.t1)
+master-bin.000001 24111 Write_rows 1 24145 table_id: # flags: STMT_END_F
+master-bin.000001 24145 Table_map 1 24184 table_id: # (test.t1)
+master-bin.000001 24184 Write_rows 1 24218 table_id: # flags: STMT_END_F
+master-bin.000001 24218 Table_map 1 24257 table_id: # (test.t1)
+master-bin.000001 24257 Write_rows 1 24291 table_id: # flags: STMT_END_F
+master-bin.000001 24291 Table_map 1 24330 table_id: # (test.t1)
+master-bin.000001 24330 Write_rows 1 24364 table_id: # flags: STMT_END_F
+master-bin.000001 24364 Table_map 1 24403 table_id: # (test.t1)
+master-bin.000001 24403 Write_rows 1 24437 table_id: # flags: STMT_END_F
+master-bin.000001 24437 Table_map 1 24476 table_id: # (test.t1)
+master-bin.000001 24476 Write_rows 1 24510 table_id: # flags: STMT_END_F
+master-bin.000001 24510 Table_map 1 24549 table_id: # (test.t1)
+master-bin.000001 24549 Write_rows 1 24583 table_id: # flags: STMT_END_F
+master-bin.000001 24583 Table_map 1 24622 table_id: # (test.t1)
+master-bin.000001 24622 Write_rows 1 24656 table_id: # flags: STMT_END_F
+master-bin.000001 24656 Table_map 1 24695 table_id: # (test.t1)
+master-bin.000001 24695 Write_rows 1 24729 table_id: # flags: STMT_END_F
+master-bin.000001 24729 Table_map 1 24768 table_id: # (test.t1)
+master-bin.000001 24768 Write_rows 1 24802 table_id: # flags: STMT_END_F
+master-bin.000001 24802 Table_map 1 24841 table_id: # (test.t1)
+master-bin.000001 24841 Write_rows 1 24875 table_id: # flags: STMT_END_F
+master-bin.000001 24875 Table_map 1 24914 table_id: # (test.t1)
+master-bin.000001 24914 Write_rows 1 24948 table_id: # flags: STMT_END_F
+master-bin.000001 24948 Table_map 1 24987 table_id: # (test.t1)
+master-bin.000001 24987 Write_rows 1 25021 table_id: # flags: STMT_END_F
+master-bin.000001 25021 Table_map 1 25060 table_id: # (test.t1)
+master-bin.000001 25060 Write_rows 1 25094 table_id: # flags: STMT_END_F
+master-bin.000001 25094 Table_map 1 25133 table_id: # (test.t1)
+master-bin.000001 25133 Write_rows 1 25167 table_id: # flags: STMT_END_F
+master-bin.000001 25167 Table_map 1 25206 table_id: # (test.t1)
+master-bin.000001 25206 Write_rows 1 25240 table_id: # flags: STMT_END_F
+master-bin.000001 25240 Table_map 1 25279 table_id: # (test.t1)
+master-bin.000001 25279 Write_rows 1 25313 table_id: # flags: STMT_END_F
+master-bin.000001 25313 Table_map 1 25352 table_id: # (test.t1)
+master-bin.000001 25352 Write_rows 1 25386 table_id: # flags: STMT_END_F
+master-bin.000001 25386 Table_map 1 25425 table_id: # (test.t1)
+master-bin.000001 25425 Write_rows 1 25459 table_id: # flags: STMT_END_F
+master-bin.000001 25459 Table_map 1 25498 table_id: # (test.t1)
+master-bin.000001 25498 Write_rows 1 25532 table_id: # flags: STMT_END_F
+master-bin.000001 25532 Table_map 1 25571 table_id: # (test.t1)
+master-bin.000001 25571 Write_rows 1 25605 table_id: # flags: STMT_END_F
+master-bin.000001 25605 Table_map 1 25644 table_id: # (test.t1)
+master-bin.000001 25644 Write_rows 1 25678 table_id: # flags: STMT_END_F
+master-bin.000001 25678 Table_map 1 25717 table_id: # (test.t1)
+master-bin.000001 25717 Write_rows 1 25751 table_id: # flags: STMT_END_F
+master-bin.000001 25751 Table_map 1 25790 table_id: # (test.t1)
+master-bin.000001 25790 Write_rows 1 25824 table_id: # flags: STMT_END_F
+master-bin.000001 25824 Table_map 1 25863 table_id: # (test.t1)
+master-bin.000001 25863 Write_rows 1 25897 table_id: # flags: STMT_END_F
+master-bin.000001 25897 Table_map 1 25936 table_id: # (test.t1)
+master-bin.000001 25936 Write_rows 1 25970 table_id: # flags: STMT_END_F
+master-bin.000001 25970 Table_map 1 26009 table_id: # (test.t1)
+master-bin.000001 26009 Write_rows 1 26043 table_id: # flags: STMT_END_F
+master-bin.000001 26043 Table_map 1 26082 table_id: # (test.t1)
+master-bin.000001 26082 Write_rows 1 26116 table_id: # flags: STMT_END_F
+master-bin.000001 26116 Table_map 1 26155 table_id: # (test.t1)
+master-bin.000001 26155 Write_rows 1 26189 table_id: # flags: STMT_END_F
+master-bin.000001 26189 Table_map 1 26228 table_id: # (test.t1)
+master-bin.000001 26228 Write_rows 1 26262 table_id: # flags: STMT_END_F
+master-bin.000001 26262 Table_map 1 26301 table_id: # (test.t1)
+master-bin.000001 26301 Write_rows 1 26335 table_id: # flags: STMT_END_F
+master-bin.000001 26335 Table_map 1 26374 table_id: # (test.t1)
+master-bin.000001 26374 Write_rows 1 26408 table_id: # flags: STMT_END_F
+master-bin.000001 26408 Table_map 1 26447 table_id: # (test.t1)
+master-bin.000001 26447 Write_rows 1 26481 table_id: # flags: STMT_END_F
+master-bin.000001 26481 Table_map 1 26520 table_id: # (test.t1)
+master-bin.000001 26520 Write_rows 1 26554 table_id: # flags: STMT_END_F
+master-bin.000001 26554 Table_map 1 26593 table_id: # (test.t1)
+master-bin.000001 26593 Write_rows 1 26627 table_id: # flags: STMT_END_F
+master-bin.000001 26627 Table_map 1 26666 table_id: # (test.t1)
+master-bin.000001 26666 Write_rows 1 26700 table_id: # flags: STMT_END_F
+master-bin.000001 26700 Table_map 1 26739 table_id: # (test.t1)
+master-bin.000001 26739 Write_rows 1 26773 table_id: # flags: STMT_END_F
+master-bin.000001 26773 Table_map 1 26812 table_id: # (test.t1)
+master-bin.000001 26812 Write_rows 1 26846 table_id: # flags: STMT_END_F
+master-bin.000001 26846 Table_map 1 26885 table_id: # (test.t1)
+master-bin.000001 26885 Write_rows 1 26919 table_id: # flags: STMT_END_F
+master-bin.000001 26919 Table_map 1 26958 table_id: # (test.t1)
+master-bin.000001 26958 Write_rows 1 26992 table_id: # flags: STMT_END_F
+master-bin.000001 26992 Table_map 1 27031 table_id: # (test.t1)
+master-bin.000001 27031 Write_rows 1 27065 table_id: # flags: STMT_END_F
+master-bin.000001 27065 Table_map 1 27104 table_id: # (test.t1)
+master-bin.000001 27104 Write_rows 1 27138 table_id: # flags: STMT_END_F
+master-bin.000001 27138 Table_map 1 27177 table_id: # (test.t1)
+master-bin.000001 27177 Write_rows 1 27211 table_id: # flags: STMT_END_F
+master-bin.000001 27211 Table_map 1 27250 table_id: # (test.t1)
+master-bin.000001 27250 Write_rows 1 27284 table_id: # flags: STMT_END_F
+master-bin.000001 27284 Table_map 1 27323 table_id: # (test.t1)
+master-bin.000001 27323 Write_rows 1 27357 table_id: # flags: STMT_END_F
+master-bin.000001 27357 Table_map 1 27396 table_id: # (test.t1)
+master-bin.000001 27396 Write_rows 1 27430 table_id: # flags: STMT_END_F
+master-bin.000001 27430 Table_map 1 27469 table_id: # (test.t1)
+master-bin.000001 27469 Write_rows 1 27503 table_id: # flags: STMT_END_F
+master-bin.000001 27503 Table_map 1 27542 table_id: # (test.t1)
+master-bin.000001 27542 Write_rows 1 27576 table_id: # flags: STMT_END_F
+master-bin.000001 27576 Table_map 1 27615 table_id: # (test.t1)
+master-bin.000001 27615 Write_rows 1 27649 table_id: # flags: STMT_END_F
+master-bin.000001 27649 Table_map 1 27688 table_id: # (test.t1)
+master-bin.000001 27688 Write_rows 1 27722 table_id: # flags: STMT_END_F
+master-bin.000001 27722 Table_map 1 27761 table_id: # (test.t1)
+master-bin.000001 27761 Write_rows 1 27795 table_id: # flags: STMT_END_F
+master-bin.000001 27795 Table_map 1 27834 table_id: # (test.t1)
+master-bin.000001 27834 Write_rows 1 27868 table_id: # flags: STMT_END_F
+master-bin.000001 27868 Table_map 1 27907 table_id: # (test.t1)
+master-bin.000001 27907 Write_rows 1 27941 table_id: # flags: STMT_END_F
+master-bin.000001 27941 Table_map 1 27980 table_id: # (test.t1)
+master-bin.000001 27980 Write_rows 1 28014 table_id: # flags: STMT_END_F
+master-bin.000001 28014 Table_map 1 28053 table_id: # (test.t1)
+master-bin.000001 28053 Write_rows 1 28087 table_id: # flags: STMT_END_F
+master-bin.000001 28087 Table_map 1 28126 table_id: # (test.t1)
+master-bin.000001 28126 Write_rows 1 28160 table_id: # flags: STMT_END_F
+master-bin.000001 28160 Table_map 1 28199 table_id: # (test.t1)
+master-bin.000001 28199 Write_rows 1 28233 table_id: # flags: STMT_END_F
+master-bin.000001 28233 Table_map 1 28272 table_id: # (test.t1)
+master-bin.000001 28272 Write_rows 1 28306 table_id: # flags: STMT_END_F
+master-bin.000001 28306 Table_map 1 28345 table_id: # (test.t1)
+master-bin.000001 28345 Write_rows 1 28379 table_id: # flags: STMT_END_F
+master-bin.000001 28379 Table_map 1 28418 table_id: # (test.t1)
+master-bin.000001 28418 Write_rows 1 28452 table_id: # flags: STMT_END_F
+master-bin.000001 28452 Table_map 1 28491 table_id: # (test.t1)
+master-bin.000001 28491 Write_rows 1 28525 table_id: # flags: STMT_END_F
+master-bin.000001 28525 Table_map 1 28564 table_id: # (test.t1)
+master-bin.000001 28564 Write_rows 1 28598 table_id: # flags: STMT_END_F
+master-bin.000001 28598 Table_map 1 28637 table_id: # (test.t1)
+master-bin.000001 28637 Write_rows 1 28671 table_id: # flags: STMT_END_F
+master-bin.000001 28671 Table_map 1 28710 table_id: # (test.t1)
+master-bin.000001 28710 Write_rows 1 28744 table_id: # flags: STMT_END_F
+master-bin.000001 28744 Table_map 1 28783 table_id: # (test.t1)
+master-bin.000001 28783 Write_rows 1 28817 table_id: # flags: STMT_END_F
+master-bin.000001 28817 Table_map 1 28856 table_id: # (test.t1)
+master-bin.000001 28856 Write_rows 1 28890 table_id: # flags: STMT_END_F
+master-bin.000001 28890 Table_map 1 28929 table_id: # (test.t1)
+master-bin.000001 28929 Write_rows 1 28963 table_id: # flags: STMT_END_F
+master-bin.000001 28963 Table_map 1 29002 table_id: # (test.t1)
+master-bin.000001 29002 Write_rows 1 29036 table_id: # flags: STMT_END_F
+master-bin.000001 29036 Table_map 1 29075 table_id: # (test.t1)
+master-bin.000001 29075 Write_rows 1 29109 table_id: # flags: STMT_END_F
+master-bin.000001 29109 Table_map 1 29148 table_id: # (test.t1)
+master-bin.000001 29148 Write_rows 1 29182 table_id: # flags: STMT_END_F
+master-bin.000001 29182 Table_map 1 29221 table_id: # (test.t1)
+master-bin.000001 29221 Write_rows 1 29255 table_id: # flags: STMT_END_F
+master-bin.000001 29255 Table_map 1 29294 table_id: # (test.t1)
+master-bin.000001 29294 Write_rows 1 29328 table_id: # flags: STMT_END_F
+master-bin.000001 29328 Table_map 1 29367 table_id: # (test.t1)
+master-bin.000001 29367 Write_rows 1 29401 table_id: # flags: STMT_END_F
+master-bin.000001 29401 Table_map 1 29440 table_id: # (test.t1)
+master-bin.000001 29440 Write_rows 1 29474 table_id: # flags: STMT_END_F
+master-bin.000001 29474 Xid 1 29501 COMMIT /* XID */
+master-bin.000001 29501 Rotate 1 29545 master-bin.000002;pos=4
+drop table t1;
+set global binlog_cache_size=@bcs;
+set session autocommit = @ac;
+End of 5.0 tests
+reset master;
+create table t1 (id tinyint auto_increment primary key);
+set insert_id=128;
+insert into t1 values(null);
+Warnings:
+Warning 1264 Out of range value for column 'id' at row 1
+select * from t1;
+id
+127
+drop table t1;
+create table t1 (a int);
+create table if not exists t2 select * from t1;
+create temporary table tt1 (a int);
+create table if not exists t3 like tt1;
+USE mysql;
+INSERT INTO user SET host='localhost', user='@#@', password=password('Just a test');
+UPDATE user SET password=password('Another password') WHERE host='localhost' AND user='@#@';
+DELETE FROM user WHERE host='localhost' AND user='@#@';
+use test;
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; create table t1 (id tinyint auto_increment primary key)
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `test`; drop table t1
+master-bin.000001 # Query # # use `test`; create table t1 (a int)
+master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t2` (
+ `a` int(11) DEFAULT NULL
+)
+master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t3` (
+ `a` int(11) DEFAULT NULL
+)
+master-bin.000001 # Table_map # # table_id: # (mysql.user)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysql.user)
+master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysql.user)
+master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F
+drop table t1,t2,t3,tt1;
+create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
+set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
+insert delayed into t1 values (207);
+insert delayed into t1 values (null);
+insert delayed into t1 values (300);
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; create table t1 (id tinyint auto_increment primary key)
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `test`; drop table t1
+master-bin.000001 # Query # # use `test`; create table t1 (a int)
+master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t2` (
+ `a` int(11) DEFAULT NULL
+)
+master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t3` (
+ `a` int(11) DEFAULT NULL
+)
+master-bin.000001 # Table_map # # table_id: # (mysql.user)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysql.user)
+master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (mysql.user)
+master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `test`; DROP TABLE `t1`,`t2`,`t3` /* generated by server */
+master-bin.000001 # Query # # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+insert delayed into t1 values (null),(null),(null),(null);
+insert delayed into t1 values (null),(null),(400),(null);
+11 == 11
+select * from t1;
+a
+207
+208
+300
+301
+302
+303
+304
+305
+306
+400
+401
+drop table t1;
+reset master;
+drop table if exists t3;
+create table t3 (a int(11) NOT NULL AUTO_INCREMENT, b text, PRIMARY KEY (a) ) engine=innodb;
+show master status;
+File Position Binlog_Do_DB Binlog_Ignore_DB
+master-bin.000001 346
+insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
+insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
+insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
+insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
+show master status /* must show new binlog index after rotating */;
+File Position Binlog_Do_DB Binlog_Ignore_DB
+master-bin.000002 106
+drop table t3;
diff --git a/mysql-test/r/binlog_row_ctype_cp932.result b/mysql-test/suite/binlog/r/binlog_row_ctype_cp932.result
index ef9f76b7d9c..ef9f76b7d9c 100644
--- a/mysql-test/r/binlog_row_ctype_cp932.result
+++ b/mysql-test/suite/binlog/r/binlog_row_ctype_cp932.result
diff --git a/mysql-test/r/binlog_row_ctype_ucs.result b/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result
index 4f4e7bcedd7..4f4e7bcedd7 100644
--- a/mysql-test/r/binlog_row_ctype_ucs.result
+++ b/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result
diff --git a/mysql-test/r/binlog_row_drop_tmp_tbl.result b/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result
index 503076d66d9..503076d66d9 100644
--- a/mysql-test/r/binlog_row_drop_tmp_tbl.result
+++ b/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result
diff --git a/mysql-test/r/binlog_row_innodb_stat.result b/mysql-test/suite/binlog/r/binlog_row_innodb_stat.result
index e6813ee2719..e6813ee2719 100644
--- a/mysql-test/r/binlog_row_innodb_stat.result
+++ b/mysql-test/suite/binlog/r/binlog_row_innodb_stat.result
diff --git a/mysql-test/r/binlog_row_insert_select.result b/mysql-test/suite/binlog/r/binlog_row_insert_select.result
index cd6ddafc47b..cd6ddafc47b 100644
--- a/mysql-test/r/binlog_row_insert_select.result
+++ b/mysql-test/suite/binlog/r/binlog_row_insert_select.result
diff --git a/mysql-test/r/binlog_row_mix_innodb_myisam.result b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
index 6ac942176c7..6ac942176c7 100644
--- a/mysql-test/r/binlog_row_mix_innodb_myisam.result
+++ b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
diff --git a/mysql-test/r/binlog_statement_insert_delayed.result b/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result
index 3a2dc441632..3a2dc441632 100644
--- a/mysql-test/r/binlog_statement_insert_delayed.result
+++ b/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result
diff --git a/mysql-test/suite/binlog/r/binlog_stm_binlog.result b/mysql-test/suite/binlog/r/binlog_stm_binlog.result
new file mode 100644
index 00000000000..80908e6b450
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_stm_binlog.result
@@ -0,0 +1,672 @@
+create table t1 (a int, b int) engine=innodb;
+begin;
+insert into t1 values (1,2);
+commit;
+show binlog events;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 4 Format_desc 1 106 Server ver: #, Binlog ver: #
+master-bin.000001 106 Query 1 213 use `test`; create table t1 (a int, b int) engine=innodb
+master-bin.000001 213 Query 1 281 use `test`; BEGIN
+master-bin.000001 281 Query 1 371 use `test`; insert into t1 values (1,2)
+master-bin.000001 371 Xid 1 398 COMMIT /* XID */
+drop table t1;
+drop table if exists t1, t2;
+reset master;
+create table t1 (a int) engine=innodb;
+create table t2 (a int) engine=innodb;
+begin;
+insert t1 values (5);
+commit;
+begin;
+insert t2 values (5);
+commit;
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; create table t1 (a int) engine=innodb
+master-bin.000001 # Query # # use `test`; create table t2 (a int) engine=innodb
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Query # # use `test`; insert t1 values (5)
+master-bin.000001 # Xid # # COMMIT /* XID */
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Query # # use `test`; insert t2 values (5)
+master-bin.000001 # Xid # # COMMIT /* XID */
+drop table t1,t2;
+reset master;
+create table t1 (n int) engine=innodb;
+begin;
+commit;
+drop table t1;
+show binlog events in 'master-bin.000001' from 106;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query 1 # use `test`; create table t1 (n int) engine=innodb
+master-bin.000001 # Query 1 # use `test`; BEGIN
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(100 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(99 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(98 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(97 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(96 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(95 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(94 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(93 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(92 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(91 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(90 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(89 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(88 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(87 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(86 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(85 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(84 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(83 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(82 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(81 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(80 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(79 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(78 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(77 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(76 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(75 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(74 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(73 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(72 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(71 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(70 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(69 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(68 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(67 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(66 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(65 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(64 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(63 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(62 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(61 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(60 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(59 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(58 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(57 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(56 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(55 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(54 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(53 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(52 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(51 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(50 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(49 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(48 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(47 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(46 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(45 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(44 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(43 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(42 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(41 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(40 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(39 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(38 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(37 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(36 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(35 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(34 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(33 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(32 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(31 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(30 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(29 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(28 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(27 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(26 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(25 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(24 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(23 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(22 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(21 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(20 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(19 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(18 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(17 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(16 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(15 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(14 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(13 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(12 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(11 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(10 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(9 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(8 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(7 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(6 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(5 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(4 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(3 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(2 + 4)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(1 + 4)
+master-bin.000001 # Xid 1 # COMMIT /* xid= */
+master-bin.000001 # Rotate 1 # master-bin.000002;pos=4
+show binlog events in 'master-bin.000002' from 106;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Query 1 # use `test`; drop table t1
+set @ac = @@autocommit;
+set autocommit= 0;
+reset master;
+create table t1(n int) engine=innodb;
+begin;
+insert into t1 values (1);
+insert into t1 values (2);
+insert into t1 values (3);
+commit;
+drop table t1;
+show binlog events from 0;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4
+master-bin.000001 106 Query 1 205 use `test`; create table t1(n int) engine=innodb
+master-bin.000001 205 Query 1 273 use `test`; BEGIN
+master-bin.000001 273 Query 1 361 use `test`; insert into t1 values (1)
+master-bin.000001 361 Query 1 449 use `test`; insert into t1 values (2)
+master-bin.000001 449 Query 1 537 use `test`; insert into t1 values (3)
+master-bin.000001 537 Xid 1 564 COMMIT /* XID */
+master-bin.000001 564 Query 1 640 use `test`; drop table t1
+set @bcs = @@binlog_cache_size;
+set global binlog_cache_size=4096;
+reset master;
+create table t1 (a int) engine=innodb;
+show binlog events from 0;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4
+master-bin.000001 106 Query 1 206 use `test`; create table t1 (a int) engine=innodb
+master-bin.000001 206 Query 1 274 use `test`; BEGIN
+master-bin.000001 274 Query 1 365 use `test`; insert into t1 values( 400 )
+master-bin.000001 365 Query 1 456 use `test`; insert into t1 values( 399 )
+master-bin.000001 456 Query 1 547 use `test`; insert into t1 values( 398 )
+master-bin.000001 547 Query 1 638 use `test`; insert into t1 values( 397 )
+master-bin.000001 638 Query 1 729 use `test`; insert into t1 values( 396 )
+master-bin.000001 729 Query 1 820 use `test`; insert into t1 values( 395 )
+master-bin.000001 820 Query 1 911 use `test`; insert into t1 values( 394 )
+master-bin.000001 911 Query 1 1002 use `test`; insert into t1 values( 393 )
+master-bin.000001 1002 Query 1 1093 use `test`; insert into t1 values( 392 )
+master-bin.000001 1093 Query 1 1184 use `test`; insert into t1 values( 391 )
+master-bin.000001 1184 Query 1 1275 use `test`; insert into t1 values( 390 )
+master-bin.000001 1275 Query 1 1366 use `test`; insert into t1 values( 389 )
+master-bin.000001 1366 Query 1 1457 use `test`; insert into t1 values( 388 )
+master-bin.000001 1457 Query 1 1548 use `test`; insert into t1 values( 387 )
+master-bin.000001 1548 Query 1 1639 use `test`; insert into t1 values( 386 )
+master-bin.000001 1639 Query 1 1730 use `test`; insert into t1 values( 385 )
+master-bin.000001 1730 Query 1 1821 use `test`; insert into t1 values( 384 )
+master-bin.000001 1821 Query 1 1912 use `test`; insert into t1 values( 383 )
+master-bin.000001 1912 Query 1 2003 use `test`; insert into t1 values( 382 )
+master-bin.000001 2003 Query 1 2094 use `test`; insert into t1 values( 381 )
+master-bin.000001 2094 Query 1 2185 use `test`; insert into t1 values( 380 )
+master-bin.000001 2185 Query 1 2276 use `test`; insert into t1 values( 379 )
+master-bin.000001 2276 Query 1 2367 use `test`; insert into t1 values( 378 )
+master-bin.000001 2367 Query 1 2458 use `test`; insert into t1 values( 377 )
+master-bin.000001 2458 Query 1 2549 use `test`; insert into t1 values( 376 )
+master-bin.000001 2549 Query 1 2640 use `test`; insert into t1 values( 375 )
+master-bin.000001 2640 Query 1 2731 use `test`; insert into t1 values( 374 )
+master-bin.000001 2731 Query 1 2822 use `test`; insert into t1 values( 373 )
+master-bin.000001 2822 Query 1 2913 use `test`; insert into t1 values( 372 )
+master-bin.000001 2913 Query 1 3004 use `test`; insert into t1 values( 371 )
+master-bin.000001 3004 Query 1 3095 use `test`; insert into t1 values( 370 )
+master-bin.000001 3095 Query 1 3186 use `test`; insert into t1 values( 369 )
+master-bin.000001 3186 Query 1 3277 use `test`; insert into t1 values( 368 )
+master-bin.000001 3277 Query 1 3368 use `test`; insert into t1 values( 367 )
+master-bin.000001 3368 Query 1 3459 use `test`; insert into t1 values( 366 )
+master-bin.000001 3459 Query 1 3550 use `test`; insert into t1 values( 365 )
+master-bin.000001 3550 Query 1 3641 use `test`; insert into t1 values( 364 )
+master-bin.000001 3641 Query 1 3732 use `test`; insert into t1 values( 363 )
+master-bin.000001 3732 Query 1 3823 use `test`; insert into t1 values( 362 )
+master-bin.000001 3823 Query 1 3914 use `test`; insert into t1 values( 361 )
+master-bin.000001 3914 Query 1 4005 use `test`; insert into t1 values( 360 )
+master-bin.000001 4005 Query 1 4096 use `test`; insert into t1 values( 359 )
+master-bin.000001 4096 Query 1 4187 use `test`; insert into t1 values( 358 )
+master-bin.000001 4187 Query 1 4278 use `test`; insert into t1 values( 357 )
+master-bin.000001 4278 Query 1 4369 use `test`; insert into t1 values( 356 )
+master-bin.000001 4369 Query 1 4460 use `test`; insert into t1 values( 355 )
+master-bin.000001 4460 Query 1 4551 use `test`; insert into t1 values( 354 )
+master-bin.000001 4551 Query 1 4642 use `test`; insert into t1 values( 353 )
+master-bin.000001 4642 Query 1 4733 use `test`; insert into t1 values( 352 )
+master-bin.000001 4733 Query 1 4824 use `test`; insert into t1 values( 351 )
+master-bin.000001 4824 Query 1 4915 use `test`; insert into t1 values( 350 )
+master-bin.000001 4915 Query 1 5006 use `test`; insert into t1 values( 349 )
+master-bin.000001 5006 Query 1 5097 use `test`; insert into t1 values( 348 )
+master-bin.000001 5097 Query 1 5188 use `test`; insert into t1 values( 347 )
+master-bin.000001 5188 Query 1 5279 use `test`; insert into t1 values( 346 )
+master-bin.000001 5279 Query 1 5370 use `test`; insert into t1 values( 345 )
+master-bin.000001 5370 Query 1 5461 use `test`; insert into t1 values( 344 )
+master-bin.000001 5461 Query 1 5552 use `test`; insert into t1 values( 343 )
+master-bin.000001 5552 Query 1 5643 use `test`; insert into t1 values( 342 )
+master-bin.000001 5643 Query 1 5734 use `test`; insert into t1 values( 341 )
+master-bin.000001 5734 Query 1 5825 use `test`; insert into t1 values( 340 )
+master-bin.000001 5825 Query 1 5916 use `test`; insert into t1 values( 339 )
+master-bin.000001 5916 Query 1 6007 use `test`; insert into t1 values( 338 )
+master-bin.000001 6007 Query 1 6098 use `test`; insert into t1 values( 337 )
+master-bin.000001 6098 Query 1 6189 use `test`; insert into t1 values( 336 )
+master-bin.000001 6189 Query 1 6280 use `test`; insert into t1 values( 335 )
+master-bin.000001 6280 Query 1 6371 use `test`; insert into t1 values( 334 )
+master-bin.000001 6371 Query 1 6462 use `test`; insert into t1 values( 333 )
+master-bin.000001 6462 Query 1 6553 use `test`; insert into t1 values( 332 )
+master-bin.000001 6553 Query 1 6644 use `test`; insert into t1 values( 331 )
+master-bin.000001 6644 Query 1 6735 use `test`; insert into t1 values( 330 )
+master-bin.000001 6735 Query 1 6826 use `test`; insert into t1 values( 329 )
+master-bin.000001 6826 Query 1 6917 use `test`; insert into t1 values( 328 )
+master-bin.000001 6917 Query 1 7008 use `test`; insert into t1 values( 327 )
+master-bin.000001 7008 Query 1 7099 use `test`; insert into t1 values( 326 )
+master-bin.000001 7099 Query 1 7190 use `test`; insert into t1 values( 325 )
+master-bin.000001 7190 Query 1 7281 use `test`; insert into t1 values( 324 )
+master-bin.000001 7281 Query 1 7372 use `test`; insert into t1 values( 323 )
+master-bin.000001 7372 Query 1 7463 use `test`; insert into t1 values( 322 )
+master-bin.000001 7463 Query 1 7554 use `test`; insert into t1 values( 321 )
+master-bin.000001 7554 Query 1 7645 use `test`; insert into t1 values( 320 )
+master-bin.000001 7645 Query 1 7736 use `test`; insert into t1 values( 319 )
+master-bin.000001 7736 Query 1 7827 use `test`; insert into t1 values( 318 )
+master-bin.000001 7827 Query 1 7918 use `test`; insert into t1 values( 317 )
+master-bin.000001 7918 Query 1 8009 use `test`; insert into t1 values( 316 )
+master-bin.000001 8009 Query 1 8100 use `test`; insert into t1 values( 315 )
+master-bin.000001 8100 Query 1 8191 use `test`; insert into t1 values( 314 )
+master-bin.000001 8191 Query 1 8282 use `test`; insert into t1 values( 313 )
+master-bin.000001 8282 Query 1 8373 use `test`; insert into t1 values( 312 )
+master-bin.000001 8373 Query 1 8464 use `test`; insert into t1 values( 311 )
+master-bin.000001 8464 Query 1 8555 use `test`; insert into t1 values( 310 )
+master-bin.000001 8555 Query 1 8646 use `test`; insert into t1 values( 309 )
+master-bin.000001 8646 Query 1 8737 use `test`; insert into t1 values( 308 )
+master-bin.000001 8737 Query 1 8828 use `test`; insert into t1 values( 307 )
+master-bin.000001 8828 Query 1 8919 use `test`; insert into t1 values( 306 )
+master-bin.000001 8919 Query 1 9010 use `test`; insert into t1 values( 305 )
+master-bin.000001 9010 Query 1 9101 use `test`; insert into t1 values( 304 )
+master-bin.000001 9101 Query 1 9192 use `test`; insert into t1 values( 303 )
+master-bin.000001 9192 Query 1 9283 use `test`; insert into t1 values( 302 )
+master-bin.000001 9283 Query 1 9374 use `test`; insert into t1 values( 301 )
+master-bin.000001 9374 Query 1 9465 use `test`; insert into t1 values( 300 )
+master-bin.000001 9465 Query 1 9556 use `test`; insert into t1 values( 299 )
+master-bin.000001 9556 Query 1 9647 use `test`; insert into t1 values( 298 )
+master-bin.000001 9647 Query 1 9738 use `test`; insert into t1 values( 297 )
+master-bin.000001 9738 Query 1 9829 use `test`; insert into t1 values( 296 )
+master-bin.000001 9829 Query 1 9920 use `test`; insert into t1 values( 295 )
+master-bin.000001 9920 Query 1 10011 use `test`; insert into t1 values( 294 )
+master-bin.000001 10011 Query 1 10102 use `test`; insert into t1 values( 293 )
+master-bin.000001 10102 Query 1 10193 use `test`; insert into t1 values( 292 )
+master-bin.000001 10193 Query 1 10284 use `test`; insert into t1 values( 291 )
+master-bin.000001 10284 Query 1 10375 use `test`; insert into t1 values( 290 )
+master-bin.000001 10375 Query 1 10466 use `test`; insert into t1 values( 289 )
+master-bin.000001 10466 Query 1 10557 use `test`; insert into t1 values( 288 )
+master-bin.000001 10557 Query 1 10648 use `test`; insert into t1 values( 287 )
+master-bin.000001 10648 Query 1 10739 use `test`; insert into t1 values( 286 )
+master-bin.000001 10739 Query 1 10830 use `test`; insert into t1 values( 285 )
+master-bin.000001 10830 Query 1 10921 use `test`; insert into t1 values( 284 )
+master-bin.000001 10921 Query 1 11012 use `test`; insert into t1 values( 283 )
+master-bin.000001 11012 Query 1 11103 use `test`; insert into t1 values( 282 )
+master-bin.000001 11103 Query 1 11194 use `test`; insert into t1 values( 281 )
+master-bin.000001 11194 Query 1 11285 use `test`; insert into t1 values( 280 )
+master-bin.000001 11285 Query 1 11376 use `test`; insert into t1 values( 279 )
+master-bin.000001 11376 Query 1 11467 use `test`; insert into t1 values( 278 )
+master-bin.000001 11467 Query 1 11558 use `test`; insert into t1 values( 277 )
+master-bin.000001 11558 Query 1 11649 use `test`; insert into t1 values( 276 )
+master-bin.000001 11649 Query 1 11740 use `test`; insert into t1 values( 275 )
+master-bin.000001 11740 Query 1 11831 use `test`; insert into t1 values( 274 )
+master-bin.000001 11831 Query 1 11922 use `test`; insert into t1 values( 273 )
+master-bin.000001 11922 Query 1 12013 use `test`; insert into t1 values( 272 )
+master-bin.000001 12013 Query 1 12104 use `test`; insert into t1 values( 271 )
+master-bin.000001 12104 Query 1 12195 use `test`; insert into t1 values( 270 )
+master-bin.000001 12195 Query 1 12286 use `test`; insert into t1 values( 269 )
+master-bin.000001 12286 Query 1 12377 use `test`; insert into t1 values( 268 )
+master-bin.000001 12377 Query 1 12468 use `test`; insert into t1 values( 267 )
+master-bin.000001 12468 Query 1 12559 use `test`; insert into t1 values( 266 )
+master-bin.000001 12559 Query 1 12650 use `test`; insert into t1 values( 265 )
+master-bin.000001 12650 Query 1 12741 use `test`; insert into t1 values( 264 )
+master-bin.000001 12741 Query 1 12832 use `test`; insert into t1 values( 263 )
+master-bin.000001 12832 Query 1 12923 use `test`; insert into t1 values( 262 )
+master-bin.000001 12923 Query 1 13014 use `test`; insert into t1 values( 261 )
+master-bin.000001 13014 Query 1 13105 use `test`; insert into t1 values( 260 )
+master-bin.000001 13105 Query 1 13196 use `test`; insert into t1 values( 259 )
+master-bin.000001 13196 Query 1 13287 use `test`; insert into t1 values( 258 )
+master-bin.000001 13287 Query 1 13378 use `test`; insert into t1 values( 257 )
+master-bin.000001 13378 Query 1 13469 use `test`; insert into t1 values( 256 )
+master-bin.000001 13469 Query 1 13560 use `test`; insert into t1 values( 255 )
+master-bin.000001 13560 Query 1 13651 use `test`; insert into t1 values( 254 )
+master-bin.000001 13651 Query 1 13742 use `test`; insert into t1 values( 253 )
+master-bin.000001 13742 Query 1 13833 use `test`; insert into t1 values( 252 )
+master-bin.000001 13833 Query 1 13924 use `test`; insert into t1 values( 251 )
+master-bin.000001 13924 Query 1 14015 use `test`; insert into t1 values( 250 )
+master-bin.000001 14015 Query 1 14106 use `test`; insert into t1 values( 249 )
+master-bin.000001 14106 Query 1 14197 use `test`; insert into t1 values( 248 )
+master-bin.000001 14197 Query 1 14288 use `test`; insert into t1 values( 247 )
+master-bin.000001 14288 Query 1 14379 use `test`; insert into t1 values( 246 )
+master-bin.000001 14379 Query 1 14470 use `test`; insert into t1 values( 245 )
+master-bin.000001 14470 Query 1 14561 use `test`; insert into t1 values( 244 )
+master-bin.000001 14561 Query 1 14652 use `test`; insert into t1 values( 243 )
+master-bin.000001 14652 Query 1 14743 use `test`; insert into t1 values( 242 )
+master-bin.000001 14743 Query 1 14834 use `test`; insert into t1 values( 241 )
+master-bin.000001 14834 Query 1 14925 use `test`; insert into t1 values( 240 )
+master-bin.000001 14925 Query 1 15016 use `test`; insert into t1 values( 239 )
+master-bin.000001 15016 Query 1 15107 use `test`; insert into t1 values( 238 )
+master-bin.000001 15107 Query 1 15198 use `test`; insert into t1 values( 237 )
+master-bin.000001 15198 Query 1 15289 use `test`; insert into t1 values( 236 )
+master-bin.000001 15289 Query 1 15380 use `test`; insert into t1 values( 235 )
+master-bin.000001 15380 Query 1 15471 use `test`; insert into t1 values( 234 )
+master-bin.000001 15471 Query 1 15562 use `test`; insert into t1 values( 233 )
+master-bin.000001 15562 Query 1 15653 use `test`; insert into t1 values( 232 )
+master-bin.000001 15653 Query 1 15744 use `test`; insert into t1 values( 231 )
+master-bin.000001 15744 Query 1 15835 use `test`; insert into t1 values( 230 )
+master-bin.000001 15835 Query 1 15926 use `test`; insert into t1 values( 229 )
+master-bin.000001 15926 Query 1 16017 use `test`; insert into t1 values( 228 )
+master-bin.000001 16017 Query 1 16108 use `test`; insert into t1 values( 227 )
+master-bin.000001 16108 Query 1 16199 use `test`; insert into t1 values( 226 )
+master-bin.000001 16199 Query 1 16290 use `test`; insert into t1 values( 225 )
+master-bin.000001 16290 Query 1 16381 use `test`; insert into t1 values( 224 )
+master-bin.000001 16381 Query 1 16472 use `test`; insert into t1 values( 223 )
+master-bin.000001 16472 Query 1 16563 use `test`; insert into t1 values( 222 )
+master-bin.000001 16563 Query 1 16654 use `test`; insert into t1 values( 221 )
+master-bin.000001 16654 Query 1 16745 use `test`; insert into t1 values( 220 )
+master-bin.000001 16745 Query 1 16836 use `test`; insert into t1 values( 219 )
+master-bin.000001 16836 Query 1 16927 use `test`; insert into t1 values( 218 )
+master-bin.000001 16927 Query 1 17018 use `test`; insert into t1 values( 217 )
+master-bin.000001 17018 Query 1 17109 use `test`; insert into t1 values( 216 )
+master-bin.000001 17109 Query 1 17200 use `test`; insert into t1 values( 215 )
+master-bin.000001 17200 Query 1 17291 use `test`; insert into t1 values( 214 )
+master-bin.000001 17291 Query 1 17382 use `test`; insert into t1 values( 213 )
+master-bin.000001 17382 Query 1 17473 use `test`; insert into t1 values( 212 )
+master-bin.000001 17473 Query 1 17564 use `test`; insert into t1 values( 211 )
+master-bin.000001 17564 Query 1 17655 use `test`; insert into t1 values( 210 )
+master-bin.000001 17655 Query 1 17746 use `test`; insert into t1 values( 209 )
+master-bin.000001 17746 Query 1 17837 use `test`; insert into t1 values( 208 )
+master-bin.000001 17837 Query 1 17928 use `test`; insert into t1 values( 207 )
+master-bin.000001 17928 Query 1 18019 use `test`; insert into t1 values( 206 )
+master-bin.000001 18019 Query 1 18110 use `test`; insert into t1 values( 205 )
+master-bin.000001 18110 Query 1 18201 use `test`; insert into t1 values( 204 )
+master-bin.000001 18201 Query 1 18292 use `test`; insert into t1 values( 203 )
+master-bin.000001 18292 Query 1 18383 use `test`; insert into t1 values( 202 )
+master-bin.000001 18383 Query 1 18474 use `test`; insert into t1 values( 201 )
+master-bin.000001 18474 Query 1 18565 use `test`; insert into t1 values( 200 )
+master-bin.000001 18565 Query 1 18656 use `test`; insert into t1 values( 199 )
+master-bin.000001 18656 Query 1 18747 use `test`; insert into t1 values( 198 )
+master-bin.000001 18747 Query 1 18838 use `test`; insert into t1 values( 197 )
+master-bin.000001 18838 Query 1 18929 use `test`; insert into t1 values( 196 )
+master-bin.000001 18929 Query 1 19020 use `test`; insert into t1 values( 195 )
+master-bin.000001 19020 Query 1 19111 use `test`; insert into t1 values( 194 )
+master-bin.000001 19111 Query 1 19202 use `test`; insert into t1 values( 193 )
+master-bin.000001 19202 Query 1 19293 use `test`; insert into t1 values( 192 )
+master-bin.000001 19293 Query 1 19384 use `test`; insert into t1 values( 191 )
+master-bin.000001 19384 Query 1 19475 use `test`; insert into t1 values( 190 )
+master-bin.000001 19475 Query 1 19566 use `test`; insert into t1 values( 189 )
+master-bin.000001 19566 Query 1 19657 use `test`; insert into t1 values( 188 )
+master-bin.000001 19657 Query 1 19748 use `test`; insert into t1 values( 187 )
+master-bin.000001 19748 Query 1 19839 use `test`; insert into t1 values( 186 )
+master-bin.000001 19839 Query 1 19930 use `test`; insert into t1 values( 185 )
+master-bin.000001 19930 Query 1 20021 use `test`; insert into t1 values( 184 )
+master-bin.000001 20021 Query 1 20112 use `test`; insert into t1 values( 183 )
+master-bin.000001 20112 Query 1 20203 use `test`; insert into t1 values( 182 )
+master-bin.000001 20203 Query 1 20294 use `test`; insert into t1 values( 181 )
+master-bin.000001 20294 Query 1 20385 use `test`; insert into t1 values( 180 )
+master-bin.000001 20385 Query 1 20476 use `test`; insert into t1 values( 179 )
+master-bin.000001 20476 Query 1 20567 use `test`; insert into t1 values( 178 )
+master-bin.000001 20567 Query 1 20658 use `test`; insert into t1 values( 177 )
+master-bin.000001 20658 Query 1 20749 use `test`; insert into t1 values( 176 )
+master-bin.000001 20749 Query 1 20840 use `test`; insert into t1 values( 175 )
+master-bin.000001 20840 Query 1 20931 use `test`; insert into t1 values( 174 )
+master-bin.000001 20931 Query 1 21022 use `test`; insert into t1 values( 173 )
+master-bin.000001 21022 Query 1 21113 use `test`; insert into t1 values( 172 )
+master-bin.000001 21113 Query 1 21204 use `test`; insert into t1 values( 171 )
+master-bin.000001 21204 Query 1 21295 use `test`; insert into t1 values( 170 )
+master-bin.000001 21295 Query 1 21386 use `test`; insert into t1 values( 169 )
+master-bin.000001 21386 Query 1 21477 use `test`; insert into t1 values( 168 )
+master-bin.000001 21477 Query 1 21568 use `test`; insert into t1 values( 167 )
+master-bin.000001 21568 Query 1 21659 use `test`; insert into t1 values( 166 )
+master-bin.000001 21659 Query 1 21750 use `test`; insert into t1 values( 165 )
+master-bin.000001 21750 Query 1 21841 use `test`; insert into t1 values( 164 )
+master-bin.000001 21841 Query 1 21932 use `test`; insert into t1 values( 163 )
+master-bin.000001 21932 Query 1 22023 use `test`; insert into t1 values( 162 )
+master-bin.000001 22023 Query 1 22114 use `test`; insert into t1 values( 161 )
+master-bin.000001 22114 Query 1 22205 use `test`; insert into t1 values( 160 )
+master-bin.000001 22205 Query 1 22296 use `test`; insert into t1 values( 159 )
+master-bin.000001 22296 Query 1 22387 use `test`; insert into t1 values( 158 )
+master-bin.000001 22387 Query 1 22478 use `test`; insert into t1 values( 157 )
+master-bin.000001 22478 Query 1 22569 use `test`; insert into t1 values( 156 )
+master-bin.000001 22569 Query 1 22660 use `test`; insert into t1 values( 155 )
+master-bin.000001 22660 Query 1 22751 use `test`; insert into t1 values( 154 )
+master-bin.000001 22751 Query 1 22842 use `test`; insert into t1 values( 153 )
+master-bin.000001 22842 Query 1 22933 use `test`; insert into t1 values( 152 )
+master-bin.000001 22933 Query 1 23024 use `test`; insert into t1 values( 151 )
+master-bin.000001 23024 Query 1 23115 use `test`; insert into t1 values( 150 )
+master-bin.000001 23115 Query 1 23206 use `test`; insert into t1 values( 149 )
+master-bin.000001 23206 Query 1 23297 use `test`; insert into t1 values( 148 )
+master-bin.000001 23297 Query 1 23388 use `test`; insert into t1 values( 147 )
+master-bin.000001 23388 Query 1 23479 use `test`; insert into t1 values( 146 )
+master-bin.000001 23479 Query 1 23570 use `test`; insert into t1 values( 145 )
+master-bin.000001 23570 Query 1 23661 use `test`; insert into t1 values( 144 )
+master-bin.000001 23661 Query 1 23752 use `test`; insert into t1 values( 143 )
+master-bin.000001 23752 Query 1 23843 use `test`; insert into t1 values( 142 )
+master-bin.000001 23843 Query 1 23934 use `test`; insert into t1 values( 141 )
+master-bin.000001 23934 Query 1 24025 use `test`; insert into t1 values( 140 )
+master-bin.000001 24025 Query 1 24116 use `test`; insert into t1 values( 139 )
+master-bin.000001 24116 Query 1 24207 use `test`; insert into t1 values( 138 )
+master-bin.000001 24207 Query 1 24298 use `test`; insert into t1 values( 137 )
+master-bin.000001 24298 Query 1 24389 use `test`; insert into t1 values( 136 )
+master-bin.000001 24389 Query 1 24480 use `test`; insert into t1 values( 135 )
+master-bin.000001 24480 Query 1 24571 use `test`; insert into t1 values( 134 )
+master-bin.000001 24571 Query 1 24662 use `test`; insert into t1 values( 133 )
+master-bin.000001 24662 Query 1 24753 use `test`; insert into t1 values( 132 )
+master-bin.000001 24753 Query 1 24844 use `test`; insert into t1 values( 131 )
+master-bin.000001 24844 Query 1 24935 use `test`; insert into t1 values( 130 )
+master-bin.000001 24935 Query 1 25026 use `test`; insert into t1 values( 129 )
+master-bin.000001 25026 Query 1 25117 use `test`; insert into t1 values( 128 )
+master-bin.000001 25117 Query 1 25208 use `test`; insert into t1 values( 127 )
+master-bin.000001 25208 Query 1 25299 use `test`; insert into t1 values( 126 )
+master-bin.000001 25299 Query 1 25390 use `test`; insert into t1 values( 125 )
+master-bin.000001 25390 Query 1 25481 use `test`; insert into t1 values( 124 )
+master-bin.000001 25481 Query 1 25572 use `test`; insert into t1 values( 123 )
+master-bin.000001 25572 Query 1 25663 use `test`; insert into t1 values( 122 )
+master-bin.000001 25663 Query 1 25754 use `test`; insert into t1 values( 121 )
+master-bin.000001 25754 Query 1 25845 use `test`; insert into t1 values( 120 )
+master-bin.000001 25845 Query 1 25936 use `test`; insert into t1 values( 119 )
+master-bin.000001 25936 Query 1 26027 use `test`; insert into t1 values( 118 )
+master-bin.000001 26027 Query 1 26118 use `test`; insert into t1 values( 117 )
+master-bin.000001 26118 Query 1 26209 use `test`; insert into t1 values( 116 )
+master-bin.000001 26209 Query 1 26300 use `test`; insert into t1 values( 115 )
+master-bin.000001 26300 Query 1 26391 use `test`; insert into t1 values( 114 )
+master-bin.000001 26391 Query 1 26482 use `test`; insert into t1 values( 113 )
+master-bin.000001 26482 Query 1 26573 use `test`; insert into t1 values( 112 )
+master-bin.000001 26573 Query 1 26664 use `test`; insert into t1 values( 111 )
+master-bin.000001 26664 Query 1 26755 use `test`; insert into t1 values( 110 )
+master-bin.000001 26755 Query 1 26846 use `test`; insert into t1 values( 109 )
+master-bin.000001 26846 Query 1 26937 use `test`; insert into t1 values( 108 )
+master-bin.000001 26937 Query 1 27028 use `test`; insert into t1 values( 107 )
+master-bin.000001 27028 Query 1 27119 use `test`; insert into t1 values( 106 )
+master-bin.000001 27119 Query 1 27210 use `test`; insert into t1 values( 105 )
+master-bin.000001 27210 Query 1 27301 use `test`; insert into t1 values( 104 )
+master-bin.000001 27301 Query 1 27392 use `test`; insert into t1 values( 103 )
+master-bin.000001 27392 Query 1 27483 use `test`; insert into t1 values( 102 )
+master-bin.000001 27483 Query 1 27574 use `test`; insert into t1 values( 101 )
+master-bin.000001 27574 Query 1 27665 use `test`; insert into t1 values( 100 )
+master-bin.000001 27665 Query 1 27755 use `test`; insert into t1 values( 99 )
+master-bin.000001 27755 Query 1 27845 use `test`; insert into t1 values( 98 )
+master-bin.000001 27845 Query 1 27935 use `test`; insert into t1 values( 97 )
+master-bin.000001 27935 Query 1 28025 use `test`; insert into t1 values( 96 )
+master-bin.000001 28025 Query 1 28115 use `test`; insert into t1 values( 95 )
+master-bin.000001 28115 Query 1 28205 use `test`; insert into t1 values( 94 )
+master-bin.000001 28205 Query 1 28295 use `test`; insert into t1 values( 93 )
+master-bin.000001 28295 Query 1 28385 use `test`; insert into t1 values( 92 )
+master-bin.000001 28385 Query 1 28475 use `test`; insert into t1 values( 91 )
+master-bin.000001 28475 Query 1 28565 use `test`; insert into t1 values( 90 )
+master-bin.000001 28565 Query 1 28655 use `test`; insert into t1 values( 89 )
+master-bin.000001 28655 Query 1 28745 use `test`; insert into t1 values( 88 )
+master-bin.000001 28745 Query 1 28835 use `test`; insert into t1 values( 87 )
+master-bin.000001 28835 Query 1 28925 use `test`; insert into t1 values( 86 )
+master-bin.000001 28925 Query 1 29015 use `test`; insert into t1 values( 85 )
+master-bin.000001 29015 Query 1 29105 use `test`; insert into t1 values( 84 )
+master-bin.000001 29105 Query 1 29195 use `test`; insert into t1 values( 83 )
+master-bin.000001 29195 Query 1 29285 use `test`; insert into t1 values( 82 )
+master-bin.000001 29285 Query 1 29375 use `test`; insert into t1 values( 81 )
+master-bin.000001 29375 Query 1 29465 use `test`; insert into t1 values( 80 )
+master-bin.000001 29465 Query 1 29555 use `test`; insert into t1 values( 79 )
+master-bin.000001 29555 Query 1 29645 use `test`; insert into t1 values( 78 )
+master-bin.000001 29645 Query 1 29735 use `test`; insert into t1 values( 77 )
+master-bin.000001 29735 Query 1 29825 use `test`; insert into t1 values( 76 )
+master-bin.000001 29825 Query 1 29915 use `test`; insert into t1 values( 75 )
+master-bin.000001 29915 Query 1 30005 use `test`; insert into t1 values( 74 )
+master-bin.000001 30005 Query 1 30095 use `test`; insert into t1 values( 73 )
+master-bin.000001 30095 Query 1 30185 use `test`; insert into t1 values( 72 )
+master-bin.000001 30185 Query 1 30275 use `test`; insert into t1 values( 71 )
+master-bin.000001 30275 Query 1 30365 use `test`; insert into t1 values( 70 )
+master-bin.000001 30365 Query 1 30455 use `test`; insert into t1 values( 69 )
+master-bin.000001 30455 Query 1 30545 use `test`; insert into t1 values( 68 )
+master-bin.000001 30545 Query 1 30635 use `test`; insert into t1 values( 67 )
+master-bin.000001 30635 Query 1 30725 use `test`; insert into t1 values( 66 )
+master-bin.000001 30725 Query 1 30815 use `test`; insert into t1 values( 65 )
+master-bin.000001 30815 Query 1 30905 use `test`; insert into t1 values( 64 )
+master-bin.000001 30905 Query 1 30995 use `test`; insert into t1 values( 63 )
+master-bin.000001 30995 Query 1 31085 use `test`; insert into t1 values( 62 )
+master-bin.000001 31085 Query 1 31175 use `test`; insert into t1 values( 61 )
+master-bin.000001 31175 Query 1 31265 use `test`; insert into t1 values( 60 )
+master-bin.000001 31265 Query 1 31355 use `test`; insert into t1 values( 59 )
+master-bin.000001 31355 Query 1 31445 use `test`; insert into t1 values( 58 )
+master-bin.000001 31445 Query 1 31535 use `test`; insert into t1 values( 57 )
+master-bin.000001 31535 Query 1 31625 use `test`; insert into t1 values( 56 )
+master-bin.000001 31625 Query 1 31715 use `test`; insert into t1 values( 55 )
+master-bin.000001 31715 Query 1 31805 use `test`; insert into t1 values( 54 )
+master-bin.000001 31805 Query 1 31895 use `test`; insert into t1 values( 53 )
+master-bin.000001 31895 Query 1 31985 use `test`; insert into t1 values( 52 )
+master-bin.000001 31985 Query 1 32075 use `test`; insert into t1 values( 51 )
+master-bin.000001 32075 Query 1 32165 use `test`; insert into t1 values( 50 )
+master-bin.000001 32165 Query 1 32255 use `test`; insert into t1 values( 49 )
+master-bin.000001 32255 Query 1 32345 use `test`; insert into t1 values( 48 )
+master-bin.000001 32345 Query 1 32435 use `test`; insert into t1 values( 47 )
+master-bin.000001 32435 Query 1 32525 use `test`; insert into t1 values( 46 )
+master-bin.000001 32525 Query 1 32615 use `test`; insert into t1 values( 45 )
+master-bin.000001 32615 Query 1 32705 use `test`; insert into t1 values( 44 )
+master-bin.000001 32705 Query 1 32795 use `test`; insert into t1 values( 43 )
+master-bin.000001 32795 Query 1 32885 use `test`; insert into t1 values( 42 )
+master-bin.000001 32885 Query 1 32975 use `test`; insert into t1 values( 41 )
+master-bin.000001 32975 Query 1 33065 use `test`; insert into t1 values( 40 )
+master-bin.000001 33065 Query 1 33155 use `test`; insert into t1 values( 39 )
+master-bin.000001 33155 Query 1 33245 use `test`; insert into t1 values( 38 )
+master-bin.000001 33245 Query 1 33335 use `test`; insert into t1 values( 37 )
+master-bin.000001 33335 Query 1 33425 use `test`; insert into t1 values( 36 )
+master-bin.000001 33425 Query 1 33515 use `test`; insert into t1 values( 35 )
+master-bin.000001 33515 Query 1 33605 use `test`; insert into t1 values( 34 )
+master-bin.000001 33605 Query 1 33695 use `test`; insert into t1 values( 33 )
+master-bin.000001 33695 Query 1 33785 use `test`; insert into t1 values( 32 )
+master-bin.000001 33785 Query 1 33875 use `test`; insert into t1 values( 31 )
+master-bin.000001 33875 Query 1 33965 use `test`; insert into t1 values( 30 )
+master-bin.000001 33965 Query 1 34055 use `test`; insert into t1 values( 29 )
+master-bin.000001 34055 Query 1 34145 use `test`; insert into t1 values( 28 )
+master-bin.000001 34145 Query 1 34235 use `test`; insert into t1 values( 27 )
+master-bin.000001 34235 Query 1 34325 use `test`; insert into t1 values( 26 )
+master-bin.000001 34325 Query 1 34415 use `test`; insert into t1 values( 25 )
+master-bin.000001 34415 Query 1 34505 use `test`; insert into t1 values( 24 )
+master-bin.000001 34505 Query 1 34595 use `test`; insert into t1 values( 23 )
+master-bin.000001 34595 Query 1 34685 use `test`; insert into t1 values( 22 )
+master-bin.000001 34685 Query 1 34775 use `test`; insert into t1 values( 21 )
+master-bin.000001 34775 Query 1 34865 use `test`; insert into t1 values( 20 )
+master-bin.000001 34865 Query 1 34955 use `test`; insert into t1 values( 19 )
+master-bin.000001 34955 Query 1 35045 use `test`; insert into t1 values( 18 )
+master-bin.000001 35045 Query 1 35135 use `test`; insert into t1 values( 17 )
+master-bin.000001 35135 Query 1 35225 use `test`; insert into t1 values( 16 )
+master-bin.000001 35225 Query 1 35315 use `test`; insert into t1 values( 15 )
+master-bin.000001 35315 Query 1 35405 use `test`; insert into t1 values( 14 )
+master-bin.000001 35405 Query 1 35495 use `test`; insert into t1 values( 13 )
+master-bin.000001 35495 Query 1 35585 use `test`; insert into t1 values( 12 )
+master-bin.000001 35585 Query 1 35675 use `test`; insert into t1 values( 11 )
+master-bin.000001 35675 Query 1 35765 use `test`; insert into t1 values( 10 )
+master-bin.000001 35765 Query 1 35854 use `test`; insert into t1 values( 9 )
+master-bin.000001 35854 Query 1 35943 use `test`; insert into t1 values( 8 )
+master-bin.000001 35943 Query 1 36032 use `test`; insert into t1 values( 7 )
+master-bin.000001 36032 Query 1 36121 use `test`; insert into t1 values( 6 )
+master-bin.000001 36121 Query 1 36210 use `test`; insert into t1 values( 5 )
+master-bin.000001 36210 Query 1 36299 use `test`; insert into t1 values( 4 )
+master-bin.000001 36299 Query 1 36388 use `test`; insert into t1 values( 3 )
+master-bin.000001 36388 Query 1 36477 use `test`; insert into t1 values( 2 )
+master-bin.000001 36477 Query 1 36566 use `test`; insert into t1 values( 1 )
+master-bin.000001 36566 Xid 1 36593 COMMIT /* XID */
+master-bin.000001 36593 Rotate 1 36637 master-bin.000002;pos=4
+drop table t1;
+set global binlog_cache_size=@bcs;
+set session autocommit = @ac;
+End of 5.0 tests
+reset master;
+create table t1 (id tinyint auto_increment primary key);
+set insert_id=128;
+insert into t1 values(null);
+Warnings:
+Warning 1264 Out of range value for column 'id' at row 1
+select * from t1;
+id
+127
+drop table t1;
+create table t1 (a int);
+create table if not exists t2 select * from t1;
+create temporary table tt1 (a int);
+create table if not exists t3 like tt1;
+USE mysql;
+INSERT INTO user SET host='localhost', user='@#@', password=password('Just a test');
+UPDATE user SET password=password('Another password') WHERE host='localhost' AND user='@#@';
+DELETE FROM user WHERE host='localhost' AND user='@#@';
+use test;
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; create table t1 (id tinyint auto_increment primary key)
+master-bin.000001 # Intvar # # INSERT_ID=127
+master-bin.000001 # Query # # use `test`; insert into t1 values(null)
+master-bin.000001 # Query # # use `test`; drop table t1
+master-bin.000001 # Query # # use `test`; create table t1 (a int)
+master-bin.000001 # Query # # use `test`; create table if not exists t2 select * from t1
+master-bin.000001 # Query # # use `test`; create temporary table tt1 (a int)
+master-bin.000001 # Query # # use `test`; create table if not exists t3 like tt1
+master-bin.000001 # Query # # use `mysql`; INSERT INTO user SET host='localhost', user='@#@', password=password('Just a test')
+master-bin.000001 # Query # # use `mysql`; UPDATE user SET password=password('Another password') WHERE host='localhost' AND user='@#@'
+master-bin.000001 # Query # # use `mysql`; DELETE FROM user WHERE host='localhost' AND user='@#@'
+drop table t1,t2,t3,tt1;
+create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
+set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
+insert delayed into t1 values (207);
+insert delayed into t1 values (null);
+insert delayed into t1 values (300);
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; create table t1 (id tinyint auto_increment primary key)
+master-bin.000001 # Intvar # # INSERT_ID=127
+master-bin.000001 # Query # # use `test`; insert into t1 values(null)
+master-bin.000001 # Query # # use `test`; drop table t1
+master-bin.000001 # Query # # use `test`; create table t1 (a int)
+master-bin.000001 # Query # # use `test`; create table if not exists t2 select * from t1
+master-bin.000001 # Query # # use `test`; create temporary table tt1 (a int)
+master-bin.000001 # Query # # use `test`; create table if not exists t3 like tt1
+master-bin.000001 # Query # # use `mysql`; INSERT INTO user SET host='localhost', user='@#@', password=password('Just a test')
+master-bin.000001 # Query # # use `mysql`; UPDATE user SET password=password('Another password') WHERE host='localhost' AND user='@#@'
+master-bin.000001 # Query # # use `mysql`; DELETE FROM user WHERE host='localhost' AND user='@#@'
+master-bin.000001 # Query # # use `test`; drop table t1,t2,t3,tt1
+master-bin.000001 # Query # # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+insert delayed into t1 values (null),(null),(null),(null);
+insert delayed into t1 values (null),(null),(400),(null);
+11 == 11
+select * from t1;
+a
+207
+208
+300
+301
+302
+303
+304
+305
+306
+400
+401
+drop table t1;
+reset master;
+drop table if exists t3;
+create table t3 (a int(11) NOT NULL AUTO_INCREMENT, b text, PRIMARY KEY (a) ) engine=innodb;
+show master status;
+File Position Binlog_Do_DB Binlog_Ignore_DB
+master-bin.000001 346
+insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
+insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
+insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
+insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
+show master status /* must show new binlog index after rotating */;
+File Position Binlog_Do_DB Binlog_Ignore_DB
+master-bin.000002 106
+drop table t3;
diff --git a/mysql-test/r/binlog_stm_blackhole.result b/mysql-test/suite/binlog/r/binlog_stm_blackhole.result
index a1c83ffc73d..a1c83ffc73d 100644
--- a/mysql-test/r/binlog_stm_blackhole.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_blackhole.result
diff --git a/mysql-test/r/binlog_stm_ctype_cp932.result b/mysql-test/suite/binlog/r/binlog_stm_ctype_cp932.result
index ef9f76b7d9c..ef9f76b7d9c 100755
--- a/mysql-test/r/binlog_stm_ctype_cp932.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_ctype_cp932.result
diff --git a/mysql-test/r/binlog_stm_ctype_ucs.result b/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result
index c789c618876..c789c618876 100644
--- a/mysql-test/r/binlog_stm_ctype_ucs.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result
diff --git a/mysql-test/r/binlog_stm_drop_tmp_tbl.result b/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result
index dc4349dea59..dc4349dea59 100644
--- a/mysql-test/r/binlog_stm_drop_tmp_tbl.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result
diff --git a/mysql-test/r/binlog_stm_innodb_stat.result b/mysql-test/suite/binlog/r/binlog_stm_innodb_stat.result
index e6813ee2719..e6813ee2719 100644
--- a/mysql-test/r/binlog_stm_innodb_stat.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_innodb_stat.result
diff --git a/mysql-test/r/binlog_stm_insert_select.result b/mysql-test/suite/binlog/r/binlog_stm_insert_select.result
index a93a8edf4aa..a93a8edf4aa 100644
--- a/mysql-test/r/binlog_stm_insert_select.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_insert_select.result
diff --git a/mysql-test/r/binlog_stm_mix_innodb_myisam.result b/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result
index c74fb17d600..c74fb17d600 100644
--- a/mysql-test/r/binlog_stm_mix_innodb_myisam.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result
diff --git a/mysql-test/r/binlog_stm_ps.result b/mysql-test/suite/binlog/r/binlog_stm_ps.result
index 47934665116..47934665116 100644
--- a/mysql-test/r/binlog_stm_ps.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_ps.result
diff --git a/mysql-test/t/binlog_innodb.test b/mysql-test/suite/binlog/t/binlog_innodb.test
index 3bad61db23a..3bad61db23a 100644
--- a/mysql-test/t/binlog_innodb.test
+++ b/mysql-test/suite/binlog/t/binlog_innodb.test
diff --git a/mysql-test/t/binlog_killed.test b/mysql-test/suite/binlog/t/binlog_killed.test
index 6c0b4b46a4e..6c0b4b46a4e 100644
--- a/mysql-test/t/binlog_killed.test
+++ b/mysql-test/suite/binlog/t/binlog_killed.test
diff --git a/mysql-test/t/binlog_multi_engine.test b/mysql-test/suite/binlog/t/binlog_multi_engine.test
index 058aca0f715..058aca0f715 100644
--- a/mysql-test/t/binlog_multi_engine.test
+++ b/mysql-test/suite/binlog/t/binlog_multi_engine.test
diff --git a/mysql-test/t/binlog_row_binlog-master.opt b/mysql-test/suite/binlog/t/binlog_row_binlog-master.opt
index ad2c6a647b5..ad2c6a647b5 100644
--- a/mysql-test/t/binlog_row_binlog-master.opt
+++ b/mysql-test/suite/binlog/t/binlog_row_binlog-master.opt
diff --git a/mysql-test/t/binlog_row_binlog.test b/mysql-test/suite/binlog/t/binlog_row_binlog.test
index 8adc8eee5c1..8adc8eee5c1 100644
--- a/mysql-test/t/binlog_row_binlog.test
+++ b/mysql-test/suite/binlog/t/binlog_row_binlog.test
diff --git a/mysql-test/t/binlog_row_ctype_cp932.test b/mysql-test/suite/binlog/t/binlog_row_ctype_cp932.test
index 595af5a3114..595af5a3114 100644
--- a/mysql-test/t/binlog_row_ctype_cp932.test
+++ b/mysql-test/suite/binlog/t/binlog_row_ctype_cp932.test
diff --git a/mysql-test/t/binlog_row_ctype_ucs.test b/mysql-test/suite/binlog/t/binlog_row_ctype_ucs.test
index 96e14ed8882..96e14ed8882 100644
--- a/mysql-test/t/binlog_row_ctype_ucs.test
+++ b/mysql-test/suite/binlog/t/binlog_row_ctype_ucs.test
diff --git a/mysql-test/t/binlog_row_drop_tmp_tbl.test b/mysql-test/suite/binlog/t/binlog_row_drop_tmp_tbl.test
index 5b503b78d85..5b503b78d85 100644
--- a/mysql-test/t/binlog_row_drop_tmp_tbl.test
+++ b/mysql-test/suite/binlog/t/binlog_row_drop_tmp_tbl.test
diff --git a/mysql-test/t/binlog_row_innodb_stat-master.opt b/mysql-test/suite/binlog/t/binlog_row_innodb_stat-master.opt
index 4cb927540bf..4cb927540bf 100644
--- a/mysql-test/t/binlog_row_innodb_stat-master.opt
+++ b/mysql-test/suite/binlog/t/binlog_row_innodb_stat-master.opt
diff --git a/mysql-test/t/binlog_row_innodb_stat.test b/mysql-test/suite/binlog/t/binlog_row_innodb_stat.test
index e4e6762226b..e4e6762226b 100644
--- a/mysql-test/t/binlog_row_innodb_stat.test
+++ b/mysql-test/suite/binlog/t/binlog_row_innodb_stat.test
diff --git a/mysql-test/t/binlog_row_insert_select.test b/mysql-test/suite/binlog/t/binlog_row_insert_select.test
index 806d495c8fb..806d495c8fb 100644
--- a/mysql-test/t/binlog_row_insert_select.test
+++ b/mysql-test/suite/binlog/t/binlog_row_insert_select.test
diff --git a/mysql-test/t/binlog_row_mix_innodb_myisam-master.opt b/mysql-test/suite/binlog/t/binlog_row_mix_innodb_myisam-master.opt
index e76299453d3..e76299453d3 100644
--- a/mysql-test/t/binlog_row_mix_innodb_myisam-master.opt
+++ b/mysql-test/suite/binlog/t/binlog_row_mix_innodb_myisam-master.opt
diff --git a/mysql-test/t/binlog_row_mix_innodb_myisam.test b/mysql-test/suite/binlog/t/binlog_row_mix_innodb_myisam.test
index 346866b01a6..346866b01a6 100644
--- a/mysql-test/t/binlog_row_mix_innodb_myisam.test
+++ b/mysql-test/suite/binlog/t/binlog_row_mix_innodb_myisam.test
diff --git a/mysql-test/t/binlog_statement_insert_delayed.test b/mysql-test/suite/binlog/t/binlog_statement_insert_delayed.test
index 9b78296236f..9b78296236f 100644
--- a/mysql-test/t/binlog_statement_insert_delayed.test
+++ b/mysql-test/suite/binlog/t/binlog_statement_insert_delayed.test
diff --git a/mysql-test/t/binlog_stm_binlog-master.opt b/mysql-test/suite/binlog/t/binlog_stm_binlog-master.opt
index ad2c6a647b5..ad2c6a647b5 100644
--- a/mysql-test/t/binlog_stm_binlog-master.opt
+++ b/mysql-test/suite/binlog/t/binlog_stm_binlog-master.opt
diff --git a/mysql-test/t/binlog_stm_binlog.test b/mysql-test/suite/binlog/t/binlog_stm_binlog.test
index 280b7a3aef9..280b7a3aef9 100644
--- a/mysql-test/t/binlog_stm_binlog.test
+++ b/mysql-test/suite/binlog/t/binlog_stm_binlog.test
diff --git a/mysql-test/t/binlog_stm_blackhole.test b/mysql-test/suite/binlog/t/binlog_stm_blackhole.test
index 02ba2be095b..02ba2be095b 100644
--- a/mysql-test/t/binlog_stm_blackhole.test
+++ b/mysql-test/suite/binlog/t/binlog_stm_blackhole.test
diff --git a/mysql-test/t/binlog_stm_ctype_cp932.test b/mysql-test/suite/binlog/t/binlog_stm_ctype_cp932.test
index c0791d81445..c0791d81445 100644
--- a/mysql-test/t/binlog_stm_ctype_cp932.test
+++ b/mysql-test/suite/binlog/t/binlog_stm_ctype_cp932.test
diff --git a/mysql-test/t/binlog_stm_ctype_ucs.test b/mysql-test/suite/binlog/t/binlog_stm_ctype_ucs.test
index c8cd7e06398..c8cd7e06398 100644
--- a/mysql-test/t/binlog_stm_ctype_ucs.test
+++ b/mysql-test/suite/binlog/t/binlog_stm_ctype_ucs.test
diff --git a/mysql-test/t/binlog_stm_drop_tmp_tbl.test b/mysql-test/suite/binlog/t/binlog_stm_drop_tmp_tbl.test
index 6017f272d01..6017f272d01 100644
--- a/mysql-test/t/binlog_stm_drop_tmp_tbl.test
+++ b/mysql-test/suite/binlog/t/binlog_stm_drop_tmp_tbl.test
diff --git a/mysql-test/t/binlog_stm_innodb_stat-master.opt b/mysql-test/suite/binlog/t/binlog_stm_innodb_stat-master.opt
index 4cb927540bf..4cb927540bf 100644
--- a/mysql-test/t/binlog_stm_innodb_stat-master.opt
+++ b/mysql-test/suite/binlog/t/binlog_stm_innodb_stat-master.opt
diff --git a/mysql-test/t/binlog_stm_innodb_stat.test b/mysql-test/suite/binlog/t/binlog_stm_innodb_stat.test
index a08039c4a41..a08039c4a41 100644
--- a/mysql-test/t/binlog_stm_innodb_stat.test
+++ b/mysql-test/suite/binlog/t/binlog_stm_innodb_stat.test
diff --git a/mysql-test/t/binlog_stm_insert_select.test b/mysql-test/suite/binlog/t/binlog_stm_insert_select.test
index 3aefa1e6cf7..3aefa1e6cf7 100644
--- a/mysql-test/t/binlog_stm_insert_select.test
+++ b/mysql-test/suite/binlog/t/binlog_stm_insert_select.test
diff --git a/mysql-test/t/binlog_stm_mix_innodb_myisam-master.opt b/mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam-master.opt
index e76299453d3..e76299453d3 100644
--- a/mysql-test/t/binlog_stm_mix_innodb_myisam-master.opt
+++ b/mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam-master.opt
diff --git a/mysql-test/t/binlog_stm_mix_innodb_myisam.test b/mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam.test
index 72651c13be7..72651c13be7 100644
--- a/mysql-test/t/binlog_stm_mix_innodb_myisam.test
+++ b/mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam.test
diff --git a/mysql-test/t/binlog_stm_ps.test b/mysql-test/suite/binlog/t/binlog_stm_ps.test
index 83add5af3d7..83add5af3d7 100644
--- a/mysql-test/t/binlog_stm_ps.test
+++ b/mysql-test/suite/binlog/t/binlog_stm_ps.test
diff --git a/mysql-test/suite/binlog/t/disabled.def b/mysql-test/suite/binlog/t/disabled.def
new file mode 100644
index 00000000000..76eeb5b00ef
--- /dev/null
+++ b/mysql-test/suite/binlog/t/disabled.def
@@ -0,0 +1,14 @@
+##############################################################################
+#
+# List the test cases that are to be disabled temporarily.
+#
+# Separate the test case name and the comment with ':'.
+#
+# <testcasename> : BUG#<xxxx> <date disabled> <disabler> <comment>
+#
+# Do not use any TAB characters for whitespace.
+#
+##############################################################################
+
+binlog_innodb : Bug#29806 2007-07-15 ingo master.err: InnoDB: Error: MySQL is freeing a thd
+binlog_killed : Bug#29806 2007-07-17 ingo master.err: InnoDB: Error: MySQL is freeing a thd
diff --git a/mysql-test/suite/funcs_1/t/suite.opt b/mysql-test/suite/funcs_1/t/suite.opt
new file mode 100644
index 00000000000..9b22c677b83
--- /dev/null
+++ b/mysql-test/suite/funcs_1/t/suite.opt
@@ -0,0 +1,2 @@
+--secure-file-priv=$MYSQL_TEST_DIR
+
diff --git a/mysql-test/suite/funcs_2/t/suite.opt b/mysql-test/suite/funcs_2/t/suite.opt
new file mode 100644
index 00000000000..9b22c677b83
--- /dev/null
+++ b/mysql-test/suite/funcs_2/t/suite.opt
@@ -0,0 +1,2 @@
+--secure-file-priv=$MYSQL_TEST_DIR
+
diff --git a/mysql-test/r/loaddata_autocom_ndb.result b/mysql-test/suite/ndb/r/loaddata_autocom_ndb.result
index f98e6a76981..f98e6a76981 100644
--- a/mysql-test/r/loaddata_autocom_ndb.result
+++ b/mysql-test/suite/ndb/r/loaddata_autocom_ndb.result
diff --git a/mysql-test/r/ndb_alter_table.result b/mysql-test/suite/ndb/r/ndb_alter_table.result
index 13c445b44ca..13c445b44ca 100644
--- a/mysql-test/r/ndb_alter_table.result
+++ b/mysql-test/suite/ndb/r/ndb_alter_table.result
diff --git a/mysql-test/r/ndb_alter_table2.result b/mysql-test/suite/ndb/r/ndb_alter_table2.result
index 3783c76447c..3783c76447c 100644
--- a/mysql-test/r/ndb_alter_table2.result
+++ b/mysql-test/suite/ndb/r/ndb_alter_table2.result
diff --git a/mysql-test/r/ndb_alter_table3.result b/mysql-test/suite/ndb/r/ndb_alter_table3.result
index ee7c9b1c7b0..ee7c9b1c7b0 100644
--- a/mysql-test/r/ndb_alter_table3.result
+++ b/mysql-test/suite/ndb/r/ndb_alter_table3.result
diff --git a/mysql-test/r/ndb_autodiscover.result b/mysql-test/suite/ndb/r/ndb_autodiscover.result
index 487f52f6427..487f52f6427 100644
--- a/mysql-test/r/ndb_autodiscover.result
+++ b/mysql-test/suite/ndb/r/ndb_autodiscover.result
diff --git a/mysql-test/r/ndb_autodiscover2.result b/mysql-test/suite/ndb/r/ndb_autodiscover2.result
index 269888e0820..269888e0820 100644
--- a/mysql-test/r/ndb_autodiscover2.result
+++ b/mysql-test/suite/ndb/r/ndb_autodiscover2.result
diff --git a/mysql-test/r/ndb_autodiscover3.result b/mysql-test/suite/ndb/r/ndb_autodiscover3.result
index 86495ebb3eb..86495ebb3eb 100644
--- a/mysql-test/r/ndb_autodiscover3.result
+++ b/mysql-test/suite/ndb/r/ndb_autodiscover3.result
diff --git a/mysql-test/r/ndb_backup_print.result b/mysql-test/suite/ndb/r/ndb_backup_print.result
index 7fa073bafb5..7fa073bafb5 100644
--- a/mysql-test/r/ndb_backup_print.result
+++ b/mysql-test/suite/ndb/r/ndb_backup_print.result
diff --git a/mysql-test/r/ndb_basic.result b/mysql-test/suite/ndb/r/ndb_basic.result
index 4eddaeb1227..4eddaeb1227 100644
--- a/mysql-test/r/ndb_basic.result
+++ b/mysql-test/suite/ndb/r/ndb_basic.result
diff --git a/mysql-test/r/ndb_binlog_basic.result b/mysql-test/suite/ndb/r/ndb_binlog_basic.result
index 931d01dbebe..931d01dbebe 100644
--- a/mysql-test/r/ndb_binlog_basic.result
+++ b/mysql-test/suite/ndb/r/ndb_binlog_basic.result
diff --git a/mysql-test/r/ndb_binlog_ddl_multi.result b/mysql-test/suite/ndb/r/ndb_binlog_ddl_multi.result
index 6631feeaa17..6631feeaa17 100644
--- a/mysql-test/r/ndb_binlog_ddl_multi.result
+++ b/mysql-test/suite/ndb/r/ndb_binlog_ddl_multi.result
diff --git a/mysql-test/r/ndb_binlog_discover.result b/mysql-test/suite/ndb/r/ndb_binlog_discover.result
index 7c3a976c4d5..7c3a976c4d5 100644
--- a/mysql-test/r/ndb_binlog_discover.result
+++ b/mysql-test/suite/ndb/r/ndb_binlog_discover.result
diff --git a/mysql-test/r/ndb_binlog_format.result b/mysql-test/suite/ndb/r/ndb_binlog_format.result
index ed26060e2a4..ed26060e2a4 100644
--- a/mysql-test/r/ndb_binlog_format.result
+++ b/mysql-test/suite/ndb/r/ndb_binlog_format.result
diff --git a/mysql-test/r/ndb_binlog_ignore_db.result b/mysql-test/suite/ndb/r/ndb_binlog_ignore_db.result
index e4c9faa802c..e4c9faa802c 100644
--- a/mysql-test/r/ndb_binlog_ignore_db.result
+++ b/mysql-test/suite/ndb/r/ndb_binlog_ignore_db.result
diff --git a/mysql-test/r/ndb_binlog_log_bin.result b/mysql-test/suite/ndb/r/ndb_binlog_log_bin.result
index f80a46324e0..f80a46324e0 100644
--- a/mysql-test/r/ndb_binlog_log_bin.result
+++ b/mysql-test/suite/ndb/r/ndb_binlog_log_bin.result
diff --git a/mysql-test/r/ndb_binlog_multi.result b/mysql-test/suite/ndb/r/ndb_binlog_multi.result
index b2a9da39be0..b2a9da39be0 100644
--- a/mysql-test/r/ndb_binlog_multi.result
+++ b/mysql-test/suite/ndb/r/ndb_binlog_multi.result
diff --git a/mysql-test/r/ndb_bitfield.result b/mysql-test/suite/ndb/r/ndb_bitfield.result
index 59c4d420b22..59c4d420b22 100644
--- a/mysql-test/r/ndb_bitfield.result
+++ b/mysql-test/suite/ndb/r/ndb_bitfield.result
diff --git a/mysql-test/r/ndb_blob.result b/mysql-test/suite/ndb/r/ndb_blob.result
index 34f2c5fdd66..34f2c5fdd66 100644
--- a/mysql-test/r/ndb_blob.result
+++ b/mysql-test/suite/ndb/r/ndb_blob.result
diff --git a/mysql-test/r/ndb_blob_partition.result b/mysql-test/suite/ndb/r/ndb_blob_partition.result
index b08a91f0cdd..b08a91f0cdd 100644
--- a/mysql-test/r/ndb_blob_partition.result
+++ b/mysql-test/suite/ndb/r/ndb_blob_partition.result
diff --git a/mysql-test/r/ndb_cache.result b/mysql-test/suite/ndb/r/ndb_cache.result
index 478663b1aa1..478663b1aa1 100644
--- a/mysql-test/r/ndb_cache.result
+++ b/mysql-test/suite/ndb/r/ndb_cache.result
diff --git a/mysql-test/r/ndb_cache2.result b/mysql-test/suite/ndb/r/ndb_cache2.result
index 2876002f864..2876002f864 100644
--- a/mysql-test/r/ndb_cache2.result
+++ b/mysql-test/suite/ndb/r/ndb_cache2.result
diff --git a/mysql-test/r/ndb_cache_multi.result b/mysql-test/suite/ndb/r/ndb_cache_multi.result
index 388131ec30a..388131ec30a 100644
--- a/mysql-test/r/ndb_cache_multi.result
+++ b/mysql-test/suite/ndb/r/ndb_cache_multi.result
diff --git a/mysql-test/r/ndb_cache_multi2.result b/mysql-test/suite/ndb/r/ndb_cache_multi2.result
index 53767bb6d3c..53767bb6d3c 100644
--- a/mysql-test/r/ndb_cache_multi2.result
+++ b/mysql-test/suite/ndb/r/ndb_cache_multi2.result
diff --git a/mysql-test/r/ndb_charset.result b/mysql-test/suite/ndb/r/ndb_charset.result
index 1c65a380039..1c65a380039 100644
--- a/mysql-test/r/ndb_charset.result
+++ b/mysql-test/suite/ndb/r/ndb_charset.result
diff --git a/mysql-test/r/ndb_condition_pushdown.result b/mysql-test/suite/ndb/r/ndb_condition_pushdown.result
index 8d1dcc4ef18..8d1dcc4ef18 100644
--- a/mysql-test/r/ndb_condition_pushdown.result
+++ b/mysql-test/suite/ndb/r/ndb_condition_pushdown.result
diff --git a/mysql-test/r/ndb_config.result b/mysql-test/suite/ndb/r/ndb_config.result
index 9495af29df6..9495af29df6 100644
--- a/mysql-test/r/ndb_config.result
+++ b/mysql-test/suite/ndb/r/ndb_config.result
diff --git a/mysql-test/r/ndb_config2.result b/mysql-test/suite/ndb/r/ndb_config2.result
index cfd012933c4..cfd012933c4 100644
--- a/mysql-test/r/ndb_config2.result
+++ b/mysql-test/suite/ndb/r/ndb_config2.result
diff --git a/mysql-test/r/ndb_cursor.result b/mysql-test/suite/ndb/r/ndb_cursor.result
index b3b815ef891..b3b815ef891 100644
--- a/mysql-test/r/ndb_cursor.result
+++ b/mysql-test/suite/ndb/r/ndb_cursor.result
diff --git a/mysql-test/r/ndb_database.result b/mysql-test/suite/ndb/r/ndb_database.result
index e3da4af0265..e3da4af0265 100644
--- a/mysql-test/r/ndb_database.result
+++ b/mysql-test/suite/ndb/r/ndb_database.result
diff --git a/mysql-test/r/ndb_dd_alter.result b/mysql-test/suite/ndb/r/ndb_dd_alter.result
index 94426546115..94426546115 100644
--- a/mysql-test/r/ndb_dd_alter.result
+++ b/mysql-test/suite/ndb/r/ndb_dd_alter.result
diff --git a/mysql-test/r/ndb_dd_backuprestore.result b/mysql-test/suite/ndb/r/ndb_dd_backuprestore.result
index c82fe560121..c82fe560121 100644
--- a/mysql-test/r/ndb_dd_backuprestore.result
+++ b/mysql-test/suite/ndb/r/ndb_dd_backuprestore.result
diff --git a/mysql-test/r/ndb_dd_basic.result b/mysql-test/suite/ndb/r/ndb_dd_basic.result
index 7aeb156869b..bc1762ce407 100644
--- a/mysql-test/r/ndb_dd_basic.result
+++ b/mysql-test/suite/ndb/r/ndb_dd_basic.result
@@ -5,20 +5,20 @@ INITIAL_SIZE 16M
UNDO_BUFFER_SIZE = 1M
ENGINE=MYISAM;
Warnings:
-Error 1466 Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+Error 1475 Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
ALTER LOGFILE GROUP lg1
ADD UNDOFILE 'undofile02.dat'
INITIAL_SIZE = 4M
ENGINE=XYZ;
Warnings:
Warning 1286 Unknown table engine 'XYZ'
-Error 1466 Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+Error 1475 Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
CREATE TABLESPACE ts1
ADD DATAFILE 'datafile.dat'
USE LOGFILE GROUP lg1
INITIAL_SIZE 12M;
Warnings:
-Error 1466 Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+Error 1475 Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
set storage_engine=ndb;
CREATE LOGFILE GROUP lg1
ADD UNDOFILE 'undofile.dat'
diff --git a/mysql-test/r/ndb_dd_ddl.result b/mysql-test/suite/ndb/r/ndb_dd_ddl.result
index 67857d39ab6..55f1f56fd0c 100644
--- a/mysql-test/r/ndb_dd_ddl.result
+++ b/mysql-test/suite/ndb/r/ndb_dd_ddl.result
@@ -16,7 +16,7 @@ ERROR HY000: Failed to create LOGFILE GROUP
SHOW WARNINGS;
Level Code Message
Error 1296 Got error 1514 'Currently there is a limit of one logfile group' from NDB
-Error 1516 Failed to create LOGFILE GROUP
+Error 1525 Failed to create LOGFILE GROUP
CREATE LOGFILE GROUP lg1
ADD UNDOFILE 'undofile.dat'
INITIAL_SIZE 1M
diff --git a/mysql-test/r/ndb_dd_disk2memory.result b/mysql-test/suite/ndb/r/ndb_dd_disk2memory.result
index 46661f36d1b..46661f36d1b 100644
--- a/mysql-test/r/ndb_dd_disk2memory.result
+++ b/mysql-test/suite/ndb/r/ndb_dd_disk2memory.result
diff --git a/mysql-test/r/ndb_dd_dump.result b/mysql-test/suite/ndb/r/ndb_dd_dump.result
index 9b1a1295588..9b1a1295588 100644
--- a/mysql-test/r/ndb_dd_dump.result
+++ b/mysql-test/suite/ndb/r/ndb_dd_dump.result
diff --git a/mysql-test/r/ndb_dd_sql_features.result b/mysql-test/suite/ndb/r/ndb_dd_sql_features.result
index 135250fe7e8..135250fe7e8 100644
--- a/mysql-test/r/ndb_dd_sql_features.result
+++ b/mysql-test/suite/ndb/r/ndb_dd_sql_features.result
diff --git a/mysql-test/r/ndb_gis.result b/mysql-test/suite/ndb/r/ndb_gis.result
index 3af7b71d72d..54f1fc23489 100644
--- a/mysql-test/r/ndb_gis.result
+++ b/mysql-test/suite/ndb/r/ndb_gis.result
@@ -463,7 +463,7 @@ drop table t1;
End of 4.1 tests
CREATE TABLE t1 (name VARCHAR(100), square GEOMETRY);
Warnings:
-Error 1466 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
+Error 1475 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))'));
INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))'));
INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))'));
@@ -1013,7 +1013,7 @@ drop table t1;
End of 4.1 tests
CREATE TABLE t1 (name VARCHAR(100), square GEOMETRY);
Warnings:
-Error 1466 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
+Error 1475 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))'));
INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))'));
INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))'));
diff --git a/mysql-test/r/ndb_grant.result b/mysql-test/suite/ndb/r/ndb_grant.result
index 6192a7cace5..6192a7cace5 100644
--- a/mysql-test/r/ndb_grant.result
+++ b/mysql-test/suite/ndb/r/ndb_grant.result
diff --git a/mysql-test/r/ndb_index.result b/mysql-test/suite/ndb/r/ndb_index.result
index 5702552b0b5..5702552b0b5 100644
--- a/mysql-test/r/ndb_index.result
+++ b/mysql-test/suite/ndb/r/ndb_index.result
diff --git a/mysql-test/r/ndb_index_ordered.result b/mysql-test/suite/ndb/r/ndb_index_ordered.result
index a29b5343d7c..a29b5343d7c 100644
--- a/mysql-test/r/ndb_index_ordered.result
+++ b/mysql-test/suite/ndb/r/ndb_index_ordered.result
diff --git a/mysql-test/r/ndb_index_unique.result b/mysql-test/suite/ndb/r/ndb_index_unique.result
index cc63ce69760..cc63ce69760 100644
--- a/mysql-test/r/ndb_index_unique.result
+++ b/mysql-test/suite/ndb/r/ndb_index_unique.result
diff --git a/mysql-test/r/ndb_insert.result b/mysql-test/suite/ndb/r/ndb_insert.result
index 51b346bbf7b..51b346bbf7b 100644
--- a/mysql-test/r/ndb_insert.result
+++ b/mysql-test/suite/ndb/r/ndb_insert.result
diff --git a/mysql-test/r/ndb_limit.result b/mysql-test/suite/ndb/r/ndb_limit.result
index da1ec3b61c3..da1ec3b61c3 100644
--- a/mysql-test/r/ndb_limit.result
+++ b/mysql-test/suite/ndb/r/ndb_limit.result
diff --git a/mysql-test/r/ndb_load.result b/mysql-test/suite/ndb/r/ndb_load.result
index 416a350066b..416a350066b 100644
--- a/mysql-test/r/ndb_load.result
+++ b/mysql-test/suite/ndb/r/ndb_load.result
diff --git a/mysql-test/r/ndb_loaddatalocal.result b/mysql-test/suite/ndb/r/ndb_loaddatalocal.result
index 1d15c608f03..1d15c608f03 100644
--- a/mysql-test/r/ndb_loaddatalocal.result
+++ b/mysql-test/suite/ndb/r/ndb_loaddatalocal.result
diff --git a/mysql-test/r/ndb_lock.result b/mysql-test/suite/ndb/r/ndb_lock.result
index 9057731c3f4..9057731c3f4 100644
--- a/mysql-test/r/ndb_lock.result
+++ b/mysql-test/suite/ndb/r/ndb_lock.result
diff --git a/mysql-test/r/ndb_minmax.result b/mysql-test/suite/ndb/r/ndb_minmax.result
index cc0c238ac6e..cc0c238ac6e 100644
--- a/mysql-test/r/ndb_minmax.result
+++ b/mysql-test/suite/ndb/r/ndb_minmax.result
diff --git a/mysql-test/r/ndb_multi.result b/mysql-test/suite/ndb/r/ndb_multi.result
index 2bc49bf9b45..2bc49bf9b45 100644
--- a/mysql-test/r/ndb_multi.result
+++ b/mysql-test/suite/ndb/r/ndb_multi.result
diff --git a/mysql-test/r/ndb_multi_row.result b/mysql-test/suite/ndb/r/ndb_multi_row.result
index cf5a76d6f01..cf5a76d6f01 100644
--- a/mysql-test/r/ndb_multi_row.result
+++ b/mysql-test/suite/ndb/r/ndb_multi_row.result
diff --git a/mysql-test/r/ndb_partition_error.result b/mysql-test/suite/ndb/r/ndb_partition_error.result
index d86dc382185..d86dc382185 100644
--- a/mysql-test/r/ndb_partition_error.result
+++ b/mysql-test/suite/ndb/r/ndb_partition_error.result
diff --git a/mysql-test/r/ndb_partition_error2.result b/mysql-test/suite/ndb/r/ndb_partition_error2.result
index a739ef3923c..a739ef3923c 100644
--- a/mysql-test/r/ndb_partition_error2.result
+++ b/mysql-test/suite/ndb/r/ndb_partition_error2.result
diff --git a/mysql-test/r/ndb_partition_key.result b/mysql-test/suite/ndb/r/ndb_partition_key.result
index 60e96ce03b6..60e96ce03b6 100644
--- a/mysql-test/r/ndb_partition_key.result
+++ b/mysql-test/suite/ndb/r/ndb_partition_key.result
diff --git a/mysql-test/r/ndb_partition_list.result b/mysql-test/suite/ndb/r/ndb_partition_list.result
index ce2574ddcc4..ce2574ddcc4 100644
--- a/mysql-test/r/ndb_partition_list.result
+++ b/mysql-test/suite/ndb/r/ndb_partition_list.result
diff --git a/mysql-test/r/ndb_partition_range.result b/mysql-test/suite/ndb/r/ndb_partition_range.result
index 0c717ed55e9..0c717ed55e9 100644
--- a/mysql-test/r/ndb_partition_range.result
+++ b/mysql-test/suite/ndb/r/ndb_partition_range.result
diff --git a/mysql-test/r/ndb_read_multi_range.result b/mysql-test/suite/ndb/r/ndb_read_multi_range.result
index 8443d0473a8..8443d0473a8 100644
--- a/mysql-test/r/ndb_read_multi_range.result
+++ b/mysql-test/suite/ndb/r/ndb_read_multi_range.result
diff --git a/mysql-test/r/ndb_rename.result b/mysql-test/suite/ndb/r/ndb_rename.result
index 2cc2dfb3ff1..2cc2dfb3ff1 100644
--- a/mysql-test/r/ndb_rename.result
+++ b/mysql-test/suite/ndb/r/ndb_rename.result
diff --git a/mysql-test/r/ndb_replace.result b/mysql-test/suite/ndb/r/ndb_replace.result
index 23844ce3bff..23844ce3bff 100644
--- a/mysql-test/r/ndb_replace.result
+++ b/mysql-test/suite/ndb/r/ndb_replace.result
diff --git a/mysql-test/r/ndb_restore.result b/mysql-test/suite/ndb/r/ndb_restore.result
index d1c76192cef..d1c76192cef 100644
--- a/mysql-test/r/ndb_restore.result
+++ b/mysql-test/suite/ndb/r/ndb_restore.result
diff --git a/mysql-test/r/ndb_restore_compat.result b/mysql-test/suite/ndb/r/ndb_restore_compat.result
index db17f9af32b..db17f9af32b 100644
--- a/mysql-test/r/ndb_restore_compat.result
+++ b/mysql-test/suite/ndb/r/ndb_restore_compat.result
diff --git a/mysql-test/r/ndb_restore_partition.result b/mysql-test/suite/ndb/r/ndb_restore_partition.result
index 7dc4057e615..7dc4057e615 100644
--- a/mysql-test/r/ndb_restore_partition.result
+++ b/mysql-test/suite/ndb/r/ndb_restore_partition.result
diff --git a/mysql-test/r/ndb_restore_print.result b/mysql-test/suite/ndb/r/ndb_restore_print.result
index e05f8e43d1a..e05f8e43d1a 100644
--- a/mysql-test/r/ndb_restore_print.result
+++ b/mysql-test/suite/ndb/r/ndb_restore_print.result
diff --git a/mysql-test/r/ndb_row_format.result b/mysql-test/suite/ndb/r/ndb_row_format.result
index ae165d87c5c..37c239986f6 100644
--- a/mysql-test/r/ndb_row_format.result
+++ b/mysql-test/suite/ndb/r/ndb_row_format.result
@@ -8,7 +8,7 @@ ENGINE=NDB;
ERROR HY000: Can't create table 'test.t1' (errno: 138)
SHOW WARNINGS;
Level Code Message
-Error 1466 Table storage engine 'ndbcluster' does not support the create option 'Row format FIXED incompatible with variable sized attribute'
+Error 1475 Table storage engine 'ndbcluster' does not support the create option 'Row format FIXED incompatible with variable sized attribute'
Error 1005 Can't create table 'test.t1' (errno: 138)
CREATE TABLE t1
( a INT KEY,
diff --git a/mysql-test/r/ndb_single_user.result b/mysql-test/suite/ndb/r/ndb_single_user.result
index 54ae99b2f4f..f916422a509 100644
--- a/mysql-test/r/ndb_single_user.result
+++ b/mysql-test/suite/ndb/r/ndb_single_user.result
@@ -11,7 +11,7 @@ ERROR HY000: Failed to create LOGFILE GROUP
show warnings;
Level Code Message
Error 1296 Got error 299 'Operation not allowed or aborted due to single user mode' from NDB
-Error 1516 Failed to create LOGFILE GROUP
+Error 1525 Failed to create LOGFILE GROUP
create table t1 (a int key, b int unique, c int) engine ndb;
CREATE LOGFILE GROUP lg1
ADD UNDOFILE 'undofile.dat'
@@ -27,14 +27,14 @@ ERROR HY000: Failed to create TABLESPACE
show warnings;
Level Code Message
Error 1296 Got error 299 'Operation not allowed or aborted due to single user mode' from NDB
-Error 1516 Failed to create TABLESPACE
+Error 1525 Failed to create TABLESPACE
DROP LOGFILE GROUP lg1
ENGINE =NDB;
ERROR HY000: Failed to drop LOGFILE GROUP
show warnings;
Level Code Message
Error 1296 Got error 299 'Operation not allowed or aborted due to single user mode' from NDB
-Error 1517 Failed to drop LOGFILE GROUP
+Error 1526 Failed to drop LOGFILE GROUP
CREATE TABLESPACE ts1
ADD DATAFILE 'datafile.dat'
USE LOGFILE GROUP lg1
@@ -47,7 +47,7 @@ ERROR HY000: Failed to alter: DROP DATAFILE
show warnings;
Level Code Message
Error 1296 Got error 299 'Operation not allowed or aborted due to single user mode' from NDB
-Error 1521 Failed to alter: DROP DATAFILE
+Error 1530 Failed to alter: DROP DATAFILE
ALTER TABLESPACE ts1
DROP DATAFILE 'datafile.dat'
ENGINE NDB;
@@ -57,7 +57,7 @@ ERROR HY000: Failed to drop TABLESPACE
show warnings;
Level Code Message
Error 1296 Got error 299 'Operation not allowed or aborted due to single user mode' from NDB
-Error 1517 Failed to drop TABLESPACE
+Error 1526 Failed to drop TABLESPACE
DROP TABLESPACE ts1
ENGINE NDB;
DROP LOGFILE GROUP lg1
diff --git a/mysql-test/r/ndb_sp.result b/mysql-test/suite/ndb/r/ndb_sp.result
index dbd0325044d..dbd0325044d 100644
--- a/mysql-test/r/ndb_sp.result
+++ b/mysql-test/suite/ndb/r/ndb_sp.result
diff --git a/mysql-test/r/ndb_subquery.result b/mysql-test/suite/ndb/r/ndb_subquery.result
index 45662882d3a..45662882d3a 100644
--- a/mysql-test/r/ndb_subquery.result
+++ b/mysql-test/suite/ndb/r/ndb_subquery.result
diff --git a/mysql-test/r/ndb_temporary.result b/mysql-test/suite/ndb/r/ndb_temporary.result
index 61fc1561e4f..61fc1561e4f 100644
--- a/mysql-test/r/ndb_temporary.result
+++ b/mysql-test/suite/ndb/r/ndb_temporary.result
diff --git a/mysql-test/r/ndb_transaction.result b/mysql-test/suite/ndb/r/ndb_transaction.result
index 691b91b1d36..691b91b1d36 100644
--- a/mysql-test/r/ndb_transaction.result
+++ b/mysql-test/suite/ndb/r/ndb_transaction.result
diff --git a/mysql-test/r/ndb_trigger.result b/mysql-test/suite/ndb/r/ndb_trigger.result
index d074ad01c22..d074ad01c22 100644
--- a/mysql-test/r/ndb_trigger.result
+++ b/mysql-test/suite/ndb/r/ndb_trigger.result
diff --git a/mysql-test/r/ndb_truncate.result b/mysql-test/suite/ndb/r/ndb_truncate.result
index 811e5e3afeb..811e5e3afeb 100644
--- a/mysql-test/r/ndb_truncate.result
+++ b/mysql-test/suite/ndb/r/ndb_truncate.result
diff --git a/mysql-test/r/ndb_types.result b/mysql-test/suite/ndb/r/ndb_types.result
index ec2858d818a..ec2858d818a 100644
--- a/mysql-test/r/ndb_types.result
+++ b/mysql-test/suite/ndb/r/ndb_types.result
diff --git a/mysql-test/suite/ndb/r/ndb_update.result b/mysql-test/suite/ndb/r/ndb_update.result
new file mode 100644
index 00000000000..daea0e27a6a
--- /dev/null
+++ b/mysql-test/suite/ndb/r/ndb_update.result
@@ -0,0 +1,88 @@
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+DROP TABLE IF EXISTS t3;
+CREATE TABLE t1 (
+pk1 INT NOT NULL PRIMARY KEY,
+b INT NOT NULL,
+c INT NOT NULL UNIQUE
+) ENGINE=ndbcluster;
+INSERT INTO t1 VALUES (0, 1, 0),(1,2,1),(2,3,2);
+UPDATE t1 set b = c;
+select * from t1 order by pk1;
+pk1 b c
+0 0 0
+1 1 1
+2 2 2
+UPDATE t1 set pk1 = 4 where pk1 = 1;
+select * from t1 order by pk1;
+pk1 b c
+0 0 0
+2 2 2
+4 1 1
+UPDATE t1 set pk1 = 4 where pk1 = 2;
+ERROR 23000: Duplicate entry '4' for key 'PRIMARY'
+UPDATE IGNORE t1 set pk1 = 4 where pk1 = 2;
+select * from t1 order by pk1;
+pk1 b c
+0 0 0
+2 2 2
+4 1 1
+UPDATE t1 set pk1 = 1, c = 2 where pk1 = 4;
+ERROR 23000: Duplicate entry '' for key '*UNKNOWN*'
+UPDATE IGNORE t1 set pk1 = 1, c = 2 where pk1 = 4;
+select * from t1 order by pk1;
+pk1 b c
+0 0 0
+2 2 2
+4 1 1
+UPDATE t1 set pk1 = pk1 + 10;
+select * from t1 order by pk1;
+pk1 b c
+10 0 0
+12 2 2
+14 1 1
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a int, b int, KEY (a, b)) ENGINE=ndbcluster;
+CREATE TABLE t2 (a int, b int, UNIQUE KEY (a, b)) ENGINE=ndbcluster;
+CREATE TABLE t3 (a int, b int, PRIMARY KEY (a, b)) ENGINE=ndbcluster;
+INSERT INTO t1 VALUES (1, 2);
+INSERT INTO t1 VALUES (2, 2);
+INSERT INTO t2 VALUES (1, 2);
+INSERT INTO t2 VALUES (2, 2);
+INSERT INTO t3 VALUES (1, 2);
+INSERT INTO t3 VALUES (2, 2);
+UPDATE t1 SET a = 1;
+UPDATE t1 SET a = 1 ORDER BY a;
+UPDATE t2 SET a = 1;
+ERROR 23000: Duplicate entry '' for key '*UNKNOWN*'
+UPDATE t2 SET a = 1 ORDER BY a;
+ERROR 23000: Duplicate entry '' for key '*UNKNOWN*'
+UPDATE t3 SET a = 1;
+ERROR 23000: Duplicate entry '1-2' for key 'PRIMARY'
+UPDATE t3 SET a = 1 ORDER BY a;
+ERROR 23000: Duplicate entry '1-2' for key 'PRIMARY'
+SELECT count(*) FROM t1;
+count(*)
+2
+SELECT count(*) FROM t2;
+count(*)
+2
+SELECT count(*) FROM t3;
+count(*)
+2
+SELECT * FROM t1 ORDER by a;
+a b
+1 2
+1 2
+SELECT * FROM t2 ORDER by a;
+a b
+1 2
+2 2
+SELECT * FROM t3 ORDER by a;
+a b
+1 2
+2 2
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+DROP TABLE IF EXISTS t3;
+End of 5.1 tests
diff --git a/mysql-test/r/ndb_view.result b/mysql-test/suite/ndb/r/ndb_view.result
index b7d1b6860c8..b7d1b6860c8 100644
--- a/mysql-test/r/ndb_view.result
+++ b/mysql-test/suite/ndb/r/ndb_view.result
diff --git a/mysql-test/r/ndbapi.result b/mysql-test/suite/ndb/r/ndbapi.result
index 8e680391a81..8e680391a81 100644
--- a/mysql-test/r/ndbapi.result
+++ b/mysql-test/suite/ndb/r/ndbapi.result
diff --git a/mysql-test/r/partition_03ndb.result b/mysql-test/suite/ndb/r/partition_03ndb.result
index 28339cc7435..28339cc7435 100644
--- a/mysql-test/r/partition_03ndb.result
+++ b/mysql-test/suite/ndb/r/partition_03ndb.result
diff --git a/mysql-test/r/ps_7ndb.result b/mysql-test/suite/ndb/r/ps_7ndb.result
index 82d2d14b075..82d2d14b075 100644
--- a/mysql-test/r/ps_7ndb.result
+++ b/mysql-test/suite/ndb/r/ps_7ndb.result
diff --git a/mysql-test/r/strict_autoinc_5ndb.result b/mysql-test/suite/ndb/r/strict_autoinc_5ndb.result
index ea6e5ffc741..ea6e5ffc741 100644
--- a/mysql-test/r/strict_autoinc_5ndb.result
+++ b/mysql-test/suite/ndb/r/strict_autoinc_5ndb.result
diff --git a/mysql-test/suite/ndb/t/disabled.def b/mysql-test/suite/ndb/t/disabled.def
new file mode 100644
index 00000000000..023c9c47210
--- /dev/null
+++ b/mysql-test/suite/ndb/t/disabled.def
@@ -0,0 +1,25 @@
+##############################################################################
+#
+# List the test cases that are to be disabled temporarily.
+#
+# Separate the test case name and the comment with ':'.
+#
+# <testcasename> : BUG#<xxxx> <date disabled> <disabler> <comment>
+#
+# Do not use any TAB characters for whitespace.
+#
+##############################################################################
+ndb_autodiscover : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog
+ndb_autodiscover2 : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog
+ndb_dd_sql_features : Bug#29102 ndb_dd_sql_features fails in pushbuild
+ndb_load : BUG#17233 2006-05-04 tomas failed load data from infile causes mysqld dbug_assert, binlog not flushed
+
+partition_03ndb : BUG#16385 2006-03-24 mikael Partitions: crash when updating a range partitioned NDB table
+
+ndb_partition_error2 : HF is not sure if the test can work as internded on all the platforms
+
+# the below testcase have been reworked to avoid the bug, test contains comment, keep bug open
+#ndb_binlog_ddl_multi : BUG#18976 2006-04-10 kent CRBR: multiple binlog, second binlog may miss schema log events
+#ndb_binlog_discover : bug#21806 2006-08-24
+#ndb_autodiscover3 : bug#21806
+ndb_autodiscover3 : Bug#20872 2007-07-15 ingo master*.err: miscellaneous error messages
diff --git a/mysql-test/t/loaddata_autocom_ndb.test b/mysql-test/suite/ndb/t/loaddata_autocom_ndb.test
index f4a6743aabe..f4a6743aabe 100644
--- a/mysql-test/t/loaddata_autocom_ndb.test
+++ b/mysql-test/suite/ndb/t/loaddata_autocom_ndb.test
diff --git a/mysql-test/t/ndb_alter_table.test b/mysql-test/suite/ndb/t/ndb_alter_table.test
index 082fe726927..082fe726927 100644
--- a/mysql-test/t/ndb_alter_table.test
+++ b/mysql-test/suite/ndb/t/ndb_alter_table.test
diff --git a/mysql-test/t/ndb_alter_table2.test b/mysql-test/suite/ndb/t/ndb_alter_table2.test
index f078ed6b479..f078ed6b479 100644
--- a/mysql-test/t/ndb_alter_table2.test
+++ b/mysql-test/suite/ndb/t/ndb_alter_table2.test
diff --git a/mysql-test/t/ndb_alter_table3.test b/mysql-test/suite/ndb/t/ndb_alter_table3.test
index 86e664b23b0..86e664b23b0 100644
--- a/mysql-test/t/ndb_alter_table3.test
+++ b/mysql-test/suite/ndb/t/ndb_alter_table3.test
diff --git a/mysql-test/t/ndb_autodiscover.test b/mysql-test/suite/ndb/t/ndb_autodiscover.test
index 06d47693c10..06d47693c10 100644
--- a/mysql-test/t/ndb_autodiscover.test
+++ b/mysql-test/suite/ndb/t/ndb_autodiscover.test
diff --git a/mysql-test/t/ndb_autodiscover2-master.opt b/mysql-test/suite/ndb/t/ndb_autodiscover2-master.opt
index e0d075c3fbd..e0d075c3fbd 100644
--- a/mysql-test/t/ndb_autodiscover2-master.opt
+++ b/mysql-test/suite/ndb/t/ndb_autodiscover2-master.opt
diff --git a/mysql-test/t/ndb_autodiscover2.test b/mysql-test/suite/ndb/t/ndb_autodiscover2.test
index ebe14696cd2..ebe14696cd2 100644
--- a/mysql-test/t/ndb_autodiscover2.test
+++ b/mysql-test/suite/ndb/t/ndb_autodiscover2.test
diff --git a/mysql-test/t/ndb_autodiscover3.test b/mysql-test/suite/ndb/t/ndb_autodiscover3.test
index 10416aee11f..10416aee11f 100644
--- a/mysql-test/t/ndb_autodiscover3.test
+++ b/mysql-test/suite/ndb/t/ndb_autodiscover3.test
diff --git a/mysql-test/t/ndb_backup_print.test b/mysql-test/suite/ndb/t/ndb_backup_print.test
index cf869fd56f5..cf869fd56f5 100644
--- a/mysql-test/t/ndb_backup_print.test
+++ b/mysql-test/suite/ndb/t/ndb_backup_print.test
diff --git a/mysql-test/t/ndb_basic.test b/mysql-test/suite/ndb/t/ndb_basic.test
index b9ccdf9fd0d..b9ccdf9fd0d 100644
--- a/mysql-test/t/ndb_basic.test
+++ b/mysql-test/suite/ndb/t/ndb_basic.test
diff --git a/mysql-test/t/ndb_binlog_basic.test b/mysql-test/suite/ndb/t/ndb_binlog_basic.test
index 0f63ced0697..0f63ced0697 100644
--- a/mysql-test/t/ndb_binlog_basic.test
+++ b/mysql-test/suite/ndb/t/ndb_binlog_basic.test
diff --git a/mysql-test/t/ndb_binlog_ddl_multi.test b/mysql-test/suite/ndb/t/ndb_binlog_ddl_multi.test
index a70dbe2011f..a70dbe2011f 100644
--- a/mysql-test/t/ndb_binlog_ddl_multi.test
+++ b/mysql-test/suite/ndb/t/ndb_binlog_ddl_multi.test
diff --git a/mysql-test/t/ndb_binlog_discover.test b/mysql-test/suite/ndb/t/ndb_binlog_discover.test
index e842b57093a..e842b57093a 100644
--- a/mysql-test/t/ndb_binlog_discover.test
+++ b/mysql-test/suite/ndb/t/ndb_binlog_discover.test
diff --git a/mysql-test/t/ndb_binlog_format.test b/mysql-test/suite/ndb/t/ndb_binlog_format.test
index acb34bb388c..acb34bb388c 100644
--- a/mysql-test/t/ndb_binlog_format.test
+++ b/mysql-test/suite/ndb/t/ndb_binlog_format.test
diff --git a/mysql-test/t/ndb_binlog_ignore_db-master.opt b/mysql-test/suite/ndb/t/ndb_binlog_ignore_db-master.opt
index e3947c0eeed..e3947c0eeed 100644
--- a/mysql-test/t/ndb_binlog_ignore_db-master.opt
+++ b/mysql-test/suite/ndb/t/ndb_binlog_ignore_db-master.opt
diff --git a/mysql-test/t/ndb_binlog_ignore_db.test b/mysql-test/suite/ndb/t/ndb_binlog_ignore_db.test
index 013df54a76a..013df54a76a 100644
--- a/mysql-test/t/ndb_binlog_ignore_db.test
+++ b/mysql-test/suite/ndb/t/ndb_binlog_ignore_db.test
diff --git a/mysql-test/t/ndb_binlog_log_bin.test b/mysql-test/suite/ndb/t/ndb_binlog_log_bin.test
index 75ac766fd25..75ac766fd25 100644
--- a/mysql-test/t/ndb_binlog_log_bin.test
+++ b/mysql-test/suite/ndb/t/ndb_binlog_log_bin.test
diff --git a/mysql-test/t/ndb_binlog_multi.test b/mysql-test/suite/ndb/t/ndb_binlog_multi.test
index c39034c71f6..c39034c71f6 100644
--- a/mysql-test/t/ndb_binlog_multi.test
+++ b/mysql-test/suite/ndb/t/ndb_binlog_multi.test
diff --git a/mysql-test/t/ndb_bitfield.test b/mysql-test/suite/ndb/t/ndb_bitfield.test
index de0ae23bfe6..de0ae23bfe6 100644
--- a/mysql-test/t/ndb_bitfield.test
+++ b/mysql-test/suite/ndb/t/ndb_bitfield.test
diff --git a/mysql-test/t/ndb_blob.test b/mysql-test/suite/ndb/t/ndb_blob.test
index b9a8c7e20ee..b9a8c7e20ee 100644
--- a/mysql-test/t/ndb_blob.test
+++ b/mysql-test/suite/ndb/t/ndb_blob.test
diff --git a/mysql-test/t/ndb_blob_partition.test b/mysql-test/suite/ndb/t/ndb_blob_partition.test
index 35df57b96ba..35df57b96ba 100644
--- a/mysql-test/t/ndb_blob_partition.test
+++ b/mysql-test/suite/ndb/t/ndb_blob_partition.test
diff --git a/mysql-test/t/ndb_cache.test b/mysql-test/suite/ndb/t/ndb_cache.test
index 9c299b61c24..9c299b61c24 100644
--- a/mysql-test/t/ndb_cache.test
+++ b/mysql-test/suite/ndb/t/ndb_cache.test
diff --git a/mysql-test/t/ndb_cache2.test b/mysql-test/suite/ndb/t/ndb_cache2.test
index 352b01ef73f..352b01ef73f 100644
--- a/mysql-test/t/ndb_cache2.test
+++ b/mysql-test/suite/ndb/t/ndb_cache2.test
diff --git a/mysql-test/t/ndb_cache_multi.test b/mysql-test/suite/ndb/t/ndb_cache_multi.test
index 8c7f186b866..8c7f186b866 100644
--- a/mysql-test/t/ndb_cache_multi.test
+++ b/mysql-test/suite/ndb/t/ndb_cache_multi.test
diff --git a/mysql-test/t/ndb_cache_multi2.test b/mysql-test/suite/ndb/t/ndb_cache_multi2.test
index 853e4090193..853e4090193 100644
--- a/mysql-test/t/ndb_cache_multi2.test
+++ b/mysql-test/suite/ndb/t/ndb_cache_multi2.test
diff --git a/mysql-test/t/ndb_charset.test b/mysql-test/suite/ndb/t/ndb_charset.test
index 2d9f66564bc..2d9f66564bc 100644
--- a/mysql-test/t/ndb_charset.test
+++ b/mysql-test/suite/ndb/t/ndb_charset.test
diff --git a/mysql-test/t/ndb_condition_pushdown.test b/mysql-test/suite/ndb/t/ndb_condition_pushdown.test
index ab56430ac1d..ab56430ac1d 100644
--- a/mysql-test/t/ndb_condition_pushdown.test
+++ b/mysql-test/suite/ndb/t/ndb_condition_pushdown.test
diff --git a/mysql-test/t/ndb_config.test b/mysql-test/suite/ndb/t/ndb_config.test
index f63c0087c1e..f63c0087c1e 100644
--- a/mysql-test/t/ndb_config.test
+++ b/mysql-test/suite/ndb/t/ndb_config.test
diff --git a/mysql-test/t/ndb_config2.test b/mysql-test/suite/ndb/t/ndb_config2.test
index 170f1b2e5e7..170f1b2e5e7 100644
--- a/mysql-test/t/ndb_config2.test
+++ b/mysql-test/suite/ndb/t/ndb_config2.test
diff --git a/mysql-test/t/ndb_cursor.test b/mysql-test/suite/ndb/t/ndb_cursor.test
index 406f8629cfe..406f8629cfe 100644
--- a/mysql-test/t/ndb_cursor.test
+++ b/mysql-test/suite/ndb/t/ndb_cursor.test
diff --git a/mysql-test/t/ndb_database.test b/mysql-test/suite/ndb/t/ndb_database.test
index 8bfdf40de88..8bfdf40de88 100644
--- a/mysql-test/t/ndb_database.test
+++ b/mysql-test/suite/ndb/t/ndb_database.test
diff --git a/mysql-test/t/ndb_dd_alter.test b/mysql-test/suite/ndb/t/ndb_dd_alter.test
index 7635a8944da..7635a8944da 100644
--- a/mysql-test/t/ndb_dd_alter.test
+++ b/mysql-test/suite/ndb/t/ndb_dd_alter.test
diff --git a/mysql-test/t/ndb_dd_backuprestore.test b/mysql-test/suite/ndb/t/ndb_dd_backuprestore.test
index 48db8ec3e0b..48db8ec3e0b 100644
--- a/mysql-test/t/ndb_dd_backuprestore.test
+++ b/mysql-test/suite/ndb/t/ndb_dd_backuprestore.test
diff --git a/mysql-test/t/ndb_dd_basic.test b/mysql-test/suite/ndb/t/ndb_dd_basic.test
index 3acf4669868..3acf4669868 100644
--- a/mysql-test/t/ndb_dd_basic.test
+++ b/mysql-test/suite/ndb/t/ndb_dd_basic.test
diff --git a/mysql-test/t/ndb_dd_ddl.test b/mysql-test/suite/ndb/t/ndb_dd_ddl.test
index aa692385b07..aa692385b07 100644
--- a/mysql-test/t/ndb_dd_ddl.test
+++ b/mysql-test/suite/ndb/t/ndb_dd_ddl.test
diff --git a/mysql-test/t/ndb_dd_disk2memory.test b/mysql-test/suite/ndb/t/ndb_dd_disk2memory.test
index 5975f44e087..5975f44e087 100644
--- a/mysql-test/t/ndb_dd_disk2memory.test
+++ b/mysql-test/suite/ndb/t/ndb_dd_disk2memory.test
diff --git a/mysql-test/t/ndb_dd_dump.test b/mysql-test/suite/ndb/t/ndb_dd_dump.test
index 38ceafb7d80..38ceafb7d80 100644
--- a/mysql-test/t/ndb_dd_dump.test
+++ b/mysql-test/suite/ndb/t/ndb_dd_dump.test
diff --git a/mysql-test/t/ndb_dd_sql_features.test b/mysql-test/suite/ndb/t/ndb_dd_sql_features.test
index f46cb217ab4..f46cb217ab4 100644
--- a/mysql-test/t/ndb_dd_sql_features.test
+++ b/mysql-test/suite/ndb/t/ndb_dd_sql_features.test
diff --git a/mysql-test/t/ndb_gis.test b/mysql-test/suite/ndb/t/ndb_gis.test
index e14f462c32d..e14f462c32d 100644
--- a/mysql-test/t/ndb_gis.test
+++ b/mysql-test/suite/ndb/t/ndb_gis.test
diff --git a/mysql-test/t/ndb_grant.later b/mysql-test/suite/ndb/t/ndb_grant.later
index 5431d94e1f8..5431d94e1f8 100644
--- a/mysql-test/t/ndb_grant.later
+++ b/mysql-test/suite/ndb/t/ndb_grant.later
diff --git a/mysql-test/t/ndb_index.test b/mysql-test/suite/ndb/t/ndb_index.test
index 272f30e3e6f..272f30e3e6f 100644
--- a/mysql-test/t/ndb_index.test
+++ b/mysql-test/suite/ndb/t/ndb_index.test
diff --git a/mysql-test/t/ndb_index_ordered.test b/mysql-test/suite/ndb/t/ndb_index_ordered.test
index 782f17ca5b2..782f17ca5b2 100644
--- a/mysql-test/t/ndb_index_ordered.test
+++ b/mysql-test/suite/ndb/t/ndb_index_ordered.test
diff --git a/mysql-test/t/ndb_index_unique.test b/mysql-test/suite/ndb/t/ndb_index_unique.test
index 78757c3bcf7..78757c3bcf7 100644
--- a/mysql-test/t/ndb_index_unique.test
+++ b/mysql-test/suite/ndb/t/ndb_index_unique.test
diff --git a/mysql-test/t/ndb_insert.test b/mysql-test/suite/ndb/t/ndb_insert.test
index 5b74cc9202c..5b74cc9202c 100644
--- a/mysql-test/t/ndb_insert.test
+++ b/mysql-test/suite/ndb/t/ndb_insert.test
diff --git a/mysql-test/t/ndb_limit.test b/mysql-test/suite/ndb/t/ndb_limit.test
index 01613606d66..01613606d66 100644
--- a/mysql-test/t/ndb_limit.test
+++ b/mysql-test/suite/ndb/t/ndb_limit.test
diff --git a/mysql-test/t/ndb_load.test b/mysql-test/suite/ndb/t/ndb_load.test
index af2df70b74e..af2df70b74e 100644
--- a/mysql-test/t/ndb_load.test
+++ b/mysql-test/suite/ndb/t/ndb_load.test
diff --git a/mysql-test/t/ndb_loaddatalocal.test b/mysql-test/suite/ndb/t/ndb_loaddatalocal.test
index 3eae3891f43..3eae3891f43 100644
--- a/mysql-test/t/ndb_loaddatalocal.test
+++ b/mysql-test/suite/ndb/t/ndb_loaddatalocal.test
diff --git a/mysql-test/t/ndb_lock.test b/mysql-test/suite/ndb/t/ndb_lock.test
index b6cd1ca7eb4..b6cd1ca7eb4 100644
--- a/mysql-test/t/ndb_lock.test
+++ b/mysql-test/suite/ndb/t/ndb_lock.test
diff --git a/mysql-test/t/ndb_minmax.test b/mysql-test/suite/ndb/t/ndb_minmax.test
index a3ac677cd2a..a3ac677cd2a 100644
--- a/mysql-test/t/ndb_minmax.test
+++ b/mysql-test/suite/ndb/t/ndb_minmax.test
diff --git a/mysql-test/t/ndb_multi.test b/mysql-test/suite/ndb/t/ndb_multi.test
index 3482db1d1b2..b8e052d606b 100644
--- a/mysql-test/t/ndb_multi.test
+++ b/mysql-test/suite/ndb/t/ndb_multi.test
@@ -1,4 +1,3 @@
--- source include/have_ndb.inc
-- source include/have_multi_ndb.inc
-- source include/not_embedded.inc
diff --git a/mysql-test/t/ndb_multi_row.test b/mysql-test/suite/ndb/t/ndb_multi_row.test
index f7b0aa3035f..c82307839f4 100644
--- a/mysql-test/t/ndb_multi_row.test
+++ b/mysql-test/suite/ndb/t/ndb_multi_row.test
@@ -1,4 +1,3 @@
--- source include/have_ndb.inc
-- source include/have_multi_ndb.inc
-- source include/not_embedded.inc
-- source include/have_binlog_format_mixed_or_row.inc
diff --git a/mysql-test/t/ndb_partition_error.test b/mysql-test/suite/ndb/t/ndb_partition_error.test
index 9db2a6a6f6d..9db2a6a6f6d 100644
--- a/mysql-test/t/ndb_partition_error.test
+++ b/mysql-test/suite/ndb/t/ndb_partition_error.test
diff --git a/mysql-test/t/ndb_partition_error2-master.opt b/mysql-test/suite/ndb/t/ndb_partition_error2-master.opt
index 955f7692c8b..955f7692c8b 100644
--- a/mysql-test/t/ndb_partition_error2-master.opt
+++ b/mysql-test/suite/ndb/t/ndb_partition_error2-master.opt
diff --git a/mysql-test/t/ndb_partition_error2.test b/mysql-test/suite/ndb/t/ndb_partition_error2.test
index afedd0e3c5c..afedd0e3c5c 100644
--- a/mysql-test/t/ndb_partition_error2.test
+++ b/mysql-test/suite/ndb/t/ndb_partition_error2.test
diff --git a/mysql-test/t/ndb_partition_key.test b/mysql-test/suite/ndb/t/ndb_partition_key.test
index 78e2c9d15c2..78e2c9d15c2 100644
--- a/mysql-test/t/ndb_partition_key.test
+++ b/mysql-test/suite/ndb/t/ndb_partition_key.test
diff --git a/mysql-test/t/ndb_partition_list.test b/mysql-test/suite/ndb/t/ndb_partition_list.test
index ccfcdbc84f4..ccfcdbc84f4 100644
--- a/mysql-test/t/ndb_partition_list.test
+++ b/mysql-test/suite/ndb/t/ndb_partition_list.test
diff --git a/mysql-test/t/ndb_partition_range.test b/mysql-test/suite/ndb/t/ndb_partition_range.test
index 7952ba502d2..7952ba502d2 100644
--- a/mysql-test/t/ndb_partition_range.test
+++ b/mysql-test/suite/ndb/t/ndb_partition_range.test
diff --git a/mysql-test/t/ndb_read_multi_range.test b/mysql-test/suite/ndb/t/ndb_read_multi_range.test
index ecca1f9862c..ecca1f9862c 100644
--- a/mysql-test/t/ndb_read_multi_range.test
+++ b/mysql-test/suite/ndb/t/ndb_read_multi_range.test
diff --git a/mysql-test/t/ndb_rename.test b/mysql-test/suite/ndb/t/ndb_rename.test
index 7f9fd0e6984..7f9fd0e6984 100644
--- a/mysql-test/t/ndb_rename.test
+++ b/mysql-test/suite/ndb/t/ndb_rename.test
diff --git a/mysql-test/t/ndb_replace.test b/mysql-test/suite/ndb/t/ndb_replace.test
index aa2072b98dd..aa2072b98dd 100644
--- a/mysql-test/t/ndb_replace.test
+++ b/mysql-test/suite/ndb/t/ndb_replace.test
diff --git a/mysql-test/t/ndb_restore.test b/mysql-test/suite/ndb/t/ndb_restore.test
index 7f0cafdfd77..7f0cafdfd77 100644
--- a/mysql-test/t/ndb_restore.test
+++ b/mysql-test/suite/ndb/t/ndb_restore.test
diff --git a/mysql-test/t/ndb_restore_compat.test b/mysql-test/suite/ndb/t/ndb_restore_compat.test
index 2622aec1d50..2622aec1d50 100644
--- a/mysql-test/t/ndb_restore_compat.test
+++ b/mysql-test/suite/ndb/t/ndb_restore_compat.test
diff --git a/mysql-test/t/ndb_restore_partition-master.opt b/mysql-test/suite/ndb/t/ndb_restore_partition-master.opt
index 075c6392dde..075c6392dde 100644
--- a/mysql-test/t/ndb_restore_partition-master.opt
+++ b/mysql-test/suite/ndb/t/ndb_restore_partition-master.opt
diff --git a/mysql-test/t/ndb_restore_partition.test b/mysql-test/suite/ndb/t/ndb_restore_partition.test
index f11324492c2..f11324492c2 100644
--- a/mysql-test/t/ndb_restore_partition.test
+++ b/mysql-test/suite/ndb/t/ndb_restore_partition.test
diff --git a/mysql-test/t/ndb_restore_print.test b/mysql-test/suite/ndb/t/ndb_restore_print.test
index 6dbbfdf5933..6dbbfdf5933 100644
--- a/mysql-test/t/ndb_restore_print.test
+++ b/mysql-test/suite/ndb/t/ndb_restore_print.test
diff --git a/mysql-test/t/ndb_row_format.test b/mysql-test/suite/ndb/t/ndb_row_format.test
index b1582cbe339..b1582cbe339 100644
--- a/mysql-test/t/ndb_row_format.test
+++ b/mysql-test/suite/ndb/t/ndb_row_format.test
diff --git a/mysql-test/t/ndb_single_user.test b/mysql-test/suite/ndb/t/ndb_single_user.test
index f059ea9ba23..07925b25917 100644
--- a/mysql-test/t/ndb_single_user.test
+++ b/mysql-test/suite/ndb/t/ndb_single_user.test
@@ -25,7 +25,7 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
create table t1 (a int key, b int unique, c int) engine ndb;
# Bug #27712 Single user mode. Creating logfile group and tablespace is allowed
# - before bug fix these would succeed
---error 1516
+--error ER_CREATE_FILEGROUP_FAILED
CREATE LOGFILE GROUP lg1
ADD UNDOFILE 'undofile.dat'
INITIAL_SIZE 16M
diff --git a/mysql-test/t/ndb_sp.test b/mysql-test/suite/ndb/t/ndb_sp.test
index b833869cad0..b833869cad0 100644
--- a/mysql-test/t/ndb_sp.test
+++ b/mysql-test/suite/ndb/t/ndb_sp.test
diff --git a/mysql-test/t/ndb_subquery.test b/mysql-test/suite/ndb/t/ndb_subquery.test
index 6282c31c922..6282c31c922 100644
--- a/mysql-test/t/ndb_subquery.test
+++ b/mysql-test/suite/ndb/t/ndb_subquery.test
diff --git a/mysql-test/t/ndb_temporary.test b/mysql-test/suite/ndb/t/ndb_temporary.test
index 7f6902bf745..7f6902bf745 100644
--- a/mysql-test/t/ndb_temporary.test
+++ b/mysql-test/suite/ndb/t/ndb_temporary.test
diff --git a/mysql-test/t/ndb_transaction.test b/mysql-test/suite/ndb/t/ndb_transaction.test
index d3ebadb1a78..d3ebadb1a78 100644
--- a/mysql-test/t/ndb_transaction.test
+++ b/mysql-test/suite/ndb/t/ndb_transaction.test
diff --git a/mysql-test/t/ndb_trigger.test b/mysql-test/suite/ndb/t/ndb_trigger.test
index 2e944174fd0..2e944174fd0 100644
--- a/mysql-test/t/ndb_trigger.test
+++ b/mysql-test/suite/ndb/t/ndb_trigger.test
diff --git a/mysql-test/t/ndb_truncate.test b/mysql-test/suite/ndb/t/ndb_truncate.test
index a1ef4be0d48..a1ef4be0d48 100644
--- a/mysql-test/t/ndb_truncate.test
+++ b/mysql-test/suite/ndb/t/ndb_truncate.test
diff --git a/mysql-test/t/ndb_types.test b/mysql-test/suite/ndb/t/ndb_types.test
index ab18817132e..ab18817132e 100644
--- a/mysql-test/t/ndb_types.test
+++ b/mysql-test/suite/ndb/t/ndb_types.test
diff --git a/mysql-test/suite/ndb/t/ndb_update.test b/mysql-test/suite/ndb/t/ndb_update.test
new file mode 100644
index 00000000000..c45f990edcc
--- /dev/null
+++ b/mysql-test/suite/ndb/t/ndb_update.test
@@ -0,0 +1,89 @@
+-- source include/have_ndb.inc
+-- source include/not_embedded.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+DROP TABLE IF EXISTS t3;
+--enable_warnings
+
+#
+# Basic test of UPDATE in NDB
+#
+
+#
+# Create a normal table with primary key
+#
+CREATE TABLE t1 (
+ pk1 INT NOT NULL PRIMARY KEY,
+ b INT NOT NULL,
+ c INT NOT NULL UNIQUE
+) ENGINE=ndbcluster;
+
+INSERT INTO t1 VALUES (0, 1, 0),(1,2,1),(2,3,2);
+UPDATE t1 set b = c;
+select * from t1 order by pk1;
+UPDATE t1 set pk1 = 4 where pk1 = 1;
+select * from t1 order by pk1;
+--error ER_DUP_ENTRY
+UPDATE t1 set pk1 = 4 where pk1 = 2;
+UPDATE IGNORE t1 set pk1 = 4 where pk1 = 2;
+select * from t1 order by pk1;
+--error ER_DUP_ENTRY
+UPDATE t1 set pk1 = 1, c = 2 where pk1 = 4;
+UPDATE IGNORE t1 set pk1 = 1, c = 2 where pk1 = 4;
+select * from t1 order by pk1;
+UPDATE t1 set pk1 = pk1 + 10;
+select * from t1 order by pk1;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+# End of 4.1 tests
+
+#
+# Bug#28158: table->read_set is set incorrectly,
+# causing wrong error message in Falcon
+#
+CREATE TABLE t1 (a int, b int, KEY (a, b)) ENGINE=ndbcluster;
+CREATE TABLE t2 (a int, b int, UNIQUE KEY (a, b)) ENGINE=ndbcluster;
+CREATE TABLE t3 (a int, b int, PRIMARY KEY (a, b)) ENGINE=ndbcluster;
+#
+INSERT INTO t1 VALUES (1, 2);
+INSERT INTO t1 VALUES (2, 2);
+#
+INSERT INTO t2 VALUES (1, 2);
+INSERT INTO t2 VALUES (2, 2);
+#
+INSERT INTO t3 VALUES (1, 2);
+INSERT INTO t3 VALUES (2, 2);
+#
+UPDATE t1 SET a = 1;
+UPDATE t1 SET a = 1 ORDER BY a;
+#
+--error ER_DUP_ENTRY
+UPDATE t2 SET a = 1;
+--error ER_DUP_ENTRY
+UPDATE t2 SET a = 1 ORDER BY a;
+#
+--error ER_DUP_ENTRY
+UPDATE t3 SET a = 1;
+--error ER_DUP_ENTRY
+UPDATE t3 SET a = 1 ORDER BY a;
+#
+SELECT count(*) FROM t1;
+SELECT count(*) FROM t2;
+SELECT count(*) FROM t3;
+SELECT * FROM t1 ORDER by a;
+SELECT * FROM t2 ORDER by a;
+SELECT * FROM t3 ORDER by a;
+#
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+DROP TABLE IF EXISTS t3;
+--enable_warnings
+
+--echo End of 5.1 tests
+
diff --git a/mysql-test/t/ndb_view.test b/mysql-test/suite/ndb/t/ndb_view.test
index 3b8fc330b40..3b8fc330b40 100644
--- a/mysql-test/t/ndb_view.test
+++ b/mysql-test/suite/ndb/t/ndb_view.test
diff --git a/mysql-test/t/ndbapi.test b/mysql-test/suite/ndb/t/ndbapi.test
index 3424513f8af..3424513f8af 100644
--- a/mysql-test/t/ndbapi.test
+++ b/mysql-test/suite/ndb/t/ndbapi.test
diff --git a/mysql-test/t/partition_03ndb.test b/mysql-test/suite/ndb/t/partition_03ndb.test
index 3190ab9dfc7..3190ab9dfc7 100644
--- a/mysql-test/t/partition_03ndb.test
+++ b/mysql-test/suite/ndb/t/partition_03ndb.test
diff --git a/mysql-test/t/ps_7ndb.test b/mysql-test/suite/ndb/t/ps_7ndb.test
index e3f65ec2c4e..e3f65ec2c4e 100644
--- a/mysql-test/t/ps_7ndb.test
+++ b/mysql-test/suite/ndb/t/ps_7ndb.test
diff --git a/mysql-test/t/strict_autoinc_5ndb.test b/mysql-test/suite/ndb/t/strict_autoinc_5ndb.test
index 9e2090fddef..9e2090fddef 100644
--- a/mysql-test/t/strict_autoinc_5ndb.test
+++ b/mysql-test/suite/ndb/t/strict_autoinc_5ndb.test
diff --git a/mysql-test/r/rpl_partition.result b/mysql-test/suite/parts/r/rpl_partition.result
index cdd29919c48..79a95fd613b 100644
--- a/mysql-test/r/rpl_partition.result
+++ b/mysql-test/suite/parts/r/rpl_partition.result
@@ -10,31 +10,9 @@ select @@global.binlog_format, @@session.binlog_format;
@@global.binlog_format ROW
@@session.binlog_format ROW
DROP TABLE IF EXISTS t1, t2, t3;
-Warnings:
-Level Note
-Code 1051
-Message Unknown table 't1'
-Level Note
-Code 1051
-Message Unknown table 't2'
-Level Note
-Code 1051
-Message Unknown table 't3'
DROP PROCEDURE IF EXISTS p1;
-Warnings:
-Level Note
-Code 1305
-Message PROCEDURE p1 does not exist
DROP PROCEDURE IF EXISTS p2;
-Warnings:
-Level Note
-Code 1305
-Message PROCEDURE p2 does not exist
DROP PROCEDURE IF EXISTS p3;
-Warnings:
-Level Note
-Code 1305
-Message PROCEDURE p3 does not exist
CREATE TABLE t1(id MEDIUMINT NOT NULL AUTO_INCREMENT,
dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
fkid MEDIUMINT, filler VARCHAR(255),
diff --git a/mysql-test/suite/parts/t/disabled.def b/mysql-test/suite/parts/t/disabled.def
index 212ca0206e2..36bf08e9851 100644
--- a/mysql-test/suite/parts/t/disabled.def
+++ b/mysql-test/suite/parts/t/disabled.def
@@ -13,4 +13,3 @@ partition_alter2_ndb : cannot create t1
partition_char_innodb : crash. Bug? More investigations
partition_sessions : needs system_3_init.inc
partition_engine_ndb : cannot create t1
-partition_supported_sql_func_ndb : cannot create t1
diff --git a/mysql-test/t/rpl_partition.test b/mysql-test/suite/parts/t/rpl_partition.test
index 7f6e05db20e..ffd6d17ec6f 100644
--- a/mysql-test/t/rpl_partition.test
+++ b/mysql-test/suite/parts/t/rpl_partition.test
@@ -9,12 +9,12 @@ SET GLOBAL binlog_format = 'ROW';
SET SESSION binlog_format = 'ROW';
select @@global.binlog_format, @@session.binlog_format;
---disable-warnings
+--disable_warnings
DROP TABLE IF EXISTS t1, t2, t3;
DROP PROCEDURE IF EXISTS p1;
DROP PROCEDURE IF EXISTS p2;
DROP PROCEDURE IF EXISTS p3;
---enable-warnings
+--enable_warnings
eval CREATE TABLE t1(id MEDIUMINT NOT NULL AUTO_INCREMENT,
dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
diff --git a/mysql-test/r/rpl000001.a.result b/mysql-test/suite/rpl/r/rpl000001.a.result
index c52b83d729a..c52b83d729a 100644
--- a/mysql-test/r/rpl000001.a.result
+++ b/mysql-test/suite/rpl/r/rpl000001.a.result
diff --git a/mysql-test/r/rpl000001.b.result b/mysql-test/suite/rpl/r/rpl000001.b.result
index 5108cfdaf26..5108cfdaf26 100644
--- a/mysql-test/r/rpl000001.b.result
+++ b/mysql-test/suite/rpl/r/rpl000001.b.result
diff --git a/mysql-test/r/rpl000010.result b/mysql-test/suite/rpl/r/rpl000010.result
index 65191ea411f..65191ea411f 100644
--- a/mysql-test/r/rpl000010.result
+++ b/mysql-test/suite/rpl/r/rpl000010.result
diff --git a/mysql-test/r/rpl000011.result b/mysql-test/suite/rpl/r/rpl000011.result
index dd0fa2fbe74..dd0fa2fbe74 100644
--- a/mysql-test/r/rpl000011.result
+++ b/mysql-test/suite/rpl/r/rpl000011.result
diff --git a/mysql-test/r/rpl000013.result b/mysql-test/suite/rpl/r/rpl000013.result
index 37838bb88e0..37838bb88e0 100644
--- a/mysql-test/r/rpl000013.result
+++ b/mysql-test/suite/rpl/r/rpl000013.result
diff --git a/mysql-test/r/rpl000017.result b/mysql-test/suite/rpl/r/rpl000017.result
index 1c611357e64..1c611357e64 100644
--- a/mysql-test/r/rpl000017.result
+++ b/mysql-test/suite/rpl/r/rpl000017.result
diff --git a/mysql-test/r/rpl_000015.result b/mysql-test/suite/rpl/r/rpl_000015.result
index 79d87354cb2..79d87354cb2 100644
--- a/mysql-test/r/rpl_000015.result
+++ b/mysql-test/suite/rpl/r/rpl_000015.result
diff --git a/mysql-test/r/rpl_EE_err.result b/mysql-test/suite/rpl/r/rpl_EE_err.result
index 16fa931e303..16fa931e303 100644
--- a/mysql-test/r/rpl_EE_err.result
+++ b/mysql-test/suite/rpl/r/rpl_EE_err.result
diff --git a/mysql-test/r/rpl_LD_INFILE.result b/mysql-test/suite/rpl/r/rpl_LD_INFILE.result
index 70013f95d85..70013f95d85 100644
--- a/mysql-test/r/rpl_LD_INFILE.result
+++ b/mysql-test/suite/rpl/r/rpl_LD_INFILE.result
diff --git a/mysql-test/r/rpl_alter.result b/mysql-test/suite/rpl/r/rpl_alter.result
index 6ef5ce3462a..6ef5ce3462a 100644
--- a/mysql-test/r/rpl_alter.result
+++ b/mysql-test/suite/rpl/r/rpl_alter.result
diff --git a/mysql-test/r/rpl_alter_db.result b/mysql-test/suite/rpl/r/rpl_alter_db.result
index 6edbe5d427f..6edbe5d427f 100644
--- a/mysql-test/r/rpl_alter_db.result
+++ b/mysql-test/suite/rpl/r/rpl_alter_db.result
diff --git a/mysql-test/r/rpl_auto_increment.result b/mysql-test/suite/rpl/r/rpl_auto_increment.result
index 083f3a4e901..083f3a4e901 100644
--- a/mysql-test/r/rpl_auto_increment.result
+++ b/mysql-test/suite/rpl/r/rpl_auto_increment.result
diff --git a/mysql-test/r/rpl_auto_increment_11932.result b/mysql-test/suite/rpl/r/rpl_auto_increment_11932.result
index 25eda6ee454..25eda6ee454 100644
--- a/mysql-test/r/rpl_auto_increment_11932.result
+++ b/mysql-test/suite/rpl/r/rpl_auto_increment_11932.result
diff --git a/mysql-test/r/rpl_bit.result b/mysql-test/suite/rpl/r/rpl_bit.result
index 924de8a65f8..924de8a65f8 100644
--- a/mysql-test/r/rpl_bit.result
+++ b/mysql-test/suite/rpl/r/rpl_bit.result
diff --git a/mysql-test/r/rpl_bit_npk.result b/mysql-test/suite/rpl/r/rpl_bit_npk.result
index 9599660f18f..9599660f18f 100644
--- a/mysql-test/r/rpl_bit_npk.result
+++ b/mysql-test/suite/rpl/r/rpl_bit_npk.result
diff --git a/mysql-test/r/rpl_change_master.result b/mysql-test/suite/rpl/r/rpl_change_master.result
index 7707ca2cf9b..7707ca2cf9b 100644
--- a/mysql-test/r/rpl_change_master.result
+++ b/mysql-test/suite/rpl/r/rpl_change_master.result
diff --git a/mysql-test/r/rpl_charset_sjis.result b/mysql-test/suite/rpl/r/rpl_charset_sjis.result
index 770ad0588d1..770ad0588d1 100644
--- a/mysql-test/r/rpl_charset_sjis.result
+++ b/mysql-test/suite/rpl/r/rpl_charset_sjis.result
diff --git a/mysql-test/r/rpl_commit_after_flush.result b/mysql-test/suite/rpl/r/rpl_commit_after_flush.result
index eaddda63b6a..eaddda63b6a 100644
--- a/mysql-test/r/rpl_commit_after_flush.result
+++ b/mysql-test/suite/rpl/r/rpl_commit_after_flush.result
diff --git a/mysql-test/r/rpl_create_database.result b/mysql-test/suite/rpl/r/rpl_create_database.result
index 0cfd44bc58c..0cfd44bc58c 100644
--- a/mysql-test/r/rpl_create_database.result
+++ b/mysql-test/suite/rpl/r/rpl_create_database.result
diff --git a/mysql-test/r/rpl_critical_errors.result b/mysql-test/suite/rpl/r/rpl_critical_errors.result
index bcc53565084..bcc53565084 100644
--- a/mysql-test/r/rpl_critical_errors.result
+++ b/mysql-test/suite/rpl/r/rpl_critical_errors.result
diff --git a/mysql-test/r/rpl_critical_errors.result.txt b/mysql-test/suite/rpl/r/rpl_critical_errors.result.txt
index 0df2e1ef369..0df2e1ef369 100644
--- a/mysql-test/r/rpl_critical_errors.result.txt
+++ b/mysql-test/suite/rpl/r/rpl_critical_errors.result.txt
diff --git a/mysql-test/r/rpl_ddl.result b/mysql-test/suite/rpl/r/rpl_ddl.result
index d41462de621..d41462de621 100644
--- a/mysql-test/r/rpl_ddl.result
+++ b/mysql-test/suite/rpl/r/rpl_ddl.result
diff --git a/mysql-test/r/rpl_deadlock_innodb.result b/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result
index 1753fc0cb2d..1753fc0cb2d 100644
--- a/mysql-test/r/rpl_deadlock_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result
diff --git a/mysql-test/r/rpl_delete_no_where.result b/mysql-test/suite/rpl/r/rpl_delete_no_where.result
index 78edf4bf3fa..78edf4bf3fa 100644
--- a/mysql-test/r/rpl_delete_no_where.result
+++ b/mysql-test/suite/rpl/r/rpl_delete_no_where.result
diff --git a/mysql-test/r/rpl_do_grant.result b/mysql-test/suite/rpl/r/rpl_do_grant.result
index f7f1ce66656..f7f1ce66656 100644
--- a/mysql-test/r/rpl_do_grant.result
+++ b/mysql-test/suite/rpl/r/rpl_do_grant.result
diff --git a/mysql-test/r/rpl_drop.result b/mysql-test/suite/rpl/r/rpl_drop.result
index b83594c9bb1..b83594c9bb1 100644
--- a/mysql-test/r/rpl_drop.result
+++ b/mysql-test/suite/rpl/r/rpl_drop.result
diff --git a/mysql-test/r/rpl_drop_db.result b/mysql-test/suite/rpl/r/rpl_drop_db.result
index c0efdf5290d..c0efdf5290d 100644
--- a/mysql-test/r/rpl_drop_db.result
+++ b/mysql-test/suite/rpl/r/rpl_drop_db.result
diff --git a/mysql-test/r/rpl_drop_temp.result b/mysql-test/suite/rpl/r/rpl_drop_temp.result
index 40d578dd13e..40d578dd13e 100644
--- a/mysql-test/r/rpl_drop_temp.result
+++ b/mysql-test/suite/rpl/r/rpl_drop_temp.result
diff --git a/mysql-test/r/rpl_dual_pos_advance.result b/mysql-test/suite/rpl/r/rpl_dual_pos_advance.result
index 257baa81b74..257baa81b74 100644
--- a/mysql-test/r/rpl_dual_pos_advance.result
+++ b/mysql-test/suite/rpl/r/rpl_dual_pos_advance.result
diff --git a/mysql-test/r/rpl_empty_master_crash.result b/mysql-test/suite/rpl/r/rpl_empty_master_crash.result
index f0d84f85069..f0d84f85069 100644
--- a/mysql-test/r/rpl_empty_master_crash.result
+++ b/mysql-test/suite/rpl/r/rpl_empty_master_crash.result
diff --git a/mysql-test/r/rpl_err_ignoredtable.result b/mysql-test/suite/rpl/r/rpl_err_ignoredtable.result
index f211d5d9a2f..f211d5d9a2f 100644
--- a/mysql-test/r/rpl_err_ignoredtable.result
+++ b/mysql-test/suite/rpl/r/rpl_err_ignoredtable.result
diff --git a/mysql-test/r/rpl_events.result b/mysql-test/suite/rpl/r/rpl_events.result
index 18fe72a9879..18fe72a9879 100644
--- a/mysql-test/r/rpl_events.result
+++ b/mysql-test/suite/rpl/r/rpl_events.result
diff --git a/mysql-test/r/rpl_extraCol_innodb.result b/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result
index cfce12b594e..c3159987b30 100644
--- a/mysql-test/r/rpl_extraCol_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result
@@ -72,7 +72,7 @@ Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
-Last_Errno 1523
+Last_Errno 1532
Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3
Skip_Counter 0
Exec_Master_Log_Pos #
@@ -90,7 +90,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
-Last_SQL_Errno 1523
+Last_SQL_Errno 1532
Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -134,7 +134,7 @@ Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
-Last_Errno 1523
+Last_Errno 1532
Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3
Skip_Counter 0
Exec_Master_Log_Pos #
@@ -152,7 +152,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
-Last_SQL_Errno 1523
+Last_SQL_Errno 1532
Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -196,7 +196,7 @@ Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
-Last_Errno 1523
+Last_Errno 1532
Last_Error Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246
Skip_Counter 0
Exec_Master_Log_Pos #
@@ -214,7 +214,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
-Last_SQL_Errno 1523
+Last_SQL_Errno 1532
Last_SQL_Error Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -257,7 +257,7 @@ Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
-Last_Errno 1523
+Last_Errno 1532
Last_Error Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3
Skip_Counter 0
Exec_Master_Log_Pos #
@@ -275,7 +275,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
-Last_SQL_Errno 1523
+Last_SQL_Errno 1532
Last_SQL_Error Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3;
*** Drop t6 ***
@@ -369,7 +369,7 @@ Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
-Last_Errno 1523
+Last_Errno 1532
Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5
Skip_Counter 0
Exec_Master_Log_Pos #
@@ -387,7 +387,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
-Last_SQL_Errno 1523
+Last_SQL_Errno 1532
Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -430,7 +430,7 @@ Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
-Last_Errno 1523
+Last_Errno 1532
Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252
Skip_Counter 0
Exec_Master_Log_Pos #
@@ -448,7 +448,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
-Last_SQL_Errno 1523
+Last_SQL_Errno 1532
Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -755,7 +755,7 @@ Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
-Last_Errno 1523
+Last_Errno 1532
Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2
Skip_Counter 0
Exec_Master_Log_Pos #
@@ -773,7 +773,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
-Last_SQL_Errno 1523
+Last_SQL_Errno 1532
Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
diff --git a/mysql-test/r/rpl_extraCol_myisam.result b/mysql-test/suite/rpl/r/rpl_extraCol_myisam.result
index b250911368c..9d6c3ed5d33 100644
--- a/mysql-test/r/rpl_extraCol_myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_extraCol_myisam.result
@@ -72,7 +72,7 @@ Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
-Last_Errno 1523
+Last_Errno 1532
Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3
Skip_Counter 0
Exec_Master_Log_Pos #
@@ -90,7 +90,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
-Last_SQL_Errno 1523
+Last_SQL_Errno 1532
Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -134,7 +134,7 @@ Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
-Last_Errno 1523
+Last_Errno 1532
Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3
Skip_Counter 0
Exec_Master_Log_Pos #
@@ -152,7 +152,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
-Last_SQL_Errno 1523
+Last_SQL_Errno 1532
Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -196,7 +196,7 @@ Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
-Last_Errno 1523
+Last_Errno 1532
Last_Error Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246
Skip_Counter 0
Exec_Master_Log_Pos #
@@ -214,7 +214,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
-Last_SQL_Errno 1523
+Last_SQL_Errno 1532
Last_SQL_Error Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -257,7 +257,7 @@ Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
-Last_Errno 1523
+Last_Errno 1532
Last_Error Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3
Skip_Counter 0
Exec_Master_Log_Pos #
@@ -275,7 +275,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
-Last_SQL_Errno 1523
+Last_SQL_Errno 1532
Last_SQL_Error Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3;
*** Drop t6 ***
@@ -369,7 +369,7 @@ Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
-Last_Errno 1523
+Last_Errno 1532
Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5
Skip_Counter 0
Exec_Master_Log_Pos #
@@ -387,7 +387,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
-Last_SQL_Errno 1523
+Last_SQL_Errno 1532
Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -430,7 +430,7 @@ Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
-Last_Errno 1523
+Last_Errno 1532
Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252
Skip_Counter 0
Exec_Master_Log_Pos #
@@ -448,7 +448,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
-Last_SQL_Errno 1523
+Last_SQL_Errno 1532
Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -755,7 +755,7 @@ Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
-Last_Errno 1523
+Last_Errno 1532
Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2
Skip_Counter 0
Exec_Master_Log_Pos #
@@ -773,7 +773,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
-Last_SQL_Errno 1523
+Last_SQL_Errno 1532
Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
diff --git a/mysql-test/r/rpl_failed_optimize.result b/mysql-test/suite/rpl/r/rpl_failed_optimize.result
index 7e397550331..7e397550331 100644
--- a/mysql-test/r/rpl_failed_optimize.result
+++ b/mysql-test/suite/rpl/r/rpl_failed_optimize.result
diff --git a/mysql-test/r/rpl_flushlog_loop.result b/mysql-test/suite/rpl/r/rpl_flushlog_loop.result
index b47c262eb66..b47c262eb66 100644
--- a/mysql-test/r/rpl_flushlog_loop.result
+++ b/mysql-test/suite/rpl/r/rpl_flushlog_loop.result
diff --git a/mysql-test/r/rpl_foreign_key_innodb.result b/mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result
index 2239c32eea3..2239c32eea3 100644
--- a/mysql-test/r/rpl_foreign_key_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result
diff --git a/mysql-test/r/rpl_free_items.result b/mysql-test/suite/rpl/r/rpl_free_items.result
index 91c1e2aa6e5..91c1e2aa6e5 100644
--- a/mysql-test/r/rpl_free_items.result
+++ b/mysql-test/suite/rpl/r/rpl_free_items.result
diff --git a/mysql-test/r/rpl_get_lock.result b/mysql-test/suite/rpl/r/rpl_get_lock.result
index 235640acad0..235640acad0 100644
--- a/mysql-test/r/rpl_get_lock.result
+++ b/mysql-test/suite/rpl/r/rpl_get_lock.result
diff --git a/mysql-test/r/rpl_grant.result b/mysql-test/suite/rpl/r/rpl_grant.result
index 935d1ca67c7..935d1ca67c7 100644
--- a/mysql-test/r/rpl_grant.result
+++ b/mysql-test/suite/rpl/r/rpl_grant.result
diff --git a/mysql-test/r/rpl_ignore_grant.result b/mysql-test/suite/rpl/r/rpl_ignore_grant.result
index 5169cc8e888..5169cc8e888 100644
--- a/mysql-test/r/rpl_ignore_grant.result
+++ b/mysql-test/suite/rpl/r/rpl_ignore_grant.result
diff --git a/mysql-test/r/rpl_ignore_revoke.result b/mysql-test/suite/rpl/r/rpl_ignore_revoke.result
index b1ccd2f0442..b1ccd2f0442 100644
--- a/mysql-test/r/rpl_ignore_revoke.result
+++ b/mysql-test/suite/rpl/r/rpl_ignore_revoke.result
diff --git a/mysql-test/r/rpl_ignore_table.result b/mysql-test/suite/rpl/r/rpl_ignore_table.result
index e7200b31212..e7200b31212 100644
--- a/mysql-test/r/rpl_ignore_table.result
+++ b/mysql-test/suite/rpl/r/rpl_ignore_table.result
diff --git a/mysql-test/r/rpl_ignore_table_update.result b/mysql-test/suite/rpl/r/rpl_ignore_table_update.result
index a88a3c690ed..a88a3c690ed 100644
--- a/mysql-test/r/rpl_ignore_table_update.result
+++ b/mysql-test/suite/rpl/r/rpl_ignore_table_update.result
diff --git a/mysql-test/r/rpl_incident.result b/mysql-test/suite/rpl/r/rpl_incident.result
index 9d82798b5f4..84fd9c0ee4f 100644
--- a/mysql-test/r/rpl_incident.result
+++ b/mysql-test/suite/rpl/r/rpl_incident.result
@@ -44,7 +44,7 @@ Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
-Last_Errno 1586
+Last_Errno 1587
Last_Error The incident LOST_EVENTS occured on the master. Message: <none>
Skip_Counter 0
Exec_Master_Log_Pos #
@@ -62,7 +62,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
-Last_SQL_Errno 1586
+Last_SQL_Errno 1587
Last_SQL_Error The incident LOST_EVENTS occured on the master. Message: <none>
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
START SLAVE;
diff --git a/mysql-test/r/rpl_init_slave.result b/mysql-test/suite/rpl/r/rpl_init_slave.result
index 740c918976c..740c918976c 100644
--- a/mysql-test/r/rpl_init_slave.result
+++ b/mysql-test/suite/rpl/r/rpl_init_slave.result
diff --git a/mysql-test/r/rpl_innodb.result b/mysql-test/suite/rpl/r/rpl_innodb.result
index 658f92f4d75..658f92f4d75 100644
--- a/mysql-test/r/rpl_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_innodb.result
diff --git a/mysql-test/r/rpl_insert.result b/mysql-test/suite/rpl/r/rpl_insert.result
index b6a97926f73..b6a97926f73 100644
--- a/mysql-test/r/rpl_insert.result
+++ b/mysql-test/suite/rpl/r/rpl_insert.result
diff --git a/mysql-test/r/rpl_insert_id.result b/mysql-test/suite/rpl/r/rpl_insert_id.result
index b0c1b6cfd73..b0c1b6cfd73 100644
--- a/mysql-test/r/rpl_insert_id.result
+++ b/mysql-test/suite/rpl/r/rpl_insert_id.result
diff --git a/mysql-test/r/rpl_insert_id_pk.result b/mysql-test/suite/rpl/r/rpl_insert_id_pk.result
index 79815355332..79815355332 100644
--- a/mysql-test/r/rpl_insert_id_pk.result
+++ b/mysql-test/suite/rpl/r/rpl_insert_id_pk.result
diff --git a/mysql-test/r/rpl_insert_ignore.result b/mysql-test/suite/rpl/r/rpl_insert_ignore.result
index da24c86627c..da24c86627c 100644
--- a/mysql-test/r/rpl_insert_ignore.result
+++ b/mysql-test/suite/rpl/r/rpl_insert_ignore.result
diff --git a/mysql-test/r/rpl_insert_select.result b/mysql-test/suite/rpl/r/rpl_insert_select.result
index 1aff39e0026..1aff39e0026 100644
--- a/mysql-test/r/rpl_insert_select.result
+++ b/mysql-test/suite/rpl/r/rpl_insert_select.result
diff --git a/mysql-test/r/rpl_invoked_features.result b/mysql-test/suite/rpl/r/rpl_invoked_features.result
index 3bcef762497..3bcef762497 100644
--- a/mysql-test/r/rpl_invoked_features.result
+++ b/mysql-test/suite/rpl/r/rpl_invoked_features.result
diff --git a/mysql-test/r/rpl_known_bugs_detection.result b/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result
index 75180334c28..75180334c28 100644
--- a/mysql-test/r/rpl_known_bugs_detection.result
+++ b/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result
diff --git a/mysql-test/r/rpl_load_from_master.result b/mysql-test/suite/rpl/r/rpl_load_from_master.result
index 08b45ec1db0..08b45ec1db0 100644
--- a/mysql-test/r/rpl_load_from_master.result
+++ b/mysql-test/suite/rpl/r/rpl_load_from_master.result
diff --git a/mysql-test/r/rpl_load_table_from_master.result b/mysql-test/suite/rpl/r/rpl_load_table_from_master.result
index c24f857d829..c24f857d829 100644
--- a/mysql-test/r/rpl_load_table_from_master.result
+++ b/mysql-test/suite/rpl/r/rpl_load_table_from_master.result
diff --git a/mysql-test/r/rpl_loaddata.result b/mysql-test/suite/rpl/r/rpl_loaddata.result
index b9bd2a22fd0..b9bd2a22fd0 100644
--- a/mysql-test/r/rpl_loaddata.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata.result
diff --git a/mysql-test/r/rpl_loaddata_charset.result b/mysql-test/suite/rpl/r/rpl_loaddata_charset.result
index 929d06e74cf..929d06e74cf 100644
--- a/mysql-test/r/rpl_loaddata_charset.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_charset.result
diff --git a/mysql-test/r/rpl_loaddata_fatal.result b/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result
index 6c73c275ff0..6c73c275ff0 100644
--- a/mysql-test/r/rpl_loaddata_fatal.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result
diff --git a/mysql-test/r/rpl_loaddata_m.result b/mysql-test/suite/rpl/r/rpl_loaddata_m.result
index 9dbae6d38c4..9dbae6d38c4 100644
--- a/mysql-test/r/rpl_loaddata_m.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_m.result
diff --git a/mysql-test/r/rpl_loaddata_s.result b/mysql-test/suite/rpl/r/rpl_loaddata_s.result
index 4fc33eee20d..4fc33eee20d 100644
--- a/mysql-test/r/rpl_loaddata_s.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_s.result
diff --git a/mysql-test/r/rpl_loaddata_simple.result b/mysql-test/suite/rpl/r/rpl_loaddata_simple.result
index 196093211b6..196093211b6 100644
--- a/mysql-test/r/rpl_loaddata_simple.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_simple.result
diff --git a/mysql-test/r/rpl_loaddatalocal.result b/mysql-test/suite/rpl/r/rpl_loaddatalocal.result
index bb1b0610aa8..bb1b0610aa8 100644
--- a/mysql-test/r/rpl_loaddatalocal.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddatalocal.result
diff --git a/mysql-test/r/rpl_loadfile.result b/mysql-test/suite/rpl/r/rpl_loadfile.result
index 7487693a9f7..7487693a9f7 100644
--- a/mysql-test/r/rpl_loadfile.result
+++ b/mysql-test/suite/rpl/r/rpl_loadfile.result
diff --git a/mysql-test/r/rpl_locale.result b/mysql-test/suite/rpl/r/rpl_locale.result
index b7396084663..b7396084663 100644
--- a/mysql-test/r/rpl_locale.result
+++ b/mysql-test/suite/rpl/r/rpl_locale.result
diff --git a/mysql-test/r/rpl_log_pos.result b/mysql-test/suite/rpl/r/rpl_log_pos.result
index 0f3552af5bc..0f3552af5bc 100644
--- a/mysql-test/r/rpl_log_pos.result
+++ b/mysql-test/suite/rpl/r/rpl_log_pos.result
diff --git a/mysql-test/r/rpl_many_optimize.result b/mysql-test/suite/rpl/r/rpl_many_optimize.result
index b2148892591..b2148892591 100644
--- a/mysql-test/r/rpl_many_optimize.result
+++ b/mysql-test/suite/rpl/r/rpl_many_optimize.result
diff --git a/mysql-test/r/rpl_master_pos_wait.result b/mysql-test/suite/rpl/r/rpl_master_pos_wait.result
index 951e944fddc..951e944fddc 100644
--- a/mysql-test/r/rpl_master_pos_wait.result
+++ b/mysql-test/suite/rpl/r/rpl_master_pos_wait.result
diff --git a/mysql-test/r/rpl_misc_functions.result b/mysql-test/suite/rpl/r/rpl_misc_functions.result
index 526414cec9c..a8e5520ca8f 100644
--- a/mysql-test/r/rpl_misc_functions.result
+++ b/mysql-test/suite/rpl/r/rpl_misc_functions.result
@@ -20,11 +20,12 @@ select * from t1, t2 where (t1.id=t2.id) and not(t1.i=t2.i and t1.r1=t2.r1 and t
id i r1 r2 p id i r1 r2 p
drop table t1;
DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 (col_a double default NULL);
+CREATE TABLE t1 (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+col_a DOUBLE DEFAULT NULL);
CREATE PROCEDURE test_replication_sp1()
BEGIN
-INSERT INTO t1 VALUES (rand()), (rand());
-INSERT INTO t1 VALUES (rand());
+INSERT INTO t1 (col_a) VALUES (rand()), (rand());
+INSERT INTO t1 (col_a) VALUES (rand());
END|
CREATE PROCEDURE test_replication_sp2()
BEGIN
@@ -37,10 +38,18 @@ RETURN (rand() + rand());
END|
CALL test_replication_sp1();
CALL test_replication_sp2();
-INSERT INTO t1 VALUES (test_replication_sf());
-INSERT INTO t1 VALUES (test_replication_sf());
-INSERT INTO t1 VALUES (test_replication_sf());
-DROP PROCEDURE IF EXISTS test_replication_sp1;
-DROP PROCEDURE IF EXISTS test_replication_sp2;
-DROP FUNCTION IF EXISTS test_replication_sf;
-DROP TABLE IF EXISTS t1;
+INSERT INTO t1 (col_a) VALUES (test_replication_sf());
+INSERT INTO t1 (col_a) VALUES (test_replication_sf());
+INSERT INTO t1 (col_a) VALUES (test_replication_sf());
+select * from t1 into outfile "../tmp/t1_slave.txt";
+create temporary table t1_slave select * from t1 where 1=0;
+load data infile '../tmp/t1_slave.txt' into table t1_slave;
+select count(*) into @aux from t1 join t1_slave using (id)
+where ABS(t1.col_a - t1_slave.col_a) < 0.0000001 ;
+SELECT @aux;
+@aux
+12
+DROP TABLE t1, t1_slave;
+DROP PROCEDURE test_replication_sp1;
+DROP PROCEDURE test_replication_sp2;
+DROP FUNCTION test_replication_sf;
diff --git a/mysql-test/r/rpl_mixed_ddl_dml.result b/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result
index 38972a4f571..38972a4f571 100644
--- a/mysql-test/r/rpl_mixed_ddl_dml.result
+++ b/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result
diff --git a/mysql-test/r/rpl_multi_delete.result b/mysql-test/suite/rpl/r/rpl_multi_delete.result
index 4831502eb88..4831502eb88 100644
--- a/mysql-test/r/rpl_multi_delete.result
+++ b/mysql-test/suite/rpl/r/rpl_multi_delete.result
diff --git a/mysql-test/r/rpl_multi_delete2.result b/mysql-test/suite/rpl/r/rpl_multi_delete2.result
index 87abe60b268..87abe60b268 100644
--- a/mysql-test/r/rpl_multi_delete2.result
+++ b/mysql-test/suite/rpl/r/rpl_multi_delete2.result
diff --git a/mysql-test/r/rpl_multi_engine.result b/mysql-test/suite/rpl/r/rpl_multi_engine.result
index 7cb7d873415..7cb7d873415 100644
--- a/mysql-test/r/rpl_multi_engine.result
+++ b/mysql-test/suite/rpl/r/rpl_multi_engine.result
diff --git a/mysql-test/r/rpl_multi_update.result b/mysql-test/suite/rpl/r/rpl_multi_update.result
index 524278be042..524278be042 100644
--- a/mysql-test/r/rpl_multi_update.result
+++ b/mysql-test/suite/rpl/r/rpl_multi_update.result
diff --git a/mysql-test/r/rpl_multi_update2.result b/mysql-test/suite/rpl/r/rpl_multi_update2.result
index 5bb262764fa..5bb262764fa 100644
--- a/mysql-test/r/rpl_multi_update2.result
+++ b/mysql-test/suite/rpl/r/rpl_multi_update2.result
diff --git a/mysql-test/r/rpl_multi_update3.result b/mysql-test/suite/rpl/r/rpl_multi_update3.result
index dba7f770ba2..dba7f770ba2 100644
--- a/mysql-test/r/rpl_multi_update3.result
+++ b/mysql-test/suite/rpl/r/rpl_multi_update3.result
diff --git a/mysql-test/r/rpl_multi_update4.result b/mysql-test/suite/rpl/r/rpl_multi_update4.result
index f6dde65a35d..f6dde65a35d 100644
--- a/mysql-test/r/rpl_multi_update4.result
+++ b/mysql-test/suite/rpl/r/rpl_multi_update4.result
diff --git a/mysql-test/r/rpl_optimize.result b/mysql-test/suite/rpl/r/rpl_optimize.result
index 79891169fbc..79891169fbc 100644
--- a/mysql-test/r/rpl_optimize.result
+++ b/mysql-test/suite/rpl/r/rpl_optimize.result
diff --git a/mysql-test/r/rpl_packet.result b/mysql-test/suite/rpl/r/rpl_packet.result
index 981c234d380..981c234d380 100644
--- a/mysql-test/r/rpl_packet.result
+++ b/mysql-test/suite/rpl/r/rpl_packet.result
diff --git a/mysql-test/r/rpl_ps.result b/mysql-test/suite/rpl/r/rpl_ps.result
index 73c36af4862..73c36af4862 100644
--- a/mysql-test/r/rpl_ps.result
+++ b/mysql-test/suite/rpl/r/rpl_ps.result
diff --git a/mysql-test/r/rpl_rbr_to_sbr.result b/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result
index 07426d80541..07426d80541 100644
--- a/mysql-test/r/rpl_rbr_to_sbr.result
+++ b/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result
diff --git a/mysql-test/r/rpl_read_only.result b/mysql-test/suite/rpl/r/rpl_read_only.result
index 6b1404b4f68..6b1404b4f68 100644
--- a/mysql-test/r/rpl_read_only.result
+++ b/mysql-test/suite/rpl/r/rpl_read_only.result
diff --git a/mysql-test/r/rpl_redirect.result b/mysql-test/suite/rpl/r/rpl_redirect.result
index 39a7cb3ac3b..39a7cb3ac3b 100644
--- a/mysql-test/r/rpl_redirect.result
+++ b/mysql-test/suite/rpl/r/rpl_redirect.result
diff --git a/mysql-test/r/rpl_relay_space_innodb.result b/mysql-test/suite/rpl/r/rpl_relay_space_innodb.result
index 54aac2eca35..54aac2eca35 100644
--- a/mysql-test/r/rpl_relay_space_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_relay_space_innodb.result
diff --git a/mysql-test/r/rpl_relay_space_myisam.result b/mysql-test/suite/rpl/r/rpl_relay_space_myisam.result
index e8d2d63e46e..e8d2d63e46e 100644
--- a/mysql-test/r/rpl_relay_space_myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_relay_space_myisam.result
diff --git a/mysql-test/r/rpl_relayrotate.result b/mysql-test/suite/rpl/r/rpl_relayrotate.result
index 20f19973d83..20f19973d83 100644
--- a/mysql-test/r/rpl_relayrotate.result
+++ b/mysql-test/suite/rpl/r/rpl_relayrotate.result
diff --git a/mysql-test/r/rpl_relayspace.result b/mysql-test/suite/rpl/r/rpl_relayspace.result
index 1f2a739d3e3..1f2a739d3e3 100644
--- a/mysql-test/r/rpl_relayspace.result
+++ b/mysql-test/suite/rpl/r/rpl_relayspace.result
diff --git a/mysql-test/r/rpl_replicate_do.result b/mysql-test/suite/rpl/r/rpl_replicate_do.result
index d854a2d0f8d..d854a2d0f8d 100644
--- a/mysql-test/r/rpl_replicate_do.result
+++ b/mysql-test/suite/rpl/r/rpl_replicate_do.result
diff --git a/mysql-test/r/rpl_replicate_ignore_db.result b/mysql-test/suite/rpl/r/rpl_replicate_ignore_db.result
index 0135804c02d..0135804c02d 100644
--- a/mysql-test/r/rpl_replicate_ignore_db.result
+++ b/mysql-test/suite/rpl/r/rpl_replicate_ignore_db.result
diff --git a/mysql-test/r/rpl_rewrt_db.result b/mysql-test/suite/rpl/r/rpl_rewrt_db.result
index 1b843bffdca..1b843bffdca 100644
--- a/mysql-test/r/rpl_rewrt_db.result
+++ b/mysql-test/suite/rpl/r/rpl_rewrt_db.result
diff --git a/mysql-test/r/rpl_rotate_logs.result b/mysql-test/suite/rpl/r/rpl_rotate_logs.result
index 8cbd74887a6..2282067ddfd 100644
--- a/mysql-test/r/rpl_rotate_logs.result
+++ b/mysql-test/suite/rpl/r/rpl_rotate_logs.result
@@ -203,3 +203,11 @@ count(*)
100
unlock tables;
drop table if exists t1,t2,t3,t4;
+End of 4.1 tests
+show binlog events in 'non existing_binlog_file';
+ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
+purge master logs before now();
+show binlog events in '';
+ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
+purge master logs before now();
+End of 5.0 tests
diff --git a/mysql-test/r/rpl_row_001.result b/mysql-test/suite/rpl/r/rpl_row_001.result
index fad60af664f..fad60af664f 100644
--- a/mysql-test/r/rpl_row_001.result
+++ b/mysql-test/suite/rpl/r/rpl_row_001.result
diff --git a/mysql-test/r/rpl_row_4_bytes.result b/mysql-test/suite/rpl/r/rpl_row_4_bytes.result
index e2431364ed3..e2431364ed3 100644
--- a/mysql-test/r/rpl_row_4_bytes.result
+++ b/mysql-test/suite/rpl/r/rpl_row_4_bytes.result
diff --git a/mysql-test/r/rpl_row_NOW.result b/mysql-test/suite/rpl/r/rpl_row_NOW.result
index 23f95878608..23f95878608 100644
--- a/mysql-test/r/rpl_row_NOW.result
+++ b/mysql-test/suite/rpl/r/rpl_row_NOW.result
diff --git a/mysql-test/r/rpl_row_USER.result b/mysql-test/suite/rpl/r/rpl_row_USER.result
index 98755fb4653..98755fb4653 100644
--- a/mysql-test/r/rpl_row_USER.result
+++ b/mysql-test/suite/rpl/r/rpl_row_USER.result
diff --git a/mysql-test/r/rpl_row_UUID.result b/mysql-test/suite/rpl/r/rpl_row_UUID.result
index 02174a7ecae..02174a7ecae 100644
--- a/mysql-test/r/rpl_row_UUID.result
+++ b/mysql-test/suite/rpl/r/rpl_row_UUID.result
diff --git a/mysql-test/r/rpl_row_basic_11bugs-master.opt b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs-master.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/r/rpl_row_basic_11bugs-master.opt
+++ b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs-master.opt
diff --git a/mysql-test/r/rpl_row_basic_11bugs-slave.opt b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs-slave.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/r/rpl_row_basic_11bugs-slave.opt
+++ b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs-slave.opt
diff --git a/mysql-test/r/rpl_row_basic_11bugs.result b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result
index ca9ba023b1d..ca9ba023b1d 100644
--- a/mysql-test/r/rpl_row_basic_11bugs.result
+++ b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result
diff --git a/mysql-test/r/rpl_row_basic_2myisam.result b/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result
index a6877b27b95..a6877b27b95 100644
--- a/mysql-test/r/rpl_row_basic_2myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result
diff --git a/mysql-test/r/rpl_row_basic_3innodb.result b/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result
index 4c6ec627db5..4c6ec627db5 100644
--- a/mysql-test/r/rpl_row_basic_3innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result
diff --git a/mysql-test/r/rpl_row_basic_8partition.result b/mysql-test/suite/rpl/r/rpl_row_basic_8partition.result
index dedd5d044e0..dedd5d044e0 100644
--- a/mysql-test/r/rpl_row_basic_8partition.result
+++ b/mysql-test/suite/rpl/r/rpl_row_basic_8partition.result
diff --git a/mysql-test/r/rpl_row_blob_innodb.result b/mysql-test/suite/rpl/r/rpl_row_blob_innodb.result
index 055efffbd6a..055efffbd6a 100644
--- a/mysql-test/r/rpl_row_blob_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_blob_innodb.result
diff --git a/mysql-test/r/rpl_row_blob_myisam.result b/mysql-test/suite/rpl/r/rpl_row_blob_myisam.result
index 055efffbd6a..055efffbd6a 100644
--- a/mysql-test/r/rpl_row_blob_myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_row_blob_myisam.result
diff --git a/mysql-test/r/rpl_row_charset.result b/mysql-test/suite/rpl/r/rpl_row_charset.result
index e51f3e57d1f..e51f3e57d1f 100644
--- a/mysql-test/r/rpl_row_charset.result
+++ b/mysql-test/suite/rpl/r/rpl_row_charset.result
diff --git a/mysql-test/r/rpl_row_create_table.result b/mysql-test/suite/rpl/r/rpl_row_create_table.result
index e76ce5b962d..f22881bd4a9 100644
--- a/mysql-test/r/rpl_row_create_table.result
+++ b/mysql-test/suite/rpl/r/rpl_row_create_table.result
@@ -279,25 +279,25 @@ Log_name Pos Event_type Server_id End_log_pos Info
# 192 Table_map # 231 table_id: # (test.t1)
# 231 Write_rows # 275 table_id: # flags: STMT_END_F
# 275 Query # 343 use `test`; BEGIN
-# 343 Query # 125 use `test`; CREATE TABLE `t2` (
+# 343 Query # 468 use `test`; CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB
-# 468 Table_map # 164 table_id: # (test.t2)
-# 507 Write_rows # 208 table_id: # flags: STMT_END_F
+# 468 Table_map # 507 table_id: # (test.t2)
+# 507 Write_rows # 551 table_id: # flags: STMT_END_F
# 551 Xid # 578 COMMIT /* XID */
# 578 Query # 646 use `test`; BEGIN
-# 646 Query # 125 use `test`; CREATE TABLE `t3` (
+# 646 Query # 771 use `test`; CREATE TABLE `t3` (
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB
-# 771 Table_map # 164 table_id: # (test.t3)
-# 810 Write_rows # 208 table_id: # flags: STMT_END_F
+# 771 Table_map # 810 table_id: # (test.t3)
+# 810 Write_rows # 854 table_id: # flags: STMT_END_F
# 854 Xid # 881 COMMIT /* XID */
# 881 Query # 949 use `test`; BEGIN
-# 949 Query # 125 use `test`; CREATE TABLE `t4` (
+# 949 Query # 1074 use `test`; CREATE TABLE `t4` (
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB
-# 1074 Table_map # 164 table_id: # (test.t4)
-# 1113 Write_rows # 208 table_id: # flags: STMT_END_F
+# 1074 Table_map # 1113 table_id: # (test.t4)
+# 1113 Write_rows # 1157 table_id: # flags: STMT_END_F
# 1157 Xid # 1184 COMMIT /* XID */
# 1184 Table_map # 1223 table_id: # (test.t1)
# 1223 Write_rows # 1267 table_id: # flags: STMT_END_F
@@ -371,10 +371,10 @@ Log_name Pos Event_type Server_id End_log_pos Info
# 231 Write_rows # 275 table_id: # flags: STMT_END_F
# 275 Query # 375 use `test`; CREATE TABLE t2 (a INT) ENGINE=INNODB
# 375 Query # 443 use `test`; BEGIN
-# 443 Table_map # 39 table_id: # (test.t2)
-# 482 Write_rows # 83 table_id: # flags: STMT_END_F
-# 526 Table_map # 122 table_id: # (test.t2)
-# 565 Write_rows # 161 table_id: # flags: STMT_END_F
+# 443 Table_map # 482 table_id: # (test.t2)
+# 482 Write_rows # 526 table_id: # flags: STMT_END_F
+# 526 Table_map # 565 table_id: # (test.t2)
+# 565 Write_rows # 604 table_id: # flags: STMT_END_F
# 604 Xid # 631 COMMIT /* XID */
SELECT * FROM t2 ORDER BY a;
a
@@ -396,7 +396,7 @@ SELECT * FROM t2 ORDER BY a;
a
SHOW BINLOG EVENTS FROM 631;
Log_name Pos Event_type Server_id End_log_pos Info
-# 631 Query # 80 use `test`; TRUNCATE TABLE t2
+# 631 Query # 711 use `test`; TRUNCATE TABLE t2
# 711 Xid # 738 COMMIT /* XID */
SELECT * FROM t2 ORDER BY a;
a
diff --git a/mysql-test/r/rpl_row_delayed_ins.result b/mysql-test/suite/rpl/r/rpl_row_delayed_ins.result
index 800a39bd567..800a39bd567 100644
--- a/mysql-test/r/rpl_row_delayed_ins.result
+++ b/mysql-test/suite/rpl/r/rpl_row_delayed_ins.result
diff --git a/mysql-test/r/rpl_row_drop.result b/mysql-test/suite/rpl/r/rpl_row_drop.result
index 89654ebf165..89654ebf165 100644
--- a/mysql-test/r/rpl_row_drop.result
+++ b/mysql-test/suite/rpl/r/rpl_row_drop.result
diff --git a/mysql-test/r/rpl_row_err_ignoredtable.result b/mysql-test/suite/rpl/r/rpl_row_err_ignoredtable.result
index b696baa57db..b696baa57db 100644
--- a/mysql-test/r/rpl_row_err_ignoredtable.result
+++ b/mysql-test/suite/rpl/r/rpl_row_err_ignoredtable.result
diff --git a/mysql-test/r/rpl_row_flsh_tbls.result b/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result
index 942a6b83bf6..942a6b83bf6 100644
--- a/mysql-test/r/rpl_row_flsh_tbls.result
+++ b/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result
diff --git a/mysql-test/r/rpl_row_func001.result b/mysql-test/suite/rpl/r/rpl_row_func001.result
index b20f3f724d0..b20f3f724d0 100644
--- a/mysql-test/r/rpl_row_func001.result
+++ b/mysql-test/suite/rpl/r/rpl_row_func001.result
diff --git a/mysql-test/r/rpl_row_func002.result b/mysql-test/suite/rpl/r/rpl_row_func002.result
index 03f5b3115c3..03f5b3115c3 100644
--- a/mysql-test/r/rpl_row_func002.result
+++ b/mysql-test/suite/rpl/r/rpl_row_func002.result
diff --git a/mysql-test/r/rpl_row_func003.result b/mysql-test/suite/rpl/r/rpl_row_func003.result
index a5fd46a2ce3..a5fd46a2ce3 100644
--- a/mysql-test/r/rpl_row_func003.result
+++ b/mysql-test/suite/rpl/r/rpl_row_func003.result
diff --git a/mysql-test/r/rpl_row_inexist_tbl.result b/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result
index 14fb01bb0d8..14fb01bb0d8 100644
--- a/mysql-test/r/rpl_row_inexist_tbl.result
+++ b/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result
diff --git a/mysql-test/r/rpl_row_insert_delayed.result b/mysql-test/suite/rpl/r/rpl_row_insert_delayed.result
index 2044672f49d..2044672f49d 100644
--- a/mysql-test/r/rpl_row_insert_delayed.result
+++ b/mysql-test/suite/rpl/r/rpl_row_insert_delayed.result
diff --git a/mysql-test/r/rpl_row_loaddata_m.result b/mysql-test/suite/rpl/r/rpl_row_loaddata_m.result
index 149efddaf8d..149efddaf8d 100644
--- a/mysql-test/r/rpl_row_loaddata_m.result
+++ b/mysql-test/suite/rpl/r/rpl_row_loaddata_m.result
diff --git a/mysql-test/r/rpl_row_log.result b/mysql-test/suite/rpl/r/rpl_row_log.result
index 351accaf3af..351accaf3af 100644
--- a/mysql-test/r/rpl_row_log.result
+++ b/mysql-test/suite/rpl/r/rpl_row_log.result
diff --git a/mysql-test/r/rpl_row_log_innodb.result b/mysql-test/suite/rpl/r/rpl_row_log_innodb.result
index b500d7660dc..b500d7660dc 100644
--- a/mysql-test/r/rpl_row_log_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_log_innodb.result
diff --git a/mysql-test/r/rpl_row_max_relay_size.result b/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result
index 3a8b3a78438..3a8b3a78438 100644
--- a/mysql-test/r/rpl_row_max_relay_size.result
+++ b/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result
diff --git a/mysql-test/r/rpl_row_multi_query.result b/mysql-test/suite/rpl/r/rpl_row_multi_query.result
index 8cb1aec522b..8cb1aec522b 100644
--- a/mysql-test/r/rpl_row_multi_query.result
+++ b/mysql-test/suite/rpl/r/rpl_row_multi_query.result
diff --git a/mysql-test/r/rpl_row_mysqlbinlog.result b/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result
index e2df1459ac0..e2df1459ac0 100644
--- a/mysql-test/r/rpl_row_mysqlbinlog.result
+++ b/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result
diff --git a/mysql-test/r/rpl_row_mystery22.result b/mysql-test/suite/rpl/r/rpl_row_mystery22.result
index bcf65e4ede3..bcf65e4ede3 100644
--- a/mysql-test/r/rpl_row_mystery22.result
+++ b/mysql-test/suite/rpl/r/rpl_row_mystery22.result
diff --git a/mysql-test/r/rpl_row_reset_slave.result b/mysql-test/suite/rpl/r/rpl_row_reset_slave.result
index fd23e254072..fd23e254072 100644
--- a/mysql-test/r/rpl_row_reset_slave.result
+++ b/mysql-test/suite/rpl/r/rpl_row_reset_slave.result
diff --git a/mysql-test/r/rpl_row_sp001.result b/mysql-test/suite/rpl/r/rpl_row_sp001.result
index 8c26c061376..8c26c061376 100644
--- a/mysql-test/r/rpl_row_sp001.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp001.result
diff --git a/mysql-test/r/rpl_row_sp002_innodb.result b/mysql-test/suite/rpl/r/rpl_row_sp002_innodb.result
index a42c9af988c..a42c9af988c 100644
--- a/mysql-test/r/rpl_row_sp002_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp002_innodb.result
diff --git a/mysql-test/r/rpl_row_sp003.result b/mysql-test/suite/rpl/r/rpl_row_sp003.result
index df3e2a7ceed..df3e2a7ceed 100644
--- a/mysql-test/r/rpl_row_sp003.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp003.result
diff --git a/mysql-test/r/rpl_row_sp005.result b/mysql-test/suite/rpl/r/rpl_row_sp005.result
index 01e1970e0df..01e1970e0df 100644
--- a/mysql-test/r/rpl_row_sp005.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp005.result
diff --git a/mysql-test/r/rpl_row_sp006_InnoDB.result b/mysql-test/suite/rpl/r/rpl_row_sp006_InnoDB.result
index 8339e77d3a0..8339e77d3a0 100644
--- a/mysql-test/r/rpl_row_sp006_InnoDB.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp006_InnoDB.result
diff --git a/mysql-test/r/rpl_row_sp007_innodb.result b/mysql-test/suite/rpl/r/rpl_row_sp007_innodb.result
index 9a2822835f8..9a2822835f8 100644
--- a/mysql-test/r/rpl_row_sp007_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp007_innodb.result
diff --git a/mysql-test/r/rpl_row_sp008.result b/mysql-test/suite/rpl/r/rpl_row_sp008.result
index 23197964a24..23197964a24 100644
--- a/mysql-test/r/rpl_row_sp008.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp008.result
diff --git a/mysql-test/r/rpl_row_sp009.result b/mysql-test/suite/rpl/r/rpl_row_sp009.result
index 35ce0d7b420..35ce0d7b420 100644
--- a/mysql-test/r/rpl_row_sp009.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp009.result
diff --git a/mysql-test/r/rpl_row_sp010.result b/mysql-test/suite/rpl/r/rpl_row_sp010.result
index 02567465428..02567465428 100644
--- a/mysql-test/r/rpl_row_sp010.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp010.result
diff --git a/mysql-test/r/rpl_row_sp011.result b/mysql-test/suite/rpl/r/rpl_row_sp011.result
index e35c9f21adb..e35c9f21adb 100644
--- a/mysql-test/r/rpl_row_sp011.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp011.result
diff --git a/mysql-test/r/rpl_row_sp012.result b/mysql-test/suite/rpl/r/rpl_row_sp012.result
index b9c818bad9a..b9c818bad9a 100644
--- a/mysql-test/r/rpl_row_sp012.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp012.result
diff --git a/mysql-test/r/rpl_row_stop_middle.result b/mysql-test/suite/rpl/r/rpl_row_stop_middle.result
index 46ca5748174..46ca5748174 100644
--- a/mysql-test/r/rpl_row_stop_middle.result
+++ b/mysql-test/suite/rpl/r/rpl_row_stop_middle.result
diff --git a/mysql-test/r/rpl_row_stop_middle_update.result b/mysql-test/suite/rpl/r/rpl_row_stop_middle_update.result
index 0fd4ff86893..0fd4ff86893 100644
--- a/mysql-test/r/rpl_row_stop_middle_update.result
+++ b/mysql-test/suite/rpl/r/rpl_row_stop_middle_update.result
diff --git a/mysql-test/r/rpl_row_tabledefs_2myisam.result b/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result
index d8ff1907e28..18243dce40b 100644
--- a/mysql-test/r/rpl_row_tabledefs_2myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result
@@ -123,7 +123,7 @@ Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 1364
-Last_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef
+Last_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef.
Skip_Counter 0
Exec_Master_Log_Pos #
Relay_Log_Space #
@@ -141,7 +141,7 @@ Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
Last_SQL_Errno 1364
-Last_SQL_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef
+Last_SQL_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef.
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
INSERT INTO t9 VALUES (2);
@@ -165,7 +165,7 @@ Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
-Last_Errno 1523
+Last_Errno 1532
Last_Error Table definition on master and slave does not match: Table width mismatch - received 2 columns, test.t2 has 1 columns
Skip_Counter 0
Exec_Master_Log_Pos #
@@ -183,7 +183,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
-Last_SQL_Errno 1523
+Last_SQL_Errno 1532
Last_SQL_Error Table definition on master and slave does not match: Table width mismatch - received 2 columns, test.t2 has 1 columns
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -208,7 +208,7 @@ Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
-Last_Errno 1523
+Last_Errno 1532
Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 3, test.t4 has type 4
Skip_Counter 0
Exec_Master_Log_Pos #
@@ -226,7 +226,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
-Last_SQL_Errno 1523
+Last_SQL_Errno 1532
Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 3, test.t4 has type 4
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -251,7 +251,7 @@ Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
-Last_Errno 1523
+Last_Errno 1532
Last_Error Table definition on master and slave does not match: Column 1 type mismatch - received type 3, test.t5 has type 4
Skip_Counter 0
Exec_Master_Log_Pos #
@@ -269,7 +269,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
-Last_SQL_Errno 1523
+Last_SQL_Errno 1532
Last_SQL_Error Table definition on master and slave does not match: Column 1 type mismatch - received type 3, test.t5 has type 4
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -294,7 +294,7 @@ Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
-Last_Errno 1523
+Last_Errno 1532
Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 3, test.t6 has type 4
Skip_Counter 0
Exec_Master_Log_Pos #
@@ -312,7 +312,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
-Last_SQL_Errno 1523
+Last_SQL_Errno 1532
Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 3, test.t6 has type 4
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
diff --git a/mysql-test/r/rpl_row_tabledefs_3innodb.result b/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result
index 17c591327c2..ef07db1c47d 100644
--- a/mysql-test/r/rpl_row_tabledefs_3innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result
@@ -123,7 +123,7 @@ Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 1364
-Last_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef
+Last_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef.
Skip_Counter 0
Exec_Master_Log_Pos #
Relay_Log_Space #
@@ -141,7 +141,7 @@ Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
Last_SQL_Errno 1364
-Last_SQL_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef
+Last_SQL_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef.
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
INSERT INTO t9 VALUES (2);
@@ -165,7 +165,7 @@ Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
-Last_Errno 1523
+Last_Errno 1532
Last_Error Table definition on master and slave does not match: Table width mismatch - received 2 columns, test.t2 has 1 columns
Skip_Counter 0
Exec_Master_Log_Pos #
@@ -183,7 +183,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
-Last_SQL_Errno 1523
+Last_SQL_Errno 1532
Last_SQL_Error Table definition on master and slave does not match: Table width mismatch - received 2 columns, test.t2 has 1 columns
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -208,7 +208,7 @@ Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
-Last_Errno 1523
+Last_Errno 1532
Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 3, test.t4 has type 4
Skip_Counter 0
Exec_Master_Log_Pos #
@@ -226,7 +226,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
-Last_SQL_Errno 1523
+Last_SQL_Errno 1532
Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 3, test.t4 has type 4
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -251,7 +251,7 @@ Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
-Last_Errno 1523
+Last_Errno 1532
Last_Error Table definition on master and slave does not match: Column 1 type mismatch - received type 3, test.t5 has type 4
Skip_Counter 0
Exec_Master_Log_Pos #
@@ -269,7 +269,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
-Last_SQL_Errno 1523
+Last_SQL_Errno 1532
Last_SQL_Error Table definition on master and slave does not match: Column 1 type mismatch - received type 3, test.t5 has type 4
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -294,7 +294,7 @@ Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
-Last_Errno 1523
+Last_Errno 1532
Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 3, test.t6 has type 4
Skip_Counter 0
Exec_Master_Log_Pos #
@@ -312,7 +312,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
-Last_SQL_Errno 1523
+Last_SQL_Errno 1532
Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 3, test.t6 has type 4
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
diff --git a/mysql-test/r/rpl_row_tabledefs_7ndb.result b/mysql-test/suite/rpl/r/rpl_row_tabledefs_7ndb.result
index 5876a0e1b65..5876a0e1b65 100644
--- a/mysql-test/r/rpl_row_tabledefs_7ndb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_tabledefs_7ndb.result
diff --git a/mysql-test/r/rpl_row_trig001.result b/mysql-test/suite/rpl/r/rpl_row_trig001.result
index 6665dc6d555..6665dc6d555 100644
--- a/mysql-test/r/rpl_row_trig001.result
+++ b/mysql-test/suite/rpl/r/rpl_row_trig001.result
diff --git a/mysql-test/r/rpl_row_trig002.result b/mysql-test/suite/rpl/r/rpl_row_trig002.result
index 794104db750..794104db750 100644
--- a/mysql-test/r/rpl_row_trig002.result
+++ b/mysql-test/suite/rpl/r/rpl_row_trig002.result
diff --git a/mysql-test/r/rpl_row_trig003.result b/mysql-test/suite/rpl/r/rpl_row_trig003.result
index 43c2ecde2b4..43c2ecde2b4 100644
--- a/mysql-test/r/rpl_row_trig003.result
+++ b/mysql-test/suite/rpl/r/rpl_row_trig003.result
diff --git a/mysql-test/r/rpl_row_trig004.result b/mysql-test/suite/rpl/r/rpl_row_trig004.result
index d0d0657f875..d0d0657f875 100644
--- a/mysql-test/r/rpl_row_trig004.result
+++ b/mysql-test/suite/rpl/r/rpl_row_trig004.result
diff --git a/mysql-test/r/rpl_row_until.result b/mysql-test/suite/rpl/r/rpl_row_until.result
index d802fce8193..d802fce8193 100644
--- a/mysql-test/r/rpl_row_until.result
+++ b/mysql-test/suite/rpl/r/rpl_row_until.result
diff --git a/mysql-test/r/rpl_row_view01.result b/mysql-test/suite/rpl/r/rpl_row_view01.result
index a4b8d0a05e3..a4b8d0a05e3 100644
--- a/mysql-test/r/rpl_row_view01.result
+++ b/mysql-test/suite/rpl/r/rpl_row_view01.result
diff --git a/mysql-test/r/rpl_server_id1.result b/mysql-test/suite/rpl/r/rpl_server_id1.result
index 9894910aaf6..9894910aaf6 100644
--- a/mysql-test/r/rpl_server_id1.result
+++ b/mysql-test/suite/rpl/r/rpl_server_id1.result
diff --git a/mysql-test/r/rpl_server_id2.result b/mysql-test/suite/rpl/r/rpl_server_id2.result
index f68f9ff829d..f68f9ff829d 100644
--- a/mysql-test/r/rpl_server_id2.result
+++ b/mysql-test/suite/rpl/r/rpl_server_id2.result
diff --git a/mysql-test/r/rpl_session_var.result b/mysql-test/suite/rpl/r/rpl_session_var.result
index b5b4b815ade..b5b4b815ade 100644
--- a/mysql-test/r/rpl_session_var.result
+++ b/mysql-test/suite/rpl/r/rpl_session_var.result
diff --git a/mysql-test/r/rpl_set_charset.result b/mysql-test/suite/rpl/r/rpl_set_charset.result
index 480d926fbba..480d926fbba 100644
--- a/mysql-test/r/rpl_set_charset.result
+++ b/mysql-test/suite/rpl/r/rpl_set_charset.result
diff --git a/mysql-test/r/rpl_sf.result b/mysql-test/suite/rpl/r/rpl_sf.result
index 46defc6908a..46defc6908a 100644
--- a/mysql-test/r/rpl_sf.result
+++ b/mysql-test/suite/rpl/r/rpl_sf.result
diff --git a/mysql-test/r/rpl_skip_error.result b/mysql-test/suite/rpl/r/rpl_skip_error.result
index 92402153c76..92402153c76 100644
--- a/mysql-test/r/rpl_skip_error.result
+++ b/mysql-test/suite/rpl/r/rpl_skip_error.result
diff --git a/mysql-test/r/rpl_slave_skip.result b/mysql-test/suite/rpl/r/rpl_slave_skip.result
index b99ae3ad94a..b99ae3ad94a 100644
--- a/mysql-test/r/rpl_slave_skip.result
+++ b/mysql-test/suite/rpl/r/rpl_slave_skip.result
diff --git a/mysql-test/r/rpl_slave_status.result b/mysql-test/suite/rpl/r/rpl_slave_status.result
index 08f79d01e7a..08f79d01e7a 100644
--- a/mysql-test/r/rpl_slave_status.result
+++ b/mysql-test/suite/rpl/r/rpl_slave_status.result
diff --git a/mysql-test/r/rpl_sp.result b/mysql-test/suite/rpl/r/rpl_sp.result
index 0b89b6d29c7..bf02a627e08 100644
--- a/mysql-test/r/rpl_sp.result
+++ b/mysql-test/suite/rpl/r/rpl_sp.result
@@ -193,7 +193,7 @@ end|
ERROR HY000: You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
set global log_bin_trust_routine_creators=1;
Warnings:
-Warning 1543 The syntax 'log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use 'log_bin_trust_function_creators' instead
+Warning 1287 The syntax 'log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use 'log_bin_trust_function_creators' instead
set global log_bin_trust_function_creators=0;
set global log_bin_trust_function_creators=1;
set global log_bin_trust_function_creators=1;
diff --git a/mysql-test/r/rpl_sp004.result b/mysql-test/suite/rpl/r/rpl_sp004.result
index 1c0ed3cc50a..1c0ed3cc50a 100644
--- a/mysql-test/r/rpl_sp004.result
+++ b/mysql-test/suite/rpl/r/rpl_sp004.result
diff --git a/mysql-test/r/rpl_sp_effects.result b/mysql-test/suite/rpl/r/rpl_sp_effects.result
index c2c44b06972..c2c44b06972 100644
--- a/mysql-test/r/rpl_sp_effects.result
+++ b/mysql-test/suite/rpl/r/rpl_sp_effects.result
diff --git a/mysql-test/r/rpl_sporadic_master.result b/mysql-test/suite/rpl/r/rpl_sporadic_master.result
index 14fb673a081..14fb673a081 100644
--- a/mysql-test/r/rpl_sporadic_master.result
+++ b/mysql-test/suite/rpl/r/rpl_sporadic_master.result
diff --git a/mysql-test/r/rpl_ssl.result b/mysql-test/suite/rpl/r/rpl_ssl.result
index d188dd353ce..d188dd353ce 100644
--- a/mysql-test/r/rpl_ssl.result
+++ b/mysql-test/suite/rpl/r/rpl_ssl.result
diff --git a/mysql-test/r/rpl_ssl1.result b/mysql-test/suite/rpl/r/rpl_ssl1.result
index 74d2550cdaf..74d2550cdaf 100644
--- a/mysql-test/r/rpl_ssl1.result
+++ b/mysql-test/suite/rpl/r/rpl_ssl1.result
diff --git a/mysql-test/r/rpl_start_stop_slave.result b/mysql-test/suite/rpl/r/rpl_start_stop_slave.result
index 1fcb586d1fb..1fcb586d1fb 100644
--- a/mysql-test/r/rpl_start_stop_slave.result
+++ b/mysql-test/suite/rpl/r/rpl_start_stop_slave.result
diff --git a/mysql-test/r/rpl_stm_000001.result b/mysql-test/suite/rpl/r/rpl_stm_000001.result
index 3b4cd05f640..3b4cd05f640 100644
--- a/mysql-test/r/rpl_stm_000001.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_000001.result
diff --git a/mysql-test/r/rpl_stm_EE_err2.result b/mysql-test/suite/rpl/r/rpl_stm_EE_err2.result
index 13aa45d8ced..13aa45d8ced 100644
--- a/mysql-test/r/rpl_stm_EE_err2.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_EE_err2.result
diff --git a/mysql-test/r/rpl_stm_charset.result b/mysql-test/suite/rpl/r/rpl_stm_charset.result
index fd9c40843d5..fd9c40843d5 100644
--- a/mysql-test/r/rpl_stm_charset.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_charset.result
diff --git a/mysql-test/r/rpl_stm_flsh_tbls.result b/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result
index 1c6b5615b6e..1c6b5615b6e 100644
--- a/mysql-test/r/rpl_stm_flsh_tbls.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result
diff --git a/mysql-test/r/rpl_stm_insert_delayed.result b/mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result
index 1c003856eb9..1c003856eb9 100644
--- a/mysql-test/r/rpl_stm_insert_delayed.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result
diff --git a/mysql-test/r/rpl_stm_log.result b/mysql-test/suite/rpl/r/rpl_stm_log.result
index 02f3dc9044a..02f3dc9044a 100644
--- a/mysql-test/r/rpl_stm_log.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_log.result
diff --git a/mysql-test/r/rpl_stm_max_relay_size.result b/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result
index 947b5686a18..947b5686a18 100644
--- a/mysql-test/r/rpl_stm_max_relay_size.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result
diff --git a/mysql-test/r/rpl_stm_multi_query.result b/mysql-test/suite/rpl/r/rpl_stm_multi_query.result
index 625c686f383..625c686f383 100644
--- a/mysql-test/r/rpl_stm_multi_query.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_multi_query.result
diff --git a/mysql-test/r/rpl_stm_mystery22.result b/mysql-test/suite/rpl/r/rpl_stm_mystery22.result
index ea34b308ec2..ea34b308ec2 100644
--- a/mysql-test/r/rpl_stm_mystery22.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_mystery22.result
diff --git a/mysql-test/r/rpl_stm_no_op.result b/mysql-test/suite/rpl/r/rpl_stm_no_op.result
index 5a253d61fcb..5a253d61fcb 100644
--- a/mysql-test/r/rpl_stm_no_op.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_no_op.result
diff --git a/mysql-test/r/rpl_stm_reset_slave.result b/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result
index d08e8646c73..d08e8646c73 100644
--- a/mysql-test/r/rpl_stm_reset_slave.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result
diff --git a/mysql-test/r/rpl_stm_until.result b/mysql-test/suite/rpl/r/rpl_stm_until.result
index 947ce0153b1..947ce0153b1 100644
--- a/mysql-test/r/rpl_stm_until.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_until.result
diff --git a/mysql-test/r/rpl_switch_stm_row_mixed.result b/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result
index c3f0c07b92c..c3f0c07b92c 100644
--- a/mysql-test/r/rpl_switch_stm_row_mixed.result
+++ b/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result
diff --git a/mysql-test/r/rpl_temp_table.result b/mysql-test/suite/rpl/r/rpl_temp_table.result
index e4ca31d8908..e4ca31d8908 100644
--- a/mysql-test/r/rpl_temp_table.result
+++ b/mysql-test/suite/rpl/r/rpl_temp_table.result
diff --git a/mysql-test/r/rpl_temporary.result b/mysql-test/suite/rpl/r/rpl_temporary.result
index 7e7d0cebe1d..7e7d0cebe1d 100644
--- a/mysql-test/r/rpl_temporary.result
+++ b/mysql-test/suite/rpl/r/rpl_temporary.result
diff --git a/mysql-test/r/rpl_timezone.result b/mysql-test/suite/rpl/r/rpl_timezone.result
index 47ef16b9d49..47ef16b9d49 100644
--- a/mysql-test/r/rpl_timezone.result
+++ b/mysql-test/suite/rpl/r/rpl_timezone.result
diff --git a/mysql-test/r/rpl_trigger.result b/mysql-test/suite/rpl/r/rpl_trigger.result
index b4ce3ee1d36..b4ce3ee1d36 100644
--- a/mysql-test/r/rpl_trigger.result
+++ b/mysql-test/suite/rpl/r/rpl_trigger.result
diff --git a/mysql-test/r/rpl_trunc_temp.result b/mysql-test/suite/rpl/r/rpl_trunc_temp.result
index 44624a38875..44624a38875 100644
--- a/mysql-test/r/rpl_trunc_temp.result
+++ b/mysql-test/suite/rpl/r/rpl_trunc_temp.result
diff --git a/mysql-test/r/rpl_truncate_2myisam.result b/mysql-test/suite/rpl/r/rpl_truncate_2myisam.result
index c7ef28ba56b..c7ef28ba56b 100644
--- a/mysql-test/r/rpl_truncate_2myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_truncate_2myisam.result
diff --git a/mysql-test/r/rpl_truncate_3innodb.result b/mysql-test/suite/rpl/r/rpl_truncate_3innodb.result
index 7ce48c2e983..7ce48c2e983 100644
--- a/mysql-test/r/rpl_truncate_3innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_truncate_3innodb.result
diff --git a/mysql-test/r/rpl_truncate_7ndb_2.result b/mysql-test/suite/rpl/r/rpl_truncate_7ndb_2.result
index d43704c2ba7..d43704c2ba7 100644
--- a/mysql-test/r/rpl_truncate_7ndb_2.result
+++ b/mysql-test/suite/rpl/r/rpl_truncate_7ndb_2.result
diff --git a/mysql-test/r/rpl_udf.result b/mysql-test/suite/rpl/r/rpl_udf.result
index d21cfd2539b..d21cfd2539b 100644
--- a/mysql-test/r/rpl_udf.result
+++ b/mysql-test/suite/rpl/r/rpl_udf.result
diff --git a/mysql-test/r/rpl_user_variables.result b/mysql-test/suite/rpl/r/rpl_user_variables.result
index d3363df3b58..d3363df3b58 100644
--- a/mysql-test/r/rpl_user_variables.result
+++ b/mysql-test/suite/rpl/r/rpl_user_variables.result
diff --git a/mysql-test/r/rpl_variables.result b/mysql-test/suite/rpl/r/rpl_variables.result
index 605a48859a0..605a48859a0 100644
--- a/mysql-test/r/rpl_variables.result
+++ b/mysql-test/suite/rpl/r/rpl_variables.result
diff --git a/mysql-test/r/rpl_view.result b/mysql-test/suite/rpl/r/rpl_view.result
index 12b7b46ffed..12b7b46ffed 100644
--- a/mysql-test/r/rpl_view.result
+++ b/mysql-test/suite/rpl/r/rpl_view.result
diff --git a/mysql-test/suite/rpl/t/disabled.def b/mysql-test/suite/rpl/t/disabled.def
new file mode 100644
index 00000000000..14102c27c17
--- /dev/null
+++ b/mysql-test/suite/rpl/t/disabled.def
@@ -0,0 +1,32 @@
+##############################################################################
+#
+# List the test cases that are to be disabled temporarily.
+#
+# Separate the test case name and the comment with ':'.
+#
+# <testcasename> : BUG#<xxxx> <date disabled> <disabler> <comment>
+#
+# Do not use any TAB characters for whitespace.
+#
+##############################################################################
+
+rpl_ddl : BUG#26418 2007-03-01 mleich Slave out of sync after CREATE/DROP TEMPORARY TABLE + ROLLBACK on master
+rpl_innodb_mixed_ddl : Bug #29363 rpl.rpl_innodb_mixed_* test failures
+rpl_innodb_mixed_dml : Bug #29363 rpl.rpl_innodb_mixed_* test failures
+rpl_invoked_features : BUG#29020 2007-06-21 Lars Non-deterministic test case
+rpl_auto_increment_11932 : Bug#29809 2007-07-16 ingo Slave SQL errors in warnings file
+rpl_deadlock_innodb : Bug#29809 2007-07-15 ingo Slave SQL errors in warnings file
+rpl_extraCol_innodb : Bug#29809 2007-07-15 ingo Slave SQL errors in warnings file
+rpl_extraCol_myisam : Bug#29809 2007-07-15 ingo Slave SQL errors in warnings file
+rpl_incident : Bug#29809 2007-07-15 ingo Slave SQL errors in warnings file
+rpl_known_bugs_detection : Bug#29809 2007-07-15 ingo Slave SQL errors in warnings file
+rpl_loaddata : Bug#29809 2007-07-15 ingo Slave SQL errors in warnings file
+rpl_loaddata_fatal : Bug#29809 2007-07-15 ingo Slave SQL errors in warnings file
+rpl_rewrt_db : Bug#29809 2007-07-15 ingo Slave SQL errors in warnings file
+rpl_rotate_logs : Bug#29809 2007-07-15 ingo Slave SQL errors in warnings file
+rpl_row_inexist_tbl : Bug#29809 2007-07-15 ingo Slave SQL errors in warnings file
+rpl_row_tabledefs_2myisam : Bug#29809 2007-07-15 ingo Slave SQL errors in warnings file
+rpl_row_tabledefs_3innodb : Bug#29809 2007-07-15 ingo Slave SQL errors in warnings file
+rpl_ssl : Bug#29809 2007-07-15 ingo Slave SQL errors in warnings file
+rpl_stm_EE_err2 : Bug#29809 2007-07-15 ingo Slave SQL errors in warnings file
+rpl_stm_mystery22 : Bug#29809 2007-07-15 ingo Slave SQL errors in warnings file
diff --git a/mysql-test/t/rpl000010-slave.opt b/mysql-test/suite/rpl/t/rpl000010-slave.opt
index 0dbfb311e33..0dbfb311e33 100644
--- a/mysql-test/t/rpl000010-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl000010-slave.opt
diff --git a/mysql-test/t/rpl000010.test b/mysql-test/suite/rpl/t/rpl000010.test
index 261b9148774..261b9148774 100644
--- a/mysql-test/t/rpl000010.test
+++ b/mysql-test/suite/rpl/t/rpl000010.test
diff --git a/mysql-test/t/rpl000011.test b/mysql-test/suite/rpl/t/rpl000011.test
index 32f6227f7c5..32f6227f7c5 100644
--- a/mysql-test/t/rpl000011.test
+++ b/mysql-test/suite/rpl/t/rpl000011.test
diff --git a/mysql-test/t/rpl000013.test b/mysql-test/suite/rpl/t/rpl000013.test
index 69a102e84ce..69a102e84ce 100644
--- a/mysql-test/t/rpl000013.test
+++ b/mysql-test/suite/rpl/t/rpl000013.test
diff --git a/mysql-test/t/rpl000017-slave.opt b/mysql-test/suite/rpl/t/rpl000017-slave.opt
index 58a964c90d0..58a964c90d0 100644
--- a/mysql-test/t/rpl000017-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl000017-slave.opt
diff --git a/mysql-test/t/rpl000017-slave.sh b/mysql-test/suite/rpl/t/rpl000017-slave.sh
index 17188aba0db..17188aba0db 100755
--- a/mysql-test/t/rpl000017-slave.sh
+++ b/mysql-test/suite/rpl/t/rpl000017-slave.sh
diff --git a/mysql-test/t/rpl000017.test b/mysql-test/suite/rpl/t/rpl000017.test
index 2ba321cd8c3..2ba321cd8c3 100644
--- a/mysql-test/t/rpl000017.test
+++ b/mysql-test/suite/rpl/t/rpl000017.test
diff --git a/mysql-test/t/rpl000018-master.opt b/mysql-test/suite/rpl/t/rpl000018-master.opt
index ad2c6a647b5..ad2c6a647b5 100644
--- a/mysql-test/t/rpl000018-master.opt
+++ b/mysql-test/suite/rpl/t/rpl000018-master.opt
diff --git a/mysql-test/t/rpl000018-slave.opt b/mysql-test/suite/rpl/t/rpl000018-slave.opt
index e854f0d0bb2..e854f0d0bb2 100644
--- a/mysql-test/t/rpl000018-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl000018-slave.opt
diff --git a/mysql-test/t/rpl_000015-slave.sh b/mysql-test/suite/rpl/t/rpl_000015-slave.sh
index 7deeca3d2d6..7deeca3d2d6 100755
--- a/mysql-test/t/rpl_000015-slave.sh
+++ b/mysql-test/suite/rpl/t/rpl_000015-slave.sh
diff --git a/mysql-test/t/rpl_000015.slave-mi b/mysql-test/suite/rpl/t/rpl_000015.slave-mi
index 28bc753dd56..28bc753dd56 100644
--- a/mysql-test/t/rpl_000015.slave-mi
+++ b/mysql-test/suite/rpl/t/rpl_000015.slave-mi
diff --git a/mysql-test/t/rpl_000015.test b/mysql-test/suite/rpl/t/rpl_000015.test
index 80db596244b..80db596244b 100644
--- a/mysql-test/t/rpl_000015.test
+++ b/mysql-test/suite/rpl/t/rpl_000015.test
diff --git a/mysql-test/t/rpl_EE_err.test b/mysql-test/suite/rpl/t/rpl_EE_err.test
index 6d064ae3197..6d064ae3197 100644
--- a/mysql-test/t/rpl_EE_err.test
+++ b/mysql-test/suite/rpl/t/rpl_EE_err.test
diff --git a/mysql-test/t/rpl_LD_INFILE.test b/mysql-test/suite/rpl/t/rpl_LD_INFILE.test
index bace5d4c1f5..bace5d4c1f5 100644
--- a/mysql-test/t/rpl_LD_INFILE.test
+++ b/mysql-test/suite/rpl/t/rpl_LD_INFILE.test
diff --git a/mysql-test/t/rpl_alter.test b/mysql-test/suite/rpl/t/rpl_alter.test
index 576376a0264..576376a0264 100644
--- a/mysql-test/t/rpl_alter.test
+++ b/mysql-test/suite/rpl/t/rpl_alter.test
diff --git a/mysql-test/t/rpl_alter_db.test b/mysql-test/suite/rpl/t/rpl_alter_db.test
index 5ac8a2f4018..5ac8a2f4018 100644
--- a/mysql-test/t/rpl_alter_db.test
+++ b/mysql-test/suite/rpl/t/rpl_alter_db.test
diff --git a/mysql-test/t/rpl_auto_increment-master.opt b/mysql-test/suite/rpl/t/rpl_auto_increment-master.opt
index a8a6af19da9..a8a6af19da9 100644
--- a/mysql-test/t/rpl_auto_increment-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_auto_increment-master.opt
diff --git a/mysql-test/t/rpl_auto_increment-slave.opt b/mysql-test/suite/rpl/t/rpl_auto_increment-slave.opt
index 48457b17309..48457b17309 100644
--- a/mysql-test/t/rpl_auto_increment-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_auto_increment-slave.opt
diff --git a/mysql-test/t/rpl_auto_increment.test b/mysql-test/suite/rpl/t/rpl_auto_increment.test
index 19770ffbdc0..19770ffbdc0 100644
--- a/mysql-test/t/rpl_auto_increment.test
+++ b/mysql-test/suite/rpl/t/rpl_auto_increment.test
diff --git a/mysql-test/t/rpl_auto_increment_11932.test b/mysql-test/suite/rpl/t/rpl_auto_increment_11932.test
index d4b7872fb2b..d4b7872fb2b 100644
--- a/mysql-test/t/rpl_auto_increment_11932.test
+++ b/mysql-test/suite/rpl/t/rpl_auto_increment_11932.test
diff --git a/mysql-test/t/rpl_bit.test b/mysql-test/suite/rpl/t/rpl_bit.test
index 07b0778296c..07b0778296c 100644
--- a/mysql-test/t/rpl_bit.test
+++ b/mysql-test/suite/rpl/t/rpl_bit.test
diff --git a/mysql-test/t/rpl_bit_npk.test b/mysql-test/suite/rpl/t/rpl_bit_npk.test
index 12b587919f9..12b587919f9 100644
--- a/mysql-test/t/rpl_bit_npk.test
+++ b/mysql-test/suite/rpl/t/rpl_bit_npk.test
diff --git a/mysql-test/t/rpl_change_master.test b/mysql-test/suite/rpl/t/rpl_change_master.test
index 7256fed656f..7256fed656f 100644
--- a/mysql-test/t/rpl_change_master.test
+++ b/mysql-test/suite/rpl/t/rpl_change_master.test
diff --git a/mysql-test/t/rpl_charset_sjis.test b/mysql-test/suite/rpl/t/rpl_charset_sjis.test
index 2469b0db8a2..2469b0db8a2 100644
--- a/mysql-test/t/rpl_charset_sjis.test
+++ b/mysql-test/suite/rpl/t/rpl_charset_sjis.test
diff --git a/mysql-test/t/rpl_commit_after_flush.test b/mysql-test/suite/rpl/t/rpl_commit_after_flush.test
index 47df391d6be..47df391d6be 100644
--- a/mysql-test/t/rpl_commit_after_flush.test
+++ b/mysql-test/suite/rpl/t/rpl_commit_after_flush.test
diff --git a/mysql-test/t/rpl_create_database-master.opt b/mysql-test/suite/rpl/t/rpl_create_database-master.opt
index 85660a17140..85660a17140 100644
--- a/mysql-test/t/rpl_create_database-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_create_database-master.opt
diff --git a/mysql-test/t/rpl_create_database-slave.opt b/mysql-test/suite/rpl/t/rpl_create_database-slave.opt
index 96d630c9229..96d630c9229 100644
--- a/mysql-test/t/rpl_create_database-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_create_database-slave.opt
diff --git a/mysql-test/t/rpl_create_database.test b/mysql-test/suite/rpl/t/rpl_create_database.test
index 70cff8daca2..70cff8daca2 100644
--- a/mysql-test/t/rpl_create_database.test
+++ b/mysql-test/suite/rpl/t/rpl_create_database.test
diff --git a/mysql-test/t/rpl_critical_errors.test b/mysql-test/suite/rpl/t/rpl_critical_errors.test
index abf827c8d1f..abf827c8d1f 100644
--- a/mysql-test/t/rpl_critical_errors.test
+++ b/mysql-test/suite/rpl/t/rpl_critical_errors.test
diff --git a/mysql-test/t/rpl_ddl.test b/mysql-test/suite/rpl/t/rpl_ddl.test
index 80df16a7a00..80df16a7a00 100644
--- a/mysql-test/t/rpl_ddl.test
+++ b/mysql-test/suite/rpl/t/rpl_ddl.test
diff --git a/mysql-test/t/rpl_deadlock_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_deadlock_innodb-slave.opt
index c52c239a1a1..c52c239a1a1 100644
--- a/mysql-test/t/rpl_deadlock_innodb-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_deadlock_innodb-slave.opt
diff --git a/mysql-test/t/rpl_deadlock_innodb.test b/mysql-test/suite/rpl/t/rpl_deadlock_innodb.test
index ee907f81b22..ee907f81b22 100644
--- a/mysql-test/t/rpl_deadlock_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_deadlock_innodb.test
diff --git a/mysql-test/t/rpl_delete_no_where.test b/mysql-test/suite/rpl/t/rpl_delete_no_where.test
index 64a293b4058..64a293b4058 100644
--- a/mysql-test/t/rpl_delete_no_where.test
+++ b/mysql-test/suite/rpl/t/rpl_delete_no_where.test
diff --git a/mysql-test/t/rpl_do_grant.test b/mysql-test/suite/rpl/t/rpl_do_grant.test
index 5615900c2dd..5615900c2dd 100644
--- a/mysql-test/t/rpl_do_grant.test
+++ b/mysql-test/suite/rpl/t/rpl_do_grant.test
diff --git a/mysql-test/t/rpl_drop.test b/mysql-test/suite/rpl/t/rpl_drop.test
index b38007a755f..b38007a755f 100644
--- a/mysql-test/t/rpl_drop.test
+++ b/mysql-test/suite/rpl/t/rpl_drop.test
diff --git a/mysql-test/t/rpl_drop_db.test b/mysql-test/suite/rpl/t/rpl_drop_db.test
index 7f4a7843c4a..7f4a7843c4a 100644
--- a/mysql-test/t/rpl_drop_db.test
+++ b/mysql-test/suite/rpl/t/rpl_drop_db.test
diff --git a/mysql-test/t/rpl_drop_temp-slave.opt b/mysql-test/suite/rpl/t/rpl_drop_temp-slave.opt
index 2f9244c65ff..2f9244c65ff 100644
--- a/mysql-test/t/rpl_drop_temp-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_drop_temp-slave.opt
diff --git a/mysql-test/t/rpl_drop_temp.test b/mysql-test/suite/rpl/t/rpl_drop_temp.test
index 305c78d3f06..305c78d3f06 100644
--- a/mysql-test/t/rpl_drop_temp.test
+++ b/mysql-test/suite/rpl/t/rpl_drop_temp.test
diff --git a/mysql-test/t/rpl_dual_pos_advance-master.opt b/mysql-test/suite/rpl/t/rpl_dual_pos_advance-master.opt
index cef79bc8585..cef79bc8585 100644
--- a/mysql-test/t/rpl_dual_pos_advance-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_dual_pos_advance-master.opt
diff --git a/mysql-test/t/rpl_dual_pos_advance.test b/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test
index 27c920a3186..27c920a3186 100644
--- a/mysql-test/t/rpl_dual_pos_advance.test
+++ b/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test
diff --git a/mysql-test/t/rpl_empty_master_crash-master.opt b/mysql-test/suite/rpl/t/rpl_empty_master_crash-master.opt
index cef79bc8585..cef79bc8585 100644
--- a/mysql-test/t/rpl_empty_master_crash-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_empty_master_crash-master.opt
diff --git a/mysql-test/t/rpl_empty_master_crash.test b/mysql-test/suite/rpl/t/rpl_empty_master_crash.test
index f8e7870ae3c..f8e7870ae3c 100644
--- a/mysql-test/t/rpl_empty_master_crash.test
+++ b/mysql-test/suite/rpl/t/rpl_empty_master_crash.test
diff --git a/mysql-test/t/rpl_err_ignoredtable-slave.opt b/mysql-test/suite/rpl/t/rpl_err_ignoredtable-slave.opt
index cb49119bfcb..cb49119bfcb 100644
--- a/mysql-test/t/rpl_err_ignoredtable-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_err_ignoredtable-slave.opt
diff --git a/mysql-test/t/rpl_err_ignoredtable.test b/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test
index 4e06a6a7096..4e06a6a7096 100644
--- a/mysql-test/t/rpl_err_ignoredtable.test
+++ b/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test
diff --git a/mysql-test/t/rpl_events.test b/mysql-test/suite/rpl/t/rpl_events.test
index 62ffead7dcb..62ffead7dcb 100644
--- a/mysql-test/t/rpl_events.test
+++ b/mysql-test/suite/rpl/t/rpl_events.test
diff --git a/mysql-test/t/rpl_extraCol_innodb-master.opt b/mysql-test/suite/rpl/t/rpl_extraCol_innodb-master.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/t/rpl_extraCol_innodb-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_extraCol_innodb-master.opt
diff --git a/mysql-test/t/rpl_extraCol_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_extraCol_innodb-slave.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/t/rpl_extraCol_innodb-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_extraCol_innodb-slave.opt
diff --git a/mysql-test/t/rpl_extraCol_innodb.test b/mysql-test/suite/rpl/t/rpl_extraCol_innodb.test
index e9685baf01b..e9685baf01b 100644
--- a/mysql-test/t/rpl_extraCol_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_extraCol_innodb.test
diff --git a/mysql-test/t/rpl_extraCol_myisam.test b/mysql-test/suite/rpl/t/rpl_extraCol_myisam.test
index d56df394ccf..d56df394ccf 100644
--- a/mysql-test/t/rpl_extraCol_myisam.test
+++ b/mysql-test/suite/rpl/t/rpl_extraCol_myisam.test
diff --git a/mysql-test/t/rpl_failed_optimize-master.opt b/mysql-test/suite/rpl/t/rpl_failed_optimize-master.opt
index 3f82baff598..3f82baff598 100644
--- a/mysql-test/t/rpl_failed_optimize-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_failed_optimize-master.opt
diff --git a/mysql-test/t/rpl_failed_optimize.test b/mysql-test/suite/rpl/t/rpl_failed_optimize.test
index 81e8342b5c0..81e8342b5c0 100644
--- a/mysql-test/t/rpl_failed_optimize.test
+++ b/mysql-test/suite/rpl/t/rpl_failed_optimize.test
diff --git a/mysql-test/t/rpl_flushlog_loop-master.opt b/mysql-test/suite/rpl/t/rpl_flushlog_loop-master.opt
index a4d1d403dc9..a4d1d403dc9 100644
--- a/mysql-test/t/rpl_flushlog_loop-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_flushlog_loop-master.opt
diff --git a/mysql-test/t/rpl_flushlog_loop-master.sh b/mysql-test/suite/rpl/t/rpl_flushlog_loop-master.sh
index a321dd690cd..a321dd690cd 100755
--- a/mysql-test/t/rpl_flushlog_loop-master.sh
+++ b/mysql-test/suite/rpl/t/rpl_flushlog_loop-master.sh
diff --git a/mysql-test/t/rpl_flushlog_loop-slave.opt b/mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.opt
index 95839c831c9..95839c831c9 100644
--- a/mysql-test/t/rpl_flushlog_loop-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.opt
diff --git a/mysql-test/t/rpl_flushlog_loop-slave.sh b/mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.sh
index e46ea6d400b..e46ea6d400b 100755
--- a/mysql-test/t/rpl_flushlog_loop-slave.sh
+++ b/mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.sh
diff --git a/mysql-test/t/rpl_flushlog_loop.test b/mysql-test/suite/rpl/t/rpl_flushlog_loop.test
index 7d92ba9c2f4..7d92ba9c2f4 100644
--- a/mysql-test/t/rpl_flushlog_loop.test
+++ b/mysql-test/suite/rpl/t/rpl_flushlog_loop.test
diff --git a/mysql-test/t/rpl_foreign_key_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_foreign_key_innodb-slave.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/t/rpl_foreign_key_innodb-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_foreign_key_innodb-slave.opt
diff --git a/mysql-test/t/rpl_foreign_key_innodb.test b/mysql-test/suite/rpl/t/rpl_foreign_key_innodb.test
index d085bff2012..d085bff2012 100644
--- a/mysql-test/t/rpl_foreign_key_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_foreign_key_innodb.test
diff --git a/mysql-test/t/rpl_free_items-slave.opt b/mysql-test/suite/rpl/t/rpl_free_items-slave.opt
index b828d03fafb..b828d03fafb 100644
--- a/mysql-test/t/rpl_free_items-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_free_items-slave.opt
diff --git a/mysql-test/t/rpl_free_items.test b/mysql-test/suite/rpl/t/rpl_free_items.test
index 043e84160b8..043e84160b8 100644
--- a/mysql-test/t/rpl_free_items.test
+++ b/mysql-test/suite/rpl/t/rpl_free_items.test
diff --git a/mysql-test/t/rpl_get_lock.test b/mysql-test/suite/rpl/t/rpl_get_lock.test
index 945bd98c993..945bd98c993 100644
--- a/mysql-test/t/rpl_get_lock.test
+++ b/mysql-test/suite/rpl/t/rpl_get_lock.test
diff --git a/mysql-test/t/rpl_grant.test b/mysql-test/suite/rpl/t/rpl_grant.test
index 71e36342584..71e36342584 100644
--- a/mysql-test/t/rpl_grant.test
+++ b/mysql-test/suite/rpl/t/rpl_grant.test
diff --git a/mysql-test/t/rpl_ignore_grant-slave.opt b/mysql-test/suite/rpl/t/rpl_ignore_grant-slave.opt
index e931bfbd37e..e931bfbd37e 100644
--- a/mysql-test/t/rpl_ignore_grant-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_ignore_grant-slave.opt
diff --git a/mysql-test/t/rpl_ignore_grant.test b/mysql-test/suite/rpl/t/rpl_ignore_grant.test
index 2e6e2ce9a31..2e6e2ce9a31 100644
--- a/mysql-test/t/rpl_ignore_grant.test
+++ b/mysql-test/suite/rpl/t/rpl_ignore_grant.test
diff --git a/mysql-test/t/rpl_ignore_revoke-slave.opt b/mysql-test/suite/rpl/t/rpl_ignore_revoke-slave.opt
index e931bfbd37e..e931bfbd37e 100644
--- a/mysql-test/t/rpl_ignore_revoke-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_ignore_revoke-slave.opt
diff --git a/mysql-test/t/rpl_ignore_revoke.test b/mysql-test/suite/rpl/t/rpl_ignore_revoke.test
index 00171605a92..00171605a92 100644
--- a/mysql-test/t/rpl_ignore_revoke.test
+++ b/mysql-test/suite/rpl/t/rpl_ignore_revoke.test
diff --git a/mysql-test/t/rpl_ignore_table-slave.opt b/mysql-test/suite/rpl/t/rpl_ignore_table-slave.opt
index 3aabbb2e0f5..3aabbb2e0f5 100644
--- a/mysql-test/t/rpl_ignore_table-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_ignore_table-slave.opt
diff --git a/mysql-test/t/rpl_ignore_table.test b/mysql-test/suite/rpl/t/rpl_ignore_table.test
index fd4ae64165a..fd4ae64165a 100644
--- a/mysql-test/t/rpl_ignore_table.test
+++ b/mysql-test/suite/rpl/t/rpl_ignore_table.test
diff --git a/mysql-test/t/rpl_ignore_table_update-slave.opt b/mysql-test/suite/rpl/t/rpl_ignore_table_update-slave.opt
index 177f89e0910..177f89e0910 100644
--- a/mysql-test/t/rpl_ignore_table_update-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_ignore_table_update-slave.opt
diff --git a/mysql-test/t/rpl_ignore_table_update.test b/mysql-test/suite/rpl/t/rpl_ignore_table_update.test
index fe030f90411..fe030f90411 100644
--- a/mysql-test/t/rpl_ignore_table_update.test
+++ b/mysql-test/suite/rpl/t/rpl_ignore_table_update.test
diff --git a/mysql-test/t/rpl_incident-master.opt b/mysql-test/suite/rpl/t/rpl_incident-master.opt
index 912801debc4..912801debc4 100644
--- a/mysql-test/t/rpl_incident-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_incident-master.opt
diff --git a/mysql-test/t/rpl_incident.test b/mysql-test/suite/rpl/t/rpl_incident.test
index 507cd0e0798..507cd0e0798 100644
--- a/mysql-test/t/rpl_incident.test
+++ b/mysql-test/suite/rpl/t/rpl_incident.test
diff --git a/mysql-test/t/rpl_init_slave-slave.opt b/mysql-test/suite/rpl/t/rpl_init_slave-slave.opt
index 337e8a60d97..337e8a60d97 100644
--- a/mysql-test/t/rpl_init_slave-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_init_slave-slave.opt
diff --git a/mysql-test/t/rpl_init_slave.test b/mysql-test/suite/rpl/t/rpl_init_slave.test
index 139b4902e12..139b4902e12 100644
--- a/mysql-test/t/rpl_init_slave.test
+++ b/mysql-test/suite/rpl/t/rpl_init_slave.test
diff --git a/mysql-test/t/rpl_innodb.test b/mysql-test/suite/rpl/t/rpl_innodb.test
index 30d40e19614..30d40e19614 100644
--- a/mysql-test/t/rpl_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_innodb.test
diff --git a/mysql-test/t/rpl_insert.test b/mysql-test/suite/rpl/t/rpl_insert.test
index 0d471a0e0a9..0d471a0e0a9 100644
--- a/mysql-test/t/rpl_insert.test
+++ b/mysql-test/suite/rpl/t/rpl_insert.test
diff --git a/mysql-test/t/rpl_insert_id-slave.opt b/mysql-test/suite/rpl/t/rpl_insert_id-slave.opt
index 48457b17309..48457b17309 100644
--- a/mysql-test/t/rpl_insert_id-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_insert_id-slave.opt
diff --git a/mysql-test/t/rpl_insert_id.test b/mysql-test/suite/rpl/t/rpl_insert_id.test
index bfd66431d3c..bfd66431d3c 100644
--- a/mysql-test/t/rpl_insert_id.test
+++ b/mysql-test/suite/rpl/t/rpl_insert_id.test
diff --git a/mysql-test/t/rpl_insert_id_pk-slave.opt b/mysql-test/suite/rpl/t/rpl_insert_id_pk-slave.opt
index 48457b17309..48457b17309 100644
--- a/mysql-test/t/rpl_insert_id_pk-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_insert_id_pk-slave.opt
diff --git a/mysql-test/t/rpl_insert_id_pk.test b/mysql-test/suite/rpl/t/rpl_insert_id_pk.test
index 01f30b78ac5..01f30b78ac5 100644
--- a/mysql-test/t/rpl_insert_id_pk.test
+++ b/mysql-test/suite/rpl/t/rpl_insert_id_pk.test
diff --git a/mysql-test/t/rpl_insert_ignore-slave.opt b/mysql-test/suite/rpl/t/rpl_insert_ignore-slave.opt
index 48457b17309..48457b17309 100644
--- a/mysql-test/t/rpl_insert_ignore-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_insert_ignore-slave.opt
diff --git a/mysql-test/t/rpl_insert_ignore.test b/mysql-test/suite/rpl/t/rpl_insert_ignore.test
index 2709430f85d..2709430f85d 100644
--- a/mysql-test/t/rpl_insert_ignore.test
+++ b/mysql-test/suite/rpl/t/rpl_insert_ignore.test
diff --git a/mysql-test/t/rpl_insert_select.test b/mysql-test/suite/rpl/t/rpl_insert_select.test
index 677be526982..677be526982 100644
--- a/mysql-test/t/rpl_insert_select.test
+++ b/mysql-test/suite/rpl/t/rpl_insert_select.test
diff --git a/mysql-test/t/rpl_invoked_features-master.opt b/mysql-test/suite/rpl/t/rpl_invoked_features-master.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/t/rpl_invoked_features-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_invoked_features-master.opt
diff --git a/mysql-test/t/rpl_invoked_features-slave.opt b/mysql-test/suite/rpl/t/rpl_invoked_features-slave.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/t/rpl_invoked_features-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_invoked_features-slave.opt
diff --git a/mysql-test/t/rpl_invoked_features.test b/mysql-test/suite/rpl/t/rpl_invoked_features.test
index e797e0552ef..e797e0552ef 100644
--- a/mysql-test/t/rpl_invoked_features.test
+++ b/mysql-test/suite/rpl/t/rpl_invoked_features.test
diff --git a/mysql-test/t/rpl_known_bugs_detection-master.opt b/mysql-test/suite/rpl/t/rpl_known_bugs_detection-master.opt
index d4ba386a1a0..d4ba386a1a0 100644
--- a/mysql-test/t/rpl_known_bugs_detection-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_known_bugs_detection-master.opt
diff --git a/mysql-test/t/rpl_known_bugs_detection.test b/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test
index b300603f454..b300603f454 100644
--- a/mysql-test/t/rpl_known_bugs_detection.test
+++ b/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test
diff --git a/mysql-test/t/rpl_load_from_master-slave.opt b/mysql-test/suite/rpl/t/rpl_load_from_master-slave.opt
index c015c02ba78..c015c02ba78 100644
--- a/mysql-test/t/rpl_load_from_master-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_load_from_master-slave.opt
diff --git a/mysql-test/t/rpl_load_from_master.test b/mysql-test/suite/rpl/t/rpl_load_from_master.test
index 9bab7d5696e..9bab7d5696e 100644
--- a/mysql-test/t/rpl_load_from_master.test
+++ b/mysql-test/suite/rpl/t/rpl_load_from_master.test
diff --git a/mysql-test/t/rpl_load_table_from_master.test b/mysql-test/suite/rpl/t/rpl_load_table_from_master.test
index b9cec3858a9..b9cec3858a9 100644
--- a/mysql-test/t/rpl_load_table_from_master.test
+++ b/mysql-test/suite/rpl/t/rpl_load_table_from_master.test
diff --git a/mysql-test/t/rpl_loaddata.test b/mysql-test/suite/rpl/t/rpl_loaddata.test
index 6f9ee4ef80a..6f9ee4ef80a 100644
--- a/mysql-test/t/rpl_loaddata.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddata.test
diff --git a/mysql-test/t/rpl_loaddata_charset.test b/mysql-test/suite/rpl/t/rpl_loaddata_charset.test
index 7f2389cb9f6..7f2389cb9f6 100644
--- a/mysql-test/t/rpl_loaddata_charset.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_charset.test
diff --git a/mysql-test/t/rpl_loaddata_fatal-slave.opt b/mysql-test/suite/rpl/t/rpl_loaddata_fatal-slave.opt
index 9c846c799f3..9c846c799f3 100644
--- a/mysql-test/t/rpl_loaddata_fatal-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_fatal-slave.opt
diff --git a/mysql-test/t/rpl_loaddata_fatal.test b/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test
index dceee7a65af..dceee7a65af 100644
--- a/mysql-test/t/rpl_loaddata_fatal.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test
diff --git a/mysql-test/t/rpl_loaddata_m-master.opt b/mysql-test/suite/rpl/t/rpl_loaddata_m-master.opt
index 9d4a8f0b95e..9d4a8f0b95e 100644
--- a/mysql-test/t/rpl_loaddata_m-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_m-master.opt
diff --git a/mysql-test/t/rpl_loaddata_m.test b/mysql-test/suite/rpl/t/rpl_loaddata_m.test
index 537d4c163ef..537d4c163ef 100644
--- a/mysql-test/t/rpl_loaddata_m.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_m.test
diff --git a/mysql-test/t/rpl_loaddata_s-slave.opt b/mysql-test/suite/rpl/t/rpl_loaddata_s-slave.opt
index 9d4a8f0b95e..9d4a8f0b95e 100644
--- a/mysql-test/t/rpl_loaddata_s-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_s-slave.opt
diff --git a/mysql-test/t/rpl_loaddata_s.test b/mysql-test/suite/rpl/t/rpl_loaddata_s.test
index f397d741310..f397d741310 100644
--- a/mysql-test/t/rpl_loaddata_s.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_s.test
diff --git a/mysql-test/t/rpl_loaddata_simple.test b/mysql-test/suite/rpl/t/rpl_loaddata_simple.test
index 9e908cac677..9e908cac677 100644
--- a/mysql-test/t/rpl_loaddata_simple.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_simple.test
diff --git a/mysql-test/t/rpl_loaddatalocal.test b/mysql-test/suite/rpl/t/rpl_loaddatalocal.test
index b10603e7195..b10603e7195 100644
--- a/mysql-test/t/rpl_loaddatalocal.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddatalocal.test
diff --git a/mysql-test/t/rpl_loadfile.test b/mysql-test/suite/rpl/t/rpl_loadfile.test
index a671bab15bb..a671bab15bb 100644
--- a/mysql-test/t/rpl_loadfile.test
+++ b/mysql-test/suite/rpl/t/rpl_loadfile.test
diff --git a/mysql-test/t/rpl_locale.test b/mysql-test/suite/rpl/t/rpl_locale.test
index 2f2d637e1b4..2f2d637e1b4 100644
--- a/mysql-test/t/rpl_locale.test
+++ b/mysql-test/suite/rpl/t/rpl_locale.test
diff --git a/mysql-test/t/rpl_log_pos.test b/mysql-test/suite/rpl/t/rpl_log_pos.test
index e5ad6f39ed2..e5ad6f39ed2 100644
--- a/mysql-test/t/rpl_log_pos.test
+++ b/mysql-test/suite/rpl/t/rpl_log_pos.test
diff --git a/mysql-test/t/rpl_many_optimize.test b/mysql-test/suite/rpl/t/rpl_many_optimize.test
index 91fab0b27a8..91fab0b27a8 100644
--- a/mysql-test/t/rpl_many_optimize.test
+++ b/mysql-test/suite/rpl/t/rpl_many_optimize.test
diff --git a/mysql-test/t/rpl_master_pos_wait.test b/mysql-test/suite/rpl/t/rpl_master_pos_wait.test
index 893c8746efc..893c8746efc 100644
--- a/mysql-test/t/rpl_master_pos_wait.test
+++ b/mysql-test/suite/rpl/t/rpl_master_pos_wait.test
diff --git a/mysql-test/t/rpl_misc_functions-slave.sh b/mysql-test/suite/rpl/t/rpl_misc_functions-slave.sh
index 8ce79797822..8ce79797822 100755
--- a/mysql-test/t/rpl_misc_functions-slave.sh
+++ b/mysql-test/suite/rpl/t/rpl_misc_functions-slave.sh
diff --git a/mysql-test/t/rpl_misc_functions.test b/mysql-test/suite/rpl/t/rpl_misc_functions.test
index db9b557baad..1c94471c975 100644
--- a/mysql-test/t/rpl_misc_functions.test
+++ b/mysql-test/suite/rpl/t/rpl_misc_functions.test
@@ -43,15 +43,16 @@ drop table t1;
DROP TABLE IF EXISTS t1;
--enable_warnings
-CREATE TABLE t1 (col_a double default NULL);
+CREATE TABLE t1 (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ col_a DOUBLE DEFAULT NULL);
DELIMITER |;
# Use a SP that calls rand() multiple times
CREATE PROCEDURE test_replication_sp1()
BEGIN
- INSERT INTO t1 VALUES (rand()), (rand());
- INSERT INTO t1 VALUES (rand());
+ INSERT INTO t1 (col_a) VALUES (rand()), (rand());
+ INSERT INTO t1 (col_a) VALUES (rand());
END|
# Use a SP that calls another SP to call rand() multiple times
@@ -73,31 +74,41 @@ DELIMITER ;|
# the master to those on the slave.
CALL test_replication_sp1();
CALL test_replication_sp2();
-INSERT INTO t1 VALUES (test_replication_sf());
-INSERT INTO t1 VALUES (test_replication_sf());
-INSERT INTO t1 VALUES (test_replication_sf());
-
-# Record the results of the query on the master
---exec $MYSQL --port=$MASTER_MYPORT test -e "SELECT * FROM test.t1" > $MYSQLTEST_VARDIR/tmp/rpl_rand_master.sql
+INSERT INTO t1 (col_a) VALUES (test_replication_sf());
+INSERT INTO t1 (col_a) VALUES (test_replication_sf());
+INSERT INTO t1 (col_a) VALUES (test_replication_sf());
--sync_slave_with_master
-# Record the results of the query on the slave
---exec $MYSQL --port=$SLAVE_MYPORT test -e "SELECT * FROM test.t1" > $MYSQLTEST_VARDIR/tmp/rpl_rand_slave.sql
+# Dump table on slave
+select * from t1 into outfile "../tmp/t1_slave.txt";
-# Compare the results from the master to the slave.
---exec diff $MYSQLTEST_VARDIR/tmp/rpl_rand_master.sql $MYSQLTEST_VARDIR/tmp/rpl_rand_slave.sql
+# Load data from slave into temp table on master
+connection master;
+create temporary table t1_slave select * from t1 where 1=0;
+load data infile '../tmp/t1_slave.txt' into table t1_slave;
+--remove_file $MYSQLTEST_VARDIR/tmp/t1_slave.txt
+
+# Compare master and slave temp table, use subtraction
+# for floating point comparison of "double"
+select count(*) into @aux from t1 join t1_slave using (id)
+where ABS(t1.col_a - t1_slave.col_a) < 0.0000001 ;
+SELECT @aux;
+if (`SELECT @aux <> 12 OR @aux IS NULL`)
+{
+ --echo # ERROR: We expected to get count(*) = 12.
+ SELECT id, col_a FROM t1;
+ SELECT id, col_a FROM t1_slave;
+ --echo # abort
+ exit;
+}
# Cleanup
connection master;
---disable_warnings
-DROP PROCEDURE IF EXISTS test_replication_sp1;
-DROP PROCEDURE IF EXISTS test_replication_sp2;
-DROP FUNCTION IF EXISTS test_replication_sf;
-DROP TABLE IF EXISTS t1;
---enable_warnings
+DROP TABLE t1, t1_slave;
+DROP PROCEDURE test_replication_sp1;
+DROP PROCEDURE test_replication_sp2;
+DROP FUNCTION test_replication_sf;
--sync_slave_with_master
-# If all is good, when can cleanup our dump files.
---remove_file $MYSQLTEST_VARDIR/tmp/rpl_rand_master.sql
---remove_file $MYSQLTEST_VARDIR/tmp/rpl_rand_slave.sql
+
diff --git a/mysql-test/t/rpl_mixed_ddl_dml.test b/mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test
index 6a1f81abed3..6a1f81abed3 100644
--- a/mysql-test/t/rpl_mixed_ddl_dml.test
+++ b/mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test
diff --git a/mysql-test/t/rpl_multi_delete-slave.opt b/mysql-test/suite/rpl/t/rpl_multi_delete-slave.opt
index c98fe0b0a46..c98fe0b0a46 100644
--- a/mysql-test/t/rpl_multi_delete-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_multi_delete-slave.opt
diff --git a/mysql-test/t/rpl_multi_delete.test b/mysql-test/suite/rpl/t/rpl_multi_delete.test
index a251cbf8833..a251cbf8833 100644
--- a/mysql-test/t/rpl_multi_delete.test
+++ b/mysql-test/suite/rpl/t/rpl_multi_delete.test
diff --git a/mysql-test/t/rpl_multi_delete2-slave.opt b/mysql-test/suite/rpl/t/rpl_multi_delete2-slave.opt
index 0febb2891b1..0febb2891b1 100644
--- a/mysql-test/t/rpl_multi_delete2-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_multi_delete2-slave.opt
diff --git a/mysql-test/t/rpl_multi_delete2.test b/mysql-test/suite/rpl/t/rpl_multi_delete2.test
index 81379d4056b..81379d4056b 100644
--- a/mysql-test/t/rpl_multi_delete2.test
+++ b/mysql-test/suite/rpl/t/rpl_multi_delete2.test
diff --git a/mysql-test/t/rpl_multi_engine-slave.opt b/mysql-test/suite/rpl/t/rpl_multi_engine-slave.opt
index 48457b17309..48457b17309 100644
--- a/mysql-test/t/rpl_multi_engine-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_multi_engine-slave.opt
diff --git a/mysql-test/t/rpl_multi_engine.test b/mysql-test/suite/rpl/t/rpl_multi_engine.test
index 10780c765f7..10780c765f7 100644
--- a/mysql-test/t/rpl_multi_engine.test
+++ b/mysql-test/suite/rpl/t/rpl_multi_engine.test
diff --git a/mysql-test/t/rpl_multi_update.test b/mysql-test/suite/rpl/t/rpl_multi_update.test
index a6111455d16..a6111455d16 100644
--- a/mysql-test/t/rpl_multi_update.test
+++ b/mysql-test/suite/rpl/t/rpl_multi_update.test
diff --git a/mysql-test/t/rpl_multi_update2-slave.opt b/mysql-test/suite/rpl/t/rpl_multi_update2-slave.opt
index 17d4171af0e..17d4171af0e 100644
--- a/mysql-test/t/rpl_multi_update2-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_multi_update2-slave.opt
diff --git a/mysql-test/t/rpl_multi_update2.test b/mysql-test/suite/rpl/t/rpl_multi_update2.test
index 812a486ad69..812a486ad69 100644
--- a/mysql-test/t/rpl_multi_update2.test
+++ b/mysql-test/suite/rpl/t/rpl_multi_update2.test
diff --git a/mysql-test/t/rpl_multi_update3.test b/mysql-test/suite/rpl/t/rpl_multi_update3.test
index 5da91c26b04..5da91c26b04 100644
--- a/mysql-test/t/rpl_multi_update3.test
+++ b/mysql-test/suite/rpl/t/rpl_multi_update3.test
diff --git a/mysql-test/t/rpl_multi_update4-slave.opt b/mysql-test/suite/rpl/t/rpl_multi_update4-slave.opt
index fea27db43ee..fea27db43ee 100644
--- a/mysql-test/t/rpl_multi_update4-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_multi_update4-slave.opt
diff --git a/mysql-test/t/rpl_multi_update4.test b/mysql-test/suite/rpl/t/rpl_multi_update4.test
index 4991a385f6f..4991a385f6f 100644
--- a/mysql-test/t/rpl_multi_update4.test
+++ b/mysql-test/suite/rpl/t/rpl_multi_update4.test
diff --git a/mysql-test/t/rpl_optimize.test b/mysql-test/suite/rpl/t/rpl_optimize.test
index 80f0c052fc8..80f0c052fc8 100644
--- a/mysql-test/t/rpl_optimize.test
+++ b/mysql-test/suite/rpl/t/rpl_optimize.test
diff --git a/mysql-test/t/rpl_packet-master.opt b/mysql-test/suite/rpl/t/rpl_packet-master.opt
index 42d4f94c999..42d4f94c999 100644
--- a/mysql-test/t/rpl_packet-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_packet-master.opt
diff --git a/mysql-test/t/rpl_packet-slave.opt b/mysql-test/suite/rpl/t/rpl_packet-slave.opt
index 42d4f94c999..42d4f94c999 100644
--- a/mysql-test/t/rpl_packet-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_packet-slave.opt
diff --git a/mysql-test/t/rpl_packet.test b/mysql-test/suite/rpl/t/rpl_packet.test
index 26fe36d8c40..26fe36d8c40 100644
--- a/mysql-test/t/rpl_packet.test
+++ b/mysql-test/suite/rpl/t/rpl_packet.test
diff --git a/mysql-test/t/rpl_ps.test b/mysql-test/suite/rpl/t/rpl_ps.test
index b8792722192..b8792722192 100644
--- a/mysql-test/t/rpl_ps.test
+++ b/mysql-test/suite/rpl/t/rpl_ps.test
diff --git a/mysql-test/t/rpl_rbr_to_sbr.test b/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test
index 72ae6a99c44..72ae6a99c44 100644
--- a/mysql-test/t/rpl_rbr_to_sbr.test
+++ b/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test
diff --git a/mysql-test/t/rpl_read_only-slave.opt b/mysql-test/suite/rpl/t/rpl_read_only-slave.opt
index 48457b17309..48457b17309 100644
--- a/mysql-test/t/rpl_read_only-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_read_only-slave.opt
diff --git a/mysql-test/t/rpl_read_only.test b/mysql-test/suite/rpl/t/rpl_read_only.test
index 62864b62a28..62864b62a28 100644
--- a/mysql-test/t/rpl_read_only.test
+++ b/mysql-test/suite/rpl/t/rpl_read_only.test
diff --git a/mysql-test/t/rpl_redirect.test b/mysql-test/suite/rpl/t/rpl_redirect.test
index 1c6f31a030e..1c6f31a030e 100644
--- a/mysql-test/t/rpl_redirect.test
+++ b/mysql-test/suite/rpl/t/rpl_redirect.test
diff --git a/mysql-test/t/rpl_relay_space_innodb-master.opt b/mysql-test/suite/rpl/t/rpl_relay_space_innodb-master.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/t/rpl_relay_space_innodb-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_relay_space_innodb-master.opt
diff --git a/mysql-test/t/rpl_relay_space_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_relay_space_innodb-slave.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/t/rpl_relay_space_innodb-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_relay_space_innodb-slave.opt
diff --git a/mysql-test/t/rpl_relay_space_innodb.test b/mysql-test/suite/rpl/t/rpl_relay_space_innodb.test
index 156d53ef856..156d53ef856 100644
--- a/mysql-test/t/rpl_relay_space_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_relay_space_innodb.test
diff --git a/mysql-test/t/rpl_relay_space_myisam.test b/mysql-test/suite/rpl/t/rpl_relay_space_myisam.test
index 1d8563e7fd9..1d8563e7fd9 100644
--- a/mysql-test/t/rpl_relay_space_myisam.test
+++ b/mysql-test/suite/rpl/t/rpl_relay_space_myisam.test
diff --git a/mysql-test/t/rpl_relayrotate-slave.opt b/mysql-test/suite/rpl/t/rpl_relayrotate-slave.opt
index cf4319f2b40..cf4319f2b40 100644
--- a/mysql-test/t/rpl_relayrotate-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_relayrotate-slave.opt
diff --git a/mysql-test/t/rpl_relayrotate.test b/mysql-test/suite/rpl/t/rpl_relayrotate.test
index ec3e6be4bea..ec3e6be4bea 100644
--- a/mysql-test/t/rpl_relayrotate.test
+++ b/mysql-test/suite/rpl/t/rpl_relayrotate.test
diff --git a/mysql-test/t/rpl_relayspace-slave.opt b/mysql-test/suite/rpl/t/rpl_relayspace-slave.opt
index 06d96aa3b9a..06d96aa3b9a 100644
--- a/mysql-test/t/rpl_relayspace-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_relayspace-slave.opt
diff --git a/mysql-test/t/rpl_relayspace.test b/mysql-test/suite/rpl/t/rpl_relayspace.test
index 70315c14f34..70315c14f34 100644
--- a/mysql-test/t/rpl_relayspace.test
+++ b/mysql-test/suite/rpl/t/rpl_relayspace.test
diff --git a/mysql-test/t/rpl_replicate_do-slave.opt b/mysql-test/suite/rpl/t/rpl_replicate_do-slave.opt
index da345474216..da345474216 100644
--- a/mysql-test/t/rpl_replicate_do-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_replicate_do-slave.opt
diff --git a/mysql-test/t/rpl_replicate_do.test b/mysql-test/suite/rpl/t/rpl_replicate_do.test
index 90f00764691..90f00764691 100644
--- a/mysql-test/t/rpl_replicate_do.test
+++ b/mysql-test/suite/rpl/t/rpl_replicate_do.test
diff --git a/mysql-test/t/rpl_replicate_ignore_db-slave.opt b/mysql-test/suite/rpl/t/rpl_replicate_ignore_db-slave.opt
index 6e3aed44f78..6e3aed44f78 100644
--- a/mysql-test/t/rpl_replicate_ignore_db-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_replicate_ignore_db-slave.opt
diff --git a/mysql-test/t/rpl_replicate_ignore_db.test b/mysql-test/suite/rpl/t/rpl_replicate_ignore_db.test
index bcfef919fad..bcfef919fad 100644
--- a/mysql-test/t/rpl_replicate_ignore_db.test
+++ b/mysql-test/suite/rpl/t/rpl_replicate_ignore_db.test
diff --git a/mysql-test/t/rpl_rewrt_db-slave.opt b/mysql-test/suite/rpl/t/rpl_rewrt_db-slave.opt
index a462ad19ba0..a462ad19ba0 100644
--- a/mysql-test/t/rpl_rewrt_db-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_rewrt_db-slave.opt
diff --git a/mysql-test/t/rpl_rewrt_db.test b/mysql-test/suite/rpl/t/rpl_rewrt_db.test
index 52f04e073dd..52f04e073dd 100644
--- a/mysql-test/t/rpl_rewrt_db.test
+++ b/mysql-test/suite/rpl/t/rpl_rewrt_db.test
diff --git a/mysql-test/t/rpl_rotate_logs-master.opt b/mysql-test/suite/rpl/t/rpl_rotate_logs-master.opt
index ad2c6a647b5..ad2c6a647b5 100644
--- a/mysql-test/t/rpl_rotate_logs-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_rotate_logs-master.opt
diff --git a/mysql-test/t/rpl_rotate_logs-slave.sh b/mysql-test/suite/rpl/t/rpl_rotate_logs-slave.sh
index 81490a54b4b..81490a54b4b 100755
--- a/mysql-test/t/rpl_rotate_logs-slave.sh
+++ b/mysql-test/suite/rpl/t/rpl_rotate_logs-slave.sh
diff --git a/mysql-test/t/rpl_rotate_logs.slave-mi b/mysql-test/suite/rpl/t/rpl_rotate_logs.slave-mi
index 80190bf6d29..80190bf6d29 100644
--- a/mysql-test/t/rpl_rotate_logs.slave-mi
+++ b/mysql-test/suite/rpl/t/rpl_rotate_logs.slave-mi
diff --git a/mysql-test/t/rpl_rotate_logs.test b/mysql-test/suite/rpl/t/rpl_rotate_logs.test
index c04b9045daa..998bce33e8f 100644
--- a/mysql-test/t/rpl_rotate_logs.test
+++ b/mysql-test/suite/rpl/t/rpl_rotate_logs.test
@@ -166,4 +166,16 @@ connection master;
drop table if exists t1,t2,t3,t4;
sync_slave_with_master;
-# End of 4.1 tests
+--echo End of 4.1 tests
+
+#
+# Bug #29420: crash with show and purge binlogs
+#
+--error 1220
+show binlog events in 'non existing_binlog_file';
+purge master logs before now();
+--error 1220
+show binlog events in '';
+purge master logs before now();
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/rpl_row_001.test b/mysql-test/suite/rpl/t/rpl_row_001.test
index 99eaebcdcaf..99eaebcdcaf 100644
--- a/mysql-test/t/rpl_row_001.test
+++ b/mysql-test/suite/rpl/t/rpl_row_001.test
diff --git a/mysql-test/t/rpl_row_4_bytes-master.opt b/mysql-test/suite/rpl/t/rpl_row_4_bytes-master.opt
index 0e1929507f7..0e1929507f7 100644
--- a/mysql-test/t/rpl_row_4_bytes-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_4_bytes-master.opt
diff --git a/mysql-test/t/rpl_row_4_bytes.test b/mysql-test/suite/rpl/t/rpl_row_4_bytes.test
index 73ef6dd2345..73ef6dd2345 100644
--- a/mysql-test/t/rpl_row_4_bytes.test
+++ b/mysql-test/suite/rpl/t/rpl_row_4_bytes.test
diff --git a/mysql-test/t/rpl_row_NOW.test b/mysql-test/suite/rpl/t/rpl_row_NOW.test
index c28b714277e..c28b714277e 100644
--- a/mysql-test/t/rpl_row_NOW.test
+++ b/mysql-test/suite/rpl/t/rpl_row_NOW.test
diff --git a/mysql-test/t/rpl_row_USER.test b/mysql-test/suite/rpl/t/rpl_row_USER.test
index 7b13ebc50ee..7b13ebc50ee 100644
--- a/mysql-test/t/rpl_row_USER.test
+++ b/mysql-test/suite/rpl/t/rpl_row_USER.test
diff --git a/mysql-test/t/rpl_row_UUID.test b/mysql-test/suite/rpl/t/rpl_row_UUID.test
index b0ef96463d0..b0ef96463d0 100644
--- a/mysql-test/t/rpl_row_UUID.test
+++ b/mysql-test/suite/rpl/t/rpl_row_UUID.test
diff --git a/mysql-test/t/rpl_row_basic_11bugs-master.opt b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs-master.opt
index ed7656c1f99..ed7656c1f99 100644
--- a/mysql-test/t/rpl_row_basic_11bugs-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs-master.opt
diff --git a/mysql-test/t/rpl_row_basic_11bugs-slave.opt b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs-slave.opt
index 48457b17309..48457b17309 100644
--- a/mysql-test/t/rpl_row_basic_11bugs-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs-slave.opt
diff --git a/mysql-test/t/rpl_row_basic_11bugs.test b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test
index fb43664f121..fb43664f121 100644
--- a/mysql-test/t/rpl_row_basic_11bugs.test
+++ b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test
diff --git a/mysql-test/t/rpl_row_basic_2myisam.test b/mysql-test/suite/rpl/t/rpl_row_basic_2myisam.test
index c5648fa1d77..c5648fa1d77 100644
--- a/mysql-test/t/rpl_row_basic_2myisam.test
+++ b/mysql-test/suite/rpl/t/rpl_row_basic_2myisam.test
diff --git a/mysql-test/t/rpl_row_basic_3innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_row_basic_3innodb-slave.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/t/rpl_row_basic_3innodb-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_basic_3innodb-slave.opt
diff --git a/mysql-test/t/rpl_row_basic_3innodb.test b/mysql-test/suite/rpl/t/rpl_row_basic_3innodb.test
index 3786a697e3f..3786a697e3f 100644
--- a/mysql-test/t/rpl_row_basic_3innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_row_basic_3innodb.test
diff --git a/mysql-test/t/rpl_row_basic_8partition.test b/mysql-test/suite/rpl/t/rpl_row_basic_8partition.test
index 687b3bc785d..687b3bc785d 100644
--- a/mysql-test/t/rpl_row_basic_8partition.test
+++ b/mysql-test/suite/rpl/t/rpl_row_basic_8partition.test
diff --git a/mysql-test/t/rpl_row_blob_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_row_blob_innodb-slave.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/t/rpl_row_blob_innodb-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_blob_innodb-slave.opt
diff --git a/mysql-test/t/rpl_row_blob_innodb.test b/mysql-test/suite/rpl/t/rpl_row_blob_innodb.test
index 6aa6c2a31b9..6aa6c2a31b9 100644
--- a/mysql-test/t/rpl_row_blob_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_row_blob_innodb.test
diff --git a/mysql-test/t/rpl_row_blob_myisam.test b/mysql-test/suite/rpl/t/rpl_row_blob_myisam.test
index 11f5336502a..11f5336502a 100644
--- a/mysql-test/t/rpl_row_blob_myisam.test
+++ b/mysql-test/suite/rpl/t/rpl_row_blob_myisam.test
diff --git a/mysql-test/t/rpl_row_charset.test b/mysql-test/suite/rpl/t/rpl_row_charset.test
index c83ccc586ba..c83ccc586ba 100644
--- a/mysql-test/t/rpl_row_charset.test
+++ b/mysql-test/suite/rpl/t/rpl_row_charset.test
diff --git a/mysql-test/t/rpl_row_create_table-slave.opt b/mysql-test/suite/rpl/t/rpl_row_create_table-slave.opt
index 48457b17309..48457b17309 100644
--- a/mysql-test/t/rpl_row_create_table-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_create_table-slave.opt
diff --git a/mysql-test/t/rpl_row_create_table.test b/mysql-test/suite/rpl/t/rpl_row_create_table.test
index be10d48b757..be10d48b757 100644
--- a/mysql-test/t/rpl_row_create_table.test
+++ b/mysql-test/suite/rpl/t/rpl_row_create_table.test
diff --git a/mysql-test/t/rpl_row_delayed_ins.test b/mysql-test/suite/rpl/t/rpl_row_delayed_ins.test
index a0e74567349..a0e74567349 100644
--- a/mysql-test/t/rpl_row_delayed_ins.test
+++ b/mysql-test/suite/rpl/t/rpl_row_delayed_ins.test
diff --git a/mysql-test/t/rpl_row_drop.test b/mysql-test/suite/rpl/t/rpl_row_drop.test
index 20c217a7c3a..20c217a7c3a 100644
--- a/mysql-test/t/rpl_row_drop.test
+++ b/mysql-test/suite/rpl/t/rpl_row_drop.test
diff --git a/mysql-test/t/rpl_row_err_daisychain-master.opt b/mysql-test/suite/rpl/t/rpl_row_err_daisychain-master.opt
index 83ed8522e72..83ed8522e72 100644
--- a/mysql-test/t/rpl_row_err_daisychain-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_err_daisychain-master.opt
diff --git a/mysql-test/t/rpl_row_err_daisychain-slave.opt b/mysql-test/suite/rpl/t/rpl_row_err_daisychain-slave.opt
index 4cb7a31da81..4cb7a31da81 100644
--- a/mysql-test/t/rpl_row_err_daisychain-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_err_daisychain-slave.opt
diff --git a/mysql-test/t/rpl_row_flsh_tbls.test b/mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test
index a2f9e31fc5d..a2f9e31fc5d 100644
--- a/mysql-test/t/rpl_row_flsh_tbls.test
+++ b/mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test
diff --git a/mysql-test/t/rpl_row_func001.test b/mysql-test/suite/rpl/t/rpl_row_func001.test
index 53fb55118e6..53fb55118e6 100644
--- a/mysql-test/t/rpl_row_func001.test
+++ b/mysql-test/suite/rpl/t/rpl_row_func001.test
diff --git a/mysql-test/t/rpl_row_func002.test b/mysql-test/suite/rpl/t/rpl_row_func002.test
index 44a704bfbc5..44a704bfbc5 100644
--- a/mysql-test/t/rpl_row_func002.test
+++ b/mysql-test/suite/rpl/t/rpl_row_func002.test
diff --git a/mysql-test/t/rpl_row_func003-slave.opt b/mysql-test/suite/rpl/t/rpl_row_func003-slave.opt
index 48457b17309..48457b17309 100644
--- a/mysql-test/t/rpl_row_func003-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_func003-slave.opt
diff --git a/mysql-test/t/rpl_row_func003.test b/mysql-test/suite/rpl/t/rpl_row_func003.test
index 30b24cf4174..30b24cf4174 100644
--- a/mysql-test/t/rpl_row_func003.test
+++ b/mysql-test/suite/rpl/t/rpl_row_func003.test
diff --git a/mysql-test/t/rpl_row_inexist_tbl-slave.opt b/mysql-test/suite/rpl/t/rpl_row_inexist_tbl-slave.opt
index abd717f8222..abd717f8222 100644
--- a/mysql-test/t/rpl_row_inexist_tbl-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_inexist_tbl-slave.opt
diff --git a/mysql-test/t/rpl_row_inexist_tbl.test b/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test
index 25a8c0e744e..25a8c0e744e 100644
--- a/mysql-test/t/rpl_row_inexist_tbl.test
+++ b/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test
diff --git a/mysql-test/t/rpl_row_insert_delayed.test b/mysql-test/suite/rpl/t/rpl_row_insert_delayed.test
index 9aeb57c4fa2..9aeb57c4fa2 100644
--- a/mysql-test/t/rpl_row_insert_delayed.test
+++ b/mysql-test/suite/rpl/t/rpl_row_insert_delayed.test
diff --git a/mysql-test/t/rpl_row_log-master.opt b/mysql-test/suite/rpl/t/rpl_row_log-master.opt
index e0d075c3fbd..e0d075c3fbd 100644
--- a/mysql-test/t/rpl_row_log-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_log-master.opt
diff --git a/mysql-test/t/rpl_row_log-slave.opt b/mysql-test/suite/rpl/t/rpl_row_log-slave.opt
index 8b137891791..8b137891791 100644
--- a/mysql-test/t/rpl_row_log-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_log-slave.opt
diff --git a/mysql-test/t/rpl_row_log.test b/mysql-test/suite/rpl/t/rpl_row_log.test
index 197f83c85af..197f83c85af 100644
--- a/mysql-test/t/rpl_row_log.test
+++ b/mysql-test/suite/rpl/t/rpl_row_log.test
diff --git a/mysql-test/t/rpl_row_log_innodb-master.opt b/mysql-test/suite/rpl/t/rpl_row_log_innodb-master.opt
index e0d075c3fbd..e0d075c3fbd 100644
--- a/mysql-test/t/rpl_row_log_innodb-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_log_innodb-master.opt
diff --git a/mysql-test/t/rpl_row_log_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_row_log_innodb-slave.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/t/rpl_row_log_innodb-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_log_innodb-slave.opt
diff --git a/mysql-test/t/rpl_row_log_innodb.test b/mysql-test/suite/rpl/t/rpl_row_log_innodb.test
index 16e775287b3..16e775287b3 100644
--- a/mysql-test/t/rpl_row_log_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_row_log_innodb.test
diff --git a/mysql-test/t/rpl_row_max_relay_size.test b/mysql-test/suite/rpl/t/rpl_row_max_relay_size.test
index a0be59e44a7..a0be59e44a7 100644
--- a/mysql-test/t/rpl_row_max_relay_size.test
+++ b/mysql-test/suite/rpl/t/rpl_row_max_relay_size.test
diff --git a/mysql-test/t/rpl_row_mysqlbinlog-master.opt b/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog-master.opt
index 07d12817f5f..07d12817f5f 100644
--- a/mysql-test/t/rpl_row_mysqlbinlog-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog-master.opt
diff --git a/mysql-test/t/rpl_row_mysqlbinlog.test b/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test
index dd46d64f684..dd46d64f684 100644
--- a/mysql-test/t/rpl_row_mysqlbinlog.test
+++ b/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test
diff --git a/mysql-test/t/rpl_row_mystery22.test b/mysql-test/suite/rpl/t/rpl_row_mystery22.test
index 9933fec22fc..9933fec22fc 100644
--- a/mysql-test/t/rpl_row_mystery22.test
+++ b/mysql-test/suite/rpl/t/rpl_row_mystery22.test
diff --git a/mysql-test/t/rpl_row_reset_slave.test b/mysql-test/suite/rpl/t/rpl_row_reset_slave.test
index a970c161153..a970c161153 100644
--- a/mysql-test/t/rpl_row_reset_slave.test
+++ b/mysql-test/suite/rpl/t/rpl_row_reset_slave.test
diff --git a/mysql-test/t/rpl_row_sp001.test b/mysql-test/suite/rpl/t/rpl_row_sp001.test
index c12e73b6861..c12e73b6861 100644
--- a/mysql-test/t/rpl_row_sp001.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp001.test
diff --git a/mysql-test/t/rpl_row_sp002_innodb-master.opt b/mysql-test/suite/rpl/t/rpl_row_sp002_innodb-master.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/t/rpl_row_sp002_innodb-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_sp002_innodb-master.opt
diff --git a/mysql-test/t/rpl_row_sp002_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_row_sp002_innodb-slave.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/t/rpl_row_sp002_innodb-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_sp002_innodb-slave.opt
diff --git a/mysql-test/t/rpl_row_sp002_innodb.test b/mysql-test/suite/rpl/t/rpl_row_sp002_innodb.test
index e272e34e715..e272e34e715 100644
--- a/mysql-test/t/rpl_row_sp002_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp002_innodb.test
diff --git a/mysql-test/t/rpl_row_sp003-master.opt b/mysql-test/suite/rpl/t/rpl_row_sp003-master.opt
index 48457b17309..48457b17309 100644
--- a/mysql-test/t/rpl_row_sp003-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_sp003-master.opt
diff --git a/mysql-test/t/rpl_row_sp003-slave.opt b/mysql-test/suite/rpl/t/rpl_row_sp003-slave.opt
index 48457b17309..48457b17309 100644
--- a/mysql-test/t/rpl_row_sp003-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_sp003-slave.opt
diff --git a/mysql-test/t/rpl_row_sp003.test b/mysql-test/suite/rpl/t/rpl_row_sp003.test
index 391ecd59b22..391ecd59b22 100644
--- a/mysql-test/t/rpl_row_sp003.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp003.test
diff --git a/mysql-test/t/rpl_row_sp005.test b/mysql-test/suite/rpl/t/rpl_row_sp005.test
index 054fa02f514..054fa02f514 100644
--- a/mysql-test/t/rpl_row_sp005.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp005.test
diff --git a/mysql-test/t/rpl_row_sp006_InnoDB-slave.opt b/mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB-slave.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/t/rpl_row_sp006_InnoDB-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB-slave.opt
diff --git a/mysql-test/t/rpl_row_sp006_InnoDB.test b/mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB.test
index e5be4e6dc28..e5be4e6dc28 100644
--- a/mysql-test/t/rpl_row_sp006_InnoDB.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB.test
diff --git a/mysql-test/t/rpl_row_sp007_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_row_sp007_innodb-slave.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/t/rpl_row_sp007_innodb-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_sp007_innodb-slave.opt
diff --git a/mysql-test/t/rpl_row_sp007_innodb.test b/mysql-test/suite/rpl/t/rpl_row_sp007_innodb.test
index 41af5a5f997..41af5a5f997 100644
--- a/mysql-test/t/rpl_row_sp007_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp007_innodb.test
diff --git a/mysql-test/t/rpl_row_sp008.test b/mysql-test/suite/rpl/t/rpl_row_sp008.test
index b1295820c99..b1295820c99 100644
--- a/mysql-test/t/rpl_row_sp008.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp008.test
diff --git a/mysql-test/t/rpl_row_sp009.test b/mysql-test/suite/rpl/t/rpl_row_sp009.test
index 92d47c6f50f..92d47c6f50f 100644
--- a/mysql-test/t/rpl_row_sp009.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp009.test
diff --git a/mysql-test/t/rpl_row_sp010.test b/mysql-test/suite/rpl/t/rpl_row_sp010.test
index 28b82217517..28b82217517 100644
--- a/mysql-test/t/rpl_row_sp010.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp010.test
diff --git a/mysql-test/t/rpl_row_sp011.test b/mysql-test/suite/rpl/t/rpl_row_sp011.test
index 25c2fc9ad26..25c2fc9ad26 100644
--- a/mysql-test/t/rpl_row_sp011.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp011.test
diff --git a/mysql-test/t/rpl_row_sp012.test b/mysql-test/suite/rpl/t/rpl_row_sp012.test
index 3a8d295121c..3a8d295121c 100644
--- a/mysql-test/t/rpl_row_sp012.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp012.test
diff --git a/mysql-test/t/rpl_row_stop_middle.test b/mysql-test/suite/rpl/t/rpl_row_stop_middle.test
index da363736100..da363736100 100644
--- a/mysql-test/t/rpl_row_stop_middle.test
+++ b/mysql-test/suite/rpl/t/rpl_row_stop_middle.test
diff --git a/mysql-test/t/rpl_row_stop_middle_update-master.opt b/mysql-test/suite/rpl/t/rpl_row_stop_middle_update-master.opt
index b7db8f97bdd..b7db8f97bdd 100644
--- a/mysql-test/t/rpl_row_stop_middle_update-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_stop_middle_update-master.opt
diff --git a/mysql-test/t/rpl_row_stop_middle_update-slave.opt b/mysql-test/suite/rpl/t/rpl_row_stop_middle_update-slave.opt
index ea49a27adf4..ea49a27adf4 100644
--- a/mysql-test/t/rpl_row_stop_middle_update-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_stop_middle_update-slave.opt
diff --git a/mysql-test/t/rpl_row_stop_middle_update.test b/mysql-test/suite/rpl/t/rpl_row_stop_middle_update.test
index 29b3008e822..29b3008e822 100644
--- a/mysql-test/t/rpl_row_stop_middle_update.test
+++ b/mysql-test/suite/rpl/t/rpl_row_stop_middle_update.test
diff --git a/mysql-test/t/rpl_row_tabledefs_2myisam.test b/mysql-test/suite/rpl/t/rpl_row_tabledefs_2myisam.test
index ab4914e15fa..ab4914e15fa 100644
--- a/mysql-test/t/rpl_row_tabledefs_2myisam.test
+++ b/mysql-test/suite/rpl/t/rpl_row_tabledefs_2myisam.test
diff --git a/mysql-test/t/rpl_row_tabledefs_3innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb-slave.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/t/rpl_row_tabledefs_3innodb-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb-slave.opt
diff --git a/mysql-test/t/rpl_row_tabledefs_3innodb.test b/mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb.test
index 7824fbfb663..7824fbfb663 100644
--- a/mysql-test/t/rpl_row_tabledefs_3innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb.test
diff --git a/mysql-test/t/rpl_row_trig001.test b/mysql-test/suite/rpl/t/rpl_row_trig001.test
index 7b1fca2d6a1..7b1fca2d6a1 100644
--- a/mysql-test/t/rpl_row_trig001.test
+++ b/mysql-test/suite/rpl/t/rpl_row_trig001.test
diff --git a/mysql-test/t/rpl_row_trig002.test b/mysql-test/suite/rpl/t/rpl_row_trig002.test
index 7ca8a68f060..7ca8a68f060 100644
--- a/mysql-test/t/rpl_row_trig002.test
+++ b/mysql-test/suite/rpl/t/rpl_row_trig002.test
diff --git a/mysql-test/t/rpl_row_trig003.test b/mysql-test/suite/rpl/t/rpl_row_trig003.test
index 4a1bbc5ca89..4a1bbc5ca89 100644
--- a/mysql-test/t/rpl_row_trig003.test
+++ b/mysql-test/suite/rpl/t/rpl_row_trig003.test
diff --git a/mysql-test/t/rpl_row_trig004.test b/mysql-test/suite/rpl/t/rpl_row_trig004.test
index a918c602d56..a918c602d56 100644
--- a/mysql-test/t/rpl_row_trig004.test
+++ b/mysql-test/suite/rpl/t/rpl_row_trig004.test
diff --git a/mysql-test/t/rpl_row_until.test b/mysql-test/suite/rpl/t/rpl_row_until.test
index 9464e5cfadd..9464e5cfadd 100644
--- a/mysql-test/t/rpl_row_until.test
+++ b/mysql-test/suite/rpl/t/rpl_row_until.test
diff --git a/mysql-test/t/rpl_row_view01.test b/mysql-test/suite/rpl/t/rpl_row_view01.test
index 634e3c30cc6..634e3c30cc6 100644
--- a/mysql-test/t/rpl_row_view01.test
+++ b/mysql-test/suite/rpl/t/rpl_row_view01.test
diff --git a/mysql-test/t/rpl_server_id1.test b/mysql-test/suite/rpl/t/rpl_server_id1.test
index 2db1f6e364d..2db1f6e364d 100644
--- a/mysql-test/t/rpl_server_id1.test
+++ b/mysql-test/suite/rpl/t/rpl_server_id1.test
diff --git a/mysql-test/t/rpl_server_id2-slave.opt b/mysql-test/suite/rpl/t/rpl_server_id2-slave.opt
index 302889525dd..302889525dd 100644
--- a/mysql-test/t/rpl_server_id2-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_server_id2-slave.opt
diff --git a/mysql-test/t/rpl_server_id2.test b/mysql-test/suite/rpl/t/rpl_server_id2.test
index 7e67fb42b4f..7e67fb42b4f 100644
--- a/mysql-test/t/rpl_server_id2.test
+++ b/mysql-test/suite/rpl/t/rpl_server_id2.test
diff --git a/mysql-test/t/rpl_session_var.test b/mysql-test/suite/rpl/t/rpl_session_var.test
index a6f4b496a23..a6f4b496a23 100644
--- a/mysql-test/t/rpl_session_var.test
+++ b/mysql-test/suite/rpl/t/rpl_session_var.test
diff --git a/mysql-test/t/rpl_set_charset.test b/mysql-test/suite/rpl/t/rpl_set_charset.test
index c70eb2681f5..c70eb2681f5 100644
--- a/mysql-test/t/rpl_set_charset.test
+++ b/mysql-test/suite/rpl/t/rpl_set_charset.test
diff --git a/mysql-test/t/rpl_sf.test b/mysql-test/suite/rpl/t/rpl_sf.test
index ecf91a723fa..ecf91a723fa 100644
--- a/mysql-test/t/rpl_sf.test
+++ b/mysql-test/suite/rpl/t/rpl_sf.test
diff --git a/mysql-test/t/rpl_skip_error-slave.opt b/mysql-test/suite/rpl/t/rpl_skip_error-slave.opt
index 982362d93a5..982362d93a5 100644
--- a/mysql-test/t/rpl_skip_error-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_skip_error-slave.opt
diff --git a/mysql-test/t/rpl_skip_error.test b/mysql-test/suite/rpl/t/rpl_skip_error.test
index b68b637b3b0..b68b637b3b0 100644
--- a/mysql-test/t/rpl_skip_error.test
+++ b/mysql-test/suite/rpl/t/rpl_skip_error.test
diff --git a/mysql-test/t/rpl_slave_skip.test b/mysql-test/suite/rpl/t/rpl_slave_skip.test
index b19d6a2730b..b19d6a2730b 100644
--- a/mysql-test/t/rpl_slave_skip.test
+++ b/mysql-test/suite/rpl/t/rpl_slave_skip.test
diff --git a/mysql-test/t/rpl_slave_status.test b/mysql-test/suite/rpl/t/rpl_slave_status.test
index d07cf13dcf4..d07cf13dcf4 100644
--- a/mysql-test/t/rpl_slave_status.test
+++ b/mysql-test/suite/rpl/t/rpl_slave_status.test
diff --git a/mysql-test/t/rpl_sp-master.opt b/mysql-test/suite/rpl/t/rpl_sp-master.opt
index 709a224fd92..709a224fd92 100644
--- a/mysql-test/t/rpl_sp-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_sp-master.opt
diff --git a/mysql-test/t/rpl_sp-slave.opt b/mysql-test/suite/rpl/t/rpl_sp-slave.opt
index 709a224fd92..709a224fd92 100644
--- a/mysql-test/t/rpl_sp-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_sp-slave.opt
diff --git a/mysql-test/t/rpl_sp.test b/mysql-test/suite/rpl/t/rpl_sp.test
index f363b64558a..f363b64558a 100644
--- a/mysql-test/t/rpl_sp.test
+++ b/mysql-test/suite/rpl/t/rpl_sp.test
diff --git a/mysql-test/t/rpl_sp004.test b/mysql-test/suite/rpl/t/rpl_sp004.test
index 967e7007c15..967e7007c15 100644
--- a/mysql-test/t/rpl_sp004.test
+++ b/mysql-test/suite/rpl/t/rpl_sp004.test
diff --git a/mysql-test/t/rpl_sp_effects-master.opt b/mysql-test/suite/rpl/t/rpl_sp_effects-master.opt
index 61dd7a6ad0e..61dd7a6ad0e 100644
--- a/mysql-test/t/rpl_sp_effects-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_sp_effects-master.opt
diff --git a/mysql-test/t/rpl_sp_effects-slave.opt b/mysql-test/suite/rpl/t/rpl_sp_effects-slave.opt
index 61dd7a6ad0e..61dd7a6ad0e 100644
--- a/mysql-test/t/rpl_sp_effects-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_sp_effects-slave.opt
diff --git a/mysql-test/t/rpl_sp_effects.test b/mysql-test/suite/rpl/t/rpl_sp_effects.test
index 027bfd69f36..027bfd69f36 100644
--- a/mysql-test/t/rpl_sp_effects.test
+++ b/mysql-test/suite/rpl/t/rpl_sp_effects.test
diff --git a/mysql-test/t/rpl_sporadic_master-master.opt b/mysql-test/suite/rpl/t/rpl_sporadic_master-master.opt
index 6d5b66bed61..6d5b66bed61 100644
--- a/mysql-test/t/rpl_sporadic_master-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_sporadic_master-master.opt
diff --git a/mysql-test/t/rpl_sporadic_master.test b/mysql-test/suite/rpl/t/rpl_sporadic_master.test
index 824f7abc9f5..824f7abc9f5 100644
--- a/mysql-test/t/rpl_sporadic_master.test
+++ b/mysql-test/suite/rpl/t/rpl_sporadic_master.test
diff --git a/mysql-test/t/rpl_ssl.test b/mysql-test/suite/rpl/t/rpl_ssl.test
index 4bc07ee0622..4bc07ee0622 100644
--- a/mysql-test/t/rpl_ssl.test
+++ b/mysql-test/suite/rpl/t/rpl_ssl.test
diff --git a/mysql-test/t/rpl_ssl1.test b/mysql-test/suite/rpl/t/rpl_ssl1.test
index b660c3991dd..b660c3991dd 100644
--- a/mysql-test/t/rpl_ssl1.test
+++ b/mysql-test/suite/rpl/t/rpl_ssl1.test
diff --git a/mysql-test/t/rpl_start_stop_slave.test b/mysql-test/suite/rpl/t/rpl_start_stop_slave.test
index 19988cf902a..19988cf902a 100644
--- a/mysql-test/t/rpl_start_stop_slave.test
+++ b/mysql-test/suite/rpl/t/rpl_start_stop_slave.test
diff --git a/mysql-test/t/rpl_stm_000001-slave.opt b/mysql-test/suite/rpl/t/rpl_stm_000001-slave.opt
index 48457b17309..48457b17309 100644
--- a/mysql-test/t/rpl_stm_000001-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_stm_000001-slave.opt
diff --git a/mysql-test/t/rpl_stm_000001.test b/mysql-test/suite/rpl/t/rpl_stm_000001.test
index aee067b2d4a..aee067b2d4a 100644
--- a/mysql-test/t/rpl_stm_000001.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_000001.test
diff --git a/mysql-test/t/rpl_stm_EE_err2.test b/mysql-test/suite/rpl/t/rpl_stm_EE_err2.test
index face651b9a1..face651b9a1 100644
--- a/mysql-test/t/rpl_stm_EE_err2.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_EE_err2.test
diff --git a/mysql-test/t/rpl_stm_charset.test b/mysql-test/suite/rpl/t/rpl_stm_charset.test
index b103a47d78c..b103a47d78c 100644
--- a/mysql-test/t/rpl_stm_charset.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_charset.test
diff --git a/mysql-test/t/rpl_stm_flsh_tbls.test b/mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test
index a8a33d05e8b..a8a33d05e8b 100644
--- a/mysql-test/t/rpl_stm_flsh_tbls.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test
diff --git a/mysql-test/t/rpl_stm_insert_delayed.test b/mysql-test/suite/rpl/t/rpl_stm_insert_delayed.test
index d55e3a4da2c..d55e3a4da2c 100644
--- a/mysql-test/t/rpl_stm_insert_delayed.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_insert_delayed.test
diff --git a/mysql-test/t/rpl_stm_log-master.opt b/mysql-test/suite/rpl/t/rpl_stm_log-master.opt
index cef79bc8585..cef79bc8585 100644
--- a/mysql-test/t/rpl_stm_log-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_stm_log-master.opt
diff --git a/mysql-test/t/rpl_stm_log-slave.opt b/mysql-test/suite/rpl/t/rpl_stm_log-slave.opt
index 8b137891791..8b137891791 100644
--- a/mysql-test/t/rpl_stm_log-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_stm_log-slave.opt
diff --git a/mysql-test/t/rpl_stm_log.test b/mysql-test/suite/rpl/t/rpl_stm_log.test
index 2af9d7f85bc..2af9d7f85bc 100644
--- a/mysql-test/t/rpl_stm_log.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_log.test
diff --git a/mysql-test/t/rpl_stm_max_relay_size.test b/mysql-test/suite/rpl/t/rpl_stm_max_relay_size.test
index 950aa8b322a..950aa8b322a 100644
--- a/mysql-test/t/rpl_stm_max_relay_size.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_max_relay_size.test
diff --git a/mysql-test/t/rpl_stm_multi_query.test b/mysql-test/suite/rpl/t/rpl_stm_multi_query.test
index c39d1fad015..c39d1fad015 100644
--- a/mysql-test/t/rpl_stm_multi_query.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_multi_query.test
diff --git a/mysql-test/t/rpl_stm_mystery22.test b/mysql-test/suite/rpl/t/rpl_stm_mystery22.test
index 017593fdfba..017593fdfba 100644
--- a/mysql-test/t/rpl_stm_mystery22.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_mystery22.test
diff --git a/mysql-test/t/rpl_stm_no_op.test b/mysql-test/suite/rpl/t/rpl_stm_no_op.test
index 66dc89bd712..66dc89bd712 100644
--- a/mysql-test/t/rpl_stm_no_op.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_no_op.test
diff --git a/mysql-test/t/rpl_stm_reset_slave.test b/mysql-test/suite/rpl/t/rpl_stm_reset_slave.test
index 6a99d4e1613..6a99d4e1613 100644
--- a/mysql-test/t/rpl_stm_reset_slave.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_reset_slave.test
diff --git a/mysql-test/t/rpl_stm_until.test b/mysql-test/suite/rpl/t/rpl_stm_until.test
index 98e7e0e5eac..98e7e0e5eac 100644
--- a/mysql-test/t/rpl_stm_until.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_until.test
diff --git a/mysql-test/t/rpl_switch_stm_row_mixed.test b/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test
index b0012827db8..b0012827db8 100644
--- a/mysql-test/t/rpl_switch_stm_row_mixed.test
+++ b/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test
diff --git a/mysql-test/t/rpl_temp_table.test b/mysql-test/suite/rpl/t/rpl_temp_table.test
index 9b73961aeea..9b73961aeea 100644
--- a/mysql-test/t/rpl_temp_table.test
+++ b/mysql-test/suite/rpl/t/rpl_temp_table.test
diff --git a/mysql-test/t/rpl_temporary.test b/mysql-test/suite/rpl/t/rpl_temporary.test
index 09b8b83f25f..09b8b83f25f 100644
--- a/mysql-test/t/rpl_temporary.test
+++ b/mysql-test/suite/rpl/t/rpl_temporary.test
diff --git a/mysql-test/t/rpl_timezone-master.opt b/mysql-test/suite/rpl/t/rpl_timezone-master.opt
index 8e43bfbbb7e..8e43bfbbb7e 100644
--- a/mysql-test/t/rpl_timezone-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_timezone-master.opt
diff --git a/mysql-test/t/rpl_timezone-slave.opt b/mysql-test/suite/rpl/t/rpl_timezone-slave.opt
index 191182c329c..191182c329c 100644
--- a/mysql-test/t/rpl_timezone-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_timezone-slave.opt
diff --git a/mysql-test/t/rpl_timezone.test b/mysql-test/suite/rpl/t/rpl_timezone.test
index 4b8c8152c82..4b8c8152c82 100644
--- a/mysql-test/t/rpl_timezone.test
+++ b/mysql-test/suite/rpl/t/rpl_timezone.test
diff --git a/mysql-test/t/rpl_trigger.test b/mysql-test/suite/rpl/t/rpl_trigger.test
index 9f5f6fc9b4c..9f5f6fc9b4c 100644
--- a/mysql-test/t/rpl_trigger.test
+++ b/mysql-test/suite/rpl/t/rpl_trigger.test
diff --git a/mysql-test/t/rpl_trunc_temp.test b/mysql-test/suite/rpl/t/rpl_trunc_temp.test
index 28bcb0c06c3..28bcb0c06c3 100644
--- a/mysql-test/t/rpl_trunc_temp.test
+++ b/mysql-test/suite/rpl/t/rpl_trunc_temp.test
diff --git a/mysql-test/t/rpl_truncate_2myisam.test b/mysql-test/suite/rpl/t/rpl_truncate_2myisam.test
index a0f0ea04f44..a0f0ea04f44 100644
--- a/mysql-test/t/rpl_truncate_2myisam.test
+++ b/mysql-test/suite/rpl/t/rpl_truncate_2myisam.test
diff --git a/mysql-test/t/rpl_truncate_3innodb.test b/mysql-test/suite/rpl/t/rpl_truncate_3innodb.test
index a31fd62a29a..a31fd62a29a 100644
--- a/mysql-test/t/rpl_truncate_3innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_truncate_3innodb.test
diff --git a/mysql-test/t/rpl_truncate_7ndb_2-master.opt b/mysql-test/suite/rpl/t/rpl_truncate_7ndb_2-master.opt
index 01cf3e0520f..01cf3e0520f 100644
--- a/mysql-test/t/rpl_truncate_7ndb_2-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_truncate_7ndb_2-master.opt
diff --git a/mysql-test/t/rpl_truncate_7ndb_2.test b/mysql-test/suite/rpl/t/rpl_truncate_7ndb_2.test
index 4ee6c98d463..4ee6c98d463 100644
--- a/mysql-test/t/rpl_truncate_7ndb_2.test
+++ b/mysql-test/suite/rpl/t/rpl_truncate_7ndb_2.test
diff --git a/mysql-test/t/rpl_udf-master.opt b/mysql-test/suite/rpl/t/rpl_udf-master.opt
index 7d8786c156a..7d8786c156a 100644
--- a/mysql-test/t/rpl_udf-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_udf-master.opt
diff --git a/mysql-test/t/rpl_udf-slave.opt b/mysql-test/suite/rpl/t/rpl_udf-slave.opt
index 7d8786c156a..7d8786c156a 100644
--- a/mysql-test/t/rpl_udf-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_udf-slave.opt
diff --git a/mysql-test/t/rpl_udf.test b/mysql-test/suite/rpl/t/rpl_udf.test
index 262ad04630c..262ad04630c 100644
--- a/mysql-test/t/rpl_udf.test
+++ b/mysql-test/suite/rpl/t/rpl_udf.test
diff --git a/mysql-test/t/rpl_user_variables.test b/mysql-test/suite/rpl/t/rpl_user_variables.test
index 539f9c88e0d..539f9c88e0d 100644
--- a/mysql-test/t/rpl_user_variables.test
+++ b/mysql-test/suite/rpl/t/rpl_user_variables.test
diff --git a/mysql-test/t/rpl_variables-master.opt b/mysql-test/suite/rpl/t/rpl_variables-master.opt
index a668c6bfbe8..a668c6bfbe8 100644
--- a/mysql-test/t/rpl_variables-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_variables-master.opt
diff --git a/mysql-test/t/rpl_variables.test b/mysql-test/suite/rpl/t/rpl_variables.test
index 84dc3acfe6e..84dc3acfe6e 100644
--- a/mysql-test/t/rpl_variables.test
+++ b/mysql-test/suite/rpl/t/rpl_variables.test
diff --git a/mysql-test/t/rpl_view-slave.opt b/mysql-test/suite/rpl/t/rpl_view-slave.opt
index 79b3bf6174b..79b3bf6174b 100644
--- a/mysql-test/t/rpl_view-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_view-slave.opt
diff --git a/mysql-test/t/rpl_view.test b/mysql-test/suite/rpl/t/rpl_view.test
index 51ad319b212..51ad319b212 100644
--- a/mysql-test/t/rpl_view.test
+++ b/mysql-test/suite/rpl/t/rpl_view.test
diff --git a/mysql-test/r/rpl_ndb_2innodb.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_2innodb.result
index f8ec4624062..f8ec4624062 100644
--- a/mysql-test/r/rpl_ndb_2innodb.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_2innodb.result
diff --git a/mysql-test/r/rpl_ndb_2myisam.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_2myisam.result
index 8611d83f3f3..8611d83f3f3 100644
--- a/mysql-test/r/rpl_ndb_2myisam.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_2myisam.result
diff --git a/mysql-test/r/rpl_ndb_UUID.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_UUID.result
index 6babf49dcaa..6babf49dcaa 100644
--- a/mysql-test/r/rpl_ndb_UUID.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_UUID.result
diff --git a/mysql-test/r/rpl_ndb_auto_inc.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_auto_inc.result
index dd4cc90a75f..dd4cc90a75f 100644
--- a/mysql-test/r/rpl_ndb_auto_inc.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_auto_inc.result
diff --git a/mysql-test/r/rpl_ndb_bank.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_bank.result
index 06c005427d1..06c005427d1 100644
--- a/mysql-test/r/rpl_ndb_bank.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_bank.result
diff --git a/mysql-test/r/rpl_ndb_basic.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result
index b5b3dc6b66c..b5b3dc6b66c 100644
--- a/mysql-test/r/rpl_ndb_basic.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result
diff --git a/mysql-test/r/rpl_ndb_blob.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_blob.result
index c11de8c27e3..c11de8c27e3 100644
--- a/mysql-test/r/rpl_ndb_blob.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_blob.result
diff --git a/mysql-test/r/rpl_ndb_blob2.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_blob2.result
index 055efffbd6a..055efffbd6a 100644
--- a/mysql-test/r/rpl_ndb_blob2.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_blob2.result
diff --git a/mysql-test/r/rpl_ndb_charset.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_charset.result
index ed9b3cfbfa8..ed9b3cfbfa8 100644
--- a/mysql-test/r/rpl_ndb_charset.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_charset.result
diff --git a/mysql-test/r/rpl_ndb_circular.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result
index e4b5e9b9216..e4b5e9b9216 100644
--- a/mysql-test/r/rpl_ndb_circular.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result
diff --git a/mysql-test/r/rpl_ndb_circular_simplex.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result
index ee452f345f9..ee452f345f9 100644
--- a/mysql-test/r/rpl_ndb_circular_simplex.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result
diff --git a/mysql-test/r/rpl_ndb_commit_afterflush.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_commit_afterflush.result
index 3fc4ca26967..3fc4ca26967 100644
--- a/mysql-test/r/rpl_ndb_commit_afterflush.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_commit_afterflush.result
diff --git a/mysql-test/r/rpl_ndb_ctype_ucs2_def.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_ctype_ucs2_def.result
index 2f9dc4ae616..2f9dc4ae616 100644
--- a/mysql-test/r/rpl_ndb_ctype_ucs2_def.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_ctype_ucs2_def.result
diff --git a/mysql-test/r/rpl_ndb_dd_advance.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_advance.result
index 7f26313894c..7f26313894c 100644
--- a/mysql-test/r/rpl_ndb_dd_advance.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_advance.result
diff --git a/mysql-test/r/rpl_ndb_dd_basic.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_basic.result
index 6a0c863440e..6a0c863440e 100644
--- a/mysql-test/r/rpl_ndb_dd_basic.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_basic.result
diff --git a/mysql-test/r/rpl_ndb_dd_partitions.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_partitions.result
index 298f45b5cee..298f45b5cee 100644
--- a/mysql-test/r/rpl_ndb_dd_partitions.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_partitions.result
diff --git a/mysql-test/r/rpl_ndb_ddl.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_ddl.result
index aeaca1e7de0..aeaca1e7de0 100644
--- a/mysql-test/r/rpl_ndb_ddl.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_ddl.result
diff --git a/mysql-test/r/rpl_ndb_delete_nowhere.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_delete_nowhere.result
index 1cecb030181..1cecb030181 100644
--- a/mysql-test/r/rpl_ndb_delete_nowhere.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_delete_nowhere.result
diff --git a/mysql-test/r/rpl_ndb_do_db.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_do_db.result
index 316f5fc7e31..316f5fc7e31 100644
--- a/mysql-test/r/rpl_ndb_do_db.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_do_db.result
diff --git a/mysql-test/r/rpl_ndb_do_table.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_do_table.result
index dda2844f6d0..dda2844f6d0 100644
--- a/mysql-test/r/rpl_ndb_do_table.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_do_table.result
diff --git a/mysql-test/r/rpl_ndb_extraCol.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result
index 5afc9c1db77..edb4dfbf392 100644
--- a/mysql-test/r/rpl_ndb_extraCol.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result
@@ -72,7 +72,7 @@ Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
-Last_Errno 1523
+Last_Errno 1532
Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3
Skip_Counter 0
Exec_Master_Log_Pos #
@@ -90,7 +90,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
-Last_SQL_Errno 1523
+Last_SQL_Errno 1532
Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -134,7 +134,7 @@ Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
-Last_Errno 1523
+Last_Errno 1532
Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3
Skip_Counter 0
Exec_Master_Log_Pos #
@@ -152,7 +152,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
-Last_SQL_Errno 1523
+Last_SQL_Errno 1532
Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -196,7 +196,7 @@ Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
-Last_Errno 1523
+Last_Errno 1532
Last_Error Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246
Skip_Counter 0
Exec_Master_Log_Pos #
@@ -214,7 +214,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
-Last_SQL_Errno 1523
+Last_SQL_Errno 1532
Last_SQL_Error Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -257,7 +257,7 @@ Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
-Last_Errno 1523
+Last_Errno 1532
Last_Error Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3
Skip_Counter 0
Exec_Master_Log_Pos #
@@ -275,7 +275,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
-Last_SQL_Errno 1523
+Last_SQL_Errno 1532
Last_SQL_Error Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3;
*** Drop t6 ***
@@ -369,7 +369,7 @@ Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
-Last_Errno 1523
+Last_Errno 1532
Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5
Skip_Counter 0
Exec_Master_Log_Pos #
@@ -387,7 +387,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
-Last_SQL_Errno 1523
+Last_SQL_Errno 1532
Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -430,7 +430,7 @@ Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
-Last_Errno 1523
+Last_Errno 1532
Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252
Skip_Counter 0
Exec_Master_Log_Pos #
@@ -448,7 +448,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
-Last_SQL_Errno 1523
+Last_SQL_Errno 1532
Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
@@ -756,7 +756,7 @@ Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
-Last_Errno 1523
+Last_Errno 1532
Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2
Skip_Counter 0
Exec_Master_Log_Pos #
@@ -774,7 +774,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
-Last_SQL_Errno 1523
+Last_SQL_Errno 1532
Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
diff --git a/mysql-test/r/rpl_ndb_func003.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_func003.result
index ad72a3fb244..ad72a3fb244 100644
--- a/mysql-test/r/rpl_ndb_func003.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_func003.result
diff --git a/mysql-test/r/rpl_ndb_idempotent.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_idempotent.result
index e2fee391bab..e2fee391bab 100644
--- a/mysql-test/r/rpl_ndb_idempotent.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_idempotent.result
diff --git a/mysql-test/r/rpl_ndb_innodb_trans.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb_trans.result
index 148e6247b03..148e6247b03 100644
--- a/mysql-test/r/rpl_ndb_innodb_trans.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb_trans.result
diff --git a/mysql-test/r/rpl_ndb_insert_ignore.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_insert_ignore.result
index 030845e89e2..030845e89e2 100644
--- a/mysql-test/r/rpl_ndb_insert_ignore.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_insert_ignore.result
diff --git a/mysql-test/r/rpl_ndb_load.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_load.result
index e51f0096557..e51f0096557 100644
--- a/mysql-test/r/rpl_ndb_load.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_load.result
diff --git a/mysql-test/r/rpl_ndb_log.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result
index 355c7c16ae2..355c7c16ae2 100644
--- a/mysql-test/r/rpl_ndb_log.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result
diff --git a/mysql-test/r/rpl_ndb_mix_innodb.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_mix_innodb.result
index 625d06de44b..625d06de44b 100644
--- a/mysql-test/r/rpl_ndb_mix_innodb.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_mix_innodb.result
diff --git a/mysql-test/r/rpl_ndb_multi.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi.result
index 760114f3639..760114f3639 100644
--- a/mysql-test/r/rpl_ndb_multi.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi.result
diff --git a/mysql-test/r/rpl_ndb_multi_update2.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update2.result
index 5d00ae6598c..5d00ae6598c 100644
--- a/mysql-test/r/rpl_ndb_multi_update2.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update2.result
diff --git a/mysql-test/r/rpl_ndb_multi_update3.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update3.result
index dc4e11c9c9e..dc4e11c9c9e 100644
--- a/mysql-test/r/rpl_ndb_multi_update3.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update3.result
diff --git a/mysql-test/r/rpl_ndb_relayrotate.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_relayrotate.result
index 6aa64973611..6aa64973611 100644
--- a/mysql-test/r/rpl_ndb_relayrotate.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_relayrotate.result
diff --git a/mysql-test/r/rpl_ndb_rep_ignore.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_rep_ignore.result
index 4e28a7e5865..4e28a7e5865 100644
--- a/mysql-test/r/rpl_ndb_rep_ignore.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_rep_ignore.result
diff --git a/mysql-test/r/rpl_ndb_row_001.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_row_001.result
index 56bb31e329d..56bb31e329d 100644
--- a/mysql-test/r/rpl_ndb_row_001.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_row_001.result
diff --git a/mysql-test/r/rpl_ndb_sp003.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_sp003.result
index d7922c61b52..d7922c61b52 100644
--- a/mysql-test/r/rpl_ndb_sp003.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_sp003.result
diff --git a/mysql-test/r/rpl_ndb_sp006.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_sp006.result
index 482d43c8f10..482d43c8f10 100644
--- a/mysql-test/r/rpl_ndb_sp006.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_sp006.result
diff --git a/mysql-test/r/rpl_ndb_stm_innodb.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_stm_innodb.result
index 426a09f945c..426a09f945c 100644
--- a/mysql-test/r/rpl_ndb_stm_innodb.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_stm_innodb.result
diff --git a/mysql-test/r/rpl_ndb_sync.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result
index f2a1ba410b9..f2a1ba410b9 100644
--- a/mysql-test/r/rpl_ndb_sync.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result
diff --git a/mysql-test/r/rpl_ndb_trig004.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_trig004.result
index ba5f0dea91c..ba5f0dea91c 100644
--- a/mysql-test/r/rpl_ndb_trig004.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_trig004.result
diff --git a/mysql-test/r/rpl_ndbapi_multi.result b/mysql-test/suite/rpl_ndb/r/rpl_ndbapi_multi.result
index 5de6914882d..5de6914882d 100644
--- a/mysql-test/r/rpl_ndbapi_multi.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndbapi_multi.result
diff --git a/mysql-test/r/rpl_row_basic_7ndb.result b/mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result
index 5519e0dcd0c..5519e0dcd0c 100644
--- a/mysql-test/r/rpl_row_basic_7ndb.result
+++ b/mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb.result b/mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb.result
new file mode 100644
index 00000000000..602c4d55ac5
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb.result
@@ -0,0 +1,95 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+**** On Master ****
+CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB;
+INSERT INTO t1 VALUES (1,1), (2,2);
+SELECT * FROM t1 ORDER BY a,b;
+a b
+1 1
+2 2
+**** On Slave ****
+INSERT INTO t1 VALUE (3,3);
+SELECT * FROM t1 ORDER BY a,b;
+a b
+1 1
+2 2
+3 3
+**** On Master ****
+TRUNCATE TABLE t1;
+SELECT * FROM t1 ORDER BY a,b;
+a b
+**** On Slave ****
+SELECT * FROM t1 ORDER BY a,b;
+a b
+**** On Master ****
+DROP TABLE t1;
+SHOW BINLOG EVENTS;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4
+master-bin.000001 106 Query 1 223 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
+master-bin.000001 223 Query 1 287 BEGIN
+master-bin.000001 287 Table_map 1 327 table_id: # (test.t1)
+master-bin.000001 327 Table_map 1 385 table_id: # (mysql.ndb_apply_status)
+master-bin.000001 385 Write_rows 1 444 table_id: #
+master-bin.000001 444 Write_rows 1 482 table_id: #
+master-bin.000001 482 Write_rows 1 520 table_id: # flags: STMT_END_F
+master-bin.000001 520 Query 1 585 COMMIT
+master-bin.000001 585 Query 1 665 use `test`; TRUNCATE TABLE t1
+master-bin.000001 665 Query 1 741 use `test`; DROP TABLE t1
+**** On Master ****
+CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB;
+INSERT INTO t1 VALUES (1,1), (2,2);
+SELECT * FROM t1 ORDER BY a,b;
+a b
+1 1
+2 2
+**** On Slave ****
+INSERT INTO t1 VALUE (3,3);
+SELECT * FROM t1 ORDER BY a,b;
+a b
+1 1
+2 2
+3 3
+**** On Master ****
+DELETE FROM t1;
+SELECT * FROM t1 ORDER BY a,b;
+a b
+**** On Slave ****
+SELECT * FROM t1 ORDER BY a,b;
+a b
+3 3
+**** On Master ****
+DROP TABLE t1;
+SHOW BINLOG EVENTS;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4
+master-bin.000001 106 Query 1 223 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
+master-bin.000001 223 Query 1 287 BEGIN
+master-bin.000001 287 Table_map 1 327 table_id: # (test.t1)
+master-bin.000001 327 Table_map 1 385 table_id: # (mysql.ndb_apply_status)
+master-bin.000001 385 Write_rows 1 444 table_id: #
+master-bin.000001 444 Write_rows 1 482 table_id: #
+master-bin.000001 482 Write_rows 1 520 table_id: # flags: STMT_END_F
+master-bin.000001 520 Query 1 585 COMMIT
+master-bin.000001 585 Query 1 665 use `test`; TRUNCATE TABLE t1
+master-bin.000001 665 Query 1 741 use `test`; DROP TABLE t1
+master-bin.000001 741 Query 1 858 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
+master-bin.000001 858 Query 1 922 BEGIN
+master-bin.000001 922 Table_map 1 962 table_id: # (test.t1)
+master-bin.000001 962 Table_map 1 1020 table_id: # (mysql.ndb_apply_status)
+master-bin.000001 1020 Write_rows 1 1079 table_id: #
+master-bin.000001 1079 Write_rows 1 1117 table_id: #
+master-bin.000001 1117 Write_rows 1 1155 table_id: # flags: STMT_END_F
+master-bin.000001 1155 Query 1 1220 COMMIT
+master-bin.000001 1220 Query 1 1284 BEGIN
+master-bin.000001 1284 Table_map 1 1324 table_id: # (test.t1)
+master-bin.000001 1324 Table_map 1 1382 table_id: # (mysql.ndb_apply_status)
+master-bin.000001 1382 Write_rows 1 1441 table_id: #
+master-bin.000001 1441 Delete_rows 1 1475 table_id: #
+master-bin.000001 1475 Delete_rows 1 1509 table_id: # flags: STMT_END_F
+master-bin.000001 1509 Query 1 1574 COMMIT
+master-bin.000001 1574 Query 1 1650 use `test`; DROP TABLE t1
diff --git a/mysql-test/suite/rpl_ndb/t/disabled.def b/mysql-test/suite/rpl_ndb/t/disabled.def
new file mode 100644
index 00000000000..a1e6cef6fca
--- /dev/null
+++ b/mysql-test/suite/rpl_ndb/t/disabled.def
@@ -0,0 +1,29 @@
+##############################################################################
+#
+# List the test cases that are to be disabled temporarily.
+#
+# Separate the test case name and the comment with ':'.
+#
+# <testcasename> : BUG#<xxxx> <date disabled> <disabler> <comment>
+#
+# Do not use any TAB characters for whitespace.
+#
+##############################################################################
+
+
+rpl_ndb_circular_simplex : BUG#27972 2007-04-20 mats Slave cannot start where it stopped
+rpl_ndb_2innodb : BUG#19227 2006-04-20 pekka pk delete apparently not replicated
+rpl_ndb_2myisam : BUG#19227 Seems to pass currently
+rpl_ndb_dd_partitions : BUG#19259 2006-04-21 rpl_ndb_dd_partitions fails on s/AMD
+rpl_ndb_innodb2ndb : Bug#29549 rpl_ndb_myisam2ndb,rpl_ndb_innodb2ndb failed on Solaris for pack_length issue
+rpl_ndb_myisam2ndb : Bug#29549 rpl_ndb_myisam2ndb,rpl_ndb_innodb2ndb failed on Solaris for pack_length issue
+rpl_ndb_ddl : BUG#28798 2007-05-31 lars Valgrind failure in NDB
+rpl_ndb_mix_innodb : BUG#28123 rpl_ndb_mix_innodb.test casue slave to core on sol10-sparc-a
+rpl_ndb_ctype_ucs2_def : BUG#27404 util thd mysql_parse sig11 when mysqld default multibyte charset
+
+
+# the below testcase have been reworked to avoid the bug, test contains comment, keep bug open
+
+#rpl_ndb_dd_advance : Bug#25913 rpl_ndb_dd_advance fails randomly
+rpl_ndb_extraCol : Bug#29809 2007-07-15 ingo Slave SQL errors in warnings file
+rpl_truncate_7ndb : Bug#29809 2007-07-15 ingo Slave SQL errors in warnings file
diff --git a/mysql-test/t/rpl_ndb_2innodb-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb-master.opt
index 701dddb075b..701dddb075b 100644
--- a/mysql-test/t/rpl_ndb_2innodb-master.opt
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb-master.opt
diff --git a/mysql-test/t/rpl_ndb_2innodb-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb-slave.opt
index d8857e54be2..d8857e54be2 100644
--- a/mysql-test/t/rpl_ndb_2innodb-slave.opt
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb-slave.opt
diff --git a/mysql-test/t/rpl_ndb_2innodb.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test
index 30e4e49eb7a..30e4e49eb7a 100644
--- a/mysql-test/t/rpl_ndb_2innodb.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test
diff --git a/mysql-test/t/rpl_ndb_2myisam-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam-master.opt
index 701dddb075b..701dddb075b 100644
--- a/mysql-test/t/rpl_ndb_2myisam-master.opt
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam-master.opt
diff --git a/mysql-test/t/rpl_ndb_2myisam-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam-slave.opt
index 6035ce27c46..6035ce27c46 100644
--- a/mysql-test/t/rpl_ndb_2myisam-slave.opt
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam-slave.opt
diff --git a/mysql-test/t/rpl_ndb_2myisam.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test
index 182d4c72d87..182d4c72d87 100644
--- a/mysql-test/t/rpl_ndb_2myisam.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test
diff --git a/mysql-test/t/rpl_ndb_UUID.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_UUID.test
index ea623a06fd1..ea623a06fd1 100644
--- a/mysql-test/t/rpl_ndb_UUID.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_UUID.test
diff --git a/mysql-test/t/rpl_ndb_auto_inc.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_auto_inc.test
index 5e0584e332a..5e0584e332a 100644
--- a/mysql-test/t/rpl_ndb_auto_inc.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_auto_inc.test
diff --git a/mysql-test/t/rpl_ndb_bank.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_bank.test
index ce951f01212..ce951f01212 100644
--- a/mysql-test/t/rpl_ndb_bank.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_bank.test
diff --git a/mysql-test/t/rpl_ndb_basic.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test
index ea7d80aef50..ea7d80aef50 100644
--- a/mysql-test/t/rpl_ndb_basic.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test
diff --git a/mysql-test/t/rpl_ndb_blob.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_blob.test
index 181d225d3c0..181d225d3c0 100644
--- a/mysql-test/t/rpl_ndb_blob.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_blob.test
diff --git a/mysql-test/t/rpl_ndb_blob2.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_blob2.test
index 64f6f5e4f42..64f6f5e4f42 100644
--- a/mysql-test/t/rpl_ndb_blob2.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_blob2.test
diff --git a/mysql-test/t/rpl_ndb_charset.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_charset.test
index 4bac267443e..4bac267443e 100644
--- a/mysql-test/t/rpl_ndb_charset.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_charset.test
diff --git a/mysql-test/t/rpl_ndb_circular.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test
index 62583188e34..62583188e34 100644
--- a/mysql-test/t/rpl_ndb_circular.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test
diff --git a/mysql-test/t/rpl_ndb_circular_simplex.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test
index b24dab4b6fe..b24dab4b6fe 100644
--- a/mysql-test/t/rpl_ndb_circular_simplex.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test
diff --git a/mysql-test/t/rpl_ndb_commit_afterflush.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_commit_afterflush.test
index 7adb62d5668..7adb62d5668 100644
--- a/mysql-test/t/rpl_ndb_commit_afterflush.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_commit_afterflush.test
diff --git a/mysql-test/t/rpl_ndb_ctype_ucs2_def-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def-master.opt
index 84d2a52b639..84d2a52b639 100644
--- a/mysql-test/t/rpl_ndb_ctype_ucs2_def-master.opt
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def-master.opt
diff --git a/mysql-test/t/rpl_ndb_ctype_ucs2_def.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def.test
index be7fd1acd2e..be7fd1acd2e 100644
--- a/mysql-test/t/rpl_ndb_ctype_ucs2_def.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def.test
diff --git a/mysql-test/t/rpl_ndb_dd_advance.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_advance.test
index a7e00262f5c..a7e00262f5c 100644
--- a/mysql-test/t/rpl_ndb_dd_advance.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_advance.test
diff --git a/mysql-test/t/rpl_ndb_dd_basic.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_basic.test
index ac0ab01f8dd..ac0ab01f8dd 100644
--- a/mysql-test/t/rpl_ndb_dd_basic.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_basic.test
diff --git a/mysql-test/t/rpl_ndb_dd_partitions.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_partitions.test
index c84854e89e8..c84854e89e8 100644
--- a/mysql-test/t/rpl_ndb_dd_partitions.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_partitions.test
diff --git a/mysql-test/t/rpl_ndb_ddl.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_ddl.test
index 654d1c08944..654d1c08944 100644
--- a/mysql-test/t/rpl_ndb_ddl.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_ddl.test
diff --git a/mysql-test/t/rpl_ndb_delete_nowhere.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_delete_nowhere.test
index bbd67e4d8d2..bbd67e4d8d2 100644
--- a/mysql-test/t/rpl_ndb_delete_nowhere.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_delete_nowhere.test
diff --git a/mysql-test/t/rpl_ndb_do_db-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db-slave.opt
index fb5e378b65f..fb5e378b65f 100644
--- a/mysql-test/t/rpl_ndb_do_db-slave.opt
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db-slave.opt
diff --git a/mysql-test/t/rpl_ndb_do_db.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db.test
index c0f85dd8981..c0f85dd8981 100644
--- a/mysql-test/t/rpl_ndb_do_db.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db.test
diff --git a/mysql-test/t/rpl_ndb_do_table-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table-slave.opt
index da345474216..da345474216 100644
--- a/mysql-test/t/rpl_ndb_do_table-slave.opt
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table-slave.opt
diff --git a/mysql-test/t/rpl_ndb_do_table.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table.test
index 3f46c6fbda4..3f46c6fbda4 100644
--- a/mysql-test/t/rpl_ndb_do_table.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table.test
diff --git a/mysql-test/t/rpl_ndb_extraCol.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_extraCol.test
index 9cf4f8dba0b..9cf4f8dba0b 100644
--- a/mysql-test/t/rpl_ndb_extraCol.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_extraCol.test
diff --git a/mysql-test/t/rpl_ndb_func003.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_func003.test
index 90315a01150..90315a01150 100644
--- a/mysql-test/t/rpl_ndb_func003.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_func003.test
diff --git a/mysql-test/t/rpl_ndb_idempotent.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_idempotent.test
index 3133ad34f0c..3133ad34f0c 100644
--- a/mysql-test/t/rpl_ndb_idempotent.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_idempotent.test
diff --git a/mysql-test/t/rpl_ndb_innodb2ndb-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb-master.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/t/rpl_ndb_innodb2ndb-master.opt
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb-master.opt
diff --git a/mysql-test/t/rpl_ndb_innodb2ndb-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb-slave.opt
index 7f9eb96dff1..7f9eb96dff1 100644
--- a/mysql-test/t/rpl_ndb_innodb2ndb-slave.opt
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb-slave.opt
diff --git a/mysql-test/t/rpl_ndb_innodb2ndb.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb.test
index 8f67802c055..8f67802c055 100644
--- a/mysql-test/t/rpl_ndb_innodb2ndb.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb.test
diff --git a/mysql-test/t/rpl_ndb_innodb_trans-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans-slave.opt
index 627becdbfb5..627becdbfb5 100644
--- a/mysql-test/t/rpl_ndb_innodb_trans-slave.opt
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans-slave.opt
diff --git a/mysql-test/t/rpl_ndb_innodb_trans.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans.test
index 63c5c5e93e3..63c5c5e93e3 100644
--- a/mysql-test/t/rpl_ndb_innodb_trans.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans.test
diff --git a/mysql-test/t/rpl_ndb_insert_ignore.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_insert_ignore.test
index 3ef360e3fdf..3ef360e3fdf 100644
--- a/mysql-test/t/rpl_ndb_insert_ignore.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_insert_ignore.test
diff --git a/mysql-test/t/rpl_ndb_load.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_load.test
index a695eee3221..a695eee3221 100644
--- a/mysql-test/t/rpl_ndb_load.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_load.test
diff --git a/mysql-test/t/rpl_ndb_log-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_log-master.opt
index e0d075c3fbd..e0d075c3fbd 100644
--- a/mysql-test/t/rpl_ndb_log-master.opt
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_log-master.opt
diff --git a/mysql-test/t/rpl_ndb_log.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_log.test
index d32a05bf92a..d32a05bf92a 100644
--- a/mysql-test/t/rpl_ndb_log.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_log.test
diff --git a/mysql-test/t/rpl_ndb_mix_innodb-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mix_innodb-master.opt
index 3596fc4d3bd..3596fc4d3bd 100644
--- a/mysql-test/t/rpl_ndb_mix_innodb-master.opt
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mix_innodb-master.opt
diff --git a/mysql-test/t/rpl_ndb_mix_innodb.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mix_innodb.test
index b730bcc08e0..b730bcc08e0 100644
--- a/mysql-test/t/rpl_ndb_mix_innodb.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mix_innodb.test
diff --git a/mysql-test/t/rpl_ndb_multi.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi.test
index dacb1307a7b..dacb1307a7b 100644
--- a/mysql-test/t/rpl_ndb_multi.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi.test
diff --git a/mysql-test/t/rpl_ndb_multi_update2-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update2-slave.opt
index 17d4171af0e..17d4171af0e 100644
--- a/mysql-test/t/rpl_ndb_multi_update2-slave.opt
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update2-slave.opt
diff --git a/mysql-test/t/rpl_ndb_multi_update2.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update2.test
index 6b86f8146f8..6b86f8146f8 100644
--- a/mysql-test/t/rpl_ndb_multi_update2.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update2.test
diff --git a/mysql-test/t/rpl_ndb_multi_update3.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update3.test
index 3e7042a0cfa..3e7042a0cfa 100644
--- a/mysql-test/t/rpl_ndb_multi_update3.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update3.test
diff --git a/mysql-test/t/rpl_ndb_myisam2ndb-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb-master.opt
index 83ed8522e72..83ed8522e72 100644
--- a/mysql-test/t/rpl_ndb_myisam2ndb-master.opt
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb-master.opt
diff --git a/mysql-test/t/rpl_ndb_myisam2ndb-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb-slave.opt
index 7f9eb96dff1..7f9eb96dff1 100644
--- a/mysql-test/t/rpl_ndb_myisam2ndb-slave.opt
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb-slave.opt
diff --git a/mysql-test/t/rpl_ndb_myisam2ndb.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb.test
index 2ed151b7a87..2ed151b7a87 100644
--- a/mysql-test/t/rpl_ndb_myisam2ndb.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb.test
diff --git a/mysql-test/t/rpl_ndb_relayrotate-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_relayrotate-slave.opt
index cf4319f2b40..cf4319f2b40 100644
--- a/mysql-test/t/rpl_ndb_relayrotate-slave.opt
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_relayrotate-slave.opt
diff --git a/mysql-test/t/rpl_ndb_relayrotate.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_relayrotate.test
index b0b9dd9e7da..b0b9dd9e7da 100644
--- a/mysql-test/t/rpl_ndb_relayrotate.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_relayrotate.test
diff --git a/mysql-test/t/rpl_ndb_rep_ignore-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore-slave.opt
index 6262cf451a6..6262cf451a6 100644
--- a/mysql-test/t/rpl_ndb_rep_ignore-slave.opt
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore-slave.opt
diff --git a/mysql-test/t/rpl_ndb_rep_ignore.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore.test
index c4e9e701251..c4e9e701251 100644
--- a/mysql-test/t/rpl_ndb_rep_ignore.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore.test
diff --git a/mysql-test/t/rpl_ndb_row_001.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_row_001.test
index 5b1090c0d41..5b1090c0d41 100644
--- a/mysql-test/t/rpl_ndb_row_001.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_row_001.test
diff --git a/mysql-test/t/rpl_ndb_sp003.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_sp003.test
index 599124ad9bd..599124ad9bd 100644
--- a/mysql-test/t/rpl_ndb_sp003.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_sp003.test
diff --git a/mysql-test/t/rpl_ndb_sp006.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_sp006.test
index 7476e7c114a..7476e7c114a 100644
--- a/mysql-test/t/rpl_ndb_sp006.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_sp006.test
diff --git a/mysql-test/t/rpl_ndb_stm_innodb-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb-master.opt
index 3596fc4d3bd..3596fc4d3bd 100644
--- a/mysql-test/t/rpl_ndb_stm_innodb-master.opt
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb-master.opt
diff --git a/mysql-test/t/rpl_ndb_stm_innodb.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb.test
index bf7f1eed7b2..bf7f1eed7b2 100644
--- a/mysql-test/t/rpl_ndb_stm_innodb.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb.test
diff --git a/mysql-test/t/rpl_ndb_sync.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test
index 116f0879ca0..116f0879ca0 100644
--- a/mysql-test/t/rpl_ndb_sync.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test
diff --git a/mysql-test/t/rpl_ndb_trig004.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_trig004.test
index 5544ded056f..5544ded056f 100644
--- a/mysql-test/t/rpl_ndb_trig004.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_trig004.test
diff --git a/mysql-test/t/rpl_ndbapi_multi.test b/mysql-test/suite/rpl_ndb/t/rpl_ndbapi_multi.test
index 5067722bb79..5067722bb79 100644
--- a/mysql-test/t/rpl_ndbapi_multi.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndbapi_multi.test
diff --git a/mysql-test/t/rpl_row_basic_7ndb.test b/mysql-test/suite/rpl_ndb/t/rpl_row_basic_7ndb.test
index 3a17de1bc9e..3a17de1bc9e 100644
--- a/mysql-test/t/rpl_row_basic_7ndb.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_row_basic_7ndb.test
diff --git a/mysql-test/t/rpl_truncate_7ndb.test b/mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb.test
index f8933b3744d..f8933b3744d 100644
--- a/mysql-test/t/rpl_truncate_7ndb.test
+++ b/mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb.test
diff --git a/mysql-test/suite/stress/include/ddl.cln b/mysql-test/suite/stress/include/ddl.cln
new file mode 100644
index 00000000000..7d021a8c912
--- /dev/null
+++ b/mysql-test/suite/stress/include/ddl.cln
@@ -0,0 +1,4 @@
+######## include/ddl.cln ########
+disconnect con2;
+DEALLOCATE PREPARE stmt_start;
+DEALLOCATE PREPARE stmt_break;
diff --git a/mysql-test/suite/stress/include/ddl.pre b/mysql-test/suite/stress/include/ddl.pre
new file mode 100644
index 00000000000..52de4a3665b
--- /dev/null
+++ b/mysql-test/suite/stress/include/ddl.pre
@@ -0,0 +1,21 @@
+######## include/ddl.pre ########
+# The variable
+# $runtime -- rough intended runtime per subtest variant
+# must be set within the routine sourcing this script.
+#
+# Please look for more details within include/ddl1.inc.
+#
+# Creation of this test:
+# 2007-07-11 mleich
+#
+SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
+PREPARE stmt_start FROM "SELECT UNIX_TIMESTAMP() INTO @start";
+--replace_result $runtime <intended_runtime>
+eval SET @runtime = $runtime;
+eval PREPARE stmt_break FROM "SELECT UNIX_TIMESTAMP() - @start > @runtime - 1";
+connect (con2,localhost,root,,);
+connection default;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
diff --git a/mysql-test/suite/stress/include/ddl1.inc b/mysql-test/suite/stress/include/ddl1.inc
new file mode 100644
index 00000000000..96adadc5af5
--- /dev/null
+++ b/mysql-test/suite/stress/include/ddl1.inc
@@ -0,0 +1,277 @@
+######## include/ddl1.inc ######
+#
+# Purpose of include/ddl1.inc - include/ddl8.inc:
+#
+# Stress storage engines with rapid CREATE/DROP TABLE/INDEX
+# and following SELECT/INSERT/SHOW etc.
+#
+# The variables
+# $loop_size -- number of rounds till we look at the clock again
+# $runtime -- rough intended runtime per subtest variant
+# Real runtime without server restarts and comparison is:
+# - >= $runtime
+# - > runtime needed for $loop_size execution loops
+# $engine_type -- storage engine to be used in CREATE TABLE
+# must be set within the routine sourcing this script.
+#
+# Other stuff which must already exist:
+# - connection con2
+# - stmt_start and stmt_break prepared by the default connection
+#
+# Attention:
+# The test does suppress the writing of most statements, server error
+# messages and result sets.
+# This is needed because their number is usual not deterministic.
+# The test is partially self checking. That means is prints some
+# helpful hints into the protocol and aborts if something is wrong.
+#
+# Creation of this test:
+# 2007-07-04 mleich
+#
+############################################################################
+#
+# Some details:
+#
+# 1. Base question of the test:
+# There was just a create or drop of some object (TABLE/INDEX).
+#
+# Could it happen that the next statement referring to this
+# object gets a somehow wrong server response (result set,
+# error message, warning) because the creation or removal of
+# the object is in an incomplete state?
+#
+# Thinkable reasons for incomplete state of creation or removal:
+# The server performs the creation or removal
+# - all time incomplete.
+# Example:
+# Bug#28309 First insert violates unique constraint
+# - was "memory" table empty ?
+# - asynchronous
+# In that case the next statement has probably to wait till
+# completion.
+#
+# 2. Why do we use in some scripts "--error 0,<expected error>" followed
+# a check of $mysql_errno?
+#
+# System reactions when running with "--error 0,<expected error>":
+# - RC=0 --> no error message
+# - RC=<expected error> --> no error message
+# - RC not in (0,<expected error>) --> error message + abort of script
+# execution
+#
+# Requirements and tricky solution for statements which are expected
+# to fail:
+# 1. RC=<expected error>
+# - no abort of script execution
+# --> add "--error <expected error>"
+# - no error message into the protocol, because the number of
+# executions is NOT deterministic
+# --> use "--error 0,<expected error>"
+# 2. RC=0 = failure
+# - abort of script execution
+# "--error 0,<expected error>" prevents the automatic abort of
+# execution. Therefore we do not need to code the abort.
+# --> Check $mysql_errno and do an explicit abort if $mysql_errno = 0.
+# 3. RC not in (0,<expected error>)
+# - abort of script execution
+# "--error 0,<expected error>" causes an automatic abort.
+#
+# 3. We do not check the correctness of the SHOW CREATE TABLE output
+# in detail. This must be done within other tests.
+# We only check here that
+# - same CREATE TABLE/INDEX statements lead to the same
+# - different CREATE TABLE/INDEX statements lead to different
+# SHOW CREATE TABLE output
+# (Applies to ddl4.inc. and ddl8.inc.)
+#
+# 4. It could be assumed that running this test with
+# - PS-PROTOCOL
+# There are already subtests using prepared statements contained.
+# - SP/CURSOR/VIEW-PROTOCOL
+# These protocol variants transform SELECTs to hopefully much
+# stressing statement sequencies using SP/CURSOR/VIEW.
+# The SELECTs within include/ddl*.inc are very simple.
+# does not increase the coverage.
+# Therefore we skip runs with these protocols.
+#
+# 5. The test consumes significant runtime when running on a non RAM
+# based filesystem (run without "--mem").
+# Therefore we adjust $runtime and $loop_size depending on "--big-test"
+# option.
+# $runtime and $loop_size do not influence the expected results.
+# Rough runtime in seconds reported by mysql-test-run.pl:
+# (engine_type = MEMORY)
+# option set -> $runtime $loop_size real runtime in seconds
+# 1 20 68
+# --mem 1 20 32
+# --big-test 5 100 200
+# --mem --big-test 5 100 400
+# I assume that runs with slow filesystems are as much valuable
+# as runs with extreme fast filesystems.
+#
+# 6. Hints for analysis of test failures:
+# 1. Look into the protocol and check in which ddl*.inc
+# script the difference to the expected result occured.
+# 2. Comment the sourcing of all other ddl*.inc scripts
+# out.
+# 3. Edit the ddl*.inc script where the error occured and
+# remove all
+# - "--disable_query_log", "--disable_result_log"
+# - successful passed subtests.
+# 4. Alternative:
+# Have a look into VARDIR/master-data/mysql/general_log.CSV
+# and construct a new testcase from that.
+# 5. If the problem is not deterministic, please try the following
+# - increase $runtime (important), $loop_size (most probably
+# less important) within the "t/ddl_<engine>.test" and
+# maybe the "--testcase-timeout" assigned to mysqltest-run.pl
+# - vary the I/O performance of the testing machine by using
+# a RAM or disk based filesystem for VARDIR
+#
+
+
+#----------------------------------------------------------------------
+# Settings for Subtest 1 variants
+# Scenario: CREATE with UNIQUE KEY/INSERT/DROP TABLE like in Bug#28309
+let $create_table= CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
+ENGINE = $engine_type;
+let $insert_into= INSERT INTO t1 VALUES (1,1), (2,2), (3,3);
+let $drop_table= DROP TABLE t1;
+#----------------------------------------------------------------------
+
+#
+--echo # Subtest 1A (one connection, no PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_table
+--echo # default: $insert_into
+--echo # default: $drop_table
+--disable_query_log
+connection default;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ eval $create_table;
+ eval $insert_into;
+ eval $drop_table;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+--enable_query_log
+#
+--echo # Subtest 1B (one connection, use PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_table
+--echo # default: $insert_into
+--echo # default: $drop_table
+--disable_query_log
+connection default;
+eval PREPARE create_table FROM "$create_table";
+EXECUTE create_table;
+eval PREPARE insert_into FROM "$insert_into";
+eval PREPARE drop_table FROM "$drop_table";
+EXECUTE drop_table;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ EXECUTE create_table;
+ EXECUTE insert_into;
+ EXECUTE drop_table;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+DEALLOCATE PREPARE create_table;
+DEALLOCATE PREPARE insert_into;
+DEALLOCATE PREPARE drop_table;
+--enable_query_log
+#
+--echo # Subtest 1C (two connections, no PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_table
+--echo # con2: $insert_into
+--echo # con2: $drop_table
+--disable_query_log
+connection default;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ eval $create_table;
+ connection con2;
+ eval $insert_into;
+ eval $drop_table;
+ connection default;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+--enable_query_log
+#
+--echo # Subtest 1D (two connections, use PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_table
+--echo # con2: $insert_into
+--echo # con2: $drop_table
+--disable_query_log
+connection default;
+eval PREPARE create_table FROM "$create_table";
+EXECUTE create_table;
+connection con2;
+eval PREPARE insert_into FROM "$insert_into";
+eval PREPARE drop_table FROM "$drop_table";
+EXECUTE drop_table;
+connection default;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ EXECUTE create_table;
+ connection con2;
+ EXECUTE insert_into;
+ EXECUTE drop_table;
+ connection default;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+DEALLOCATE PREPARE create_table;
+connection con2;
+DEALLOCATE PREPARE insert_into;
+DEALLOCATE PREPARE drop_table;
+connection default;
+--enable_query_log
diff --git a/mysql-test/suite/stress/include/ddl2.inc b/mysql-test/suite/stress/include/ddl2.inc
new file mode 100644
index 00000000000..dd2ec0fd804
--- /dev/null
+++ b/mysql-test/suite/stress/include/ddl2.inc
@@ -0,0 +1,259 @@
+######## include/ddl2.inc ######
+#
+# Stress the storage engine with rapid CREATE/DROP TABLE/INDEX
+# and following SELECT/INSERT/SHOW etc.
+# Subtest 2 variants (2A - 2D)
+#
+# The variables
+# $loop_size -- number of rounds till we look at the clock again
+# $runtime -- rough intended runtime per subtest variant
+# $engine_type -- storage engine to be used in CREATE TABLE
+# must be set within the routine sourcing this script.
+#
+# Other stuff which must already exist:
+# - connection con2
+# - stmt_start and stmt_break prepared by the default connection
+#
+# Please look for more details within include/ddl1.inc.
+#
+# Creation of this test:
+# 2007-07-04 mleich
+#
+
+
+#----------------------------------------------------------------------
+# Settings for Subtest 2 variants
+# Scenario: CREATE TABLE AS SELECT/SELECT/DROP/SELECT(F)
+let $create_table= CREATE TABLE t1 ENGINE = $engine_type AS SELECT 1 AS f1;
+let $select_record= SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1;
+let $drop_table= DROP TABLE t1;
+#----------------------------------------------------------------------
+
+#
+--echo # Subtest 2A (one connection, no PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_table
+--echo # default: $select_record
+--echo # default: $drop_table
+--echo # default: $select_record (expect to get ER_NO_SUCH_TABLE)
+--disable_query_log
+--disable_result_log
+connection default;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ eval $create_table;
+ if (`$select_record`)
+ {
+ --enable_result_log
+ --enable_query_log
+ --echo # Error: Unexpected content within t1.
+ --echo # Expected: 0
+ --echo # Got:
+ eval $select_record;
+ SELECT * FROM t1;
+ --echo # abort
+ exit;
+ }
+ eval $drop_table;
+ --error 0,ER_NO_SUCH_TABLE
+ eval $select_record;
+ if (!$mysql_errno)
+ {
+ --echo # Error: SELECT was successful though we expected ER_NO_SUCH_TABLE
+ --echo # abort
+ exit;
+ }
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+--enable_result_log
+--enable_query_log
+#
+--echo # Subtest 2B (one connection, use PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_table
+--echo # default: $select_record
+--echo # default: $drop_table
+--echo # default: $select_record (expect to get ER_NO_SUCH_TABLE)
+--disable_query_log
+--disable_result_log
+connection default;
+eval PREPARE create_table FROM "$create_table";
+EXECUTE create_table;
+eval PREPARE select_record FROM "$select_record";
+eval PREPARE drop_table FROM "$drop_table";
+EXECUTE drop_table;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ EXECUTE create_table;
+ if (`EXECUTE select_record`)
+ {
+ --enable_result_log
+ --enable_query_log
+ --echo # Error: Unexpected content within t1.
+ --echo # Expected: 0
+ --echo # Got:
+ EXECUTE select_record;
+ SELECT * FROM t1;
+ --echo # abort
+ exit;
+ }
+ EXECUTE drop_table;
+ --error 0,ER_NO_SUCH_TABLE
+ EXECUTE select_record;
+ if (!$mysql_errno)
+ {
+ --echo # Error: SELECT was successful though we expected ER_NO_SUCH_TABLE
+ --echo # abort
+ exit;
+ }
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+DEALLOCATE PREPARE create_table;
+DEALLOCATE PREPARE select_record;
+DEALLOCATE PREPARE drop_table;
+--enable_result_log
+--enable_query_log
+#
+--echo # Subtest 2C (two connections, no PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_table
+--echo # con2: $select_record
+--echo # default: $drop_table
+--echo # con2: $select_record (expect to get ER_NO_SUCH_TABLE)
+--disable_query_log
+--disable_result_log
+connection default;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ eval $create_table;
+ connection con2;
+ if (`$select_record`)
+ {
+ --enable_result_log
+ --enable_query_log
+ --echo # Error: Unexpected content within t1.
+ --echo # Expected: 0
+ --echo # Got:
+ eval $select_record;
+ SELECT * FROM t1;
+ --echo # abort
+ exit;
+ }
+ connection default;
+ eval $drop_table;
+ connection con2;
+ --error 0,ER_NO_SUCH_TABLE
+ eval $select_record;
+ if (!$mysql_errno)
+ {
+ --echo # Error: SELECT was successful though we expected ER_NO_SUCH_TABLE
+ --echo # abort
+ exit;
+ }
+ connection default;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+--enable_result_log
+--enable_query_log
+#
+--echo # Subtest 2D (two connections, use PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_table
+--echo # con2: $select_record
+--echo # default: $drop_table
+--echo # con2: $select_record (expect to get ER_NO_SUCH_TABLE)
+--disable_query_log
+--disable_result_log
+connection default;
+eval PREPARE create_table FROM "$create_table";
+eval PREPARE drop_table FROM "$drop_table";
+EXECUTE create_table;
+connection con2;
+eval PREPARE select_record FROM "$select_record";
+connection default;
+EXECUTE drop_table;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ EXECUTE create_table;
+ connection con2;
+ if (`EXECUTE select_record`)
+ {
+ --enable_result_log
+ --enable_query_log
+ --echo # Error: Unexpected content within t1.
+ --echo # Expected: 0
+ --echo # Got:
+ EXECUTE select_record;
+ SELECT * FROM t1;
+ --echo # abort
+ exit;
+ }
+ connection default;
+ EXECUTE drop_table;
+ connection con2;
+ --error 0,ER_NO_SUCH_TABLE
+ EXECUTE select_record;
+ if (!$mysql_errno)
+ {
+ --echo # Error: SELECT was successful though we expected ER_NO_SUCH_TABLE
+ --echo # abort
+ exit;
+ }
+ connection default;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+DEALLOCATE PREPARE create_table;
+DEALLOCATE PREPARE drop_table;
+connection con2;
+DEALLOCATE PREPARE select_record;
+connection default;
+--enable_result_log
+--enable_query_log
diff --git a/mysql-test/suite/stress/include/ddl3.inc b/mysql-test/suite/stress/include/ddl3.inc
new file mode 100644
index 00000000000..aacf09f9428
--- /dev/null
+++ b/mysql-test/suite/stress/include/ddl3.inc
@@ -0,0 +1,242 @@
+######## include/ddl3.inc ######
+#
+# Stress the storage engine with rapid CREATE/DROP TABLE/INDEX
+# and following SELECT/INSERT/SHOW etc.
+# Subtest 3 variants (3A - 3D)
+#
+# The variables
+# $loop_size -- number of rounds till we look at the clock again
+# $runtime -- rough intended runtime per subtest variant
+# $engine_type -- storage engine to be used in CREATE TABLE
+# must be set within the routine sourcing this script.
+#
+# Other stuff which must already exist:
+# - connection con2
+# - stmt_start and stmt_break prepared by the default connection
+#
+# Please look for more details within include/ddl2.inc.
+#
+# Creation of this test:
+# 2007-07-04 mleich
+#
+
+
+#----------------------------------------------------------------------
+# Settings for Subtest 3 variants
+# Scenario: CREATE TABLE/CREATE TABLE(F)/DROP TABLE/DROP TABLE(F)
+let $create_table= CREATE TABLE t1 (f1 BIGINT) ENGINE=$engine_type;
+let $drop_table= DROP TABLE t1;
+#----------------------------------------------------------------------
+
+#
+--echo # Subtest 3A (one connection, no PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_table
+--echo # default: $create_table (expect to get ER_TABLE_EXISTS_ERROR)
+--echo # default: $drop_table
+--echo # default: $drop_table (expect to get ER_BAD_TABLE_ERROR)
+--disable_query_log
+--disable_result_log
+connection default;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ eval $create_table;
+ --error 0,ER_TABLE_EXISTS_ERROR
+ eval $create_table;
+ if (!$mysql_errno)
+ {
+ --echo # Error: CREATE TABLE was successful though we expected ER_TABLE_EXISTS_ERROR
+ --echo # abort
+ exit;
+ }
+ eval $drop_table;
+ --error 0,ER_BAD_TABLE_ERROR
+ eval $drop_table;
+ if (!$mysql_errno)
+ {
+ --echo # Error: DROP TABLE was successful though we expected ER_BAD_TABLE_ERROR)
+ --echo # abort
+ exit;
+ }
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+--enable_result_log
+--enable_query_log
+#
+--echo # Subtest 3B (one connection, use PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_table
+--echo # default: $create_table (expect to get ER_TABLE_EXISTS_ERROR)
+--echo # default: $drop_table
+--echo # default: $drop_table (expect to get ER_BAD_TABLE_ERROR)
+--disable_query_log
+--disable_result_log
+connection default;
+eval PREPARE create_table FROM "$create_table";
+EXECUTE create_table;
+eval PREPARE drop_table FROM "$drop_table";
+EXECUTE drop_table;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ EXECUTE create_table;
+ --error 0,ER_TABLE_EXISTS_ERROR
+ EXECUTE create_table;
+ if (!$mysql_errno)
+ {
+ --echo # Error: CREATE TABLE was successful though we expected ER_TABLE_EXISTS_ERROR
+ --echo # abort
+ exit;
+ }
+ EXECUTE drop_table;
+ --error 0,ER_BAD_TABLE_ERROR
+ EXECUTE drop_table;
+ if (!$mysql_errno)
+ {
+ --echo # Error: DROP TABLE was successful though we expected ER_BAD_TABLE_ERROR)
+ --echo # abort
+ exit;
+ }
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+DEALLOCATE PREPARE create_table;
+DEALLOCATE PREPARE drop_table;
+--enable_result_log
+--enable_query_log
+#
+--echo # Subtest 3C (two connections, no PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_table
+--echo # con2: $create_table (expect to get ER_TABLE_EXISTS_ERROR)
+--echo # default: $drop_table
+--echo # con2: $drop_table (expect to get ER_BAD_TABLE_ERROR)
+--disable_query_log
+--disable_result_log
+connection default;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ eval $create_table;
+ connection con2;
+ --error 0,ER_TABLE_EXISTS_ERROR
+ eval $create_table;
+ if (!$mysql_errno)
+ {
+ --echo # Error: CREATE TABLE was successful though we expected ER_TABLE_EXISTS_ERROR
+ --echo # abort
+ exit;
+ }
+ connection default;
+ eval $drop_table;
+ connection con2;
+ --error 0,ER_BAD_TABLE_ERROR
+ eval $drop_table;
+ if (!$mysql_errno)
+ {
+ --echo # Error: DROP TABLE was successful though we expected ER_BAD_TABLE_ERROR)
+ --echo # abort
+ exit;
+ }
+ connection default;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+--enable_result_log
+--enable_query_log
+#
+--echo # Subtest 3D (two connections, use PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_table
+--echo # con2: $create_table (expect to get ER_TABLE_EXISTS_ERROR)
+--echo # default: $drop_table
+--echo # con2: $drop_table (expect to get ER_BAD_TABLE_ERROR)
+--disable_query_log
+--disable_result_log
+connection default;
+eval PREPARE create_table FROM "$create_table";
+eval PREPARE drop_table FROM "$drop_table";
+EXECUTE create_table;
+connection con2;
+eval PREPARE create_table FROM "$create_table";
+eval PREPARE drop_table FROM "$drop_table";
+EXECUTE drop_table;
+connection default;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ EXECUTE create_table;
+ connection con2;
+ --error 0,ER_TABLE_EXISTS_ERROR
+ EXECUTE create_table;
+ if (!$mysql_errno)
+ {
+ --echo # Error: CREATE TABLE was successful though we expected ER_TABLE_EXISTS_ERROR
+ --echo # abort
+ exit;
+ }
+ connection default;
+ EXECUTE drop_table;
+ connection con2;
+ --error 0,ER_BAD_TABLE_ERROR
+ EXECUTE drop_table;
+ if (!$mysql_errno)
+ {
+ --echo # Error: DROP TABLE was successful though we expected ER_BAD_TABLE_ERROR)
+ --echo # abort
+ exit;
+ }
+ connection default;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+DEALLOCATE PREPARE create_table;
+DEALLOCATE PREPARE drop_table;
+connection con2;
+DEALLOCATE PREPARE create_table;
+DEALLOCATE PREPARE drop_table;
+connection default;
+--enable_result_log
+--enable_query_log
diff --git a/mysql-test/suite/stress/include/ddl4.inc b/mysql-test/suite/stress/include/ddl4.inc
new file mode 100644
index 00000000000..10452a453a5
--- /dev/null
+++ b/mysql-test/suite/stress/include/ddl4.inc
@@ -0,0 +1,339 @@
+######## include/ddl4.inc ######
+#
+# Stress the storage engine with rapid CREATE/DROP TABLE/INDEX
+# and following SELECT/INSERT/SHOW etc.
+# Subtest 4 variants (4A - 4D)
+#
+# The variables
+# $loop_size -- number of rounds till we look at the clock again
+# $runtime -- rough intended runtime per subtest variant
+# $engine_type -- storage engine to be used in CREATE TABLE
+# must be set within the routine sourcing this script.
+#
+# Other stuff which must already exist:
+# - connection con2
+# - stmt_start and stmt_break prepared by the default connection
+#
+# Please look for more details within include/ddl1.inc.
+#
+# Creation of this test:
+# 2007-07-04 mleich
+#
+
+
+#----------------------------------------------------------------------
+# Settings for Subtest 4 variants
+# Scenario: CREATE TABLE variant1/SHOW/DROP TABLE/SHOW(F)/
+# CREATE TABLE variant2/SHOW/DROP TABLE
+let $create_table1= CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=$engine_type;
+let $create_table2= CREATE TABLE t1 (f1 BIGINT) ENGINE=$engine_type;
+let $show_table= SHOW CREATE TABLE t1;
+let $drop_table= DROP TABLE t1;
+#
+eval $create_table1;
+let $cr_value1= INITIALIZED;
+let $cr_value1= query_get_value($show_table, Create Table, 1);
+eval $drop_table;
+eval $create_table2;
+let $cr_value2= INITIALIZED;
+let $cr_value2= query_get_value($show_table, Create Table, 1);
+eval $drop_table;
+if (`SELECT '$cr_value1' = '$cr_value2'`)
+{
+ --echo # Error during generation of prerequisites.
+ --echo # cr_value1 equals cr_value2
+ --echo # cr_value1: $cr_value1
+ --echo # cr_value2: $cr_value2
+ --echo # abort
+ exit;
+}
+#----------------------------------------------------------------------
+
+#
+--echo # Subtest 4A (one connection, no PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_table1
+--echo # default: $show_table
+--echo # default: $drop_table
+--echo # default: $show_table (expect to get ER_NO_SUCH_TABLE)
+--echo # default: $create_table2
+--echo # default: $show_table
+--echo # default: $drop_table
+--disable_query_log
+--disable_result_log
+connection default;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ eval $create_table1;
+ let $value= INITIALIZED;
+ let $value= query_get_value($show_table, Create Table, 1);
+ if (`SELECT '$value' <> '$cr_value1'`)
+ {
+ --echo # Error: Unexpected SHOW CREATE TABLE output
+ --echo # Got: $value
+ --echo # Expected: $cr_value1
+ --echo # abort
+ exit;
+ }
+ eval $drop_table;
+ --error 0,ER_NO_SUCH_TABLE
+ eval $show_table;
+ if (!$mysql_errno)
+ {
+ --echo # Error: SHOW CREATE TABLE was successful though we expected ER_NO_SUCH_TABLE)
+ --echo # abort
+ exit;
+ }
+ eval $create_table2;
+ let $value= INITIALIZED;
+ let $value= query_get_value($show_table, Create Table, 1);
+ if (`SELECT '$value' <> '$cr_value2'`)
+ {
+ --echo # Error: Unexpected SHOW CREATE TABLE output
+ --echo # Got: $value
+ --echo # Expected: $cr_value2
+ --echo # abort
+ exit;
+ }
+ eval $drop_table;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+--enable_result_log
+--enable_query_log
+#
+--echo # Subtest 4B (one connection, use PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_table1
+--echo # default: $show_table
+--echo # default: $drop_table
+--echo # default: $show_table (expect to get ER_NO_SUCH_TABLE)
+--echo # default: $create_table2
+--echo # default: $show_table
+--echo # default: $drop_table
+--disable_query_log
+--disable_result_log
+connection default;
+eval PREPARE create_table1 FROM "$create_table1";
+eval PREPARE create_table2 FROM "$create_table2";
+EXECUTE create_table1;
+eval PREPARE show_table FROM "$show_table";
+eval PREPARE drop_table FROM "$drop_table";
+EXECUTE drop_table;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ EXECUTE create_table1;
+ let $value= INITIALIZED;
+ let $value= query_get_value(EXECUTE show_table, Create Table, 1);
+ if (`SELECT '$value' <> '$cr_value1'`)
+ {
+ --echo # Error: Unexpected SHOW CREATE TABLE output
+ --echo # Got: $value
+ --echo # Expected: $cr_value1
+ --echo # abort
+ exit;
+ }
+ EXECUTE drop_table;
+ --error 0,ER_NO_SUCH_TABLE
+ EXECUTE show_table;
+ if (!$mysql_errno)
+ {
+ --echo # Error: SHOW CREATE TABLE was successful though we expected ER_NO_SUCH_TABLE)
+ --echo # abort
+ exit;
+ }
+ EXECUTE create_table2;
+ let $value= INITIALIZED;
+ let $value= query_get_value(EXECUTE show_table, Create Table, 1);
+ if (`SELECT '$value' <> '$cr_value2'`)
+ {
+ --echo # Error: Unexpected SHOW CREATE TABLE output
+ --echo # Got: $value
+ --echo # Expected: $cr_value2
+ --echo # abort
+ exit;
+ }
+ EXECUTE drop_table;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+DEALLOCATE PREPARE create_table1;
+DEALLOCATE PREPARE create_table2;
+DEALLOCATE PREPARE show_table;
+DEALLOCATE PREPARE drop_table;
+--enable_result_log
+--enable_query_log
+#
+--echo # Subtest 4C (two connections, no PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_table1
+--echo # con2: $show_table
+--echo # default: $drop_table
+--echo # con2: $show_table (expect to get ER_NO_SUCH_TABLE)
+--echo # default: $create_table2
+--echo # con2: $show_table
+--echo # default: $drop_table
+--disable_query_log
+--disable_result_log
+connection default;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ eval $create_table1;
+ connection con2;
+ let $value= INITIALIZED;
+ let $value= query_get_value($show_table, Create Table, 1);
+ if (`SELECT '$value' <> '$cr_value1'`)
+ {
+ --echo # Error: Unexpected SHOW CREATE TABLE output
+ --echo # Got: $value
+ --echo # Expected: $cr_value1
+ --echo # abort
+ exit;
+ }
+ connection default;
+ eval $drop_table;
+ connection con2;
+ --error 0,ER_NO_SUCH_TABLE
+ eval $show_table;
+ if (!$mysql_errno)
+ {
+ --echo # Error: SHOW CREATE TABLE was successful though we expected ER_NO_SUCH_TABLE)
+ --echo # abort
+ exit;
+ }
+ connection default;
+ eval $create_table2;
+ connection con2;
+ let $value= INITIALIZED;
+ let $value= query_get_value($show_table, Create Table, 1);
+ if (`SELECT '$value' <> '$cr_value2'`)
+ {
+ --echo # Error: Unexpected SHOW CREATE TABLE output
+ --echo # Got: $value
+ --echo # Expected: $cr_value2
+ --echo # abort
+ exit;
+ }
+ connection default;
+ eval $drop_table;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+--enable_result_log
+--enable_query_log
+#
+--echo # Subtest 4D (two connections, use PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_table1
+--echo # con2: $show_table
+--echo # default: $drop_table
+--echo # con2: $show_table (expect to get ER_NO_SUCH_TABLE)
+--echo # default: $create_table2
+--echo # con2: $show_table
+--echo # default: $drop_table
+--disable_query_log
+--disable_result_log
+connection default;
+eval PREPARE create_table1 FROM "$create_table1";
+eval PREPARE create_table2 FROM "$create_table2";
+eval PREPARE drop_table FROM "$drop_table";
+EXECUTE create_table1;
+connection con2;
+eval PREPARE show_table FROM "$show_table";
+connection default;
+EXECUTE drop_table;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ EXECUTE create_table1;
+ connection con2;
+ let $value= INITIALIZED;
+ let $value= query_get_value(EXECUTE show_table, Create Table, 1);
+ if (`SELECT '$value' <> '$cr_value1'`)
+ {
+ --echo # Error: Unexpected SHOW CREATE TABLE output
+ --echo # Got: $value
+ --echo # Expected: $cr_value1
+ --echo # abort
+ exit;
+ }
+ connection default;
+ EXECUTE drop_table;
+ connection con2;
+ --error 0,ER_NO_SUCH_TABLE
+ EXECUTE show_table;
+ if (!$mysql_errno)
+ {
+ --echo # Error: SHOW CREATE TABLE was successful though we expected ER_NO_SUCH_TABLE)
+ --echo # abort
+ exit;
+ }
+ connection default;
+ EXECUTE create_table2;
+ connection con2;
+ let $value= INITIALIZED;
+ let $value= query_get_value(EXECUTE show_table, Create Table, 1);
+ if (`SELECT '$value' <> '$cr_value2'`)
+ {
+ --echo # Error: Unexpected SHOW CREATE TABLE output
+ --echo # Got: $value
+ --echo # Expected: $cr_value2
+ --echo # abort
+ exit;
+ }
+ connection default;
+ EXECUTE drop_table;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+DEALLOCATE PREPARE create_table1;
+DEALLOCATE PREPARE create_table2;
+DEALLOCATE PREPARE drop_table;
+connection con2;
+DEALLOCATE PREPARE show_table;
+connection default;
+--enable_result_log
+--enable_query_log
diff --git a/mysql-test/suite/stress/include/ddl5.inc b/mysql-test/suite/stress/include/ddl5.inc
new file mode 100644
index 00000000000..5a6c2fa0e96
--- /dev/null
+++ b/mysql-test/suite/stress/include/ddl5.inc
@@ -0,0 +1,227 @@
+######## include/ddl5.inc ######
+#
+# Stress the storage engine with rapid CREATE/DROP TABLE/INDEX
+# and following SELECT/INSERT/SHOW etc.
+# Subtest 5 variants (5A - 5D)
+#
+# The variables
+# $loop_size -- number of rounds till we look at the clock again
+# $runtime -- rough intended runtime per subtest variant
+# $engine_type -- storage engine to be used in CREATE TABLE
+# must be set within the routine sourcing this script.
+#
+# Other stuff which must already exist:
+# - connection con2
+# - stmt_start and stmt_break prepared by the default connection
+#
+# Please look for more details within include/ddl1.inc.
+#
+# Creation of this test:
+# 2007-07-04 mleich
+#
+
+#----------------------------------------------------------------------
+# Settings for Subtest 5 variants
+# Scenario: CREATE TABLE with AUTOINC/INSERT/SELECT/DROP TABLE
+let $create_table= CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = $engine_type;
+let $insert_into= INSERT INTO t1 SET f2 = 9;
+let $select_record= SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9;
+let $drop_table= DROP TABLE t1;
+#----------------------------------------------------------------------
+
+#
+--echo # Subtest 5A (one connection, no PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_table
+--echo # default: $insert_into
+--echo # default: $select_record
+--echo # default: $drop_table
+--disable_query_log
+connection default;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ eval $create_table;
+ eval $insert_into;
+ if (`$select_record`)
+ {
+ --enable_result_log
+ --enable_query_log
+ --echo # Error: Unexpected content within t1.
+ --echo # Expected: 0
+ --echo # Got:
+ eval $select_record;
+ SELECT * FROM t1;
+ --echo # abort
+ exit;
+ }
+ eval $drop_table;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+--enable_query_log
+#
+--echo # Subtest 5B (one connection, use PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_table
+--echo # default: $insert_into
+--echo # default: $select_record
+--echo # default: $drop_table
+--disable_query_log
+connection default;
+eval PREPARE create_table FROM "$create_table";
+EXECUTE create_table;
+eval PREPARE insert_into FROM "$insert_into";
+eval PREPARE select_record FROM "$select_record";
+eval PREPARE drop_table FROM "$drop_table";
+EXECUTE drop_table;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ EXECUTE create_table;
+ EXECUTE insert_into;
+ if (`EXECUTE select_record`)
+ {
+ --enable_result_log
+ --enable_query_log
+ --echo # Error: Unexpected content within t1.
+ --echo # Expected: 0
+ --echo # Got:
+ EXECUTE select_record;
+ SELECT * FROM t1;
+ --echo # abort
+ exit;
+ }
+ EXECUTE drop_table;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+DEALLOCATE PREPARE create_table;
+DEALLOCATE PREPARE insert_into;
+DEALLOCATE PREPARE select_record;
+DEALLOCATE PREPARE drop_table;
+--enable_query_log
+#
+--echo # Subtest 5C (two connections, no PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_table
+--echo # con2: $insert_into
+--echo # default: $select_record
+--echo # con2: $drop_table
+--disable_query_log
+connection default;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ eval $create_table;
+ connection con2;
+ eval $insert_into;
+ connection default;
+ if (`$select_record`)
+ {
+ --enable_result_log
+ --enable_query_log
+ --echo # Error: Unexpected content within t1.
+ --echo # Expected: 0
+ --echo # Got:
+ eval $select_record;
+ SELECT * FROM t1;
+ --echo # abort
+ exit;
+ }
+ connection con2;
+ eval $drop_table;
+ connection default;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+--enable_query_log
+#
+--echo # Subtest 5D (two connections, use PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_table
+--echo # con2: $insert_into
+--echo # default: $select_record
+--echo # con2: $drop_table
+--disable_query_log
+connection default;
+eval PREPARE create_table FROM "$create_table";
+EXECUTE create_table;
+eval PREPARE select_record FROM "$select_record";
+connection con2;
+eval PREPARE insert_into FROM "$insert_into";
+eval PREPARE drop_table FROM "$drop_table";
+EXECUTE drop_table;
+connection default;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ EXECUTE create_table;
+ connection con2;
+ EXECUTE insert_into;
+ connection default;
+ if (`EXECUTE select_record`)
+ {
+ --enable_result_log
+ --enable_query_log
+ --echo # Error: Unexpected content within t1.
+ --echo # Expected: 0
+ --echo # Got:
+ EXECUTE select_record;
+ SELECT * FROM t1;
+ --echo # abort
+ exit;
+ }
+ connection con2;
+ EXECUTE drop_table;
+ connection default;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+DEALLOCATE PREPARE create_table;
+DEALLOCATE PREPARE select_record;
+connection con2;
+DEALLOCATE PREPARE insert_into;
+DEALLOCATE PREPARE drop_table;
+connection default;
+--enable_query_log
diff --git a/mysql-test/suite/stress/include/ddl6.inc b/mysql-test/suite/stress/include/ddl6.inc
new file mode 100644
index 00000000000..7bbfe300eaa
--- /dev/null
+++ b/mysql-test/suite/stress/include/ddl6.inc
@@ -0,0 +1,266 @@
+######## include/ddl6.inc ######
+#
+# Stress the storage engine with rapid CREATE/DROP TABLE/INDEX
+# and following SELECT/INSERT/SHOW etc.
+# Subtest 6 variants (6A - 6D)
+#
+# The variables
+# $loop_size -- number of rounds till we look at the clock again
+# $runtime -- rough intended runtime per subtest variant
+# $engine_type -- storage engine to be used in CREATE TABLE
+# must be set within the routine sourcing this script.
+#
+# Other stuff which must already exist:
+# - connection con2
+# - stmt_start and stmt_break prepared by the default connection
+#
+# Please look for more details within include/ddl1.inc.
+#
+# Creation of this test:
+# 2007-07-04 mleich
+#
+
+
+#----------------------------------------------------------------------
+# Settings for Subtest 6 variants
+# Scenario: CREATE INDEX/CREATE INDEX(F)/DROP INDEX/DROP INDEX(F)
+let $create_index= CREATE INDEX IDX1 ON t1 (f2);
+let $drop_index= DROP INDEX IDX1 ON t1;
+eval CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=$engine_type;
+#----------------------------------------------------------------------
+
+
+#
+--echo # Subtest 6A (one connection, no PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_index
+--echo # default: $create_index (expect to get ER_DUP_KEYNAME)
+--echo # default: $drop_index
+--echo # default: $drop_index (expect to get ER_CANT_DROP_FIELD_OR_KEY)
+--echo # default: $create_index
+--echo # default: $drop_index
+--disable_query_log
+--disable_result_log
+connection default;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ eval $create_index;
+ --error 0,ER_DUP_KEYNAME
+ eval $create_index;
+ if (!$mysql_errno)
+ {
+ --echo # Error: CREATE INDEX was successful though we expected ER_DUP_KEYNAME
+ --echo # abort
+ exit;
+ }
+ eval $drop_index;
+ --error 0,ER_CANT_DROP_FIELD_OR_KEY
+ eval $drop_index;
+ if (!$mysql_errno)
+ {
+ --echo # Error: DROP INDEX was successful though we expected ER_CANT_DROP_FIELD_OR_KEY
+ --echo # abort
+ exit;
+ }
+ eval $create_index;
+ eval $drop_index;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+--enable_result_log
+--enable_query_log
+#
+--echo # Subtest 6B (one connection, use PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_index
+--echo # default: $create_index (expect to get ER_DUP_KEYNAME)
+--echo # default: $drop_index
+--echo # default: $drop_index (expect to get ER_CANT_DROP_FIELD_OR_KEY)
+--echo # default: $create_index
+--echo # default: $drop_index
+--disable_query_log
+--disable_result_log
+connection default;
+eval PREPARE create_index FROM "$create_index";
+EXECUTE create_index;
+eval PREPARE drop_index FROM "$drop_index";
+EXECUTE drop_index;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ EXECUTE create_index;
+ --error 0,ER_DUP_KEYNAME
+ EXECUTE create_index;
+ if (!$mysql_errno)
+ {
+ --echo # Error: CREATE INDEX was successful though we expected ER_DUP_KEYNAME
+ --echo # abort
+ exit;
+ }
+ EXECUTE drop_index;
+ --error 0,ER_CANT_DROP_FIELD_OR_KEY
+ EXECUTE drop_index;
+ if (!$mysql_errno)
+ {
+ --echo # Error: DROP INDEX was successful though we expected ER_CANT_DROP_FIELD_OR_KEY
+ --echo # abort
+ exit;
+ }
+ EXECUTE create_index;
+ EXECUTE drop_index;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+DEALLOCATE PREPARE create_index;
+DEALLOCATE PREPARE drop_index;
+--enable_result_log
+--enable_query_log
+#
+--echo # Subtest 6C (two connections, no PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_index
+--echo # con2: $create_index (expect to get ER_DUP_KEYNAME)
+--echo # default: $drop_index
+--echo # con2: $drop_index (expect to get ER_CANT_DROP_FIELD_OR_KEY)
+--echo # default: $create_index
+--echo # con2: $drop_index
+--disable_query_log
+--disable_result_log
+connection default;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ eval $create_index;
+ connection con2;
+ --error 0,ER_DUP_KEYNAME
+ eval $create_index;
+ if (!$mysql_errno)
+ {
+ --echo # Error: CREATE INDEX was successful though we expected ER_DUP_KEYNAME
+ --echo # abort
+ exit;
+ }
+ connection default;
+ eval $drop_index;
+ connection con2;
+ --error 0,ER_CANT_DROP_FIELD_OR_KEY
+ eval $drop_index;
+ if (!$mysql_errno)
+ {
+ --echo # Error: DROP INDEX was successful though we expected ER_CANT_DROP_FIELD_OR_KEY
+ --echo # abort
+ exit;
+ }
+ connection default;
+ eval $create_index;
+ connection con2;
+ eval $drop_index;
+ connection default;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+--enable_result_log
+--enable_query_log
+#
+--echo # Subtest 6D (two connections, use PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_index
+--echo # con2: $create_index (expect to get ER_DUP_KEYNAME)
+--echo # default: $drop_index
+--echo # con2: $drop_index (expect to get ER_CANT_DROP_FIELD_OR_KEY)
+--echo # default: $create_index
+--echo # con2: $drop_index
+--disable_query_log
+--disable_result_log
+connection default;
+eval PREPARE create_index FROM "$create_index";
+eval PREPARE drop_index FROM "$drop_index";
+EXECUTE create_index;
+connection con2;
+eval PREPARE create_index FROM "$create_index";
+eval PREPARE drop_index FROM "$drop_index";
+EXECUTE drop_index;
+connection default;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ EXECUTE create_index;
+ connection con2;
+ --error 0,ER_DUP_KEYNAME
+ EXECUTE create_index;
+ if (!$mysql_errno)
+ {
+ --echo # Error: CREATE INDEX was successful though we expected ER_DUP_KEYNAME
+ --echo # abort
+ exit;
+ }
+ connection default;
+ EXECUTE drop_index;
+ connection con2;
+ --error 0,ER_CANT_DROP_FIELD_OR_KEY
+ EXECUTE drop_index;
+ if (!$mysql_errno)
+ {
+ --echo # Error: DROP INDEX was successful though we expected ER_CANT_DROP_FIELD_OR_KEY
+ --echo # abort
+ exit;
+ }
+ connection default;
+ EXECUTE create_index;
+ connection con2;
+ EXECUTE drop_index;
+ connection default;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+DEALLOCATE PREPARE create_index;
+DEALLOCATE PREPARE drop_index;
+connection con2;
+DEALLOCATE PREPARE create_index;
+DEALLOCATE PREPARE drop_index;
+connection default;
+--enable_result_log
+--enable_query_log
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/stress/include/ddl7.inc b/mysql-test/suite/stress/include/ddl7.inc
new file mode 100644
index 00000000000..76ba8066c66
--- /dev/null
+++ b/mysql-test/suite/stress/include/ddl7.inc
@@ -0,0 +1,274 @@
+######## include/ddl7.inc ######
+#
+# Stress the storage engine with rapid CREATE/DROP TABLE/INDEX
+# and following SELECT/INSERT/SHOW etc.
+# Subtest 7 variants (7A - 7D)
+#
+# The variables
+# $loop_size -- number of rounds till we look at the clock again
+# $runtime -- rough intended runtime per subtest variant
+# $engine_type -- storage engine to be used in CREATE TABLE
+# must be set within the routine sourcing this script.
+#
+# Other stuff which must already exist:
+# - connection con2
+# - stmt_start and stmt_break prepared by the default connection
+#
+# Please look for more details within include/ddl1.inc.
+#
+# Creation of this test:
+# 2007-07-04 mleich
+#
+
+
+#----------------------------------------------------------------------
+# Settings for Subtest 7 variants
+# Scenario: CREATE INDEX/INSERT(F)/DROP INDEX/INSERT/CREATE INDEX(F)/DELETE
+let $create_index= CREATE UNIQUE INDEX IDX1 ON t1 (f2);
+let $insert_record= INSERT INTO t1 VALUES(1,1);
+let $drop_index= DROP INDEX IDX1 ON t1;
+let $delete_record= DELETE FROM t1 WHERE f1 = 1;
+eval CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, PRIMARY KEY(f1)) ENGINE=$engine_type;
+INSERT INTO t1 VALUES(0,1);
+#----------------------------------------------------------------------
+
+#
+--echo # Subtest 7A (one connection, no PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_index
+--echo # default: $insert_record (expect to get ER_DUP_ENTRY)
+--echo # default: $drop_index
+--echo # default: $insert_record
+--echo # default: $create_index (expect to get ER_DUP_ENTRY)
+--echo # default: $delete_record
+--disable_query_log
+--disable_result_log
+connection default;
+let $run= 1;
+let $counter= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ eval $create_index;
+ --error 0,ER_DUP_ENTRY
+ eval $insert_record;
+ if (!$mysql_errno)
+ {
+ --echo # Error: INSERT was successful though we expected ER_DUP_ENTRY
+ --echo # abort
+ exit;
+ }
+ eval $drop_index;
+ eval $insert_record;
+ # NDB: ER_DUP_UNIQUE, others: ER_DUP_ENTRY
+ --error 0,ER_DUP_ENTRY,ER_DUP_UNIQUE
+ eval $create_index;
+ if (!$mysql_errno)
+ {
+ --echo # Error: CREATE INDEX was successful though we expected ER_DUP_ENTRY
+ --echo # Error: or ER_DUP_UNIQUE (NDB only)
+ --echo # abort
+ exit;
+ }
+ eval $delete_record;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+--enable_result_log
+--enable_query_log
+#
+--echo # Subtest 7B (one connection, use PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_index
+--echo # default: $insert_record (expect to get ER_DUP_ENTRY)
+--echo # default: $drop_index
+--echo # default: $insert_record
+--echo # default: $create_index (expect to get ER_DUP_ENTRY)
+--echo # default: $delete_record
+--disable_query_log
+--disable_result_log
+connection default;
+eval PREPARE create_index FROM "$create_index";
+eval PREPARE insert_record FROM "$insert_record";
+eval PREPARE delete_record FROM "$delete_record";
+eval PREPARE drop_index FROM "$drop_index";
+let $run= 1;
+let $counter= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ EXECUTE create_index;
+ --error 0,ER_DUP_ENTRY
+ EXECUTE insert_record;
+ if (!$mysql_errno)
+ {
+ --echo # Error: INSERT was successful though we expected ER_DUP_ENTRY
+ --echo # abort
+ exit;
+ }
+ EXECUTE drop_index;
+ EXECUTE insert_record;
+ --error 0,ER_DUP_ENTRY
+ EXECUTE create_index;
+ if (!$mysql_errno)
+ {
+ --echo # Error: CREATE INDEX was successful though we expected ER_DUP_ENTRY
+ --echo # abort
+ exit;
+ }
+ EXECUTE delete_record;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+DEALLOCATE PREPARE create_index;
+DEALLOCATE PREPARE insert_record;
+DEALLOCATE PREPARE delete_record;
+DEALLOCATE PREPARE drop_index;
+--enable_result_log
+--enable_query_log
+#
+--echo # Subtest 7C (two connections, no PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_index
+--echo # default: $insert_record (expect to get ER_DUP_ENTRY)
+--echo # con2: $drop_index
+--echo # default: $insert_record
+--echo # con2: $create_index (expect to get ER_DUP_ENTRY)
+--echo # con2: $delete_record
+--disable_query_log
+--disable_result_log
+connection default;
+let $run= 1;
+let $counter= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ eval $create_index;
+ --error 0,ER_DUP_ENTRY
+ eval $insert_record;
+ if (!$mysql_errno)
+ {
+ --echo # Error: INSERT was successful though we expected ER_DUP_ENTRY
+ --echo # abort
+ exit;
+ }
+ connection con2;
+ eval $drop_index;
+ connection default;
+ eval $insert_record;
+ connection con2;
+ --error 0,ER_DUP_ENTRY
+ eval $create_index;
+ if (!$mysql_errno)
+ {
+ --echo # Error: CREATE INDEX was successful though we expected ER_DUP_ENTRY
+ --echo # abort
+ exit;
+ }
+ eval $delete_record;
+ connection default;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+--enable_result_log
+--enable_query_log
+#
+--echo # Subtest 7D (two connections, use PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_index
+--echo # default: $insert_record (expect to get ER_DUP_ENTRY)
+--echo # con2: $drop_index
+--echo # default: $insert_record
+--echo # con2: $create_index (expect to get ER_DUP_ENTRY)
+--echo # con2: $delete_record
+--disable_query_log
+--disable_result_log
+connection default;
+eval PREPARE create_index FROM "$create_index";
+eval PREPARE insert_record FROM "$insert_record";
+EXECUTE create_index;
+connection con2;
+eval PREPARE create_index FROM "$create_index";
+eval PREPARE drop_index FROM "$drop_index";
+eval PREPARE delete_record FROM "$delete_record";
+EXECUTE drop_index;
+connection default;
+let $run= 1;
+let $counter= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ EXECUTE create_index;
+ --error 0,ER_DUP_ENTRY
+ EXECUTE insert_record;
+ if (!$mysql_errno)
+ {
+ --echo # Error: INSERT was successful though we expected ER_DUP_ENTRY
+ --echo # abort
+ exit;
+ }
+ connection con2;
+ EXECUTE drop_index;
+ connection default;
+ EXECUTE insert_record;
+ connection con2;
+ --error 0,ER_DUP_ENTRY
+ EXECUTE create_index;
+ if (!$mysql_errno)
+ {
+ --echo # Error: CREATE INDEX was successful though we expected ER_DUP_ENTRY
+ --echo # abort
+ exit;
+ }
+ EXECUTE delete_record;
+ connection default;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+DEALLOCATE PREPARE create_index;
+DEALLOCATE PREPARE insert_record;
+connection con2;
+DEALLOCATE PREPARE create_index;
+DEALLOCATE PREPARE drop_index;
+DEALLOCATE PREPARE delete_record;
+connection default;
+--enable_result_log
+--enable_query_log
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/stress/include/ddl8.inc b/mysql-test/suite/stress/include/ddl8.inc
new file mode 100644
index 00000000000..85a70770a56
--- /dev/null
+++ b/mysql-test/suite/stress/include/ddl8.inc
@@ -0,0 +1,302 @@
+######## include/ddl8.inc ######
+#
+# Stress the storage engine with rapid CREATE/DROP TABLE/INDEX
+# and following SELECT/INSERT/SHOW etc.
+# Subtest 8 variants (8A - 8D)
+#
+# The variables
+# $loop_size -- number of rounds till we look at the clock again
+# $runtime -- rough intended runtime per subtest variant
+# $engine_type -- storage engine to be used in CREATE TABLE
+# must be set within the routine sourcing this script.
+#
+# Other stuff which must already exist:
+# - connection con2
+# - stmt_start and stmt_break prepared by the default connection
+#
+# Please look for more details within include/ddl1.inc.
+#
+# Creation of this test:
+# 2007-07-04 mleich
+#
+
+
+#----------------------------------------------------------------------
+# Settings for Subtest 8 variants
+# Scenario: CREATE INDEX variant1/SHOW/DROP INDEX/
+# CREATE INDEX variant2/SHOW/DROP INDEX
+let $create_index1= CREATE INDEX IDX ON t1 (f2);
+let $create_index2= CREATE UNIQUE INDEX IDX ON t1 (f2);
+let $show_table= SHOW CREATE TABLE t1;
+let $drop_index= DROP INDEX IDX ON t1;
+eval CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=$engine_type;
+INSERT INTO t1 VALUES(1,1);
+eval $create_index1;
+let $cr_value1= INITIALIZED;
+let $cr_value1= query_get_value($show_table, Create Table, 1);
+eval $drop_index;
+eval $create_index2;
+let $cr_value2= INITIALIZED;
+let $cr_value2= query_get_value($show_table, Create Table, 1);
+eval $drop_index;
+if (`SELECT '$cr_value1' = '$cr_value2'`)
+{
+ --echo # Error during generation of prerequisites.
+ --echo # cr_value1 equals cr_value2
+ --echo # cr_value1: $cr_value1
+ --echo # cr_value2: $cr_value2
+ --echo # abort
+ exit;
+}
+#----------------------------------------------------------------------
+
+#
+--echo # Subtest 8A (one connection, no PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_index1
+--echo # default: $show_table
+--echo # default: $drop_index
+--echo # default: $create_index2
+--echo # default: $show_table
+--echo # default: $drop_index
+--disable_query_log
+--disable_result_log
+connection default;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ eval $create_index1;
+ let $value= INITIALIZED;
+ let $value= query_get_value($show_table, Create Table, 1);
+ if (`SELECT '$value' <> '$cr_value1'`)
+ {
+ --echo # Error: Unexpected SHOW CREATE TABLE output
+ --echo # Got: $value
+ --echo # Expected: $cr_value1
+ --echo # abort
+ exit;
+ }
+ eval $drop_index;
+ eval $create_index2;
+ let $value= INITIALIZED;
+ let $value= query_get_value($show_table, Create Table, 1);
+ if (`SELECT '$value' <> '$cr_value2'`)
+ {
+ --echo # Error: Unexpected SHOW CREATE TABLE output
+ --echo # Got: $value
+ --echo # Expected: $cr_value2
+ --echo # abort
+ exit;
+ }
+ eval $drop_index;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+--enable_result_log
+--enable_query_log
+#
+--echo # Subtest 8B (one connection, use PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_index1
+--echo # default: $show_table
+--echo # default: $drop_index
+--echo # default: $create_index2
+--echo # default: $show_table
+--echo # default: $drop_index
+--disable_query_log
+--disable_result_log
+connection default;
+eval PREPARE create_index1 FROM "$create_index1";
+eval PREPARE create_index2 FROM "$create_index2";
+EXECUTE create_index1;
+eval PREPARE show_table FROM "$show_table";
+eval PREPARE drop_index FROM "$drop_index";
+EXECUTE drop_index;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ EXECUTE create_index1;
+ let $value= INITIALIZED;
+ let $value= query_get_value(EXECUTE show_table, Create Table, 1);
+ if (`SELECT '$value' <> '$cr_value1'`)
+ {
+ --echo # Error: Unexpected SHOW CREATE TABLE output
+ --echo # Got: $value
+ --echo # Expected: $cr_value1
+ --echo # abort
+ exit;
+ }
+ EXECUTE drop_index;
+ EXECUTE create_index2;
+ let $value= INITIALIZED;
+ let $value= query_get_value(EXECUTE show_table, Create Table, 1);
+ if (`SELECT '$value' <> '$cr_value2'`)
+ {
+ --echo # Error: Unexpected SHOW CREATE TABLE output
+ --echo # Got: $value
+ --echo # Expected: $cr_value2
+ --echo # abort
+ exit;
+ }
+ EXECUTE drop_index;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+DEALLOCATE PREPARE create_index1;
+DEALLOCATE PREPARE create_index2;
+DEALLOCATE PREPARE show_table;
+DEALLOCATE PREPARE drop_index;
+--enable_result_log
+--enable_query_log
+#
+--echo # Subtest 8C (two connections, no PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_index1
+--echo # con2: $show_table
+--echo # default: $drop_index
+--echo # default: $create_index2
+--echo # con2: $show_table
+--echo # default: $drop_index
+--disable_query_log
+--disable_result_log
+connection default;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ eval $create_index1;
+ connection con2;
+ let $value= INITIALIZED;
+ let $value= query_get_value($show_table, Create Table, 1);
+ if (`SELECT '$value' <> '$cr_value1'`)
+ {
+ --echo # Error: Unexpected SHOW CREATE TABLE output
+ --echo # Got: $value
+ --echo # Expected: $cr_value1
+ --echo # abort
+ exit;
+ }
+ connection default;
+ eval $drop_index;
+ eval $create_index2;
+ connection con2;
+ let $value= INITIALIZED;
+ let $value= query_get_value($show_table, Create Table, 1);
+ if (`SELECT '$value' <> '$cr_value2'`)
+ {
+ --echo # Error: Unexpected SHOW CREATE TABLE output
+ --echo # Got: $value
+ --echo # Expected: $cr_value2
+ --echo # abort
+ exit;
+ }
+ connection default;
+ eval $drop_index;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+--enable_result_log
+--enable_query_log
+#
+--echo # Subtest 8D (two connections, use PREPARE/EXECUTE)
+--echo # connection action
+--echo # default: $create_index1
+--echo # con2: $show_table
+--echo # default: $drop_index
+--echo # default: $create_index2
+--echo # con2: $show_table
+--echo # default: $drop_index
+--disable_query_log
+--disable_result_log
+connection default;
+eval PREPARE create_index1 FROM "$create_index1";
+eval PREPARE create_index2 FROM "$create_index2";
+eval PREPARE drop_index FROM "$drop_index";
+EXECUTE create_index1;
+connection con2;
+eval PREPARE show_table FROM "$show_table";
+connection default;
+EXECUTE drop_index;
+let $run= 1;
+# Determine the current time.
+EXECUTE stmt_start;
+# Run execution loops till the planned runtime is reached
+while ($run)
+{
+ let $loop_run= $loop_size;
+ while ($loop_run)
+ {
+ EXECUTE create_index1;
+ connection con2;
+ let $value= INITIALIZED;
+ let $value= query_get_value(EXECUTE show_table, Create Table, 1);
+ if (`SELECT '$value' <> '$cr_value1'`)
+ {
+ --echo # Error: Unexpected SHOW CREATE TABLE output
+ --echo # Got: $value
+ --echo # Expected: $cr_value1
+ --echo # abort
+ exit;
+ }
+ connection default;
+ EXECUTE drop_index;
+ EXECUTE create_index2;
+ connection con2;
+ let $value= INITIALIZED;
+ let $value= query_get_value(EXECUTE show_table, Create Table, 1);
+ if (`SELECT '$value' <> '$cr_value2'`)
+ {
+ --echo # Error: Unexpected SHOW CREATE TABLE output
+ --echo # Got: $value
+ --echo # Expected: $cr_value2
+ --echo # abort
+ exit;
+ }
+ connection default;
+ EXECUTE drop_index;
+ dec $loop_run;
+ }
+ if (`EXECUTE stmt_break`)
+ {
+ let $run= 0;
+ }
+}
+DEALLOCATE PREPARE create_index1;
+DEALLOCATE PREPARE create_index2;
+DEALLOCATE PREPARE drop_index;
+connection con2;
+DEALLOCATE PREPARE show_table;
+connection default;
+--enable_result_log
+--enable_query_log
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/stress/r/ddl_archive.result b/mysql-test/suite/stress/r/ddl_archive.result
new file mode 100644
index 00000000000..47c64a6af94
--- /dev/null
+++ b/mysql-test/suite/stress/r/ddl_archive.result
@@ -0,0 +1,79 @@
+SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
+PREPARE stmt_start FROM "SELECT UNIX_TIMESTAMP() INTO @start";
+SET @runtime = <intended_runtime>;
+PREPARE stmt_break FROM "SELECT UNIX_TIMESTAMP() - @start > @runtime - 1";
+DROP TABLE IF EXISTS t1;
+# Subtest 2A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = ARCHIVE AS SELECT 1 AS f1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 2B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = ARCHIVE AS SELECT 1 AS f1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 2C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = ARCHIVE AS SELECT 1 AS f1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 2D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = ARCHIVE AS SELECT 1 AS f1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 3A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=ARCHIVE
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=ARCHIVE (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+# Subtest 3B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=ARCHIVE
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=ARCHIVE (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+# Subtest 3C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=ARCHIVE
+# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=ARCHIVE (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+# Subtest 3D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=ARCHIVE
+# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=ARCHIVE (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+# Subtest 5A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = ARCHIVE
+# default: INSERT INTO t1 SET f2 = 9
+# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
+# default: DROP TABLE t1
+# Subtest 5B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = ARCHIVE
+# default: INSERT INTO t1 SET f2 = 9
+# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
+# default: DROP TABLE t1
+# Subtest 5C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = ARCHIVE
+# con2: INSERT INTO t1 SET f2 = 9
+# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
+# con2: DROP TABLE t1
+# Subtest 5D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = ARCHIVE
+# con2: INSERT INTO t1 SET f2 = 9
+# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
+# con2: DROP TABLE t1
+DEALLOCATE PREPARE stmt_start;
+DEALLOCATE PREPARE stmt_break;
diff --git a/mysql-test/suite/stress/r/ddl_csv.result b/mysql-test/suite/stress/r/ddl_csv.result
new file mode 100644
index 00000000000..3dfa0c8fd15
--- /dev/null
+++ b/mysql-test/suite/stress/r/ddl_csv.result
@@ -0,0 +1,55 @@
+SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
+PREPARE stmt_start FROM "SELECT UNIX_TIMESTAMP() INTO @start";
+SET @runtime = <intended_runtime>;
+PREPARE stmt_break FROM "SELECT UNIX_TIMESTAMP() - @start > @runtime - 1";
+DROP TABLE IF EXISTS t1;
+# Subtest 2A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = CSV AS SELECT 1 AS f1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 2B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = CSV AS SELECT 1 AS f1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 2C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = CSV AS SELECT 1 AS f1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 2D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = CSV AS SELECT 1 AS f1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 3A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=CSV
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=CSV (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+# Subtest 3B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=CSV
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=CSV (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+# Subtest 3C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=CSV
+# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=CSV (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+# Subtest 3D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=CSV
+# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=CSV (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+DEALLOCATE PREPARE stmt_start;
+DEALLOCATE PREPARE stmt_break;
diff --git a/mysql-test/suite/stress/r/ddl_innodb.result b/mysql-test/suite/stress/r/ddl_innodb.result
new file mode 100644
index 00000000000..6417d3e1c5c
--- /dev/null
+++ b/mysql-test/suite/stress/r/ddl_innodb.result
@@ -0,0 +1,251 @@
+SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
+PREPARE stmt_start FROM "SELECT UNIX_TIMESTAMP() INTO @start";
+SET @runtime = <intended_runtime>;
+PREPARE stmt_break FROM "SELECT UNIX_TIMESTAMP() - @start > @runtime - 1";
+DROP TABLE IF EXISTS t1;
+# Subtest 1A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
+ENGINE = InnoDB
+# default: INSERT INTO t1 VALUES (1,1), (2,2), (3,3)
+# default: DROP TABLE t1
+# Subtest 1B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
+ENGINE = InnoDB
+# default: INSERT INTO t1 VALUES (1,1), (2,2), (3,3)
+# default: DROP TABLE t1
+# Subtest 1C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
+ENGINE = InnoDB
+# con2: INSERT INTO t1 VALUES (1,1), (2,2), (3,3)
+# con2: DROP TABLE t1
+# Subtest 1D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
+ENGINE = InnoDB
+# con2: INSERT INTO t1 VALUES (1,1), (2,2), (3,3)
+# con2: DROP TABLE t1
+# Subtest 2A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = InnoDB AS SELECT 1 AS f1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 2B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = InnoDB AS SELECT 1 AS f1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 2C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = InnoDB AS SELECT 1 AS f1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 2D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = InnoDB AS SELECT 1 AS f1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 3A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+# Subtest 3B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+# Subtest 3C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB
+# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+# Subtest 3D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB
+# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=InnoDB;
+DROP TABLE t1;
+CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB;
+DROP TABLE t1;
+# Subtest 4A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=InnoDB
+# default: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# default: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE)
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB
+# default: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# Subtest 4B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=InnoDB
+# default: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# default: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE)
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB
+# default: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# Subtest 4C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=InnoDB
+# con2: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# con2: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE)
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB
+# con2: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# Subtest 4D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=InnoDB
+# con2: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# con2: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE)
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB
+# con2: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# Subtest 5A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = InnoDB
+# default: INSERT INTO t1 SET f2 = 9
+# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
+# default: DROP TABLE t1
+# Subtest 5B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = InnoDB
+# default: INSERT INTO t1 SET f2 = 9
+# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
+# default: DROP TABLE t1
+# Subtest 5C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = InnoDB
+# con2: INSERT INTO t1 SET f2 = 9
+# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
+# con2: DROP TABLE t1
+# Subtest 5D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = InnoDB
+# con2: INSERT INTO t1 SET f2 = 9
+# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
+# con2: DROP TABLE t1
+CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=InnoDB;
+# Subtest 6A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# default: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME)
+# default: DROP INDEX IDX1 ON t1
+# default: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY)
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# default: DROP INDEX IDX1 ON t1
+# Subtest 6B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# default: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME)
+# default: DROP INDEX IDX1 ON t1
+# default: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY)
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# default: DROP INDEX IDX1 ON t1
+# Subtest 6C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# con2: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME)
+# default: DROP INDEX IDX1 ON t1
+# con2: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY)
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# con2: DROP INDEX IDX1 ON t1
+# Subtest 6D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# con2: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME)
+# default: DROP INDEX IDX1 ON t1
+# con2: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY)
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# con2: DROP INDEX IDX1 ON t1
+DROP TABLE t1;
+CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, PRIMARY KEY(f1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(0,1);
+# Subtest 7A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2)
+# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY)
+# default: DROP INDEX IDX1 ON t1
+# default: INSERT INTO t1 VALUES(1,1)
+# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY)
+# default: DELETE FROM t1 WHERE f1 = 1
+# Subtest 7B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2)
+# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY)
+# default: DROP INDEX IDX1 ON t1
+# default: INSERT INTO t1 VALUES(1,1)
+# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY)
+# default: DELETE FROM t1 WHERE f1 = 1
+# Subtest 7C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2)
+# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY)
+# con2: DROP INDEX IDX1 ON t1
+# default: INSERT INTO t1 VALUES(1,1)
+# con2: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY)
+# con2: DELETE FROM t1 WHERE f1 = 1
+# Subtest 7D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2)
+# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY)
+# con2: DROP INDEX IDX1 ON t1
+# default: INSERT INTO t1 VALUES(1,1)
+# con2: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY)
+# con2: DELETE FROM t1 WHERE f1 = 1
+DROP TABLE t1;
+CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1,1);
+CREATE INDEX IDX ON t1 (f2);
+DROP INDEX IDX ON t1;
+CREATE UNIQUE INDEX IDX ON t1 (f2);
+DROP INDEX IDX ON t1;
+# Subtest 8A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX ON t1 (f2)
+# default: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# default: CREATE UNIQUE INDEX IDX ON t1 (f2)
+# default: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# Subtest 8B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX ON t1 (f2)
+# default: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# default: CREATE UNIQUE INDEX IDX ON t1 (f2)
+# default: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# Subtest 8C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX ON t1 (f2)
+# con2: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# default: CREATE UNIQUE INDEX IDX ON t1 (f2)
+# con2: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# Subtest 8D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX ON t1 (f2)
+# con2: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# default: CREATE UNIQUE INDEX IDX ON t1 (f2)
+# con2: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+DROP TABLE t1;
+DEALLOCATE PREPARE stmt_start;
+DEALLOCATE PREPARE stmt_break;
diff --git a/mysql-test/suite/stress/r/ddl_memory.result b/mysql-test/suite/stress/r/ddl_memory.result
new file mode 100644
index 00000000000..1700fbc2745
--- /dev/null
+++ b/mysql-test/suite/stress/r/ddl_memory.result
@@ -0,0 +1,251 @@
+SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
+PREPARE stmt_start FROM "SELECT UNIX_TIMESTAMP() INTO @start";
+SET @runtime = <intended_runtime>;
+PREPARE stmt_break FROM "SELECT UNIX_TIMESTAMP() - @start > @runtime - 1";
+DROP TABLE IF EXISTS t1;
+# Subtest 1A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
+ENGINE = MEMORY
+# default: INSERT INTO t1 VALUES (1,1), (2,2), (3,3)
+# default: DROP TABLE t1
+# Subtest 1B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
+ENGINE = MEMORY
+# default: INSERT INTO t1 VALUES (1,1), (2,2), (3,3)
+# default: DROP TABLE t1
+# Subtest 1C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
+ENGINE = MEMORY
+# con2: INSERT INTO t1 VALUES (1,1), (2,2), (3,3)
+# con2: DROP TABLE t1
+# Subtest 1D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
+ENGINE = MEMORY
+# con2: INSERT INTO t1 VALUES (1,1), (2,2), (3,3)
+# con2: DROP TABLE t1
+# Subtest 2A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = MEMORY AS SELECT 1 AS f1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 2B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = MEMORY AS SELECT 1 AS f1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 2C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = MEMORY AS SELECT 1 AS f1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 2D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = MEMORY AS SELECT 1 AS f1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 3A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+# Subtest 3B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+# Subtest 3C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY
+# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+# Subtest 3D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY
+# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MEMORY;
+DROP TABLE t1;
+CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY;
+DROP TABLE t1;
+# Subtest 4A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MEMORY
+# default: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# default: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE)
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY
+# default: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# Subtest 4B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MEMORY
+# default: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# default: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE)
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY
+# default: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# Subtest 4C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MEMORY
+# con2: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# con2: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE)
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY
+# con2: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# Subtest 4D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MEMORY
+# con2: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# con2: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE)
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY
+# con2: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# Subtest 5A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = MEMORY
+# default: INSERT INTO t1 SET f2 = 9
+# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
+# default: DROP TABLE t1
+# Subtest 5B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = MEMORY
+# default: INSERT INTO t1 SET f2 = 9
+# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
+# default: DROP TABLE t1
+# Subtest 5C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = MEMORY
+# con2: INSERT INTO t1 SET f2 = 9
+# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
+# con2: DROP TABLE t1
+# Subtest 5D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = MEMORY
+# con2: INSERT INTO t1 SET f2 = 9
+# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
+# con2: DROP TABLE t1
+CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=MEMORY;
+# Subtest 6A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# default: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME)
+# default: DROP INDEX IDX1 ON t1
+# default: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY)
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# default: DROP INDEX IDX1 ON t1
+# Subtest 6B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# default: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME)
+# default: DROP INDEX IDX1 ON t1
+# default: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY)
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# default: DROP INDEX IDX1 ON t1
+# Subtest 6C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# con2: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME)
+# default: DROP INDEX IDX1 ON t1
+# con2: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY)
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# con2: DROP INDEX IDX1 ON t1
+# Subtest 6D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# con2: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME)
+# default: DROP INDEX IDX1 ON t1
+# con2: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY)
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# con2: DROP INDEX IDX1 ON t1
+DROP TABLE t1;
+CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, PRIMARY KEY(f1)) ENGINE=MEMORY;
+INSERT INTO t1 VALUES(0,1);
+# Subtest 7A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2)
+# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY)
+# default: DROP INDEX IDX1 ON t1
+# default: INSERT INTO t1 VALUES(1,1)
+# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY)
+# default: DELETE FROM t1 WHERE f1 = 1
+# Subtest 7B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2)
+# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY)
+# default: DROP INDEX IDX1 ON t1
+# default: INSERT INTO t1 VALUES(1,1)
+# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY)
+# default: DELETE FROM t1 WHERE f1 = 1
+# Subtest 7C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2)
+# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY)
+# con2: DROP INDEX IDX1 ON t1
+# default: INSERT INTO t1 VALUES(1,1)
+# con2: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY)
+# con2: DELETE FROM t1 WHERE f1 = 1
+# Subtest 7D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2)
+# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY)
+# con2: DROP INDEX IDX1 ON t1
+# default: INSERT INTO t1 VALUES(1,1)
+# con2: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY)
+# con2: DELETE FROM t1 WHERE f1 = 1
+DROP TABLE t1;
+CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=MEMORY;
+INSERT INTO t1 VALUES(1,1);
+CREATE INDEX IDX ON t1 (f2);
+DROP INDEX IDX ON t1;
+CREATE UNIQUE INDEX IDX ON t1 (f2);
+DROP INDEX IDX ON t1;
+# Subtest 8A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX ON t1 (f2)
+# default: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# default: CREATE UNIQUE INDEX IDX ON t1 (f2)
+# default: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# Subtest 8B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX ON t1 (f2)
+# default: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# default: CREATE UNIQUE INDEX IDX ON t1 (f2)
+# default: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# Subtest 8C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX ON t1 (f2)
+# con2: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# default: CREATE UNIQUE INDEX IDX ON t1 (f2)
+# con2: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# Subtest 8D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX ON t1 (f2)
+# con2: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# default: CREATE UNIQUE INDEX IDX ON t1 (f2)
+# con2: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+DROP TABLE t1;
+DEALLOCATE PREPARE stmt_start;
+DEALLOCATE PREPARE stmt_break;
diff --git a/mysql-test/suite/stress/r/ddl_myisam.result b/mysql-test/suite/stress/r/ddl_myisam.result
new file mode 100644
index 00000000000..82be55b8371
--- /dev/null
+++ b/mysql-test/suite/stress/r/ddl_myisam.result
@@ -0,0 +1,251 @@
+SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
+PREPARE stmt_start FROM "SELECT UNIX_TIMESTAMP() INTO @start";
+SET @runtime = <intended_runtime>;
+PREPARE stmt_break FROM "SELECT UNIX_TIMESTAMP() - @start > @runtime - 1";
+DROP TABLE IF EXISTS t1;
+# Subtest 1A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
+ENGINE = MyISAM
+# default: INSERT INTO t1 VALUES (1,1), (2,2), (3,3)
+# default: DROP TABLE t1
+# Subtest 1B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
+ENGINE = MyISAM
+# default: INSERT INTO t1 VALUES (1,1), (2,2), (3,3)
+# default: DROP TABLE t1
+# Subtest 1C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
+ENGINE = MyISAM
+# con2: INSERT INTO t1 VALUES (1,1), (2,2), (3,3)
+# con2: DROP TABLE t1
+# Subtest 1D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
+ENGINE = MyISAM
+# con2: INSERT INTO t1 VALUES (1,1), (2,2), (3,3)
+# con2: DROP TABLE t1
+# Subtest 2A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = MyISAM AS SELECT 1 AS f1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 2B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = MyISAM AS SELECT 1 AS f1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 2C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = MyISAM AS SELECT 1 AS f1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 2D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = MyISAM AS SELECT 1 AS f1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 3A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+# Subtest 3B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+# Subtest 3C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM
+# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+# Subtest 3D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM
+# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MyISAM;
+DROP TABLE t1;
+CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM;
+DROP TABLE t1;
+# Subtest 4A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MyISAM
+# default: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# default: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE)
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM
+# default: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# Subtest 4B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MyISAM
+# default: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# default: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE)
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM
+# default: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# Subtest 4C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MyISAM
+# con2: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# con2: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE)
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM
+# con2: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# Subtest 4D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MyISAM
+# con2: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# con2: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE)
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM
+# con2: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# Subtest 5A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = MyISAM
+# default: INSERT INTO t1 SET f2 = 9
+# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
+# default: DROP TABLE t1
+# Subtest 5B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = MyISAM
+# default: INSERT INTO t1 SET f2 = 9
+# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
+# default: DROP TABLE t1
+# Subtest 5C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = MyISAM
+# con2: INSERT INTO t1 SET f2 = 9
+# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
+# con2: DROP TABLE t1
+# Subtest 5D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = MyISAM
+# con2: INSERT INTO t1 SET f2 = 9
+# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
+# con2: DROP TABLE t1
+CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=MyISAM;
+# Subtest 6A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# default: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME)
+# default: DROP INDEX IDX1 ON t1
+# default: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY)
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# default: DROP INDEX IDX1 ON t1
+# Subtest 6B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# default: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME)
+# default: DROP INDEX IDX1 ON t1
+# default: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY)
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# default: DROP INDEX IDX1 ON t1
+# Subtest 6C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# con2: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME)
+# default: DROP INDEX IDX1 ON t1
+# con2: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY)
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# con2: DROP INDEX IDX1 ON t1
+# Subtest 6D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# con2: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME)
+# default: DROP INDEX IDX1 ON t1
+# con2: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY)
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# con2: DROP INDEX IDX1 ON t1
+DROP TABLE t1;
+CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, PRIMARY KEY(f1)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES(0,1);
+# Subtest 7A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2)
+# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY)
+# default: DROP INDEX IDX1 ON t1
+# default: INSERT INTO t1 VALUES(1,1)
+# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY)
+# default: DELETE FROM t1 WHERE f1 = 1
+# Subtest 7B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2)
+# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY)
+# default: DROP INDEX IDX1 ON t1
+# default: INSERT INTO t1 VALUES(1,1)
+# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY)
+# default: DELETE FROM t1 WHERE f1 = 1
+# Subtest 7C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2)
+# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY)
+# con2: DROP INDEX IDX1 ON t1
+# default: INSERT INTO t1 VALUES(1,1)
+# con2: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY)
+# con2: DELETE FROM t1 WHERE f1 = 1
+# Subtest 7D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2)
+# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY)
+# con2: DROP INDEX IDX1 ON t1
+# default: INSERT INTO t1 VALUES(1,1)
+# con2: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY)
+# con2: DELETE FROM t1 WHERE f1 = 1
+DROP TABLE t1;
+CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES(1,1);
+CREATE INDEX IDX ON t1 (f2);
+DROP INDEX IDX ON t1;
+CREATE UNIQUE INDEX IDX ON t1 (f2);
+DROP INDEX IDX ON t1;
+# Subtest 8A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX ON t1 (f2)
+# default: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# default: CREATE UNIQUE INDEX IDX ON t1 (f2)
+# default: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# Subtest 8B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX ON t1 (f2)
+# default: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# default: CREATE UNIQUE INDEX IDX ON t1 (f2)
+# default: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# Subtest 8C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX ON t1 (f2)
+# con2: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# default: CREATE UNIQUE INDEX IDX ON t1 (f2)
+# con2: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# Subtest 8D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX ON t1 (f2)
+# con2: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# default: CREATE UNIQUE INDEX IDX ON t1 (f2)
+# con2: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+DROP TABLE t1;
+DEALLOCATE PREPARE stmt_start;
+DEALLOCATE PREPARE stmt_break;
diff --git a/mysql-test/suite/stress/r/ddl_ndb.result b/mysql-test/suite/stress/r/ddl_ndb.result
new file mode 100644
index 00000000000..39146e65fb0
--- /dev/null
+++ b/mysql-test/suite/stress/r/ddl_ndb.result
@@ -0,0 +1,216 @@
+SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
+PREPARE stmt_start FROM "SELECT UNIX_TIMESTAMP() INTO @start";
+SET @runtime = <intended_runtime>;
+PREPARE stmt_break FROM "SELECT UNIX_TIMESTAMP() - @start > @runtime - 1";
+DROP TABLE IF EXISTS t1;
+# Subtest 1A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
+ENGINE = NDB
+# default: INSERT INTO t1 VALUES (1,1), (2,2), (3,3)
+# default: DROP TABLE t1
+# Subtest 1B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
+ENGINE = NDB
+# default: INSERT INTO t1 VALUES (1,1), (2,2), (3,3)
+# default: DROP TABLE t1
+# Subtest 1C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
+ENGINE = NDB
+# con2: INSERT INTO t1 VALUES (1,1), (2,2), (3,3)
+# con2: DROP TABLE t1
+# Subtest 1D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2))
+ENGINE = NDB
+# con2: INSERT INTO t1 VALUES (1,1), (2,2), (3,3)
+# con2: DROP TABLE t1
+# Subtest 2A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = NDB AS SELECT 1 AS f1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 2B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = NDB AS SELECT 1 AS f1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 2C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = NDB AS SELECT 1 AS f1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 2D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 ENGINE = NDB AS SELECT 1 AS f1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1
+# default: DROP TABLE t1
+# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE)
+# Subtest 3A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+# Subtest 3B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+# Subtest 3C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB
+# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+# Subtest 3D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB
+# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB (expect to get ER_TABLE_EXISTS_ERROR)
+# default: DROP TABLE t1
+# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=NDB;
+DROP TABLE t1;
+CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB;
+DROP TABLE t1;
+# Subtest 4A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=NDB
+# default: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# default: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE)
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB
+# default: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# Subtest 4B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=NDB
+# default: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# default: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE)
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB
+# default: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# Subtest 4C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=NDB
+# con2: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# con2: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE)
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB
+# con2: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# Subtest 4D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=NDB
+# con2: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# con2: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE)
+# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB
+# con2: SHOW CREATE TABLE t1
+# default: DROP TABLE t1
+# Subtest 5A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = NDB
+# default: INSERT INTO t1 SET f2 = 9
+# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
+# default: DROP TABLE t1
+# Subtest 5B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = NDB
+# default: INSERT INTO t1 SET f2 = 9
+# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
+# default: DROP TABLE t1
+# Subtest 5C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = NDB
+# con2: INSERT INTO t1 SET f2 = 9
+# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
+# con2: DROP TABLE t1
+# Subtest 5D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = NDB
+# con2: INSERT INTO t1 SET f2 = 9
+# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
+# con2: DROP TABLE t1
+CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=NDB;
+# Subtest 6A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# default: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME)
+# default: DROP INDEX IDX1 ON t1
+# default: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY)
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# default: DROP INDEX IDX1 ON t1
+# Subtest 6B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# default: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME)
+# default: DROP INDEX IDX1 ON t1
+# default: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY)
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# default: DROP INDEX IDX1 ON t1
+# Subtest 6C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# con2: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME)
+# default: DROP INDEX IDX1 ON t1
+# con2: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY)
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# con2: DROP INDEX IDX1 ON t1
+# Subtest 6D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# con2: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME)
+# default: DROP INDEX IDX1 ON t1
+# con2: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY)
+# default: CREATE INDEX IDX1 ON t1 (f2)
+# con2: DROP INDEX IDX1 ON t1
+DROP TABLE t1;
+CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=NDB;
+INSERT INTO t1 VALUES(1,1);
+CREATE INDEX IDX ON t1 (f2);
+DROP INDEX IDX ON t1;
+CREATE UNIQUE INDEX IDX ON t1 (f2);
+DROP INDEX IDX ON t1;
+# Subtest 8A (one connection, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX ON t1 (f2)
+# default: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# default: CREATE UNIQUE INDEX IDX ON t1 (f2)
+# default: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# Subtest 8B (one connection, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX ON t1 (f2)
+# default: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# default: CREATE UNIQUE INDEX IDX ON t1 (f2)
+# default: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# Subtest 8C (two connections, no PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX ON t1 (f2)
+# con2: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# default: CREATE UNIQUE INDEX IDX ON t1 (f2)
+# con2: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# Subtest 8D (two connections, use PREPARE/EXECUTE)
+# connection action
+# default: CREATE INDEX IDX ON t1 (f2)
+# con2: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+# default: CREATE UNIQUE INDEX IDX ON t1 (f2)
+# con2: SHOW CREATE TABLE t1
+# default: DROP INDEX IDX ON t1
+DROP TABLE t1;
+DEALLOCATE PREPARE stmt_start;
+DEALLOCATE PREPARE stmt_break;
diff --git a/mysql-test/suite/stress/t/ddl_archive.test b/mysql-test/suite/stress/t/ddl_archive.test
new file mode 100644
index 00000000000..0c47b5fcdd5
--- /dev/null
+++ b/mysql-test/suite/stress/t/ddl_archive.test
@@ -0,0 +1,51 @@
+######## t/ddl_archive.test ######
+#
+# Stress the storage engine ARCHIVE with CREATE/DROP TABLE/INDEX
+#
+# Please look for details within include/ddl1.inc.
+#
+# Creation of this test:
+# 2007-07-04 mleich
+#
+
+# Storage engine to be used in CREATE TABLE
+--source include/have_archive.inc
+let $engine_type= ARCHIVE;
+
+
+if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`)
+{
+ --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled
+}
+let $run= `SELECT '$BIG_TEST' = '1'`;
+if ($run)
+{
+ # A run started with "--big-test" should be allowed to consume more time.
+ # Rough intended runtime per subtest variant in seconds
+ let $runtime = 5;
+ # number of rounds till we look at the clock again
+ let $loop_size= 100;
+}
+if (!$run)
+{
+ let $runtime = 1;
+ let $loop_size= 20;
+}
+
+
+##### Some preparations needed for the ddl*.inc scripts
+--source suite/stress/include/ddl.pre
+
+# Tests set to comment fail because of CSV limitations
+# (limited number of keys, NULL within index not supported)
+# --source suite/stress/include/ddl1.inc
+--source suite/stress/include/ddl2.inc
+--source suite/stress/include/ddl3.inc
+# --source suite/stress/include/ddl4.inc
+--source suite/stress/include/ddl5.inc
+# --source suite/stress/include/ddl6.inc
+# --source suite/stress/include/ddl7.inc
+# --source suite/stress/include/ddl8.inc
+
+##### Cleanup
+--source suite/stress/include/ddl.cln
diff --git a/mysql-test/suite/stress/t/ddl_csv.test b/mysql-test/suite/stress/t/ddl_csv.test
new file mode 100644
index 00000000000..9f6185c76be
--- /dev/null
+++ b/mysql-test/suite/stress/t/ddl_csv.test
@@ -0,0 +1,51 @@
+######## t/ddl_csv.test ######
+#
+# Stress the storage engine CSV with CREATE/DROP TABLE/INDEX
+#
+# Please look for details within include/ddl1.inc.
+#
+# Creation of this test:
+# 2007-07-04 mleich
+#
+
+# Storage engine to be used in CREATE TABLE
+--source include/have_csv.inc
+let $engine_type= CSV;
+
+
+if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`)
+{
+ --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled
+}
+let $run= `SELECT '$BIG_TEST' = '1'`;
+if ($run)
+{
+ # A run started with "--big-test" should be allowed to consume more time.
+ # Rough intended runtime per subtest variant in seconds
+ let $runtime = 5;
+ # number of rounds till we look at the clock again
+ let $loop_size= 100;
+}
+if (!$run)
+{
+ let $runtime = 1;
+ let $loop_size= 20;
+}
+
+
+##### Some preparations needed for the ddl*.inc scripts
+--source suite/stress/include/ddl.pre
+
+# Tests set to comment fail because of CSV limitations
+# (limited number of keys, AUTOINC not supported)
+# --source suite/stress/include/ddl1.inc
+--source suite/stress/include/ddl2.inc
+--source suite/stress/include/ddl3.inc
+# --source suite/stress/include/ddl4.inc
+# --source suite/stress/include/ddl5.inc
+# --source suite/stress/include/ddl6.inc
+# --source suite/stress/include/ddl7.inc
+# --source suite/stress/include/ddl8.inc
+
+##### Cleanup
+--source suite/stress/include/ddl.cln
diff --git a/mysql-test/suite/stress/t/ddl_innodb.test b/mysql-test/suite/stress/t/ddl_innodb.test
new file mode 100644
index 00000000000..784ba8ff003
--- /dev/null
+++ b/mysql-test/suite/stress/t/ddl_innodb.test
@@ -0,0 +1,49 @@
+######## t/ddl_innodb.test ######
+#
+# Stress the storage engine InnoDB with CREATE/DROP TABLE/INDEX
+#
+# Please look for details within include/ddl1.inc.
+#
+# Creation of this test:
+# 2007-07-04 mleich
+#
+
+# Storage engine to be used in CREATE TABLE
+--source include/have_innodb.inc
+let $engine_type= InnoDB;
+
+
+if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`)
+{
+ --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled
+}
+let $run= `SELECT '$BIG_TEST' = '1'`;
+if ($run)
+{
+ # A run started with "--big-test" should be allowed to consume more time.
+ # Rough intended runtime per subtest variant in seconds
+ let $runtime = 5;
+ # number of rounds till we look at the clock again
+ let $loop_size= 100;
+}
+if (!$run)
+{
+ let $runtime = 1;
+ let $loop_size= 20;
+}
+
+
+##### Some preparations needed for the ddl*.inc scripts
+--source suite/stress/include/ddl.pre
+
+--source suite/stress/include/ddl1.inc
+--source suite/stress/include/ddl2.inc
+--source suite/stress/include/ddl3.inc
+--source suite/stress/include/ddl4.inc
+--source suite/stress/include/ddl5.inc
+--source suite/stress/include/ddl6.inc
+--source suite/stress/include/ddl7.inc
+--source suite/stress/include/ddl8.inc
+
+##### Cleanup
+--source suite/stress/include/ddl.cln
diff --git a/mysql-test/suite/stress/t/ddl_memory.test b/mysql-test/suite/stress/t/ddl_memory.test
new file mode 100644
index 00000000000..5178439bff1
--- /dev/null
+++ b/mysql-test/suite/stress/t/ddl_memory.test
@@ -0,0 +1,48 @@
+######## t/ddl_memory.test ######
+#
+# Stress the storage engine MEMORY with CREATE/DROP TABLE/INDEX
+#
+# Please look for details within include/ddl1.inc.
+#
+# Creation of this test:
+# 2007-07-04 mleich
+#
+
+# Storage engine to be used in CREATE TABLE
+let $engine_type= MEMORY;
+
+
+if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`)
+{
+ --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled
+}
+let $run= `SELECT '$BIG_TEST' = '1'`;
+if ($run)
+{
+ # A run started with "--big-test" should be allowed to consume more time.
+ # Rough intended runtime per subtest variant in seconds
+ let $runtime = 5;
+ # number of rounds till we look at the clock again
+ let $loop_size= 100;
+}
+if (!$run)
+{
+ let $runtime = 1;
+ let $loop_size= 20;
+}
+
+
+##### Some preparations needed for the ddl*.inc scripts
+--source suite/stress/include/ddl.pre
+
+--source suite/stress/include/ddl1.inc
+--source suite/stress/include/ddl2.inc
+--source suite/stress/include/ddl3.inc
+--source suite/stress/include/ddl4.inc
+--source suite/stress/include/ddl5.inc
+--source suite/stress/include/ddl6.inc
+--source suite/stress/include/ddl7.inc
+--source suite/stress/include/ddl8.inc
+
+##### Cleanup
+--source suite/stress/include/ddl.cln
diff --git a/mysql-test/suite/stress/t/ddl_myisam.test b/mysql-test/suite/stress/t/ddl_myisam.test
new file mode 100644
index 00000000000..8d6226e573b
--- /dev/null
+++ b/mysql-test/suite/stress/t/ddl_myisam.test
@@ -0,0 +1,48 @@
+######## t/ddl_myisam.test ######
+#
+# Stress the storage engine MyISAM with CREATE/DROP TABLE/INDEX
+#
+# Please look for details within include/ddl1.inc.
+#
+# Creation of this test:
+# 2007-07-04 mleich
+#
+
+# Storage engine to be used in CREATE TABLE
+let $engine_type= MyISAM;
+
+
+if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`)
+{
+ --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled
+}
+let $run= `SELECT '$BIG_TEST' = '1'`;
+if ($run)
+{
+ # A run started with "--big-test" should be allowed to consume more time.
+ # Rough intended runtime per subtest variant in seconds
+ let $runtime = 5;
+ # number of rounds till we look at the clock again
+ let $loop_size= 100;
+}
+if (!$run)
+{
+ let $runtime = 1;
+ let $loop_size= 20;
+}
+
+
+##### Some preparations needed for the ddl*.inc scripts
+--source suite/stress/include/ddl.pre
+
+--source suite/stress/include/ddl1.inc
+--source suite/stress/include/ddl2.inc
+--source suite/stress/include/ddl3.inc
+--source suite/stress/include/ddl4.inc
+--source suite/stress/include/ddl5.inc
+--source suite/stress/include/ddl6.inc
+--source suite/stress/include/ddl7.inc
+--source suite/stress/include/ddl8.inc
+
+##### Cleanup
+--source suite/stress/include/ddl.cln
diff --git a/mysql-test/suite/stress/t/ddl_ndb.test b/mysql-test/suite/stress/t/ddl_ndb.test
new file mode 100644
index 00000000000..7eb45da8739
--- /dev/null
+++ b/mysql-test/suite/stress/t/ddl_ndb.test
@@ -0,0 +1,56 @@
+######## t/ddl_ndb.test ######
+#
+# Stress the storage engine NDB with CREATE/DROP TABLE/INDEX
+#
+# Please look for details within include/ddl1.inc.
+#
+# Creation of this test:
+# 2007-07-04 mleich
+#
+
+# Storage engine to be used in CREATE TABLE
+--source include/have_ndb.inc
+let $engine_type= NDB;
+
+
+if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`)
+{
+ --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled
+}
+# Attention: We set here much smaller values for $runtime and $loop_size compared
+# to the other storage engines.
+# The reason is that NDB is extreme slow and should not exceed
+# the "testcase-timeout".
+let $run= `SELECT '$BIG_TEST' = '1'`;
+if ($run)
+{
+ # A run started with "--big-test" should be allowed to consume more time.
+ # Rough intended runtime per subtest variant in seconds
+ let $runtime = 5;
+ # number of rounds till we look at the clock again
+ let $loop_size= 3;
+}
+if (!$run)
+{
+ let $runtime = 1;
+ let $loop_size= 1;
+}
+
+
+##### Some preparations needed for the ddl*.inc scripts
+--source suite/stress/include/ddl.pre
+
+--source suite/stress/include/ddl1.inc
+--source suite/stress/include/ddl2.inc
+--source suite/stress/include/ddl3.inc
+--source suite/stress/include/ddl4.inc
+--source suite/stress/include/ddl5.inc
+--source suite/stress/include/ddl6.inc
+# The following test suffers from
+# Bug#26043 UNIQUE INDEX create always fails after constraint violation
+# and is therefore set to comment.
+# --source suite/stress/include/ddl7.inc
+--source suite/stress/include/ddl8.inc
+
+##### Cleanup
+--source suite/stress/include/ddl.cln
diff --git a/mysql-test/t/archive-big.test b/mysql-test/t/archive-big.test
new file mode 100644
index 00000000000..414b689b180
--- /dev/null
+++ b/mysql-test/t/archive-big.test
@@ -0,0 +1,25 @@
+--source include/big_test.inc
+--source include/have_archive.inc
+CREATE TABLE t1(a BLOB) ENGINE=ARCHIVE;
+--disable_query_log
+INSERT INTO t1 VALUES('<W*a8,mnd-Kt35R&Z\"-ZgzY-iUPm^o:j5\\W\'PFM6_bRV:Z@ixJCQOw8GANFVahj^wcjnm^k(wOa\"uX9LXZ@hv>gt:Y;V(Wh/DM;z\'@Scyb^2u*b:8GBTan./A;D(7x(PB98IL%ipw0x=^H,>8=i%m\'heEdN:pR*o%Ywtf&x]H2[]Ex\\Bn1>\'EhfGmw56OpkO(n$VpXE2d.M#Z*XevKM$`Er;euB&2e3d-HdFlw;RobzhxMQ3EFn&aCf`5y79V/\"UmMt-t36S(aAY&Ekt.w@m4Q!G,@@]?\\<Pazh\"\\79X7D3m[\\@gnt\'RPzBq@&6y5.)z`POzG+>:D.R;j1Kj[j*&\"n8cq6Me>@fgW_Wx$821=#0fAM@75D7\'Wi2T8W32B96C2kQ5MiO2C>NP-(!fms!;I?Biu7F?G*6o[Z54D?LCJ/H\\#+M,-;$?Rd\'-Ii`+GfW_\\5-zRc\'.M%dV`dYpOv2,\"`L;\"3u(Xk9pU8Ry79Z?fo\"K=-b7#FxX0!OS6Oma\"uZ@m1C?Q]c\\*P=z\")Hq/(xSsrd\"j&n(m{J9x#4y:KM%cSV7LZft=gzUtse$tM`#zsV35Oqsrf,=0u-q#H-@=Qc(1\\ddM6`gke>>^F{fmt(Zuey[9G=;O_tRx1zH2[Z9E5rjDL8j<)RIVX<\\Bq@\'<<X-nqmT:`_@Y*Yl<yz#/a*@I1S9[G/S9``Chja*E]-]va`Eq8V34J]wg\"c[{&=CuT!?[4+u@uX;U$H),@@bRS11DGt@wfvJF`7-u7KSFBVmMostran-)\'(0YW/x@m3Kd<;Pc-ImokLw>cbFq2;qS+q*lprp_gnv/t0$`Ep4HP>$4w-iWW35Lc7{8<bcK0GWbl\"R_l(r:_Y$:<^NH]&;:Pe7trbsD5v%Fr<es:]MIgRD=E\',EZxtcp3D=F-Ii\\pFHvH@DrA(@I5h:z,]u]Sh9vvs_`I.CK4[Uy.iUMb-N)uH?Bl)tA#$*Ea@UmO#WscxX0zH4d,AEvRo`tOf;/r&Ve{c^1po]da=G1[_LA@\\629duIFa?Sd&\'1^p>zxpK`+KyLKs.{Si>3#PR.,.@>Uqd%zj(wRpe,@Cm)q4D<>caAZ+[qQy9HCT_e_3sy0qw,b6#Fz`QT7Qv+a4v\'N;xxudtC+FcJ%p9``Cjt0)vJKt7JO5T10<\"-\\qK_#&2iIke<7?tY@m4Os$H((0TC/[did@K<)TU0)vJJq(eO;uj6aq>u_Z*Yi+1S6Pqo`qA*Fg\\u`_ChmkXU&SU8Pod.M{Q[[:LR=rR&\\)L.;\"1l\\i\"Z0u1)s;a_>Q^k&js+lkYY7B*FbEkr&U`hljR9cp01GUYAtRw/qz8>m:k=)M3Oy>`OMr\"Bju6A\'<:LUKWV.yJ>9Axft@va`Be\\#,RC5#EwV)]&<@gr-zQavV-ox56L_!wh&uM\\k,0Ia7\'YrYI?>W&N<{)L*).JmlZ]H0S9[I9!5)i`,N.7d\"m/:r\\UutlDH#hp!F#rIO4Q&\\*TNiO-0GWeyY/v59``ChiYbf]#,O6W<ccK/A?W\"73:g%tIIs5C3pg9y*TPv-lf><QhAEtHCXq[SjG_/_\"ym<wpP{F%ygwI@EvPg>8Ayk1EN;xwpQ$Vi9unNu-q#I1Q/1HZoHRGL+,<-gL\'p1;pQ\"MERQ#OO{J<-fFh^%2kP08h2T:\\LDQNpty*V\\NO(lu1(o+xMS=qMhL\"Y\'K-9tlDJ,8q`it4:g%q=sW8KWU,mng:)Yl=#3sz3\"MFWexSpauQod-G_4z;KL{Sg4c$xb`B`Dp6OpnZU$Er;er8T(^.`(:/u33ECbL5`hq%S[TsmLmkUGARYNXV*b>I:#<I;,c>G.Ii\\rPs\"<KJp\"G)1XNa#xi\'vRn[\\AjzQ]efVZD%&/Y[An5Orx-fGkme6qd&%&0\\fny=[<TtupU8T(^0fAL>0omXQkN&gb8+i[n@.`\'5qjERPy<W\'RPx:O`zm7^\\79X9LUL[gwKLwBw]LFVbn+yUx\'I\"bUcvN_tT%QS/++2[\\@ebAZ)QEFlt-p\"G(.Jmnc+?BjxG1XQn\\bYxvj6d$sJQ;oIZj1HYl;xvl?.b3mVHGfV\\NR6NjS@&7&QOw7@yn?-]sU-t7JO4Q$Td{fkmd0Z\\E\"o;mB;Bv\\E(.P2A2t#?Vw$:<[?bZz#0f>>Y.oty.iSD;:M[ccM6`kyI8z.gIq,vAv[Cx`Y!-\\oEDeV`dXk:uj8lFTX@qGJzW#;D(7x)UX?m2FM6][4.*%tJR@+O5T0.5_e`81./?4%Ywtcp6NjUIK\"\\512I[qOrw\'N9oOyAk%gb;:PiF]*M-3XJJp&Yxvl=&B\\0qtx(K)&#tU*hX`]4(eRHTQv,fK%l$]6/*!bYwqU5A.[j++4d*:\'OA7.yMMyI8x%>LG]\'ASczfo!G*8x&CcRPw44D>J=0s\'Wh0H`2n`uSz8@v^Sd%{n<ueyX-ka(:-mjS=qPv.pw/r$L<\'I!_G%ydfYh($tQsvx!+SGK\'vN]m7\\UqbuPiIliQ8]TmQ-%l%cN=&AVsf,=1y@flmb\'1azk.9r_d[{%8/zMMv:Rsqd%{n:j8i:wy\"+Q@-X]MIcBY#6,r,u:Y8E7$Fy[<Uz2x9JL%dYoIZm>\'AWupW@v`\\/jWRv)WexSrjCK1LosuwvpS-zRf3^hu:X309h1O#WrcxX0yG0S:bf\\zyucn(jmiKs1/4YLP/4W@wcheFid=Ak&hiZft?qIRD=Cxa[*SJ[k3S.&n+zVz1t)]\'ATe(.Kq$QQ)n#PS5GJzW$Be[vi2R-$ggUS$NFPGO<yxrV7KWX6A(<8E7{89W32>(Eg]#)BVmKfK#cUajs+kfBRZO[aZ$95?yqPu)\\#/`%)@G*7rh6h7oU;`]611A71-/CGwQjIj`)=>\\=X-j^tW4:euD-O1A6*h[m<z#0e9)ZrV7KUNf=<Pd-GcFlv33C=F-GcDcM8lDK-9wy$4y7;`Z\'I{^Cn1;r[Qd*:)Xg&wW/v;W.u34IXabL3WE1_uV0%bN?/hL{ToWF7\">UsmKjZdmw9KQ9aggO7_`G!fjfFcGtAzoD>I9z0ne5mR3A2og<0v6=pIVX=_QU<fuB%)@I2WJL{Sh;\'M4WB\"yn>\'D`A^=P`rGEdO>(HvE1_sL]pD?OR3?)IvC&.R>xm?.c4n]c_5\'[%81)t@ym<vl@3y=V\"<KJnt\"?Wz0nf<1zF*8w%AX#:?l.4YMUIKzQc\'-Hi_&2g>9C(9)[woJ_%1e5mT=m;rZJCPMornXKP3IXdp.(wTv#:?l.4\\Z2&cL0I_+N.8k@738`cRP{G+<0t+i\\oB7,r+mt&M=)N4V<cg\\xqOrw(PEFm\"OO&bI($tOjN\'kr&UcvM[baCf`1hHi_&5srf/Kmm`w\\G0T<l6_d]\'C[-_)?G,AEuKQ:exTttmJb:308g,;\'L/CH\"fjc7$FxW)[yxpNpn^hu=b`?TnR2<tahiYcg`1e:-k_\"yl6_d[\",UNhGeQC96@#(=>^H+:&J)\'\'-N&inm\\dfV]Re+>7;`Y#7-xH:(RPu.q\"DsC1f;-j[j-5`m-+/JlfAJ6h6kESR(fUU23FJ%m)tA#%.VMa*@F&#w_Xxz$5z9C+E\\*REB\\.fGjhM(vMWQpjCL9r`ggVW7GCXsctG@I2ZW)[uez]Cn1?*M1EL1I`.Zdls%PJb7&QOx:Oa$%*D\\)L.;{,YfvG<3*s8S\"Co4HTNjR<oJ\\rS\'^3x69Z@k\'r=k1HXfyZ3)o(eUZF-Kt5?zubjq\"Ey]DyaXsdy[;O`w`WrcvRpc%%(7!:D)<68S%RXE0[`VlCGwPb%(5rnS3?%91*xRkLs-s10=#4x3,zUvwwr]W#<H9%FuH@F\'\',HgW\\NO\'kqx0u2+#gi]xi+0Mv7D3oax`XxxtdvN[ceTR$R[RjF[xrU5C5y4-%jr)bAX{/fANGWeyX+dDbGxUx)QHSK]t[I:\'N:scsB*Gg[pLb3jKs/%f`3pjFXk<$:;V(ZwmDCdU[MO,$l%dTYE/R8]TkDOB;Bw_Tg1T;es9Y>eh_)CWqZP_rGFjiVPna{l2HXdr8U-w@m5S,vAtS#I-BG$o8_\\63;mA6)dK+,>4)lptvwxwoLgIq-zP^hvAw^Q[Y0zH4c&&,Jt6GCZ#3w1#Ui;&Em{J;&I&vSv&GyY0xAm.5]\\<Qe0VHD[%<Ap=t]Wy)QDBZ&Em#Sd$w\\E&(6rkERR&Z$7,r+mry3$Ug0Mv7F?G*5jFXl>-]wh)%xb_;D&*?CrB,N-1Kka*@F#o;j6am)uB&0[fo&^5&XpU7Nd6w\'I%r?zu^Y\'M6`jwAp?&8*b@R`l+\"da;=_NG[vh+3\\_I3YRmVE7#Ciq&Xr]Z0u1(lx=^I1S9^TkGXi0I`2lYW,i[j-7h7oV>n=yyueyW(Xi2R-#dYqW?n8cr>pHSK[l7cuLUHK\"\\9B#{u]Q^gnv1$[*SNkY[BsIO2EJ*)1XRpd+;.nlYU$FzbYvoNqw,a5w*]{{{\"$-WT%RS/-0JhTMb/XT#Fy[;QiEVez`OKiVRx1{I8vulDFs>qK^{vbgb<<Y2*uC\'5tsi8q_d_3v*_-VQt\"9=ceUYD(7v\"6*khM(s>qJX^Sg3_j!Vsh3[Y0w;Sv&GxQiBJ3WF7z63;nFN7csC-SC5x1x<Y3-)%tM`#!vbf^)FfZl:pU5GFha2jKt36V5C2kQ6Qy9H?Co7V39blyF+@Cl$^=NTA(=?aVg,:\"4%WnNt+fQ?)Gmv58X;W/xCx`Yz)N3Ov2-\'xZ6=j.<\'Gr5IQ={$2kTB+K\"]9Ayl5YIAI.DM=(L.<&DeXj6an-,3[X,fK$d\\$3pkLs.xF/P1<ws]W\"6-xH9&J+1R4EC`A_Bhj`\'5sqbuOf:(TYF/TD4tuvr][4-#cU^];IBL;\"2rw(QGN7cvN]n9f$p8^Y&H\"cZxwoJ`,O0>)L-7kA@Z-gM++3]edK,4^edJ$jyH7rh8raq:clw9M\\i&o.-5c!izRe0S<j0FSPy;RmWKO.3U<fvD.R<m@1oiCOFRMjUIM*\'{i#`I-=0pstq^bT_aNB>QavV*eK%n+{]@aQR*q,xH<2#Te)2\\aUd#o:h,4`p<oIXdo+u?qIRFGmy?c]0iO-0GZoHSOqpd)3d+<4-\"`H((1YW+fN5WAv]NN\"Sd$uU*dGr3=wl>(J%m)q4D=E&*<3-#d[z\")Hp+r13LhN+($uT%OH\\vf\"bXoP#QXICUf((2`vW0#Z+[rT*mqssj>/l`{qISJWY@l-2Q+u>l4S.%hi\\pHQA2pkMx@m3J`,O2DCeYoIZk6_cYqU7M_{rQu)[uduHBQT4C:47W7HFeUV6F@LCJ.?60/7g.BH&x]F*7rj=/mc/TC2kQ4K_#(==Y1\"R_k\"X$?Q_n2B::Su#>P\\_NGXg\'!i\"[0t,nsw\'J*,=4*q,wF1^o:j3R01EI%o4IXbgc@NKj^yk3Ow7B*GgYg#hp#L?5+q,vC\"wdks([z#/_yl6][64@*L*\'$yen\"MFTXC%\'6uz,^\"{yoHRHQC95;h\'zaWq[TqbwX1&eXg%sHGkjY^QYNZ_QWF8$FuKO/6_d_1kVL[guAxeo)knkS=qNl^rIRB5#G&#v\\J=0qx0s&T\\TnVC.UJQ;pPv2)r6KZg{Z1\"OQ,#aPMnjLv<]I7mO\"QYN[dg]ysYC\"tS%S[Qd-HfO:oMnkQ1<woNomXPiG_4x55FFifGlpqkIfM/;z*N4T4@(BUi8oT7NgDWlA<H7tp\\W\'OB=I:(PEI#hmpnZX/w:Sw)Wbhi[k2KfGkmg>=TrkFWcq8V2/7ctG@J7oWF8\">Vx\'Fp/.9oS/-2Q,ySlO&fZnDB_?X(O@3u*`1jO,)(*:*]$1gBL:y(Gp,wIAI0KorsnP)lu/xArFBVmKgM,/GYm@3w0yF*8y-d>DwW-r(^/gDZy\"*L+*0P+yUw%AY%Cf]%6\"Bjt38\\NR6R!Co3FJ%o2@.^zqMfBRZO[aYz%:7D4qlMt/\"Wwy\".`&3jIke=<Tv$=KDSYH;0v46R\"H-ABfeK(zb\\(Gp-\"[5.)z^G*4d,AG$sKWW32>(Go(g]\"$-TJRD;<[<Tw\'L/CDku46T*lmb\'/WQm\\b\\,[k5XE1_tOkR;i-;\"2rw(N8j8pV?qHN2KgJyP]eia1b*@G(+>:E2b(4kN{OS6Pt#AaOCDks(^/e<7>n@-Ydkr\"Bir+ox6:]PYQh?=TpasE;8D0`yh{[50/;z\'DaGwQg<0v3/2KhP6ZKF]+P<uf%rB.WV/\"TkDN?.a.UKVQu&K1Kkb-O,+2YRlR6Onf6qe+;-fHo\"MGYnDB`Dn*vF3iDPKgJwG7w\'H!_I0Mw=_PS18bn,#eb?NMu47W:V-nrv!2t%L7i:wvpQ#QYKN(r8W5<nA4!Bl\'lw;Tz75GFifIt:X7A\'9,kc2d.O,\'y_MEROu.s-t37W:U)^/b-Q6S+q,s5A.X]J</mg><RlN!OU?tZE)6rh6lJgQ@*N0>.fBR[Trh8rcwU%L7j>0olVGAONw;V(YnEK+.DPI]{yt\\P[Z7>oC:8IL\'o,$gja*FbCbL3XG:+eGp(ha0a(7x,a0c-Jt39cp16]X%GwQiDT]X&H!aTal%`AaM<&@UmMr$J3YO_sMa(9+dFhc<;SrlLoqpbzdh`-R@)Ho$VlCFtD0_sOjQ5Nnf8z2zCsGD^3x56OkXV+fO7aip\"Ex\\Bm-.>1t(Wg(%zl1FN9oNrz:E0[aWr`hkhIoz?`NFSPw56PplQ05WB!sU-u8Og?@d^0iM\'n&cL2P$Wsf\'&\'1^n6XByk/>/iP3IZk3T4C91*zW&M9oQ)jhQ;l?-^zsU.#]8;]KAAcWh.@;G6ri;%@UpZRjHa80&f\\z{\"(BTd\"j&m$[,_(<8F:-ortrd\"l+(\'\'0Z[=Z67R!Bit6C2iJnsy0t)_/b-N+%rB-R@*K#aK6d#qC7&SXB\"wclv6?vbhfM/;z)K&p4HSIVW48[I=4+u?m6[Qax^ONw;V(Zvj6`l\'ku0%dU^Z.jY`Z&B^;F2c\'0ZZ;Ttwy#0f@EzaZ{*N6ZJCRT5EAR\\]@bUcuIGh]xj2Nu/{OS9[H4e.Lv<]I6jBFvMWQqlN#UnP\'eTT/\'o,#cXmEL1Jb9.s/%bN@4\"G)0T>u_\\3&\\*RFJ#bUbn-)&\"p?\'@OP)q/,/FV`dZt`f_1jR:fyUy0omZY406ZNWOb*?@d_3v+b;:PiEXmEJ(\"k(uJIq(dL.=-b5v&GuG=;MXU\'Xk=\'Ejmg@F$rFATe(,DVdz^H-BH\'&&+CUf)/N%cOC?R`q?yu__?Z/prqbwW.t22A3u\'RQ$R[W\'PDEm#R_k$^=Rd,@Biq%UcuJL\"[0t+gSIRFFkoqnVB(;42?\'@PWF8&OB;C\"v\\LFWg+5d)1\\bZ#5&Vg.CI+5e.HdEf\\xqPu-nof6nU>qJX`[,`,O2EGuE1^qD9/\"Vq_gljR;l=$7,nt%I)*8z2v.t1+$m*wNXRstnO!LETW?n8bl$[-c9,liM&kt0&hgN3LgKzRe.Kpy;LS>ucn(knlWN^tU+i^\"\"!!!\"$/^rMd8%L5]_F$rGFjgM)z^I.H`3u$BbRP\"J8sh6g4`q?!#)EbGwO`w\\G0R8W9PlTA&5u#=NQ2?,X_Wsh2T9]NN{NMu5=qMgJt8Ne7x*Xcm\"OS4D<BsIP8bkw>caA\\3#NH\\yvexTtvtg+5g6lKmiM$_Cinqqg3_m0;xwnIYh))/Q4HP>$5z:F4lR4GN3Q\'cK.<\'J%p7U0+&uM^qFDaCdYmDFo*u?n<tajq%SYLM!TjDL7i6g1R4ECaEp04U6IQ?\'@MH_/`&/XX44GJ&q9`^=MP..:z)N4T4@\'>DzhzRh;)TV5A+O3LhM*%rC3mZZ8E3lS8ZCygt>k.8nP\"PVA\"zqNma#zn>&>I9z.gGh_\':1%bK/CI*,ACl#Xz+UU0(r7Rz=Tri=-eD].d:.r(]+TNjQ8[MN$\\1t\'U_`H&{k,/CJ,7oWE4kO)q3@*K#`I,:#:?j\'tD2hDT^^Bgjc6w(PEGt=j*\'&\'1^p?$2lVJO2GRKa,KzSh;)SNng?>X+`0c1^l0?1ohADsD5u\"6-yNS9_[0omYU#Bgi]u]OUA\'6x.k`{rMe;2*vE1_sL^wes8T\'Zyxtaipx2&aCe[xrW<b]3!E#o<pOu*b;9LWU*dIzVx)P?-\\oA0hKu8OiImppc#uX6?xm=$6\'YrZKJox7<er5FFjk\\k-6d!ixI?>W%I&vV(Zvj5^bWk<%>MKnrrmLpy529h/EQMk\\i$hmne4i@>Usj@9>j(xTy0ptw$;BvY9LWU)b>K@>W%Fs?u]OT<i(#p=t^Y&I#is22DCcQLfHkmd0ZZ:LS?\"&8(\\&;9M[dg\\ubkv8IIr.#^>W#<I>8=h$hkf@I3]da@Ti<*XclzG.JnqrmNw;Sw\'N:r^_DsC/\\hxLLwAuT#G\'%$#!xj/BCdYpOt)\\\"+O4S+q,wC\'/XSy3&`?TkGZrV6HJyOXOe5nVE5soZRjF\\&:8GAOLorrh8tmJc>Dx`Tf,;*Zm=%<@n5QzAjzOVF:.q\"Ey`QU<gwLN&gc?K@<LKr,t6GD^5\'^2rtsh5d%ygxOYTz9>n9i1Lnof4d,CMA9<`VmH\\zyubhi[i&sC0]n:j4[V#=P\\bYws]Y*ZoIYg{]@cZxvi/CI(%yfq-#aNA98L\\k0A:=b_;C#yl4R)ls#FxY1$\\0qtx%?PWG?DxZ9KM)vIGeQD>LG^)JyQazi$feK&r=pHRGJ$ip#K7nP$Xx{)Ht=h\"`L9pYLP/7bsB*GjhN/8lDH\"da=H4g5kESV:V.u5?zvf\"d_4{?aPKgL(xUz613J_(=@eeO9l?1rv%En*s9U+h[k4WAwbbL6`l%dV_^>TqatKR?$0e9)Yl?.c3mWKQ7[NR4IVX9PjKr,p%Vi7kCH#j!Up\\Z54D;=]E\"o<s\\OZV\'U\\UslFSS*mrx,dAS`m,)(*:*]$1iHhZj/@74?#*Ir11A9:U$J1NzH2]ddJ)$tPn`sJRC8,ox7>n=!(EeUZF.N%dU]W!3{DwW/xAqB0c/TD7&PKeAR[V#?X&J(&$\"wep/+,:\"4\"I3ZV%K3XG=9E1c*;0v46S&WlDGuE5pd)4g7rf,?=Qe0S<j2Lj\\k.8nNv5:bhfL(y\\Ais1-,6h6kEST1/;uk>.b4pd,AEtHFfUW;W/{NO(kqy3*s6JTJVW34Lc5sq`m,\'y`Tap9]Q_j\"Y)SNl^sOiM$`G\"glnhCPLjX\\H2\\_K;%BaI*/Mw?i\"[2#R]aPNu1(n%]1s\"=Qb%\"wchc=An5Pw2*vD.S=sYC\"sOl\\fmw43D=G.Jnsy/l_yi&o2?+RFFjmg@Cn1<wrXAv_Ti;\'I%o3EEjld6uy(HwKL!UnR17]Z/on`vV.u8IM+))1[]E\"o;oIXdn(ieBWq]Z2&aDjr&T\\X\'O@3z=V\";H<0x<Y54FEheC\\,[pGN6^_EvN_sPnc(3g:%Fq6NjR9cm#Xvtf%vU&SW>j*\'$yh$eb<BrGEeUX>hyOYU%L8mH\\wi.@89S{>V{4)g\\t\\OXMZ_Tf,=4*p\'cJ*+7tmLnm[aZ!+UPqrjA@]:D*AK:xz&=F,BK4_iv?l1B>LJkd7#AaM>.e@K;%AZ-c8+hVX9Of:*^*K\"\\8;`Xy\'DdTT/)wO`xceUX?k,.?76E?J:$=KEXoNqtx&CaFvMWQph=2#S^edJ#d\\&;=\\Ahr,u:W1*xO[_ONx@j!Vvxz&:8JM)wN]k,+5e-DQOw9IGh\\rR#NEPGRGP=z\")EbFs>qK[m8h.AChlhKxF/Q4Ka/XY9JL$e[yxrV8Nb,Js0*{`NDH$n0;vl?1okN#Z*UY@n7[LMzLHcAWrcvRn\\aWmGWcm$Y$=H8x(K-7kAA^>W#=LKs0(r:_Xx$833HQD@R`n0;uk;x{\'ATe)2[^K:!1ppc%{pB7(_2pmT;g\"bUais-v=caA]:D*=;NZ^K>3#PT7NiLzOU@!xm?,Ydo(jiSE?LCI+5h9y)O:oLiVQrtp[Sqd%!qGJ\"`H*0R6R$NFSQz@fi`*EbDe[xqT-yNT>rS%Vg.CI((-HgW\\NN\"R`m.2Nu/zMIiZg\"`J3ZSqh9wz&?OP+zW$A_BggSHP<ueyY2)mx>`QS28bl\"RasHEcHyW(TZH<2$Y\"3x7<h$jv=`Uf+7p]_L<(K)\'%$#$*DZ$7*i^\"\"\"#\'<9KO0:pU6IQ@-VU-s.{TlJhWV2.2Nt*fP>\",UOl[`Td{ejiQ8afa6&RV=fs7L\\pEATi:z,Ydq15W>l1EL/DH#l&jqz;NWNb*><Sqe,>:F4lR3EBZ&En$Y!/e>@c\\)IzVy,_)BVi:wwtctD2f:)Yk6an/3Q(fZnA7/%bOCCbM9oT2:i/CH$o5Q!F\'(3e/R7U.\"Y(QFL,3ZRnZX.s)cDeV_]89W34GL.;#6)fUS&WoNs(Zvh/DK1Mt.t4<oEHvF5o]eeRGO9g-<+]!#\'<:MYY9LSC6{<MQ6U1-0FSQ{E{hu>j)z_K9uqZP^m/:r\\W%H\"glmb(7x,a2kQ3D@R_k$`Er;fxNZ]G-BJ/Ib931:nJb8+gTMc6uw\"1ne4h<.lc1_rHJyP_p<qPu+eK%n*ySmR2?)Hs7OiL!Ti?8:X5;fz[79Z@m3IYh)(-F[\"-ZchfHnzCtLY_R_k#Z)SQy9IDYul?/jTD9.w=b]/hJu;Z>_K;$>MLt0)tB%-R>xnB:=_PQ+wKHgW]Q[X.s)a<ArFARZTsp]^DsB,O2GSOojIi_\"ypJ]u^Up[Ux)RJ[oC>K@?\\:D,KxF1YX2+xNWOc.R8]Sf2ZV$FwQkP+!^Co4IUU,r-xF1[aVlBBdXl=\'Eg`2kS>sW;Y6<h\'wSw\'N=$7-v<\\E\"p@\'>D{k*&ycbFr7Pruy(J#d^0iM$`Do1;pR(fXdr9[G1ZW-ot{5.#_Dn-)%vX6=m:qU5FBWr^bVdwQjLu7E9/w?j$dXlA7/&jr(^0jP1=%<?i{Vuq]\\;JImpnZX0zI9\"85C2jLxG3aw]LAAbOHW`aK0KiY_Xwxui4[Uvz-_$-Q9co,#fcAWvr\\W\"8:V,kfCTbq:cm\"NLs+i`(==X+a8-t20;tg*/MzMKpz:JJq\'_70*yY.pu\'N>+TQu\'SR)kk[emx:N^o?&8,mpmT?wetB%,N--<*V[I;+b6#EvQmXPe7tsf*3_m/8kA;D*;1zH2ZW)^+N3Mlc-Jr-xF/TA*GjfHlrz8;a\\.d;417bn*wLQ5NkYZ>aTcvOb)9\'ST.$e](ATf+;*Xg&vT\"?X)Xi-:z*SK]sU.\"Y%Elw;Su{2u+dC[-_\':0zK@=Rg7re)0WKQ;mA5%T`jt4<m=$6\'XoMprqarC3oc&\'0Y[>_MA=MQ07`hov+cAS`l(o,#dZxrZJDUakyE)5o]aTam*xPb%$$)?Ezfp(dO?*P=!&:6?vbild6trd$vX44JYgzX(SR%YvqW?pD;=\\@dbC`BcU__Dn.-9r`ju7GCZ#4z;O`w\\F*:\'O?0jTE=An3FL/A>P\\`PNx>aXr]Z.nlWN_wbaFtE3hCNCCfa90%bN<\"-]tV34K`+Jv?o>z{#+K$cWf\'\"o:i1KhSHO4S.%fb?LCL5`n/3P#Saq<nD@Tg4c#rGGkptv{,[m9l@4&Xs_d[{%4v(UZKEYs]X%Fq6L`)?F%ydifFha1f=7<dks%PMnkQ5OojHfQA2og:&K0H^\';7D1a%*@I3ZW)]$1iHjb2iGa949`aH&x^MDM;xz%92,&uKP8^Y)UX<aZ\"3u)[xqPx9IGg[n?-\\oD?NP)n%]2v.q#H*2]gq*lnf:)ZrU23GQC;?izP^j#`G{c\\+SIRD=F+=7;_VpXF7!8:Y9M\\j&o/3Ov2*vIAL=,_(?E#sKXZBsKVRv)Xh,8tk@711A70*yV{60,-=0omWM\\k-4[Uv\"4$PNt.v<^MEPHXdq3?(BY{-[n@-ZgzW%H$m.1I_,Q=vh+1T<h&tF=<Uz5+t9V,mne1\\egYi,6g0R2=zz#+O6W<a]3y>[:JJp&[\'CaGwRlP,$ir(bC`Be])Hr4B2m[`Uf,<,b6z8>k0B@X%B`Ckw<[?bZy{&8.xD%\'0\\hvC&-M%dVco17cq:_[.iUKVRx1zG-EVdyZ9D2d.N\'m$Y\"3x7>oD=D#tS!AgliQ8]TjEQKb3n_m2CAZ,_)D\\*SLc4nZW*_.\\n=\")FjiSFD^85@%1gBNCCgc@Q[W*]&8+gRFGr3?&;7D3lVF<7@xi*)0Q3D@Sd$vZ?gp&Z\"-]sT*je>?bYtg)-DSYI?Ae`81*z\\>Y.pty,^#)AQVA$&4n]flojKt23HUU.yLHdHuC*?Cp:fyW&L6e$uT%OGV_\\4)ieAOP%[*UV4:euE3jIi[j0A<I>;IDVg,9{0nhBL:y%95;h\'yaWpV>j+*2YSqh:$>P\\aVh4^efQB7,nt%H\'!k){aRXIAI/Ha945Le==X,gO7^\\513LjVPm^j\'p3A3v*\\yt]Up]`PLk^sRz>[67OjQ7X@qFDbHz^Cr?yrR#MEM:th0Ib<@j!Wy+Xclx@k(r8V33HSK^xl6^aNDH!bVg+7re\'\'-Jp%Vi7j=-b3n^i!Vx#70(s;dm{I7rd\"k(tC-R>xnB<C!o?%7([yxqQ\"H0Q-)&{l.8nLjZep+s5D90%aI*.Hb?K@=OYV*a91,\'xX0{LG](C\\-b3lS=oDB]4)ib4qlKnnc)8\"9>j(xW(YnEK**3_l.1Nu0&eWcp03P!J9wxz&<=^J5e*8w\"3v-j_yn>\'@R_it5>wh*-AEr=m>&>H3_l*$m--;\"3x8B%.UL[gvG:*^)D_9;X44GM0A=LIhYdo*q-zSjDQNpro[W(TYG5o[Y0w=^I3[Z53?(BXx\"-\\pFFkqw,d?J;\'L0EN;wtajv8HHnzBp8^Y\'I&vStw!/gGeQFGq/.5`m*{]>Z1zI5g4d*:\'M6cvQjMyG3ayfp(g\\vfz[8@wep/-2Q,zX&H$n/5][53=yvi0FTW>gu=gu>m6YF3f4f2[^G+8x(M2Mprqf,@?Z3&aCdVbn+!]?[7<ep+s6IN/=(K)\'\'+BM?3\"K:!0mb)9\'RNqu{3zBo7YAtS\"Bir)eN5ZMQ4IVV5=qQy>\\<RjJjb/XU(ZwpNry0u/w?iyMO+zZ1zH4d)2ayfq0.7h1S6Mc3jIgTLa*DZ\"0jQ4MjTGFha3mZ[>\\=Uy.jXZ<[;Ob%&0Z_PR18csA$*CYy$5#H)0T@zu]UmP\'g\\zvg&uOf=65HN4Q#RYO]i#^@`H*3]egXabM:tg+4d(0VIIs5C5{=RiBFxV%J,:#97JP7]UtoS14S-zTnWG<8@zpJXa`AaK4ZSnZW*a90%aGyZ7<eo*p+s7L\\m6]Z.mf>:JJq*mrx/oph;)V_\\4)ha2hDWk<&CbL6cwT{:F5o_k&jr\'XpR)jhO2HVZE,CPNs(Ztcq7R{@ecDf[t`bN@6.{SjAAcVbo/1FRKb3lR7U/#_?Z0u/xBtPoe/P-+-BFwTy/oph</opg9y)QFHwJE[%::PjKt5>u`aK1NzG/O(m#Tg0O&dTV8OiJr+p\']/gFbEilf@F$sL]pEB[-`,M*$m.1JeFifFh_\'<:O`xbbH#jzLKow/s(^0iN+\'y^J8rbuOd3f7usd#m.4WA!u[I<0v32={\'?MGZucp18g)+:(RNqroZUz2\"J:z+VZE)6rh:z.c6z63<pOs%L7h6f0Q..:x!+P<t`cVbm(lt+hZg\"aOGUYD&.Q5Px8B(<:KO0;wqU4?\"\'>DzhwG7x(N7e\"ixG7trbsE7#EsD2f9#>Sh=1u-pz<Qe1YTx-gL$fb>J=0s&RS.\'sA#&6y2\"K>4)h_)D\\-_%-TGGls#Fz_MCI&ya[&AWwwuh.BDl\"Sc\"n5S*mt\'U`ghURx52=wl?0jR<m@1pkMxArHL(wStvvqZNTB,P8__Er=oEDeV__Cjr+kjSC2jM\"TmMt.yG1ZZ7@xk4T28bn)p,xKJp$QR/+)*7utj=+XbheHp*p(fUV4;j1JfK$fcBXy\'B[+Zl:pR(fXbjqz:ICRU;^PT:a_=OWM[fo&]/iQ:h)(,BJ3XLTD5w+_*Hp(fUW9PjN\'n%^84>zvg%sF>DwZ;SrlLot#@[4)lr\"Bgi[k0CCe[yxoIYh&vPiHeL+/GZs^Y)SR$RXG9)[xrX>gu?pC946T*jd;7>oB7-s.{TkG[wnDB_AaM=)PA1m`vY:Rn^k)xRmUA#(<:MWQqkIfO6YG9&K0Ic?K>4)kk]m6\\SkJhUQw.orrh9vuj:xyz\"*JwI>=V\":@qGJyRiABe^.\\oB6%SYKKv<^NKj]qJYer4B3qnYRnYSsp[V%FxTttnQ\'bFs?tW8LY\\F)5kIdDcK0EPGSLb1e3f4d)7uwwr[Qc&*?@d^1m^m2FM6][79X8IIq*lrx-iTIRA0f@DvSuy,^#)ANH^+M,-?612EGt@yk3Q\'bGuD/Y[Al*zZ53>$2n^n7\\Rd)6p_j!UpZRjG`3sw%CcODGuF8%J/GXg(\'*:+c?H2YTw\'J*.EVdxV#AcTZKGa:9MZbaEm%`@Y(QHRIW]OR4GJ\"_FxZ8D2e6p_iwBw`Y$98M^sOlZ^J:$>MN$\\0qw*Yl:q[P^j&js-u8M\\i&o2@-[m9i1P)o\'aDgb<=]G)1[^K<*Xet@xg\"`MA<J@Bjv<]I3_k\'p/-7h3[W)Zt`dXmC?Rbw[Bo9adXj4[Ux(O=%92-,3[X.px2&bI%q?{yrT-v@pA.]sS&Udy[<Uz3%WnNv32?+SJVW6A*Gh_*E`>LIgTLb.SA+N.6dzefW`]:AuY;V&PKd?G*8z/jXX6<l7cwRo`tLZa]5*nv0zH5kG^)Hq.%ju5=rS)eN8h2S3>%7)a;<Z8F9,iX_WuoR,zSjCK3WF6u{0ojIgTMgCWlB>QawZ>_L@;D\'1_rIO5U6GGkniGcDdSPy=Y1#Sd&#v^Tf/IhX^Ti=.gIs6IM-2T8V/#\\2yAixE-HgXadRQ{F%{n:j7g.DPJb5v(PC@UnR.)#k%gc@PVB(:-pw.mjN\'kv6>uadVcp4GK(xZ7<j,2T8V33GL0CCdWeyY1$[,\\sV5?\"\'9/xBuSy52:mA7/&imjQ7YBw`[)P>(Gq0/<$834JZl7dxY54GJ\"`K4_iu8Nc/VKTGGlqv\'OA6,p$RYMR9af`3rtpZO]hu>j(xW*^,SEAUkDL5^aRT27__BghZh%m*yW$BdZt`dYqT26U25R\'^2v,gO8aipw2%^6,u=dhc90!PXLTE;9HD\\+SMc5uw#4z>Y.ot{4)h^$-VOjP2A6(`82/3T4@,UMd8%K4ZSmU?t[KCL9q]Z1!K?:D)9*a5x1\"PT9\\I:&Hz\\=Uy0omYU$FwQkO\'iiWV/#[,b3oc&);2%^5,s39blyCxb_;C$\"xj-7i;#86B.[guAw`\\.iR=t]Wx$:=^NH_/^u[H6p^efQA3w.opkLr&Vi5_gmrw\'K-;%>NO\'ij]pC8/!Sg4bycaA[.gL\'q6Pt\"<LJp$NEPCA[0r!=SmR2={&:44IW\\J?:F3g=2\"OO%^9;Z;Uz629g&y_NKle:+b<@ht5B0d6ttj>1t)_0e9(V`e^*K#`K4\\\\<RjFZueyY2(kprqe(/O+#ea>J>63:k:ulB=I>8=i%l&dU[OYStuulBB`FyZ7?sS\'[#1lYY8F<9F7\"@[5/.5an/3P\"LBFvKQ9adYpNon_o:g%sF>DwX46OoiF]*L)$sGBWr^^Bhow1$Y\"3w2)myBo9cp16[Qaxa\\.d=>^H-CL:umFQFJ\'y^I3^gnv1$Y%?PXN^qFBY{,Zh#fdJ$jv:RrmS8U.zP[\\?bUe#l-/DI))0S=oDB[-b6!=P^n4Ou-nnb\'1[b_98M\\l3LiVPog8w#5%RV=gvG:+`2lXSuz.d;56Prv#9:W-r)eM4S00>*SMgFa@UpYLP3GO<xtaipy:IBQS01DFq5HN3Ns$H),@Ck\"Ti;$?Sh:{/jTGC\\.d:/w>eh\\wg\"d]+SJVU.!Sg3]dbDeXg)(-Jp!DvStw\"3v,fK$hnruy(K(y^K9x#5&Ubo3EDcM9mI^&7%NCBaJ/GYnFN7csB)?F&%\'4n[]Ezfmu-py:G<67PplQ04U6GHq/)!d_5$OI_+L)y\\@bXoOx=Y2)p+u?o=wmA70+&tJN/9mH\\yqS(aAZ(N9lA<H8!5-xI<3(igL\'o04T4A/`$%/Y[CtOe8#@Z.la):.q\"ExZ7>pHQA2qo^iu<^OP%_=KF\\\'@R_jyH9!5)jfD\\,Yckqy4-$ggRC947U1/6bsD5v$?Ww\"3u\'SV9U(\\$4w.oqlNzLFWg((.Kt22C?PYQh@Cm)r7Qv+c?K@?X\'L3S01FM7dy^H,>63>!&90$[-b3lVJM\'p4EC]3!G,?<LM$aH$o4MkYZ<W+c>I7rf-BFwU!:E.Q8\\OXPe4iDOEJ*,>5/+*.HcDbI\'\"k)xUx,_+L%iow.noe0S:dq3?\'@QZUy.gK#^@_EwSu\"5+o#PP%\\/hM\'q6Oog;+^&8+gUS%RWAzqJYfuE0[b]/iO.4[SlO&bK1Nw8G@H/MxBw\\E$ygyRg7sj@;D+BMBA`EuJL#^>Vy*VX>fp(ePC;>c_:;[@jzNT>qMfCUg/H_.]rNgGfSLa+JwD\'1`yi$e`7*fRHQ@-[j-7i8q\\Z3*s5GFhb7(Ys^Z0u/xBvW/\"WvulCEn(jk_yi*),@Bhmm^pA,TISHM-5_hp\"H,<.iVRw/qy67OiM%eZs]UtmLle9&K0JeFh`0b+BOJeEdQGP>&<BrD9-s+ox9E4lT<l7csD3mYV%M;x!*L*&x`VlFST-{Urd%w^PU<gxO]hxH<2%Z\'FmzG-DQP!H2[Z9E4mVGAOKhTK[l5W?pE@OQ,$fgRFIwJGa?NP*t?sQv,fL\'r>qNjTD91&f\\zxqR$QU<er3<rX@sQtz2y?`QR,xNT@%1e5nVE6w(QGQEEhfJyRg6lLq{>Y-jZchdAQVB(8(YqT0-.>4\'_71-/B@[0r$H)/N#Wwy$7*dJ$is,t4<nEI!^Fzb\\*P?*L(xY2*r5D:58\\LIgTL`(;404S0.5^bWi5_jxF/P1<z#0f=8@wfvICQT3>!&;8G?E\"o<sYF0WLY]LDOB?Se.G`5#I/G]\'AR\\\\;O]j&lzK?<KIlma!rOkWOg?AgkfDZz\'B[+W^Wwy$6\'ZwoJ`,N.5`jyI9$BbPHYg%rB.XY;Tw)U[KG^-ZfwLM$^<LMzKDPJ`/^tU-s1.1I_-TKYbcPC@Vrd%w\\G,BI.DN>*SLc4n]c^1ne5jG^-WX7F>Am,+0P+ySnVE7!;I>=TsoVA{tY>dh_)BUe).Lt5<oGN6_aNDFq4GIvD.Q7[I=65GHq.%ggTNiN,(\"m0<\".a-N,))2]eh`*D\\-^ztY@m5U38`bOEJ\'y`Tbr@$,M+(\'+@ExZ:LQ9ahgQ?)GnzDx\\F&(2b%&.TF@NLpv*^)EbI#jxG1ZX2)q/-1Mt,moh@Ad^,VV0)vH?Bm)wMTD7&RQ&^4$RYMUE9-nsx*XfxRlO&dUYF0YX1\'hc<>`PR-\"^BffP=!\'?K>2\"NJfM/:wtcs@ypJZk5YIBOH[t]TlLr&Ubq:aaGy[8B&3iEYqV:Z=[>]Cq>wi,5c{izTnWF8$EuHCUf)0S;fwMVM[gvE0YZ<V%H\'!l/<\"0hHlmc,HhZj/@712EI$iu9Od2b$#zqMfCWpT15V9Ru\":@qEBXwxxs[P^l-/A?X\'K-<\'J(!hvB\"tW6C2hCOJb8)_1m]gu<a\\-_&6z5.\'q7U-xD(5n[Y0yF*9#@[1w6?vclw;Sv%Dikc1a!rKZg{Z3\'fXexSpbzfmw44GL-6e\'(4iCN?3zAit5>wh*.Hb?KACiq#H+9y(K*)0T>t\\MN\"Tj@<I??^BjxC\"qISFGn#R[W%FwSqh;\'I$l(r9X9LVRu#<JDSZMR:do+vG6v{/fCTdzaYvoMnkR6Qw1&aEn(n\"LAChmkVJQ<qS)jeBS`k$]74?\"(ARZSo_m.3U:[CvY:QjIkfCUe&yejiUM`%-O0;xwpPy>`PMpw,eEaDjoqo[X.r$M>0ojJlkWSy2%Z%@Th8qap8YC#xgyRjG^+RD=D#uY<Z8B(<6<i*+7p]`NEPC=I9\":@o>\"*Is5E@NMv7C.WT&RV<digO2I[oFK+,=2zBqA*Is4A+O6XAxfuAyl6^_G\"k%gfM-5^edGr7NhGgVX<^MEQKeCXscvOc-Ill^o>zxrV5C3roZV$Eq6Om_rGGn#S^aRU8Sz=Vy.fGic:0!OT:^Vq^cYs`gfN3P#OO\"NMw<\\@gozBn09j<#7.xF/S>sYBzk.:wsakyF+@BkzMMzJ>9@rMe=:KM\'o-%kyH8vy&?MHa:6?zubij^u\\J?<LP/3R+s5C5y7:ZAn7[OVE9,hVW36Qx8@zrR\"F&\"pD<>bZ!+RFDbGxTv$>P[Z69ZD\"qHM/=\'Df^(?J:$>P\\`S[SlO&dSPw6:`^:@pB2n`tRtz2w42=z$2nb\"rMc2d-Ks1,,4^fi^\"\"%2hCPKfKzUslGXj4WD/WQoaxa]3{Cq?{xoGP@-\\qIVU.xG4iCK4\\[:G<3-&p6Rz=X,iVU,nv.ou&L6bsD4pg6mR05U6GIu?qHP;nI\\vco+vC)=<RjHdFkon_p=s\\Rd(2]i\"Z,c;7A$+KzRe,BJ3XLR;i0EPEGuD/WRtz2x9G?Bn2B835Qx7>pFIxP_o:h+4_m-.=-c8\'Vbm\'jmf?Bl\'ks*gVV0)t?tV37YC$!uZD%%\'6x.jWV/!RarE<<U!:E/UHFfW_\\5+t;Z@iwC#{rPs\";E/TB/]o@-X]PU@wg$iu9Og@F\"j%geGp+u?n<uf#ht39co,$fdGr5E>G0S;fxP`vZ?egZm;ug((.M$]8;\\G,@AcZxrZKF_1m_tPod/O)t@v_Y&Df`2lVLVRw,dATf-@@_FxZ9F7#BfdDcPCAY\'K+.DQNr{:G7w\'L1Lk]pEAUj>1t)[{$/`%,L#^=Qaxb_<I;*^%4ty+XbhgN1CCf`2lWNa$#%,N.3S29g*1T=l7bq;fxPc*=8>m8bq6Rz@c[$4y9D-N)vKL#^=NVIK{VuumFRKa0a$#\"ztZH5mQ/2KgN/:sdxY2)q14Nr\">X&I\'\"o<rXAw_Wti7j=+ZnB821=#3rsp[V#>Rg5jESS-yMQ08g+5i<*Yi+2WHBQS3@*M.9oS3;pOv1$[-a1c.O.1H\\wk8h4]aSZPb#uZ@m2DDf^)EeTT/&kv9MZccM8h0Lq\"Cn1;r[Rh;+\\vewN]hxKJnrttoS/-4[W\'OB>MMxCzh![4,yRf1YV\'U]W\"6/\'p18dwSpf1T?xm<y{%6%NEK,8oV?tY=aXtg.A@[4*n{G,?=To]c[$6\'[#/c1`vZ>c`=G1\\b\\*P>\'?NMu6?xnB821?-\\qK_#\'7%NA86C1g@DtJM*%rB,O4Ml^sOjO/7ctGAPQ,zTp]bYtdwTy/prqc!k(uF;2(lt-p{Aiv;Y6;fvH>>Y1#R^fgW\\KEU^[4,wI>=TrjBDn,\"_G$sKVQt#=NT>rR%S[RkJkc2c.LzMN%aEr:^RbwZ<V&PJ_(?H.F\\%6%OGUX?n8bl\"R`o4JZl7ak{OT;cika(8&OC@X\"4%Uf+6lJhUOjR;j3U8T&S[Qc(0YX2)q03KfEbEn&aFt@zsV36U11?-]u^TlH_-X[E\'.O--7lH]%6\"@_H+7qbvStuumHZoHRIVV1-/A=MP/5YKJp$QQ*r3:i/DN=&@Se,?=Qc&(6v!1rw(PB<Cyeo%Xti3[Uz4\'_99Oe7x,^#*Hp\'`<G1[^K<+Yj3Q)n\"K=-fHo\"I5d(/S=oDAWvuj7i7nR,\"\\:G9%I\'$w`WulDI%p8\\NP+ySo^fi_$,M(vJL\"Z+[t]Vsi:{-]wes<fwIAJ5atIM)yY3-&p5K\\sT(cEijZft>l2Jb7$J/FV`cU_`H\'$xdlu/zLHa:6A)BR[Uv#84=t\\NS9[J?<P^m/:tg*0S8W7E;9G@J8sh2U?v`]87M_xgxQd.Lw>elr!=Qe/N&e[t`dXj7i6i<(L1GXi.?4&[(K\'vN`zo@,TMd6tusbsA\'8(Zt`bPIZnC@RbyaXtg+4d\'+AK6i;$>LHdGq.(vMXX5:``Cjt1,\'y^I4bzgs4?$0b*AL?5,u=dg^$-THM,0JfM-5`m,(\"l+(%yenzDydg[sYBw^R_k#\\5+s6E=BrD5y64D931:oOt,i]u\\LFXnHUX<\\F(-Jq%T_ggWZCxcdO@3v/r\'[z%5y8<gwKKu9PlXQmXOe5o\\`NHZoHUU/&kv6?zwi-:y\'DdRNprmP*r5GJySmQ,$iq%S]\\8=j*)-F\\%:5:dp16ZKIll[eknkR9^Wwxz%90\'lx?ddK+1P*uB#$)BS\\X+c=@ht8PjP1<z$1jM&hhSGJ#aOHXg&sHE`=J?=SmS7T*gYdn\'fZnEFo*s8S!@_H+8tmIb7\'Wk:umHWaeYoJ^\"$+K\"[1x;Sqh9z,\\tX>dh^$,O2FL1KiUOkUGD\\+VX:Sv\'M7cxX/x@n3LeBTd#qC3od-Ij`(==Z3-\'tF:/w>c_71-0EM9nMopf6nV@yl6_e^-Zg{Z2&_<I;.mgBNEM9pS.%kv:Stx\'HxRkLu47X=a[\'DdU]VtmKj[gzVy+[qPt$H%sFAOP(kqz77PqmU@yoC<Ap?%2mYV(XmB>MMyG1ZY6;er4D:7C/[gt:Y;Ty1x=[;Qg;+a3ob\"rMb-O1?-\\rOoh??[7:ZBrHIt:Y9MY[@k&ku48[I<1zE&(6uvwtcr=nA4y69X7D6{;H??^EwSuz1pqh=/niIi^ypHRFI{[50/<#2sz2!H.JljS>vf#hq&Z\".a)=;N\\gv@tS%PLld6uuq\\Y+_-VQt{4(dN9j;\"2sy/lb*?Cq=rU0+$l&geFieBVkA>SjDNA:?izUuse\'&)9\'RPx7B\'7#CkzMKov)[wmA5$POyCx_QYMWQpe1ZW)])Fhb5w-iUPm_p>yvg\'zfms#EvPe6qbyb^6+p$S\\X+`/_wchdC\\-a.WSz8=i)\"k&inplQ05XC&-O-0I_-UPn_sMa);402I^&5x1w8G?F$w\\F*:(UYB{pD;>aVkA:@o>\"\'=An5Pw3..7kBA_Er<i+.DPGSNng>:G:,fJ!Z.k_zoC948ZF-Ks.\"X\"722B;@n7[LLw@n7[NS;h(#qB/^tU,p%T_ffN7_bQPzF&$###%/]m5W?m5T0-1NyBrE=@j!Vvxy!(C]4&[\'C`A_Dq8ZBvX7E8&RR)kl^sPqpbw[>^J5f-CL7i:z,Zg#ea=F.Ks0(r7Qt!76IP;oKd;6>pGK*\'#w^PWIE_4\"Ezb\\+TPqsp]aRV<eq0.6d%vX6<l8e%wX44HP?*O7_`K3VB(9*b:6A%2iIjc7$Gz]F\"n4Nqu\"73:evLTB-TGHr15S,u;]I7oYPb$#zsU.\"X#;AsMc4mU@ypIXckq{=Vy-eBRYLR9bikc1`xbaFq7Qt$Dl$Z\'GvG:+c?LESS.$dWi2P(hb8)`4y66KZeo*r3:j4XH?Bn/5[To[[;N[cdN8i4[W\'RNrz63=vh-9vsbp4FIxO\\ekl_xdlu1*uE1_tQtz3\"J7oU=j,1R/.7j=,]xk4W@v]Q[Z6:_Y$=JAEwSrmQ+wH<65IRFDaFtC,L#];IAH+9x&B_@[3%[)O;qV:Z@j$aJ/FTYG8y.fEbCeYpMjUJSEAUlH[vh)(+@Dq=pKa-R<qQ#L@;D(5rlJhVRy7;a`Be[wl=\'DcPFN:oOv1&dTV9U\'Vdy]DtJP5T/)wPf7uvsctHCUh1P)r4?\'=Ao8^[/niJp#MDI\'zccJ&tHGg[pIW\\NQ/0BA^?Z1zDx`TcwX/yE(4iADn,&sD3lR8[H8x(L1H[rS+q+p(dN8i4]aQQ(id>E$yh{X)V__@^Ae^._zrNl]k)\"fib1c,E\\&<Am3IYevH@ExZ;Sqg7oWF8%J-;(O?,X^UkFV`bPI]\"#(ANLorrjAAbOFQGP>$5{=V#?X\'M9mFO@1ma!rL`\'7#BgfO7^^AcXmFN;tez`RV?tU,q\'_4#I2VE4n\\_LA=MP-*,;*Yi0EPEJ(\"m/9mH[t_]:B#!vadWco//@5*kjUJQ?&<<Z6<fwKInu*a7)a;=`R\\X*^*JzSlLq#H)0UC0^rIQ?)FihP9g%uN`{qL_#$,O1@1ojIhX^R_j!Vrf.DQMooayceTS(eN9k=+V[I9#=LKq&WmI\\wh)*5lLpx2\'eSQz@d`;=^K>3%Yws^^BghW[F-Jns\">Rh;*[rU0*!bWlDHz\\=V!87KYa`BaL7g0O%_?UqasF@J7mP(knkS:dr6Me=<Qg=3&_<E-Hi`)?G+:%FuHAK9unLk\\m8bn-(!fkl]n;qT.#aI,:#<E+BM@86GC\\/gGgXbf]#+N2HV]Q`p<m?-^xi+/G^*L)\"hs38__Dn+!]@`K6h8q]\\<RlP)q01B>NO*uB##%/Y]LCK4YNZ]F\')8{5.#`I-=/ngAI.CL7g.FWe!c^1nc,GcC_>TmQ,$iox54B5#H*3`rD9-s,ox7>qL`(9+eJ\"^Cm*yUx+\\sZE)8#?X%ChgP<s]Usi:y(Ht@wbf\\zxoIV[I:(SS(dL0EN=&=G1XPiEYqW@qHO6ZKHgUS$NEOA70(s>oD=D\"tQu&M;xvmB?Se+<0u1)tA{sU/#[0ry4-\"];JGbAX\"2sz5,xLKr)dJ%l(n&aCfb:6?wj/@:@pA0e;1#Scyb[\'Gp/-2P)mw9HCXr^aM?4\'].d:-lhHjfDYxwnI[pLd:.s,p{Bl&josw$>OVD1d/TB.XZ>c_97F?I5e-DT\\Uvy$81*yV\";H9#@Y*Yl9oOy@gp&\\)L,1R05U6GHs7KX\\G1XOd2b#xcga4stram,\'vQlUD2g><RiAFwSrmQ-(xV$H&y`VmH\\wj2Nt,mpkN\"Sf.F\\#.ZfvF7x*VZH9$ChhWW5<m?,VW5=rR&Ywuf%sFAPR.++4auPlWN`!sS&XoNr#Cn,#hnrw&En(ihSE>I5f3`p<nB837X<`Td$sJUNe;0w=\\CtLVSy4.\'tC/[bbFr9X:Tz9@uX;V\'TZMR9`aGz]DtIK{Urg3\\]Afja0]l0?.e>?_L?3\"L@;F1[`R\\X+b;;Sv#99T#Dp7U0)xRlP+zW%Fs?sV21?+VW8IJvD\'3f9\"9=elt+hYdo(jk^sOnb&*@H-AEtHCVj;!/d:-osv\"5(dJ%n09mGV\\OUC.UM_xh\"bRV=i%m)s:]LFWg*1S:beWeyW(Wf#k%cPI]yrS*ic7\"AbU^^AfdGq/-1NyD#w`Xy%:9Pg@Cn-)(*:*]$.X\\H4d+</r#Fy\\@da?Q\\`OI`1f>=Vz2x;QkN%bM7e\'&*>;NXSw+]$0c0\\ddPB;>dgZl:nMniJq%Vh0Ls)bBZ(L.=,]xn@/f@H-DQLiVPlYX1$]4(fUU23IYer7Rw0x>bXuj7g2YPd.N(n(lt+iZi)&!m4R)id=@eeM5WB#$)ANFU\\Rg6kFXj6cxZ:LQ8^Y(QHVW9Nb,HkiO1A70\'n(koob%%(8$G{c],ZfxNZ\\Dx^OLqz:IDWnKeCXvr\\W{2x8E6y1w7@!xl;tdxUz75C5y52:k:r_d]\'BXwxxug(\'+@Cn-,4^gmpn]c`97GCZ%>LEWf&zdg[rU36S*lme5lP,\"bVcuKR>yt^Wx&AXy\'Gq16W@rJTNf?ExY7@xl8h/ETYE-Kt38_]8:X7D2iIkhKv?m5T0.6ao3C;@l,,8tmJdAPR.*&{k*$o5Qz>^F#n6U4>wj4WC(:0x@k\'p19i1O\"OS6L`&0`yj-3ZSo]dbCcQKb6y4*o$Ui9uoR,yQd+<2$Yy$5$NEO@2sy/la\'1_rIP8dwQkM{PVE7!:E-N\'n\'hc;9JKzRc&);-lgBOIa5z7;`[+[oDCaEr;fuE0Z_QU>oD?LDNA;AsNgDYte!eeP?*O9j6d{fo{E#rFD`?Re.HdEf\\xoHVYBvX47V6B0b+F_4y;MXSu$A_Ciou&K3U<gzV!739bkv6@$,N0>*Q@/d5soYO`xdhd>E%\"tS#J3[W)Xl;y{&:45OohAH\'\'+CPMr{=SlP*vH><Qh>9AzoA0hGcGt@va_?UtnP&bGvKN*yY0w<X.t1,&tIIs4>ys[MO)q3@,UNf>=W(SV7JTL^wbf^\'<;Rpb\"o>ywj5^aPMprrf/Ls.yKCOFPEGq15XAv_UlH[uexSpc&%(6w%DhiZgzX*[wj2P%[+Xdp//;z&@PUA\"zrQx6;bdU\\Q^l)yW)Xj3U<eo(fXcn\'hb8,ja-O0:r\\V{3zBn08h2U?rQv.r$J3YQg:\'O>,XaaEr<fxNYY6;fwKN&jpy517]Y+]\"&7(ZvmA6-wBxeo\'bI#hp\"F#rIP7_`I+7p\\Z2$Z%=F.M#Y(M4YH@DuOb(6tsg1R2>&=CxaZ$95=sX=aYxyz$0e:-j^uZAo=s\\Si=0ry5/,.BDkxBw[Ap;m@0jSA,R>\"(APT:]NP)p-#cWh,9wz)M0B=LIhYes<dijY`[+[oD?PZStsi7mKhSHN3LjWV.xE\'1\\ekk^rK[j,1R03Nqu\"61/7f()6qd\'(3e2_n7ZI<1!LBEq9]OT<j0BA^>Vw#95A)BUh2XJL!UoXJHia.WU&T[RiBG\"iyMMyF,BNDK-;%CbK2Q+wG8z2!H.G`5{?\\<O_qB3qkJiZep+vE/S>vevLP4J[oEEjnlYY42>$4w-j\\m7_cXj8nNt-p!Cp8[J@Ae`6\'Ys__G\"ixH;-hQ=xpLfDZ\".`\'4oavX59^VunOw9JL\"Z-gL\'q7U/%eZqR%VmHYj5[UuupV<chd@K>60.6ap7U1-/CFuHCT`ir)dM1GWblxBrF?I7qbsF?I2WJIr.$bQKc;45K]tY?izUre+8utlB>P\\bZ#1na{n;pQ$S_hov.r(],X_Y%@WvvpT4B0d6v\"4\"I0O&eU[NR4HREC^;D&.P3IW\\OS7S&Vi6f.G\\{%7&T]X(ROt\'SU5C3ro[Z69[G0VGANI`1hGeM2KgKzUrf/Mv;U$H((/S<m>(Eg^\'=An3GQEEf^%6\"@`J0Nx@l.5]\\9E1a#xgxMS=qPv.q!Ahpz@ea>I:%FtB(:/v7D3n_qA+N.4\\[9D.Q9``H$q@%2hEZyyuez_I0Mv8HFdL2MoqnXMWQpg9y(K+/JgRB5\"Bl&f]#.Y_WrcuKP7[MQ1:qV9S\"Co09lCDgeHq12FN9k?2t\'V`e`4u&N;y#/d7x,b7\'T[NVKQ:h*-BJ2R04S.%ggSHO7__EvOb\'2d-IlkZ_R^bT^`L;z)L*)/O)r8S$NFSS(aA[0psslH[uduG<55IQC7,ov.r$M@85B0a\'4nZX0\"QZRn\\`OLlb,KxI=5/.7i7mKkb,Jq+nv/u48\\MN$]738af`4w-ka\'2g>:E3f6p^gox56La+GfTQv/u1+{^Dq=oEGq01DGtB(;2)p+vE-LxH9\"8:V*fO9i3U;dkr$J3[W(TV;Z?dbB_AaL8oS2;pOrz500@4\"H/IdGn{G.G`7,nv,iZgwKJr+q(dK-7mKk_yl8ez`QS02Ja3mXQn]gp$S\\W\'PEHzY.oqo\\`OIa6#G\"j#^?Z1w:Pf8y,`,Q;k7h1O\'eWdq5K]u[G1[\\Bn0:pU9T&T]X)U[LKr+mrx.iSB2oc\'-Kv?l/;xxs^\\9@uX:T{9A{rPt#@[2\"LABdXmEJ($sM_{sS\'Zz$5y8?qL^{t[H6rf-BH\'$v[E%$$&1a%(7\"?Z-gO3Mk[ft9W31<yyxoKb4srf/Kmm_tRx3+t=en$WoS28cp1:mFM5[RjDRQ%WoR,wI?@cWk;z*P=yvk8k?3y>\\?_G\'&\'0Z_PT9X9MZb_;C%&-P4Kc7$FvPd1]hu>h![50/9pWAxh&q:adTX?n9f&wX305XC(7y/mg?@aPKgM-1KmiJp#L=-c7%K4[V$Cjt/%cROs&PKeE`<G1[^LBCghVV22A3v+dBXy$6\'Yvk;{*Q?*L)$o8]Sf3^iwByi&q:dn&_;Av[BuU&SZMR9]Sh8re)2\\bYwr\\Uurao4GM0DGvJKyJ??\\<NXRroZUx*Yh\'x]E$vY:Pe7ux!+SK\\pGL-7i:x{*N5XC&0Z^MESS-!X#;Aw]OO&dRMjVOgAL;!0jTGCZ$81+\"c\\%:7D3kP/1KgK$fa8-q\'^2qpc\"n:i2S2;nHTT-wD\'/UJO4Nry0v2-)$uQqjG_0f@G)0T?xk5\\W%Eo03P\"K>2y=Z7=m:nHZk7cvQkQ2?*P;qT0/7g/JiZgzY,gM-1Mt,p\"G\'*9%Er<g!^DsE9-ot$FuF;43A/c4nYU{9>l2I\\ubkt.v=aXsctHCXuj:uk?2v/u5;g\"cYs^]:F3h>77OkUGCYz)J{Z1x>aVj<&A[.hM)yY3+yP_rHK#aK6f-CN@4%TcuM[djk[gvE1\\fp)kmc0XU$I.ABe])Fkoph=1x=\\=Y.pv(ST/\'q6Mc4mVD5ssj?4(eRIW^Wvuj9q]\\8?tU,ox8C*CUf,;)TT,t6GFg[tZH:&I%sE:2-)#o8``Gy\\AgkjTE;7B)?F%zl4Px;Pe4g7tmKka&1`xdmw7@#\'8*dFigO2HV\\NP,&tHDZ#3w/s([#0f@F\"k(vMYZ<U#@_EuJKxJAH*4e/MyH5lN{MJi\\n=z#,RA-WZ?flon[^K9wws`ghWZBw]I8sk@:?l/9sbp7U1-,4^hq\'`;@o;nFL1Jc<<W)\\!%7&T[O[^I1VG>?`MCFr:a_=OYV(YnGRJYes<dlw9IGia1b,E]-]tW8JO2FM2Nw6?vadU[LLwBuV.v:Ty5/*#l*\"d_2sw(QEFlx<X1&bK0FU\\P]daAX\"4#MDM9mI`0b,Ilnf9#=NS9_[.hO1CAY\'K.<&DhhSHO5XC%*BRYLM&gdD`>Q^hr-zP^hs1/7g/IeGo%[(J#fgSK\\oC948]Q`o7X>gvC%*BS[Vz0qv%Em%_<JBJ4\\\\<Qf8x&DhfL(wRo]gnw56PqrjCG\"hp%Vi6f.FZtbku7D3lVIK{Ure)0UB,M){`NGXf\"d_3t$Eq6Pt#?X(SOs%I,:\"4%WoOzDx]I3`qA)CZ$81-+/Lq#G\'%\"wabI&wY6>pGO7cr=l7dy\\@ecEheGmw7@ynA4z<Pa\"uX8IJxJCNDHz\\>Y-iYbbI%rC1c/VM[emv2*vH=8B%-Q7ZH8x*UW8Nb+E^1plR4ISL`&4n^izP\\aTbtHFfUV4=sW;Z>^H/Lt1+\"d^/d9*^)EdO=$4y9B&2f8{5*kjVOiLwC#wa^9=dieCWq\\Y+b92*ySpasGCZ%=F.Ks.\"Z*ZmA3w2)mv46Prv$>OUD1b(6v!1rx-eEbDgeGls&RQ\'cJ(%yceTR\'].b3iFZyvk7f+7q`m,(\"l/8j=)P?,VU.wAsL]rPpmWKR>wl9nKeEa@Wy)M1HZpNomVG@K:\"6,s23GQDB[+Yh\'xZ8C,L$dXi2S18e{aSZPaxaZ\'Fp-%m\'jopjFZug\'#rGGknkR9acSR)ia1f;.oro]da=F,DSYH;1zH2]efVYBuV/!Sd(0UC2gAF!hv?n:i1Lpu%G{`NEO?0l\\fp\'`=I:(QKb2iHeN6ZNXPf<4,xMP07ctGBRXIDXr\\TnWG?DuM^rNf>>\\=W$Dku5>sW;[?c^0iN*z\\<RkKq#L:z*P>%:5:et?qK^wfvIDVi7i;#6+ox9F9(YpMme5p`p:g$n1<xug)*7rf-BJ1Nx?efW]Sg7nU<eo(jk\\l1EL1Ib8,ljR=sZH;+^\';8F9,hURw1!LCK1O$Y\"2u(Wf#l+#hnt&OFM3T6JUOm^n7]Uq`m,*,;(QJ[nA3v,gN2I]{zwj1LnlXRph;\'M5[Tp`q>xoIW_Y$<E)9%FuIE\\*RGJ#bT]X&I\'zfo#QV>n=\")EfYi.=-c9+fO9i0Kle;2\'dQIYg#feN7am\'jmf?Bjw@p?#+M*$n4K`)?G,ADp4IVY?hxJBL:y$820:r\\Uvwxvl>-_%/\\h\"\\:D.R=rU38^Y&I&wX/yH3aycdQFI\"`K7j>2x8D1a\"uX:QmYW+eK$iq$QQ(g\\xl:r]X&L3T7OlXRrqbwV*b;=`RYNYW-ow0yAp<qQ\"I1VC.TF@LAAbQNr\"?\\7<bdQHSMhM&ilgBOJeGjk^sOm_qD;9JM\'p1:mC@X#:<]J:#:<_QU>oC95>sYAuX5:es;bfZqPw303P#PQ)o(ha1c0XSy2!K>600=%;=_QXG;2)o&]2t&M<$:9Of;.mjM%dVahke<7?rPqrmO{KADo..;z)N5ZKImpo^hr0,,4bwW-q&XoNr\"@aPKhR>\"\'<<Y3,\"_G&ydha3ph;)UYAuW46T+ms\"=Re0S9^VuoS16YE,Ins!;G8!8:Y;Ty1y?c],Yep//;y$5$OGTV6FAQZPc*<3*q0/;xxvl=\'DeWco,{Z2$Uj=-b3lTA&3mYV&N@710<z%6\'Yuf\'{i$dXmC?Sh9wy&=CydigN.5]]>X+`2m]hvAuX8GAOOzG,BI-AAbTYJCRS16XBzn={&:59_X!2w1$[*TQw418csB\'7$I-=/la&/XT!>X)YnEHyW$Er;bg`1f<52;qS,u>hyQax`Wr_gi\\pGM/?1s#Ckw?i!X$>OVF:0\"Q[[9E4o`q?#+KzSjCJ.BEs@\"zt[I:)Wcn(lw7B*CWnLla&/VNa&1`xbbK-8sf+6lLpx2$Z$;@n7ZI?@cXpQ%WqZP_rGHo$Te(+><Pazi&q8Y=caB^>SjERR\'cH{^Co3DBZ)TPv-oqqd\'(5pby`WpV<fs7OkUE:2)s:]LET[NWKSA.[fu?oB4x2\'f[t]Sf0Q07akyI9!4$QU<eo)n{H/Lv9Oc.R9_^<LM\"UoVB\'5rlKnna{m8aiq$L<&Elw9LUIP8bl{NLs,q(bAX#723GQC=D$xgxOYY44HP;r[MP-**2]fje@MCGxW(V`cU^^Ad])Hq14Q#MEOA7.zRc$yi&q:cild3jG`7,mpo]fjd<9IE^1qpd)5mR19i1P%]3!F$uSx2&`>QauSy4,xJF_2pkMxBsMa(9(Xi1Mu0%dU[LIja-P3Ka0^tS\"Bl(o)o(fYg%sD3oc%$%,Js1/6bq=oGP=#1hHjc6z4,vB\"u\\I;,b7([{%7)^0e>>Y2$Z(L0DK.=-eBRZPazj+*2[[;NZ^NIb9/\"Vsg/G^+P<s]UtpWA\"yl6^_F!fkiQ8af`4w,fJyQb\"rKY`Z\'GuC)?F$tOgCS[Rh<0t)_0gCS[Tp^gox8A$*FfUU0(s@wdp,\"_Dp5K`(:.r)dJ&p7V36U4:g\'{gr/)wPc*=9C)=9HCT_cYqXB#zpGN6^^AfcAXwvpS-#_Ck!R^iu9Ru!5-xKEZug+2YSsp]aS[Qd,DRV=guB##$)?F%zj++4c\"pB4u$ChhW[D\"tT&UcsB)?H0O(n&bGwPa\"rNiL{Sf0R4EFlt.t21>*N2KgN/;y#0gBNDK0FUZH9&L3S3>{#.Zeo%Z%>KDRQ$Td{flon^j#_Dm\'igO7[Q`uRt{4(dL.=*VX>gq.%fcAWr`hnrv!2v1#Wsg.FYnGQEDdSQ\"I1UC+Jt8PlWOf:,c?I4b{k*#l,\'{gp\'a@VtnMqx1zH0P-)%yen\"LBEr;chfIwH<3+uB{sS#K9tj<%AZ)QDB[.hN.4[SnWIE`:<^L@=OYTz64@*IwH;-j^tV34IW^TkGXk9nKeFha1gAH,=0t)`7*hYfuE2e5kHc?MIfM/<&C`Cjq%PMqx2#QYO`xa[)RGM1HYj1KhQ;pQzDvSv%Dku49_\\2zBn2D@WuqZLP1?-]sT,q\'^2t%K1NzF*7w%@Wur`is0\'lx>dcHzY.oqnWJJu;\\Dzgt<aZ\'I!^FzbZ\".^xi)&#w_WuoQ%Yxz#.\\m8dxW+cBVpZPaxa]2v1#VpYMUF<<X,fN3MnkS:do*q12I\\t[I<1zG-G_3sy/k\\k/:tg,=.k]pC6(\\%80$_A`I+5h9y)M3Ov58Y>ejgJv@rL]qJYdn$Z$96D7\'Ve#k&iorqe+9$CgeGp*ny>^F$w\\F)3f4c(/S>vds?rOojKox3*s6HM+,;&I\"d`7/#[.gL\'r;fxNZ\\CvSy2$XuoNt+fN2Lk\\k/<$7.xG5kIdC_=KF\\&<=_L?75D:6<k4U7Pnaxdg_*GkolWKTE<<V\'RR(cK+.G[xt_^<NXPhCQNu0$[,]xoEHwJF`7/$_BcU_aM<%>LFXmC@Wy&B_>P^k\'q7R{@aQP{I4c#rIP8dtD0_tRx4.(y\\@ecFlw;Tz4)mt)](Fhc;5;clx?eh]zwg\"d]*Q?&=BtOg?BjwAtRu%Eq5HQC:6A&5x/nkQ3GL.;$96A+M*\"goy=Z4.+-=.k\\k-3WC,LzRc&&+CVi4^fgX_Z(L1KhRA-XZ@l.3WB$&1d0VLXZ>_NJc?J<+]zveuD/Z]I6lMr&Wi5bwU$I+7nU>pEEg^%5z78Rw0x@iyLLw@n6V7JRC7*gVW6C3n]gq+r/)yZ52;pPw7B\'7$GzbWpS/+),=63<rYF0WNa&0Y[?fh^#)ANIdAScxZ9JIq)jeBRXIE]._\"!yrT-wE*?Aea=F.Lv;Y6>sT-u9PjO,)).Ks-u:U(Zuh/CFvNZ`Uh4^fgXclw9KP6T0,-9wxz#-X[F+?@cXmDHyV!9?l1FN:r\\SmR19h0Lnm^l,,8tlGWae](D`@Z,a0c1]i\"[2{G-F\\$2lWPkO)s:]NMv;U\"?Y-gM++3_n3FK($rD8*dHt;`Y{-_$,M)yX-j\\n={&8-s.zOT>sU.\"Y%ElzG1VIGjeAQWC)@G\'(4iDRS.&n*t=h!\\;JE]+SISKZi)#m0:scr>t\\LF\\$5z:F6tvtg,:#;D\'/WRro\\_I1Q.**1UB)@J7mMt.w>dg]{yrU37YD&+DWoOv59[F0T>uadWg))1YV(ZueyX+dEdPC@Vsi8q\\Y-hSEBVpYLN(q6KZh&rA%/Z`XvpT3=wnFL1I^(@K>5+t:Y:QlR6Pt&PFM3S16XB{pEBY%?Rby`Ui8q\\Z4-%ju7GD\\*RFGr7M`&1b(3g:(SQ\"J7oWD/VM_v_X!1ng=529exV$G\"hq)h^!ztZG3b!n8`fa:5;h)(,AI.DOEL1Llc1_qB2kS<l;voMme9$Bfa80&g`1iImpo]flniHfQD<ArE>G+>8?sQw/t0$]9<b^86FAPS5GHt;a^6-wD)8%I),@?Y-hRC6$L<&Eikb,Inv.r%SXD,Hjc9+eIvD.P3GO<y!&8+jb/Y[Am1>*P=z#,UM`%.ULZb`@W!4$RXG:,gP<t_^=Qe/P,%m+\"bWj:wtdz^F$tNd4kO&eWduHDWnMqv\'N:sdwRpf0Q/4V;a\\1s$H$sGD]/gHkl_wa_>P]dbDe[tae[vi2O\"PS4FFkqw-iWW1,\'xZ;Ob\'/TA*FgZm@0hIp%XsdwRmWJN,+3[[9D0^p?&:6@!ypHTQw0w;Tx/njO*zZ4-#cWj7h3ZSrjCI)-EU`fdEeV]Vur_cWk:wui3XHBNGXg&wX3/0A<F2_p@\'>Dydg]ypKa.XY8E6y2\"MFXh-:\"4\"F$uV-r)cGr4C90\'ij^u\\LDRR\'cL0FQJ\\rS&Z!+RC;:Pf:)ZoI[pK^\"zvdq5GHs:[D{k.6cy`TcwW,kb.R<qPu+eHq12FL/BCfb>H1VF>?cZy\"*JyO\\b\\*REB[*W^UmNzI7sj?5-xH9$Ciml[aYxz&;9KSB1f?AffQC;<[>\\@cZz$2lYU&QNqx/nmZZ:LUHIt;\\H4d*:)V]TnT7Ry7;dkorri=-eD\\+XbeYk8h4\\^H+7rf,=3(h_\':1&f[vg&vRqlKnog8z.eBQXF7y2x;Sqg4e+;*]\")CY!.`(;69ZBw]MG]%4suwy{\'@PS5KZgzX)Xf#j{Q`o9co-%kzLEVbl$]727YD&.S@\':3..8pZNVLXX6@#(>CuPkR6T*jfE_70(s<h&r?xk5\\V\"88PlYX1\'g_*K#_EvMZa[(K*(*9\":B{qJX`]76FAR^bVf&!l1C@Wy(I\"cWk;{,Ydn$UlFQLe?F%\"qJUOnc*>:JHh]wi+/IdFiiTHM/:ti7j>1t)\\%5z:H@EzdeRK`+Jv?m3Noo`sHK#bRT01@4{Cq;i,3[Z53>$3rrjBEo..:unLjWX5:cjq\"Co2>\'C_;E.O-.=-a.VPn`uU*dFjnm\\cbElzF+>9C*@F$vZ=]CsHIq+s4?#,P7\\Si>4,vC%*CVh2T<es9Y=`QU<er5EAVoU<cheFg^%2kP07e#l,))0VF<:LTD6{<Pb\"tS\"Dq<l;s`fdGo&]1ry3&\\-_\'6{9?pC935Ld:0{LFYqU4@(AR[X-j\\l3Nptx(L-8q[Uv!0m_uU,moh?>V!74>xoHUU.{Sg6lIb:48ZE+AI/H`3rqd)1XRpg6kGZucq5HO9j7i8p[TtrbtIHmu-ml\\dg[rR%WoOzCsJQ;l>+US%S\\Y/pt{4(fVZF/P1<xvj4[W&M7h2T<fxNXQobzi#`I.A?Z0t+fP;s^]<O]flokO)s;`Y#96C0c1\\eib6y4-\"Z1w9IGfVY@n9g&x\\CuOd5pbvV*eK)!fmqtvxyyz!$1g@DrB,P5S,v?k.6bvPjKq(`;@k*%sFAONyE%%\'3iDU`fb>J<,c9/xC!o?%5z<NYY56MgGgYh%q<k5[Qc(1[`TbsD5w(RMk\\j&p4ISISJYdm{I6mO\"SasHEa@Wvuk<%>LH`6(\\&<Ao9cp2<vj6aq<k6^`J1Q.)%uQod+@Aea:8HFdN8f(*8w$=H6qbvSx1w7A%-TIM,-<)QGM3P\"K?9@sPqpd&$\"u\\KCK3WF7y/opf3avW2*xQg;)V\\Rb\"o;l>)L.;!.c4pe/N&eZoIZk6^bQQ&]0kWT#H\'&(3g=4,yRg6lMu33DAY%@WvvqW>k/>-^\"!ysV7IO2EJ&rB.WV+ja.UL[fs9W2/5XF6tuoR+u?n:l>*SLa*Ea?Q\\^H+:\'N;vlA86B1e8#>TmQ.-5_hp\"H,>8<difIr00<z\'@R]bUf\'$zk.8mKiXZ@m.6am,%n..>.gK!W{2v-nrsnP\'eV\\P[]E!k(vLUHGjhQ;oJ^#\':3-*\'&(3g9#?TmNzH4g5f3`p;j1Kj\\k/;!.a*E].c4pd*8y+Zj2Nt,mm^pA/`$\'7!;JDUdxX/t/$]77M_zrMgHkiR>yt^Z,b5v&H#hp$PQ*s7OhHh[pGL-7j>1v1%`BdZrZJBNB?TmNyE(/R;h*-ACm&dRPv1\'jk]rK]rOnc)9$Es>rPu\'SR*knhBK7i9wxwoLhN,,8re%w[Cx]J:\"5\'^1nc,GdIzV{5*nzCrE:2*uD/WOf;0x>`PP$VoS3@)It9V.u8JO2FK-9sh2U@zrOqqg4d(1ZY6=n?+SHO8bp3A4w-le;0xAn4Ld==Y2&bHz^Ezca@UnS5HO7__Fzb[&>I:&GwQg=63=xoK`-Q:h),<0s(\\$4x0w8E9*cATf,<.mhEYuf&y`Ui:x\"-[m:oNs%N@4$QR/-5_it24LfE_6,r/(s@yl8e!fkhL&kw;X/w>b]0l[ccK,3\\^F#n8^X$>QawY6>pK^yoC<Czj+)+;-iTK[h#fcC^86F@MGYoJ^$*Ho!H0Q07`e`7*eM/?4#ONt.xE(3h=2\"LBDl\"UlIb8+i_!ym>(Ht?oA/b/Y[@j{TmP&`BbNA:>hxIAH+9z.d<8E6u{0nhCPJa4suupS0/<!,VV0(p18cq6OojHcAVran./B?Urf+8vvsbn-\'x[;N\\hvD(8\"<JBNDH#jzMLt0&ika\'7z4(fV\\NP+zY/qy79W5=nC=G1ZY3-(y]Ezfn{F&\'/S?zwh+1R3@+TJX]NLu47W;W1&dUYE.Q5Qx55JYckq!@_EwTx-fIu=ft:Z?eic:2,#cZvmC@X$=I<2$Uj=+[qOpmWLVM_zn?*O9h-<(PB80(o+yTp`p8^W{0k[dg[sZH6qf-AFxZ69ZArIN2HV[MLs/&gb91(n%]2x8B\'7$G{da=F.M#\\3#NJfM-4[W&M:uj9pYIAK:y$7+mpmVE7$H%sJR?#+O4R)h`,P8`cU`e^+O8bl$\\/k\\j*$p=t[MMzJ?=SkIeJ{Z.ooe/P/4V=h!\\:G:+a7\'Zvj5^d\\&<@l*$o3HSK^zu]Se*7usf+6mQ.)#o7W<aYz\'DbI($vZ@j$bQKeAPQ,#cXlA86D90!Q\\]Bk!TkH_-WV1)s:_Xy(Ht>l2KgM*&yaYy\",UOjQ4LeAPP&`A\\63:k8i6e\'+>:H>?`L<%@Vrcy`QV=l3Ox9KR=rU4;i0I`2m]fmu+fN4T0/8kA:BxbbJ+2XMVOiHi^zrR!E{hwC\'0\\emt)`4x3(koqjEU^^AaQNqy4*p(eTQ{Cp7X?k)\"iu:T$I+8tnO{I4d*6rf.HcC`?Uqczb[\'EijZdkqv(TW;\\Cw[Aj$`FvLS@%4stq_fgUS#J6j?5+s6FC]0l]n7^\\514Nqty+Zi,5czejfGid>Ak$_A_F{ddJ(zc^2rw&Eo-%k{NQ/2Moph=0r\"AcVe$o7X>fq,vB#zpFFks\'Vf$rD8)`7)dI{[528ahiZep/,->5-yOYTy2zCvU\'Wg(*6nUA\"#\':1\'jmf>;N[`S]_I0N\"Sc!j$dYqS,wD)9\'SS+o$Uf)/Q1<xvh.?8;]I5g6nQ-&r>t[I:%GwNYZ<U\">Vy-a.Y]LCH\'#sKX^PVD/WSx2#SbtLVQrpatJO4Orz63>zyucn(iiVS{=Uv!1nf;+`/]n=xs[OVIIq-zQbzhxLLyJ@?Z0s*cDdRMl`zn;s\\Rd*8\"86HK$fcC_;C#!u[F,EZuj6br@%2hF[#2m^m3IYfzY.mjO.0FRNmc,HfTOpmWKO.4WB$(;3-(zaXpV=fr5FEeSPx9H@I1S6Psx+]\"$+N-2P$Y\"1oiDRT13I[pIX`_A^AaOFQIYevG;3,\"_DsC1b*><TrjBDo/2KfIu?o@,SGGo&^722DB\\2y@fh^zrT+mqrmNzJ:&HyX,eIt;^NN\"QXNZ_OP&`?Vutg/Ha5\"Co1;sal{OQ/1FO?+UU,p#J7oWC)=;N\\hyP_n3IXdr8U-u:T\"?Z/s(Zuh+4bzdha3mXRqg9x&A[-d?H.FZwpQ{E{hxLLxF/S;h&vQlS<k2OyBq>zveuF8%I*/MxCzi$fc@Sc!k)xTx*Xcm%^:>fr27[MN\'ij]sS$NDK0H]#,R@,RA/a\'6x-gK!Y*Yj2Q*s7OhFa<D%%*@J5c!l,.A?X&I(#rIM.7j;$:<\\DycaCcQMk]m4R)jfGh`,O1B=G3b$zo@,VT&Wk=)O;r[OXPg><Qe2`qC2lVKUJTJTMb.TF?J;&En&cOA4#J5czejhM*#k#\\4\'cI%r?ypKa-Q9aikd7!9@qGIwIAI0Mw;W+eHq01A;?l.6d\"m1C?Q_j#]9>j*\'%#zoC<BtQpg9\"87JSE>E\'*>=Uux#6\'Z{(BY$::Sv\'L2R-%js+lmb(6soWF7x,b8(YpQ%Z\"-^xh(zdcGuE3iF]\'?LBH$q>vewN[b^7.#_@_Fy^I4_l+%p8[KCOFPDB^:C#yn?(D`@W!3y<U!8:Y8HE^4#MCH$o5Qz>^Ex[?aRU;a]6-yMN&dUZJCOFPEI\"bT][4+t<`Z%@UoXICS][4-$geL-4[W%J,9y(IyTrh7pZSo\\^H+:\'O?-^xk1KfJxKIll^pB3str`l(q3>$2m]hwH8#=MQ1=#1jQ6V4:h+0MxC!n8dtF9,kb0[cdO<!)IyRh=0s&PKd?I5e*8y,\\t[JBH*2ZX.s*fP?+Q>!&;7D3jKp#L<)O=#2oh?;JDUcvN`xcfZpMkY]LCJ/ERNqw*\\vg%o6R%UcvRrlNyE\'-LxE+??_H,;*[rS(a@Vsf,<-eEcI%q<m>\'C`A\\76GGlrz9C(:-nm^o=ubjr%SZLM$_Be]\'@OO%\\0qssj?3$Tao5MfDXui3ZPd-Kr*jgGic:2,$is-v>fnx<W+b;;Su\"5)fUU1-,6g4c$uW1(o)mv2.,3WH?CsF?G+=4+u>i\'r=n>(Hs:[F)6smKkb-M%dXi1NxAl.1Ms&Ucs@#%0^tT)b@R^fh^ztYAuU*dHt<dmzE%{n<vh-:#98Nd1`uW2-,3YN[`WpV=j*(+;*]!\"(?H2XOb\'3e3b$xdkr{<P`vW0#Xy\'CbL4ZRkMw?hxI>:F6v#725Q\"J5d(/Q5MiO2C?OUA$)AOLqy529g)+:&J)(,BNCFq6NiN,(\"n5S*ny<W(U^]9@rOjSA)CYz\'AUmKj^uZCzl0>,[oFHvF8!9?pC934J\\pGO8f((1YU&OGRMgJs4@%5y64D:48X=ca@VrczdfTT*lmd3d+=7<dkpv(RNqsp^fi_%/Y]I8tlDJ-9vvqV<a^6.#_Ckx@o9dtC,M\'p2<vmA85@\':45La+Hnu.r\'Zws]Vusf).Lt36U23J]xm?-]sS\'^1ma#yk2I]\"&6\"AcUbq8[G0VHFcI$k{R`p;j4V>n>%8,ll]l0A7/%geIt>j+*3]b[&?MIcC]2x:LR=sZH;*]$0`%*AK;&Fq3?(AUlEM9pS26ZH:)YnDB`CgdGmzF)2]iyMR4IUS%RU9Y:Su\"88Ne7v#723HRISMd8\'SW<`Yz*P>#0d6w%B_AbSU6JSHK%l$]611C>OU?u^VtlFQHSMiN-0EQLeCVj>-d:2,$jv=`WnOzG,AH\'$zm6YH<4//<$95>u``G{aVj8pWC(7#BgfM.8mLmiKt24Lc7$I,;\'K/A<JAG%vX2./?5(dL1Ja5w-j[gyQc&(4kLt0\'n\'dSR&[\'Ega6\"AfeM0A<F1\\dcJ)(*9%G{aQT6KX^Q]`POx<X-ot\":D\'3iEWi5_fi]vaaH%sIK{Wy,\\sU23GM4W?pEBXy\'C_>SjDM;z(Flr%M?2w419i5^bVf\'$yfs6IQ>!\'=CtM_ym8dyZ9E6v$?Si>3&[(J#d^/e>>\\<Qd/Q4J\\pHP?*L,.BDm&dRNolS;g$jv<]G-BK3XKM&kv8HD\\-_$)BUg1P+ySlMu6@#)CXsdxW*b=CwZ<X-kd7z614Pz@gp#K9x!-ZfvIAL;$;?i\"]=Rh=3\'dQFHxPc\'.P2B:<]H1S8W6@\':1\'jle;1#UkDJ,8p[V{739co/1GSOqux\'Gr6Ne<68W5;i-7lGZpLfD\\*SIUQx3-\'tG>CrB+L&o.-4[Y2%^9:X45JZi(y_NGZrW<b]4#NFTV8OgCRU:Y<Z7>rR\"F$tNc1_rHK#cU`e]\'@Q[W\'SS,wE-Jp%WlEM7cwStvxz%6\'[\"*M.8lFQIZm;tf%sIN-1Nv6@\"!zveuE3jHfO9g+6jBEs?vclv6=oEGq2;pNpssi<)RHSJZi*()3e0UE7#EsC.XX32>\'AUlGWds>pISITNjR9co,#d[\"+N3Ml_xdkr$K5asGBUg/Hc@R]aS[SmT=m=!(C\\,^zvdo-(xW,hWY=`R\\Y/q{=SlP+zVy-eAPQ*q00?/gIq)g\\sW:T\"Ad]*L(z_NEPCB]9=eo$Tf+7rh4^fkjTF@ONyD{l0A99Rsurcy\\Aj\"Vsg1T;dlx@iyKEYqV9T$I.ESU3:i0FU^X&Fr9[H6nU=j-4_jxD(4lO(n&aBbNA71-,7nS3?(EeTU25Py;Pf8y-c8)^*J\"^@aPKd@NJgRA0d4lQ1:nI^%3m[^I3\\_MBA_Cl#Wvuk?2v0\"Q]`NGV_];G7w&Dga6#EvPhBM>0ng=4-&o/0CFs<fuC);3+yQe/O(q3=woJ_\'8+eJ$feJ\"`M=*VX>gq-\"Z,b6\"Ae^/e;1#Te*7uth2T:_Xx\"1l\\dg\\veuC-O.3U;baFuF;2\'eXh))2]gp%Vi8oV>m7bo/1FO?+UT)bB\\1r{;H>;KM$`FwRmVD4ob#tT%OGUYC%(9\'TZLJnqsq_jwByfq.&o19i2R2:l=\'Eij]qJWY>b^4$OJc<?c^1ne2^l,*-CL;y$5\"Co3D?OS8W5@$/[gwJDVg,8vwtdxU{8<cdQJ[n?-[i+->3&\\,]u^Vsh4aq=sX=a\\.b4n]ca?Q^fkjWT$I,<,b7\'XlA71.2Q*s6HM.7g2VB\'5v&FtD/XX45JZi+/H`3qnVF:0yF-HdFmx?ddL-7kEN<\"/c4n\\_NFTW;\\F(.P0;tdxTy0ptvz(Ht<ep-\"]<OYX2+yQg7tpYJHjc8%K3WD.R:f\"fjb2hCPKhP9f#k$bPFPB;=_NH_,UMd6ttnNv6?xm>%:8KP7[OXQjJpy;Pb#zm;qW?m5U6F@OO%\\/k\\j(wPg</s\'XpPzAm-,5f.IfN5V9T$M>0mc/R:cm#WrcvPe7uumKfJzTqasHIp*lomXPiF[z%5y4-&o1:nHV^X\"6.zP]efTR{Cp8[I>9@v^Q]d_7,q&\\\'DeXh*.Hb>I7rf-ADq9]Q\\_MBA^@`G&zfp*p)kl^qGIvC);3,{Z1{J9z,\\rPu+fK&n..:wvoKfGlrx0u/zMKot{5.$dZtafb>F+=3+t=ep)ifHo%Ywtey\\Aiu:W.v:RsskEPEI$l(o,ySlMxAo<oJ_)@I5f0R3C<Cw^OQ+yTrh7mLnn_sKVT&T^_G%vU%NBA^=P]hwC#ym9j7h5bwX1%bK0GWez[9D/WQn^n4Nppg7qbuOf;,fK\"^@_H((/Q5Pw1\"R]_L=*V\\OWHDZz%;:Od1]i#_Ad\\%:47V5>xnB:;V+gTLb/XU\'VctD2hCNA=NS8X<_ONx@k)wPb\'/TC1f:,fK$ggTOnd-ImokO(n&bGwQg:\'M8lCDlyF-F](Go(fYh*,<,d?I5g4e*9!5)jgIp(bGr9[F,EWj:umHXf#gkfD[%;?izSjDN@7/\'p18bn,&sB,N,+4`p=pNl]k-3XJInw43C8.v>gs6HJzUrg0Q19k:uk>0md2azj*\'\"qD<=]G(/O)s=j*(*:&K1JfL&o1<wqS+s3:i.?4)jgJv?m6ZKHfQB7-u7HGklb(7z2zE#rJTL^wes9Z@l,-9wy#2plR2>$2pkJiZh#ea<Cx_Ui8rcvRobzhxLO)vH?@da;=_PR.\'vN]m3Mmd4iAEvM[b_:>fq/(uG=:KO0:sbq:acQKa2hCQS.&m\'ijZfr6HL+*2[]Cp;h)\'&(5pbx]F*7skCFwPd.M$`DkxBvY;Tw\'N:pS12GRIX_[0ppe0Q3C:9M^qIQ>\"+O6ZKIhYfuD.R=qPt(Wi0Kk`&/Z]J:$>PZV%I,7oYLR;i/DJ*.HdEf[uae\\{#*JyP\\b].a+Io\"J9uq\\Y+_,THL+*1VF;42<woI\\u`aH#k&kt-u7GBTcxY6<j,4]_I/Lpz>Y-iVRx3*s5FBXxxyvj5]`J3\\[8?rMe;42;r[OYW+dEg^\'=@gmt&ODDks)a97D5w*ZoGO;saiq&UcuLVNd4mU?wh(#n4LhN,+2XMXW.w>caAZ,b5w,eC[&CaH\"glmb):+b90&e[tagdBZ(L.:y$6\'\\(DdTU4>xqOqtuulCEp02Kd>E#tPlXRpg6nU>qMf@J5e,ACk!R_k$`Dm&cN<#3t{60/;ws^]=Pb\"rMa,Jt5A*Ho$S]^Bl(n(h`0a%(:/t/\"X\"4$PP%]2u+fK&p3EEf]\"(@LAA`H%w\\E$w_VoT7Pnc\'1\\ca?Si<*V\\Q^jzQ^j\"Y\'M7ctIJt7KXZ>aXsdwRpb!l1DGuF8&L8kA<G5kMu6@\"$,N/8k?3y?_L>1u-ov,eEdQHTQz=W&N=\'C`BdWg+2ZW*b:59^X\"5)eQDAXy\'Fm\"NLpx4-$hjb1b)9\'PEJ&vRpg5h;)TU37YD&+F_6,p&Yws^[2!J:%@Y\'L/CEo/2I^$-THJzVy.d=?aUd!fid;419i2U<er4A-ZdmzD{k+*0R5Md8(Vbl!PU?tZE)7x)QEHuC(7\"=Rg9!4&\\+US&WnJb7%OEL1JeD]3y<Uz4)h^#+It:W2..:vsctF<7?wdn\'g]zxpNl]n:l>*P>$3rpbx]G.G])Gn\"ONw=^I1T<g{]@`NA>P\\_L?88PkT@%/^uW35MiR>vg&uOe9%H\"fi_%/\\k,->2\"L@=P_m2FN8e#o7X@n;mA6,r/\'n*r4B3sw$<D\'0[_OO#SbuPiIke@G)2\\ddL/?5,t7HK#bPKeD^4$QS2:k8j=*V[J>9C&1c);.px3(ha1e9&M:r_bQPzF(.M#\\5+q-yOZW*`3pkKpz<Pb%&-P4K_(<9JKyMO*wMUHEaCdTZH<2&bGwPc(4iCL9q[TsnQ*s8Rw/t.t23FIzZ2\'eU[JBI,9y(M1I_)CZ$7.yJ?>Y+_,Q<qS)ic:0\"Tf/KnpmVF<8A#%/\\hyRh=2\"LCH&yccI\"cZz#-WW34J]u^Up[Ux+\\wh*,?9@sOkUIJwG6snQ,\"^AcZue\"hs38\\Q_n3GN9mDH\"edHt>oA0e=9G<69Y<[<W+b92/3S0.7h3[W*^+M,/H\\\"\'<<V%L6cwW+hUQv*`1gCT_cYpR\'bFr9Y=^LBBcWg\'$w\\I9w\"3w3*r5D91(q2;oJ`.VPnb#wbdTW=ceUV8LY_VoS16XC$$)?EzdgYi.?4&\\+TOog:\'PDDheIt<djiWU(])Hr3=vi.>0omWM[dkmd4kKq#H,=2\"LA@];IBL:x\"/b.TFAS`l(o*s8Qsw#838^Z,b6!>UsnP&bJ*+9#:>hyO[\\CuOe9%FwQiEUaip\"DtJM(wO_rHM/=(HvH@G&$\"wabJ+1U@{u``EtB*FcHxP`w\\H3bx`Wsbq:bf_-UPog:\'M8kA:AtS#I.FXk8j=,`*D]1ppb!m5S*nw6=oC<@l-1Lnm[^J:{0kYY9LVNb,Jq(a>KCL9se&zhwH;0x>c_6*jfBS_hov,hUQt\"<LM#[-b6z9@uY>deSOpn[[<Uw(N9oMpsslFV`dYoLfEa?Sg3]c[\'B\\/k\\j)\"ixH:&L4ZO]k*#iwArKY`Z(K)\'&)9\'RQ#NH]%4v\'M6btGBTap7W8M_zm8f&ydg]yrS*ic6{9@rNhHh]xj0DI(\')6spYMTA(>CsHGkk\\l3Mmg>;MS?!\"&7\'Xk<\"1kXV)]*M/;y&<ArE=Bq?$-UMc2e3c(1^m3HW^X\"4&Xsajv<Z9HDXtg)/Ls.!TjCH&x_QV@wchdD^6.$`FwRmXQkN&dUZG8x*W`_AbSV9U\'XnJ_*Hms%M>.e@I1UA$)APP&');
+--enable_query_log
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+--error 0,1114
+INSERT INTO t1 SELECT * FROM t1;
+DROP TABLE t1;
diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test
index b5ace75dbc4..23c591856a7 100644
--- a/mysql-test/t/archive.test
+++ b/mysql-test/t/archive.test
@@ -1550,3 +1550,12 @@ insert into t1 values (1);
repair table t1 use_frm;
select * from t1;
drop table t1;
+
+#
+# BUG#29207 - archive table reported as corrupt by check table
+#
+create table t1(a longblob) engine=archive;
+insert into t1 set a='';
+insert into t1 set a='a';
+check table t1 extended;
+drop table t1;
diff --git a/mysql-test/t/bigint.test b/mysql-test/t/bigint.test
index 9b4fc3f39b0..da10f4efa61 100644
--- a/mysql-test/t/bigint.test
+++ b/mysql-test/t/bigint.test
@@ -307,7 +307,7 @@ select -(9223372036854775808);
select -((9223372036854775808));
select -(-(9223372036854775808));
--disable_metadata
---endble_ps_protocol
+--enable_ps_protocol
select --9223372036854775808, ---9223372036854775808, ----9223372036854775808;
select -(-9223372036854775808), -(-(-9223372036854775808));
diff --git a/mysql-test/t/cast.test b/mysql-test/t/cast.test
index ab2859a5346..5563e260a06 100644
--- a/mysql-test/t/cast.test
+++ b/mysql-test/t/cast.test
@@ -237,4 +237,13 @@ select hex(cast('a' as char(2) binary));
select hex(cast('a' as binary(2)));
select hex(cast('a' as char(2) binary));
+#
+# Bug#29898: Item_date_typecast::val_int doesn't reset the null_value flag.
+#
+CREATE TABLE t1 (d1 datetime);
+INSERT INTO t1(d1) VALUES ('2007-07-19 08:30:00'), (NULL),
+ ('2007-07-19 08:34:00'), (NULL), ('2007-07-19 08:36:00');
+SELECT cast(date(d1) as signed) FROM t1;
+drop table t1;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test
index dd3037ce88d..8b1de227ab8 100644
--- a/mysql-test/t/create.test
+++ b/mysql-test/t/create.test
@@ -1122,6 +1122,25 @@ show create table t1;
drop table t1;
+--echo
+--echo Bug #26104 Bug on foreign key class constructor
+--echo
+--echo Check that ref_columns is initalized correctly in the constructor
+--echo and semantic checks in mysql_prepare_table work.
+--echo
+--echo We do not need a storage engine that supports foreign keys
+--echo for this test, as the checks are purely syntax-based, and the
+--echo syntax is supported for all engines.
+--echo
+--disable_warnings
+drop table if exists t1,t2;
+--enable_warnings
+
+create table t1(a int not null, b int not null, primary key (a, b));
+--error ER_WRONG_FK_DEF
+create table t2(a int not null, b int not null, c int not null, primary key (a),
+foreign key fk_bug26104 (b,c) references t1(a));
+drop table t1;
--echo End of 5.0 tests
diff --git a/mysql-test/t/create_not_windows.test b/mysql-test/t/create_not_windows.test
index 2c1700d9e49..56b4002106d 100644
--- a/mysql-test/t/create_not_windows.test
+++ b/mysql-test/t/create_not_windows.test
@@ -17,6 +17,7 @@ primary key (_id)
show create table `about:text`;
drop table `about:text`;
+
# End of 5.0 tests
#
diff --git a/mysql-test/t/csv.test b/mysql-test/t/csv.test
index c7c7f3e13ab..4aff4b27976 100644
--- a/mysql-test/t/csv.test
+++ b/mysql-test/t/csv.test
@@ -1674,3 +1674,52 @@ CREATE TABLE `bug21328` (
insert into bug21328 values (1,NULL,NULL);
alter table bug21328 engine=myisam;
drop table bug21328;
+
+#
+# BUG#28971 - ALTER TABLE followed by UPDATE for a CSV table make server
+# crash
+#
+create table t1(a blob, b int) engine=csv;
+insert into t1 values('a', 1);
+flush tables;
+update t1 set b=2;
+select * from t1;
+drop table t1;
+
+#
+# Bug #29353: negative values
+#
+create table t1(a int) engine=csv;
+insert into t1 values(-1), (-123.34), (2), (-23);
+select * from t1;
+check table t1;
+drop table t1;
+
+create table t1(a int, b int) engine=csv;
+--write_file $MYSQLTEST_VARDIR/master-data/test/t1.CSV
+1, 1E-2
+-2E2, .9
+-10E-1, -.9
+-1, -100.1
+1a, -2b
+EOF
+repair table t1;
+check table t1;
+select * from t1;
+check table t1;
+drop table t1;
+
+#
+# Bug #29411: deleting from a csv table leads to the table corruption
+#
+create table t1(a int) engine=csv;
+insert into t1 values (0), (1), (2);
+delete from t1 limit 2;
+check table t1;
+select * from t1;
+delete from t1;
+check table t1;
+select * from t1;
+drop table t1;
+
+--echo End of 5.1 tests
diff --git a/mysql-test/t/ctype_collate.test b/mysql-test/t/ctype_collate.test
index 4bbae42559a..cfef8dfe81a 100644
--- a/mysql-test/t/ctype_collate.test
+++ b/mysql-test/t/ctype_collate.test
@@ -218,3 +218,14 @@ insert into t1 set f1=0x3F3F1E563F;
insert into t1 set f1=0x3F3F;
check table t1 extended;
drop table t1;
+
+#
+# Bug#29461: Sort order of the collation wasn't used when comparing characters
+# with the space character.
+#
+create table t1 (a varchar(2) character set latin7 collate latin7_general_ci,key(a));
+insert into t1 set a=0x4c20;
+insert into t1 set a=0x6c;
+insert into t1 set a=0x4c98;
+check table t1 extended;
+drop table t1;
diff --git a/mysql-test/t/ctype_uca.test b/mysql-test/t/ctype_uca.test
index 17632e7c8fc..695a21adbf5 100644
--- a/mysql-test/t/ctype_uca.test
+++ b/mysql-test/t/ctype_uca.test
@@ -530,7 +530,7 @@ create table t1 (
a varchar(255),
key a(a)
) character set utf8 collate utf8_czech_ci;
--- In Czech 'ch' is a single letter between 'h' and 'i'
+# In Czech 'ch' is a single letter between 'h' and 'i'
insert into t1 values
('b'),('c'),('d'),('e'),('f'),('g'),('h'),('ch'),('i'),('j');
select * from t1 where a like 'c%';
diff --git a/mysql-test/t/ddl_i18n_koi8r.test b/mysql-test/t/ddl_i18n_koi8r.test
index e636d801b07..1d16adbad55 100644
--- a/mysql-test/t/ddl_i18n_koi8r.test
+++ b/mysql-test/t/ddl_i18n_koi8r.test
@@ -30,6 +30,8 @@
#
###########################################################################
+# Test requires server to accept client connections (for mysqldump portions)
+--source include/not_embedded.inc
--source include/have_utf8.inc
--source include/have_cp866.inc
--source include/have_cp1251.inc
diff --git a/mysql-test/t/ddl_i18n_utf8.test b/mysql-test/t/ddl_i18n_utf8.test
index 5f032232e56..c80137a58b5 100644
--- a/mysql-test/t/ddl_i18n_utf8.test
+++ b/mysql-test/t/ddl_i18n_utf8.test
@@ -30,6 +30,8 @@
#
###########################################################################
+# Test requires server to accept client connections (for mysqldump portions)
+--source include/not_embedded.inc
--source include/have_utf8.inc
--source include/have_cp866.inc
--source include/have_cp1251.inc
diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def
index 54021b834a4..cfee9c5ad00 100644
--- a/mysql-test/t/disabled.def
+++ b/mysql-test/t/disabled.def
@@ -20,35 +20,8 @@ im_life_cycle : BUG#27851 Instance manager dies on ASSERT in ~Thread_
im_instance_conf : BUG#28743 Instance manager generates warnings in test suite
im_utils : BUG#28743 Instance manager generates warnings in test suite
concurrent_innodb : BUG#21579 2006-08-11 mleich innodb_concurrent random failures with varying differences
-ndb_autodiscover : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog
-ndb_autodiscover2 : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog
-ndb_load : BUG#17233 2006-05-04 tomas failed load data from infile causes mysqld dbug_assert, binlog not flushed
+ctype_big5 : BUG#26711 2007-06-21 Lars Test has never worked on Double Whopper
-partition_03ndb : BUG#16385 2006-03-24 mikael Partitions: crash when updating a range partitioned NDB table
-rpl_ndb_circular_simplex : BUG#27972 2007-04-20 mats Slave cannot start where it stopped
-rpl_ndb_2innodb : BUG#19227 2006-04-20 pekka pk delete apparently not replicated
-rpl_ndb_2myisam : BUG#19227 Seems to pass currently
-rpl_ddl : BUG#26418 2007-03-01 mleich Slave out of sync after CREATE/DROP TEMPORARY TABLE + ROLLBACK on master
-rpl_ndb_innodb2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement
-rpl_ndb_myisam2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement
-#rpl_row_blob_innodb : BUG#18980 2006-04-10 kent Test fails randomly
-rpl_ndb_ddl : BUG#28798 2007-05-31 lars Valgrind failure in NDB
-rpl_ndb_mix_innodb : BUG#28123 rpl_ndb_mix_innodb.test casue slave to core on sol10-sparc-a
-rpl_ndb_ctype_ucs2_def : BUG#27404 util thd mysql_parse sig11 when mysqld default multibyte charset
-
-rpl_invoked_features : BUG#29020 2007-06-21 Lars Non-deterministic test case
-
-# the below testcase have been reworked to avoid the bug, test contains comment, keep bug open
-#ndb_binlog_ddl_multi : BUG#18976 2006-04-10 kent CRBR: multiple binlog, second binlog may miss schema log events
-#ndb_binlog_discover : bug#21806 2006-08-24
-#ndb_autodiscover3 : bug#21806
-
-#rpl_ndb_dd_advance : Bug#25913 rpl_ndb_dd_advance fails randomly
-
-ndb_partition_error2 : HF is not sure if the test can work as internded on all the platforms
-
-im_options_set : Bug#20294: Instance manager tests fail randomly
-im_options_unset : Bug#20294: Instance manager tests fail randomly
mysql_upgrade : Bug#28560 test links to /usr/local/mysql/lib libraries, causes non-determinism and failures on ABI breakage
-rpl_udf : Bug#28993 rpl_udf test causes server crash and valgrind warning in pushbuild
-ndb_dd_sql_features : Bug#29102 ndb_dd_sql_features fails in pushbuild
+federated_innodb : Bug#29522 failed assertion in binlog_close_connection()
+lowercase_table3 : Bug#29839 2007-07-17 ingo Cannot find table test/T1 from the internal data dictionary
diff --git a/mysql-test/t/federated.test b/mysql-test/t/federated.test
index 0eaead8011e..fa65568e9cc 100644
--- a/mysql-test/t/federated.test
+++ b/mysql-test/t/federated.test
@@ -1630,4 +1630,57 @@ connection slave;
drop table federated.t1;
+#
+# BUG#21019 Federated Engine does not support REPLACE/INSERT IGNORE/UPDATE IGNORE
+#
+connection slave;
+create table federated.t1 (a int primary key, b varchar(64))
+ DEFAULT CHARSET=utf8;
+connection master;
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+eval create table federated.t1 (a int primary key, b varchar(64))
+ ENGINE=FEDERATED
+ connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'
+ DEFAULT CHARSET=utf8;
+
+insert ignore into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe");
+select * from federated.t1;
+
+truncate federated.t1;
+replace into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe");
+select * from federated.t1;
+
+update ignore federated.t1 set a=a+1;
+select * from federated.t1;
+
+drop table federated.t1;
+connection slave;
+drop table federated.t1;
+
+#
+# BUG#25511 Federated Insert failures.
+#
+# When the user performs a INSERT...ON DUPLICATE KEY UPDATE, we want
+# it to fail if a duplicate key exists instead of ignoring it.
+#
+connection slave;
+create table federated.t1 (a int primary key, b varchar(64))
+ DEFAULT CHARSET=utf8;
+connection master;
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+eval create table federated.t1 (a int primary key, b varchar(64))
+ ENGINE=FEDERATED
+ connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'
+ DEFAULT CHARSET=utf8;
+
+--error ER_DUP_KEY
+insert into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe")
+on duplicate key update a=a+100;
+select * from federated.t1;
+
+drop table federated.t1;
+connection slave;
+drop table federated.t1;
+
+
source include/federated_cleanup.inc;
diff --git a/mysql-test/t/federated_innodb-slave.opt b/mysql-test/t/federated_innodb-slave.opt
new file mode 100644
index 00000000000..627becdbfb5
--- /dev/null
+++ b/mysql-test/t/federated_innodb-slave.opt
@@ -0,0 +1 @@
+--innodb
diff --git a/mysql-test/t/federated_innodb.test b/mysql-test/t/federated_innodb.test
new file mode 100644
index 00000000000..772e37a2929
--- /dev/null
+++ b/mysql-test/t/federated_innodb.test
@@ -0,0 +1,34 @@
+source include/federated.inc;
+source include/have_innodb.inc;
+
+#
+# Bug#25513 Federated transaction failures
+#
+connection slave;
+create table federated.t1 (a int primary key, b varchar(64))
+ engine=myisam;
+connection master;
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+eval create table federated.t1 (a int primary key, b varchar(64))
+ engine=federated
+ connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1';
+
+--error ER_DUP_KEY
+insert into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe");
+select * from federated.t1;
+
+connection slave;
+truncate federated.t1;
+alter table federated.t1 engine=innodb;
+connection master;
+
+--error ER_DUP_KEY
+insert into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe");
+select * from federated.t1;
+
+drop table federated.t1;
+connection slave;
+drop table federated.t1;
+
+
+source include/federated_cleanup.inc;
diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test
index 537ab5888bd..1f8a3b82cfd 100644
--- a/mysql-test/t/fulltext.test
+++ b/mysql-test/t/fulltext.test
@@ -399,4 +399,14 @@ ALTER TABLE t1 DISABLE KEYS;
SELECT * FROM t1 WHERE MATCH(a) AGAINST('test');
DROP TABLE t1;
+#
+# BUG#29445 - match ... against () never returns
+#
+CREATE TABLE t1(a VARCHAR(20), FULLTEXT(a));
+INSERT INTO t1 VALUES('Offside'),('City Of God');
+SELECT a FROM t1 WHERE MATCH a AGAINST ('+city of*' IN BOOLEAN MODE);
+SELECT a FROM t1 WHERE MATCH a AGAINST ('+city (of*)' IN BOOLEAN MODE);
+SELECT a FROM t1 WHERE MATCH a AGAINST ('+city* of*' IN BOOLEAN MODE);
+DROP TABLE t1;
+
# End of 4.1 tests
diff --git a/mysql-test/t/fulltext3.test b/mysql-test/t/fulltext3.test
new file mode 100644
index 00000000000..1b6a07c540f
--- /dev/null
+++ b/mysql-test/t/fulltext3.test
@@ -0,0 +1,34 @@
+--source include/have_gbk.inc
+#
+# test of new fulltext search features
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+
+#
+# BUG#29299 - repeatable myisam fulltext index corruption
+#
+CREATE TABLE t1(a VARCHAR(255) CHARACTER SET gbk, FULLTEXT(a));
+SET NAMES utf8;
+INSERT INTO t1 VALUES(0xF043616161),(0xBEF361616197C22061616161);
+SELECT HEX(a) FROM t1 WHERE MATCH(a) AGAINST(0x97C22061616161 IN BOOLEAN MODE);
+DELETE FROM t1 LIMIT 1;
+CHECK TABLE t1;
+SET NAMES latin1;
+DROP TABLE t1;
+
+# End of 5.0 tests
+
+#
+# BUG#29464 - load data infile into table with big5 chinese fulltext index
+# hangs 100% cpu
+#
+CREATE TABLE t1(a VARCHAR(2) CHARACTER SET big5 COLLATE big5_chinese_ci,
+FULLTEXT(a));
+INSERT INTO t1 VALUES(0xA3C2);
+DROP TABLE t1;
+
+# End of 5.1 tests
diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test
index b24015ebb99..6f9b5399b7b 100644
--- a/mysql-test/t/func_gconcat.test
+++ b/mysql-test/t/func_gconcat.test
@@ -551,4 +551,15 @@ SELECT LENGTH( GROUP_CONCAT( a ) ) FROM t3 WHERE b = 3;
SET group_concat_max_len= DEFAULT;
DROP TABLE t1, t2, t3;
+#
+# Bug#29850: Wrong charset of the GROUP_CONCAT result when the select employs
+# a temporary table.
+#
+set names latin1;
+create table t1 (id int, name varchar(20)) DEFAULT CHARSET=utf8;
+insert into t1 (id, name) values (1, "óra");
+insert into t1 (id, name) values (2, "óra");
+select b.id, group_concat(b.name) from t1 a, t1 b group by b.id;
+drop table t1;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/gis-rtree.test b/mysql-test/t/gis-rtree.test
index 579ec65f149..88f31143d93 100644
--- a/mysql-test/t/gis-rtree.test
+++ b/mysql-test/t/gis-rtree.test
@@ -827,3 +827,22 @@ INSERT INTO t1 (b) SELECT b FROM t1;
OPTIMIZE TABLE t1;
DROP TABLE t1;
+
+
+#
+# Bug #29070: Error in spatial index
+#
+
+CREATE TABLE t1 (a INT, b GEOMETRY NOT NULL, SPATIAL KEY b(b));
+INSERT INTO t1 VALUES (1, GEOMFROMTEXT('LINESTRING(1102218.456 1,2000000 2)'));
+INSERT INTO t1 VALUES (2, GEOMFROMTEXT('LINESTRING(1102218.456 1,2000000 2)'));
+
+# must return the same number as the next select
+SELECT COUNT(*) FROM t1 WHERE
+ MBRINTERSECTS(b, GEOMFROMTEXT('LINESTRING(1 1,1102219 2)') );
+SELECT COUNT(*) FROM t1 IGNORE INDEX (b) WHERE
+ MBRINTERSECTS(b, GEOMFROMTEXT('LINESTRING(1 1,1102219 2)') );
+
+DROP TABLE t1;
+
+--echo End of 5.0 tests.
diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test
index 426eec4be6d..d7182e36e3a 100644
--- a/mysql-test/t/gis.test
+++ b/mysql-test/t/gis.test
@@ -571,6 +571,26 @@ create table t2 as select f2 as a from t1 union select f3 from t1;
desc t2;
select AsText(a) from t2;
drop table t1, t2;
+
+#
+# Bug #29166: MYsql crash when query is run
+#
+
+# The test query itself is not logged : too large output.
+# The real test is the second query : see if the first hasn't crashed the
+# server
+--disable_query_log
+--disable_result_log
+SELECT AsText(GeometryFromText(CONCAT(
+ 'MULTIPOLYGON(((',
+ REPEAT ('-0.00000000001234567890123456789012 -0.123456789012345678,', 1000),
+ '-0.00000000001234567890123456789012 -0.123456789012345678',
+ ')))'
+))) AS a;
+--enable_result_log
+--enable_query_log
+SELECT 1;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test
index 17c5f1bbe8f..e33712e1ebf 100644
--- a/mysql-test/t/grant.test
+++ b/mysql-test/t/grant.test
@@ -1271,6 +1271,6 @@ grant select on test.* to юзер_юзер@localhost;
--exec $MYSQL --default-character-set=utf8 --user=юзер_юзер -e "select user()"
revoke all on test.* from юзер_юзер@localhost;
drop user юзер_юзер@localhost;
---error 1573
+--error ER_WRONG_STRING_LENGTH
grant select on test.* to очень_длинный_юзер@localhost;
set names default;
diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test
index 9babeddbae2..6fa2a9ebc51 100644
--- a/mysql-test/t/information_schema.test
+++ b/mysql-test/t/information_schema.test
@@ -703,7 +703,7 @@ drop table t1;
#
# Bug #9846 Inappropriate error displayed while dropping table from 'INFORMATION_SCHEMA'
#
---error 1044
+--error ER_PARSE_ERROR
alter database information_schema;
--error 1044
drop database information_schema;
@@ -1039,6 +1039,14 @@ delete from v1;
drop view v1,v2;
drop table t1,t2;
+#
+# Bug#25859 ALTER DATABASE works w/o parameters
+#
+--error ER_PARSE_ERROR
+alter database;
+--error ER_PARSE_ERROR
+alter database test;
+
--echo End of 5.0 tests.
#
# Show engines
diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test
index 321a1f4763a..140aac3b9c3 100644
--- a/mysql-test/t/innodb.test
+++ b/mysql-test/t/innodb.test
@@ -1178,7 +1178,7 @@ drop table t2;
# Clean up filename -- embedded server reports whole path without .frm,
# regular server reports relative path with .frm (argh!)
--replace_result \\ / $MYSQL_TEST_DIR . /var/master-data/ / t2.frm t2
---error 1005
+--error ER_WRONG_FK_DEF
create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = innodb;
# bug#3749
@@ -2349,6 +2349,21 @@ SHOW CREATE TABLE t1;
DROP TABLE t1,t2;
+#
+# Bug #21101 (Prints wrong error message if max row size is too large)
+#
+--error 1118
+CREATE TABLE t1 (
+ c01 CHAR(255), c02 CHAR(255), c03 CHAR(255), c04 CHAR(255),
+ c05 CHAR(255), c06 CHAR(255), c07 CHAR(255), c08 CHAR(255),
+ c09 CHAR(255), c10 CHAR(255), c11 CHAR(255), c12 CHAR(255),
+ c13 CHAR(255), c14 CHAR(255), c15 CHAR(255), c16 CHAR(255),
+ c17 CHAR(255), c18 CHAR(255), c19 CHAR(255), c20 CHAR(255),
+ c21 CHAR(255), c22 CHAR(255), c23 CHAR(255), c24 CHAR(255),
+ c25 CHAR(255), c26 CHAR(255), c27 CHAR(255), c28 CHAR(255),
+ c29 CHAR(255), c30 CHAR(255), c31 CHAR(255), c32 CHAR(255)
+ ) ENGINE = InnoDB;
+
#######################################################################
# #
# Please, DO NOT TOUCH this file as well as the innodb.result file. #
diff --git a/mysql-test/t/innodb_trx_weight.test b/mysql-test/t/innodb_trx_weight.test
new file mode 100644
index 00000000000..b72eaad345f
--- /dev/null
+++ b/mysql-test/t/innodb_trx_weight.test
@@ -0,0 +1,108 @@
+#
+# Ensure that the number of locks (SELECT FOR UPDATE for example) is
+# added to the number of altered rows when choosing the smallest
+# transaction to kill as a victim when a deadlock is detected.
+# Also transactions what had edited non-transactional tables should
+# be heavier than ones that had not.
+#
+
+-- source include/have_innodb.inc
+
+SET storage_engine=InnoDB;
+
+# we do not really care about what gets printed, we are only
+# interested in getting the deadlock resolved according to our
+# expectations
+-- disable_query_log
+-- disable_result_log
+
+# we want to use "-- eval statement1; statement2" which does not work with
+# prepared statements. Because this test should not behave differently with
+# or without prepared statements we disable them so the test does not fail
+# if someone runs ./mysql-test-run.pl --ps-protocol
+-- disable_ps_protocol
+
+-- disable_warnings
+DROP TABLE IF EXISTS t1, t2, t3, t4, t5_nontrans;
+-- enable_warnings
+
+# we will create a simple deadlock with t1, t2 and two connections
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (a INT);
+
+# auxiliary table with a bulk of rows which will be locked by a
+# transaction to increase its weight
+CREATE TABLE t3 (a INT);
+
+# auxiliary empty table which will be inserted by a
+# transaction to increase its weight
+CREATE TABLE t4 (a INT);
+
+# auxiliary non-transactional table which will be edited by a
+# transaction to tremendously increase its weight
+CREATE TABLE t5_nontrans (a INT) ENGINE=MyISAM;
+
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+# insert a lot of rows in t3
+INSERT INTO t3 VALUES (1);
+INSERT INTO t3 SELECT * FROM t3;
+INSERT INTO t3 SELECT * FROM t3;
+INSERT INTO t3 SELECT * FROM t3;
+INSERT INTO t3 SELECT * FROM t3;
+INSERT INTO t3 SELECT * FROM t3;
+INSERT INTO t3 SELECT * FROM t3;
+INSERT INTO t3 SELECT * FROM t3;
+INSERT INTO t3 SELECT * FROM t3;
+INSERT INTO t3 SELECT * FROM t3;
+INSERT INTO t3 SELECT * FROM t3;
+INSERT INTO t3 SELECT * FROM t3;
+
+# test locking weight
+
+-- let $con1_extra_sql =
+-- let $con1_extra_sql_present = 0
+-- let $con2_extra_sql = SELECT * FROM t3 FOR UPDATE
+-- let $con2_extra_sql_present = 1
+-- let $con1_should_be_rolledback = 1
+-- source include/innodb_trx_weight.inc
+
+-- let $con1_extra_sql = INSERT INTO t4 VALUES (1), (1)
+-- let $con1_extra_sql_present = 1
+-- let $con2_extra_sql = SELECT * FROM t3 FOR UPDATE
+-- let $con2_extra_sql_present = 1
+-- let $con1_should_be_rolledback = 1
+-- source include/innodb_trx_weight.inc
+
+-- let $con1_extra_sql = INSERT INTO t4 VALUES (1), (1), (1), (1), (1), (1)
+-- let $con1_extra_sql_present = 1
+-- let $con2_extra_sql = SELECT * FROM t3 FOR UPDATE
+-- let $con2_extra_sql_present = 1
+-- let $con1_should_be_rolledback = 0
+-- source include/innodb_trx_weight.inc
+
+# test weight when non-transactional tables are edited
+
+-- let $con1_extra_sql = INSERT INTO t4 VALUES (1), (1), (1)
+-- let $con1_extra_sql_present = 1
+-- let $con2_extra_sql =
+-- let $con2_extra_sql_present = 0
+-- let $con1_should_be_rolledback = 0
+-- source include/innodb_trx_weight.inc
+
+-- let $con1_extra_sql = INSERT INTO t4 VALUES (1), (1), (1)
+-- let $con1_extra_sql_present = 1
+-- let $con2_extra_sql = INSERT INTO t5_nontrans VALUES (1)
+-- let $con2_extra_sql_present = 1
+-- let $con1_should_be_rolledback = 1
+-- source include/innodb_trx_weight.inc
+
+-- let $con1_extra_sql = INSERT INTO t4 VALUES (1), (1), (1)
+-- let $con1_extra_sql = $con1_extra_sql; INSERT INTO t5_nontrans VALUES (1)
+-- let $con1_extra_sql_present = 1
+-- let $con2_extra_sql = INSERT INTO t5_nontrans VALUES (1)
+-- let $con2_extra_sql_present = 1
+-- let $con1_should_be_rolledback = 0
+-- source include/innodb_trx_weight.inc
+
+DROP TABLE t1, t2, t3, t4, t5_nontrans;
diff --git a/mysql-test/t/join_nested.test b/mysql-test/t/join_nested.test
index f29366797f6..5b07d8966f1 100644
--- a/mysql-test/t/join_nested.test
+++ b/mysql-test/t/join_nested.test
@@ -1083,4 +1083,118 @@ SELECT * FROM t1 JOIN (t2 JOIN t3 USING (b)) USING (a);
DROP TABLE t1,t2,t3;
+#
+# BUG#29604: inner nest of left join interleaves with outer tables
+#
+
+CREATE TABLE t1 (
+ carrier char(2) default NULL,
+ id int NOT NULL auto_increment PRIMARY KEY
+);
+INSERT INTO t1 VALUES
+ ('CO',235371754),('CO',235376554),('CO',235376884),('CO',235377874),
+ ('CO',231060394),('CO',231059224),('CO',231059314),('CO',231060484),
+ ('CO',231060274),('CO',231060124),('CO',231060244),('CO',231058594),
+ ('CO',231058924),('CO',231058504),('CO',231059344),('CO',231060424),
+ ('CO',231059554),('CO',231060304),('CO',231059644),('CO',231059464),
+ ('CO',231059764),('CO',231058294),('CO',231058624),('CO',231058864),
+ ('CO',231059374),('CO',231059584),('CO',231059734),('CO',231059014),
+ ('CO',231059854),('CO',231059494),('CO',231059794),('CO',231058534),
+ ('CO',231058324),('CO',231058684),('CO',231059524),('CO',231059974);
+
+CREATE TABLE t2 (
+ scan_date date default NULL,
+ package_id int default NULL,
+ INDEX scan_date(scan_date),
+ INDEX package_id(package_id)
+);
+INSERT INTO t2 VALUES
+ ('2008-12-29',231062944),('2008-12-29',231065764),('2008-12-29',231066124),
+ ('2008-12-29',231060094),('2008-12-29',231061054),('2008-12-29',231065644),
+ ('2008-12-29',231064384),('2008-12-29',231064444),('2008-12-29',231073774),
+ ('2008-12-29',231058594),('2008-12-29',231059374),('2008-12-29',231066004),
+ ('2008-12-29',231068494),('2008-12-29',231070174),('2008-12-29',231071884),
+ ('2008-12-29',231063274),('2008-12-29',231063754),('2008-12-29',231064144),
+ ('2008-12-29',231069424),('2008-12-29',231073714),('2008-12-29',231058414),
+ ('2008-12-29',231060994),('2008-12-29',231069154),('2008-12-29',231068614),
+ ('2008-12-29',231071464),('2008-12-29',231074014),('2008-12-29',231059614),
+ ('2008-12-29',231059074),('2008-12-29',231059464),('2008-12-29',231069094),
+ ('2008-12-29',231067294),('2008-12-29',231070144),('2008-12-29',231073804),
+ ('2008-12-29',231072634),('2008-12-29',231058294),('2008-12-29',231065344),
+ ('2008-12-29',231066094),('2008-12-29',231069034),('2008-12-29',231058594),
+ ('2008-12-29',231059854),('2008-12-29',231059884),('2008-12-29',231059914),
+ ('2008-12-29',231063664),('2008-12-29',231063814),('2008-12-29',231063904);
+
+CREATE TABLE t3 (
+ package_id int default NULL,
+ INDEX package_id(package_id)
+);
+INSERT INTO t3 VALUES
+ (231058294),(231058324),(231058354),(231058384),(231058414),(231058444),
+ (231058474),(231058504),(231058534),(231058564),(231058594),(231058624),
+ (231058684),(231058744),(231058804),(231058864),(231058924),(231058954),
+ (231059014),(231059074),(231059104),(231059134),(231059164),(231059194),
+ (231059224),(231059254),(231059284),(231059314),(231059344),(231059374),
+ (231059404),(231059434),(231059464),(231059494),(231059524),(231059554),
+ (231059584),(231059614),(231059644),(231059674),(231059704),(231059734),
+ (231059764),(231059794),(231059824),(231059854),(231059884),(231059914),
+ (231059944),(231059974),(231060004),(231060034),(231060064),(231060094),
+ (231060124),(231060154),(231060184),(231060214),(231060244),(231060274),
+ (231060304),(231060334),(231060364),(231060394),(231060424),(231060454),
+ (231060484),(231060514),(231060544),(231060574),(231060604),(231060634),
+ (231060664),(231060694),(231060724),(231060754),(231060784),(231060814),
+ (231060844),(231060874),(231060904),(231060934),(231060964),(231060994),
+ (231061024),(231061054),(231061084),(231061144),(231061174),(231061204),
+ (231061234),(231061294),(231061354),(231061384),(231061414),(231061474),
+ (231061564),(231061594),(231061624),(231061684),(231061714),(231061774),
+ (231061804),(231061894),(231061984),(231062074),(231062134),(231062224),
+ (231062254),(231062314),(231062374),(231062434),(231062494),(231062554),
+ (231062584),(231062614),(231062644),(231062704),(231062734),(231062794),
+ (231062854),(231062884),(231062944),(231063004),(231063034),(231063064),
+ (231063124),(231063154),(231063184),(231063214),(231063274),(231063334),
+ (231063394),(231063424),(231063454),(231063514),(231063574),(231063664);
+
+CREATE TABLE t4 (
+ carrier char(2) NOT NULL default '' PRIMARY KEY,
+ id int(11) default NULL,
+ INDEX id(id)
+);
+INSERT INTO t4 VALUES
+ ('99',6),('SK',456),('UA',486),('AI',1081),('OS',1111),('VS',1510);
+
+CREATE TABLE t5 (
+ carrier_id int default NULL,
+ INDEX carrier_id(carrier_id)
+);
+INSERT INTO t5 VALUES
+ (6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),
+ (6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),
+ (6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),
+ (6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),
+ (6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),
+ (6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(456),(456),(456),
+ (456),(456),(456),(456),(456),(456),(456),(456),(456),(456),(456),(456),
+ (456),(486),(1081),(1111),(1111),(1111),(1111),(1510);
+
+SELECT COUNT(*)
+ FROM((t2 JOIN t1 ON t2.package_id = t1.id)
+ JOIN t3 ON t3.package_id = t1.id);
+
+EXPLAIN
+SELECT COUNT(*)
+ FROM ((t2 JOIN t1 ON t2.package_id = t1.id)
+ JOIN t3 ON t3.package_id = t1.id)
+ LEFT JOIN
+ (t5 JOIN t4 ON t5.carrier_id = t4.id)
+ ON t4.carrier = t1.carrier;
+SELECT COUNT(*)
+ FROM ((t2 JOIN t1 ON t2.package_id = t1.id)
+ JOIN t3 ON t3.package_id = t1.id)
+ LEFT JOIN
+ (t5 JOIN t4 ON t5.carrier_id = t4.id)
+ ON t4.carrier = t1.carrier;
+
+DROP TABLE t1,t2,t3,t4,t5;
+
--echo End of 5.0 tests
+
diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test
index 51f5e5135e6..4a4f667d3ea 100644
--- a/mysql-test/t/loaddata.test
+++ b/mysql-test/t/loaddata.test
@@ -67,6 +67,41 @@ load data infile '../std_data_ln/loaddata_dq.dat' into table t1 fields terminate
select * from t1;
drop table t1;
+#
+# Bug #29294 SELECT INTO OUTFILE/LOAD DATA INFILE with special
+# characters in the FIELDS ENCLOSED BY clause
+#
+
+CREATE TABLE t1 (
+ id INT AUTO_INCREMENT PRIMARY KEY,
+ c1 VARCHAR(255)
+);
+
+CREATE TABLE t2 (
+ id INT,
+ c2 VARCHAR(255)
+);
+
+INSERT INTO t1 (c1) VALUES
+ ('r'), ('rr'), ('rrr'), ('rrrr'),
+ ('.r'), ('.rr'), ('.rrr'), ('.rrrr'),
+ ('r.'), ('rr.'), ('rrr.'), ('rrrr.'),
+ ('.r.'), ('.rr.'), ('.rrr.'), ('.rrrr.');
+SELECT * FROM t1;
+
+--exec rm -f $MYSQLTEST_VARDIR/tmp/t1
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1' FIELDS ENCLOSED BY 'r' FROM t1;
+--exec cat $MYSQLTEST_VARDIR/tmp/t1
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/t1' INTO TABLE t2 FIELDS ENCLOSED BY 'r';
+SELECT t1.id, c1, c2 FROM t1 LEFT JOIN t2 ON t1.id=t2.id WHERE c1 != c2;
+SELECT t1.id, c1, c2 FROM t1 RIGHT JOIN t2 ON t1.id=t2.id WHERE c1 != c2;
+
+--exec rm $MYSQLTEST_VARDIR/tmp/t1
+DROP TABLE t1,t2;
+
# End of 4.1 tests
#
@@ -182,6 +217,31 @@ select f1 from t1 where f2 <> '0000-00-00 00:00:00' order by f1;
--exec rm $MYSQLTEST_VARDIR/tmp/t2
drop table t1,t2;
+#
+# Bug#29442: SELECT INTO OUTFILE FIELDS ENCLOSED BY digit, minus sign etc
+# corrupts non-string fields containing this character.
+#
+
+CREATE TABLE t1 (c1 INT, c2 TIMESTAMP, c3 REAL, c4 DOUBLE);
+
+INSERT INTO t1 (c1, c2, c3, c4) VALUES (10, '1970-02-01 01:02:03', 1.1E-100, 1.1E+100);
+SELECT * FROM t1;
+
+--exec rm -f $MYSQLTEST_VARDIR/tmp/t1
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1' FIELDS ENCLOSED BY '-' FROM t1;
+--exec cat $MYSQLTEST_VARDIR/tmp/t1
+--exec echo EOF
+
+TRUNCATE t1;
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/t1' INTO TABLE t1 FIELDS ENCLOSED BY '-';
+SELECT * FROM t1;
+
+--exec rm $MYSQLTEST_VARDIR/tmp/t1
+DROP TABLE t1;
+
# End of 5.0 tests
diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test
index 0f1fee453a5..38d8a07fe48 100644
--- a/mysql-test/t/mysqldump.test
+++ b/mysql-test/t/mysqldump.test
@@ -1542,6 +1542,19 @@ INSERT INTO t1 SET c1=11, c2=REPEAT('q',509);
DROP TABLE t1;
--echo #
+--echo # Bug #28524: mysqldump --skip-add-drop-table is not
+--echo # compatible with views
+--echo #
+
+CREATE VIEW v1 AS SELECT 1;
+--exec $MYSQL_DUMP --skip-add-drop-table test > $MYSQLTEST_VARDIR/tmp/bug28524.sql
+DROP VIEW v1;
+
+--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/bug28524.sql
+SELECT * FROM v1;
+DROP VIEW v1;
+
+--echo #
--echo # End of 5.0 tests
--echo #
diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test
index aa0e2f89382..b01579dce53 100644
--- a/mysql-test/t/mysqltest.test
+++ b/mysql-test/t/mysqltest.test
@@ -1263,7 +1263,7 @@ while ($i)
EOF
--exec echo "source $MYSQLTEST_VARDIR/tmp/mysqltest.sql; echo OK;" | $MYSQL_TEST 2>&1
-# Repeat connect/disconnect, exceed max number of connections
+# Repeat connect/disconnect
--write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql
let $i=200;
while ($i)
diff --git a/mysql-test/t/ndb_update.test b/mysql-test/t/ndb_update.test
deleted file mode 100644
index 73a0ebc69cb..00000000000
--- a/mysql-test/t/ndb_update.test
+++ /dev/null
@@ -1,41 +0,0 @@
--- source include/have_ndb.inc
--- source include/not_embedded.inc
-
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
-
-#
-# Basic test of INSERT in NDB
-#
-
-#
-# Create a normal table with primary key
-#
-CREATE TABLE t1 (
- pk1 INT NOT NULL PRIMARY KEY,
- b INT NOT NULL,
- c INT NOT NULL UNIQUE
-) ENGINE=ndbcluster;
-
-INSERT INTO t1 VALUES (0, 1, 0),(1,2,1),(2,3,2);
-UPDATE t1 set b = c;
-select * from t1 order by pk1;
-UPDATE t1 set pk1 = 4 where pk1 = 1;
-select * from t1 order by pk1;
---error ER_DUP_ENTRY
-UPDATE t1 set pk1 = 4 where pk1 = 2;
-UPDATE IGNORE t1 set pk1 = 4 where pk1 = 2;
-select * from t1 order by pk1;
---error ER_DUP_ENTRY
-UPDATE t1 set pk1 = 1, c = 2 where pk1 = 4;
-UPDATE IGNORE t1 set pk1 = 1, c = 2 where pk1 = 4;
-select * from t1 order by pk1;
-UPDATE t1 set pk1 = pk1 + 10;
-select * from t1 order by pk1;
-
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
-
-# End of 4.1 tests
diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test
index 1374c049431..42db23dadef 100644
--- a/mysql-test/t/partition.test
+++ b/mysql-test/t/partition.test
@@ -1496,17 +1496,7 @@ SET GLOBAL general_log = default;
#
# Bug #27084 partitioning by list seems failing when using case
+# BUG #18198: Case no longer supported, test case removed
#
-CREATE TABLE `t1` ( `a` varchar(1)) ENGINE=MyISAM
- PARTITION BY LIST (CASE a WHEN 'a' THEN 1
- WHEN 'b' THEN 2
- WHEN 'c' THEN 3
- END) (
- PARTITION a VALUES IN (1),
- PARTITION b VALUES IN (2),
- PARTITION c VALUES IN (3)
-);
-
-DROP TABLE t1;
--echo End of 5.1 tests
diff --git a/mysql-test/t/partition_bug18198.test b/mysql-test/t/partition_bug18198.test
new file mode 100644
index 00000000000..7f071c6ec9e
--- /dev/null
+++ b/mysql-test/t/partition_bug18198.test
@@ -0,0 +1,219 @@
+-- source include/have_partition.inc
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+create table t1 (col1 datetime)
+partition by range(datediff(col1,col1))
+(partition p0 values less than (10), partition p1 values less than (30));
+drop table t1;
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(greatest(col1,10))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(isnull(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(least(col1,12))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(case when col1>0 then 10 else 20 end)
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(ifnull(col1,5))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(nullif(col1,5))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(bit_length(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 char(5))
+partition by range(bit_length(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(char_length(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 char(5))
+partition by range(char_length(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 char(5))
+partition by range(character_length(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(find_in_set(col1,1))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 char(5))
+partition by range(find_in_set(col1,'1'))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(instr(col1,3))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 char(5))
+partition by range(instr(col1,'3'))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 char(5))
+partition by range(length(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 char(5))
+partition by range(locate(1,col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(locate(1,col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 char(5))
+partition by range(octet_length(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 char(5))
+partition by range(position(1 in col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(position(1 in col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 char(5))
+partition by range(strcmp(col1,2))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(strcmp(col1,2))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(crc32(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(round(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(sign(col1))
+(partition p0 values less than (2), partition p1 values less than (6));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 datetime)
+partition by range(period_add(col1,5))
+(partition p0 values less than (10), partition p1 values less than (30));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 datetime, col2 datetime)
+partition by range(period_diff(col1,col2))
+(partition p0 values less than (10), partition p1 values less than (30));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int, col2 int)
+partition by range(period_diff(col1,col2))
+(partition p0 values less than (10), partition p1 values less than (30));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 datetime)
+partition by range(timestampdiff(day,5,col1))
+(partition p0 values less than (10), partition p1 values less than (30));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 date)
+partition by range(unix_timestamp(col1))
+(partition p0 values less than (10), partition p1 values less than (30));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 datetime)
+partition by range(week(col1))
+(partition p0 values less than (10), partition p1 values less than (30));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 varchar(25))
+partition by range(cast(col1 as signed))
+(partition p0 values less than (10), partition p1 values less than (30));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 varchar(25))
+partition by range(convert(col1,unsigned))
+(partition p0 values less than (10), partition p1 values less than (30));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(col1 | 20)
+(partition p0 values less than (10), partition p1 values less than (30));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(col1 & 20)
+(partition p0 values less than (10), partition p1 values less than (30));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(col1 ^ 20)
+(partition p0 values less than (10), partition p1 values less than (30));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(col1 << 20)
+(partition p0 values less than (10), partition p1 values less than (30));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(col1 >> 20)
+(partition p0 values less than (10), partition p1 values less than (30));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(~col1)
+(partition p0 values less than (10), partition p1 values less than (30));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(bit_count(col1))
+(partition p0 values less than (10), partition p1 values less than (30));
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (col1 int)
+partition by range(inet_aton(col1))
+(partition p0 values less than (10), partition p1 values less than (30));
diff --git a/mysql-test/t/partition_charset.test b/mysql-test/t/partition_charset.test
index 27d0dc87b89..6842e5268fa 100644
--- a/mysql-test/t/partition_charset.test
+++ b/mysql-test/t/partition_charset.test
@@ -19,3 +19,11 @@ flush tables;
set names latin1;
select * from t1;
drop table t1;
+
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (a varchar(1), primary key (a))
+partition by list (ascii(a))
+(partition p1 values in (65));
+#insert into t1 values ('A');
+#replace into t1 values ('A');
+#drop table t1;
diff --git a/mysql-test/t/partition_error.test b/mysql-test/t/partition_error.test
index 20703b979f1..5fc2097cc52 100644
--- a/mysql-test/t/partition_error.test
+++ b/mysql-test/t/partition_error.test
@@ -33,7 +33,7 @@ partitions 2;
#
# Partition by key list, wrong result type
#
---error ER_PARTITION_FUNC_NOT_ALLOWED_ERROR
+--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -109,7 +109,7 @@ partitions 3
#
# Partition by hash, invalid result type
#
---error ER_PARTITION_FUNC_NOT_ALLOWED_ERROR
+--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -533,7 +533,7 @@ partitions 2
#
# Partition by range, wrong result type of partition function
#
---error ER_PARTITION_FUNC_NOT_ALLOWED_ERROR
+--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -769,10 +769,11 @@ partition by range (a)
#
# Bug 18198 Partitions: Verify that erroneus partition functions doesn't work
#
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
create table t1 (v varchar(12))
partition by range (ascii(v))
(partition p0 values less than (10));
-drop table t1;
+#drop table t1;
-- error 1064
create table t1 (a int)
@@ -790,7 +791,7 @@ partition by hash (extract(hour from convert_tz(a, '+00:00', '+00:00')));
create table t1 (a int)
partition by range (a + (select count(*) from t1))
(partition p1 values less than (1));
--- error ER_PARTITION_FUNC_NOT_ALLOWED_ERROR
+-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
create table t1 (a char(10))
partition by hash (extractvalue(a,'a'));
diff --git a/mysql-test/t/partition_grant.test b/mysql-test/t/partition_grant.test
index 0d30ad01c7a..cf944e507fd 100644
--- a/mysql-test/t/partition_grant.test
+++ b/mysql-test/t/partition_grant.test
@@ -63,13 +63,13 @@ insert into t1 values (1);
grant alter on mysqltest_1.* to mysqltest_1@localhost;
connect (conn4,localhost,mysqltest_1,,mysqltest_1);
connection conn4;
---error 1514
+--error ER_NO_PARTITION_FOR_GIVEN_VALUE
alter table t1 partition by list (s1) (partition p1 values in (2));
connection default;
grant select, alter on mysqltest_1.* to mysqltest_1@localhost;
disconnect conn4;
connect (conn5,localhost,mysqltest_1,,mysqltest_1);
---error 1514
+--error ER_NO_PARTITION_FOR_GIVEN_VALUE
alter table t1 partition by list (s1) (partition p1 values in (2));
disconnect conn5;
connection default;
diff --git a/mysql-test/t/partition_hash.test b/mysql-test/t/partition_hash.test
index ca7972cc01c..98add060a76 100644
--- a/mysql-test/t/partition_hash.test
+++ b/mysql-test/t/partition_hash.test
@@ -10,18 +10,6 @@ drop table if exists t1;
--enable_warnings
#
-# BUG 18198: Partition functions handling
-#
-create table t1 (a varchar(10) charset latin1 collate latin1_bin)
-partition by hash(length(a))
-partitions 10;
-insert into t1 values (''),(' '),('a'),('a '),('a ');
-explain partitions select * from t1 where a='a ';
-explain partitions select * from t1 where a='a';
-explain partitions select * from t1 where a='a ' OR a='a';
-drop table t1;
-
-#
# More partition pruning tests, especially on interval walking
#
create table t1 (a int unsigned)
diff --git a/mysql-test/t/partition_list.test b/mysql-test/t/partition_list.test
index 1e420cfe6ed..1c76de9d55a 100644
--- a/mysql-test/t/partition_list.test
+++ b/mysql-test/t/partition_list.test
@@ -179,4 +179,8 @@ insert into t1 values (null);
select * from t1;
drop table t1;
+--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
+create table t1 (a char(1))
+partition by list (ascii(ucase(a)))
+(partition p1 values in (2));
diff --git a/mysql-test/t/partition_mgm.test b/mysql-test/t/partition_mgm.test
index 8458d47d634..a06f8d1aee5 100644
--- a/mysql-test/t/partition_mgm.test
+++ b/mysql-test/t/partition_mgm.test
@@ -20,7 +20,7 @@ subpartition sp01, subpartition sp02));
drop table t1;
CREATE TABLE t1 (f_date DATE, f_varchar VARCHAR(30))
-PARTITION BY HASH(CAST(YEAR(f_date) AS SIGNED INTEGER)) PARTITIONS 2;
+PARTITION BY HASH(YEAR(f_date)) PARTITIONS 2;
SHOW CREATE TABLE t1;
--replace_result $MYSQLTEST_VARDIR "hello"
diff --git a/mysql-test/t/partition_pruning.test b/mysql-test/t/partition_pruning.test
index a60846f18ff..12951c9232a 100644
--- a/mysql-test/t/partition_pruning.test
+++ b/mysql-test/t/partition_pruning.test
@@ -538,18 +538,17 @@ select * from t1 where f_int1 between 5 and 15 order by f_int1;
drop table t1;
# part2: bug in pruning code
-create table t1 (a char(10) binary)
-partition by list(length(a))
- (partition p1 values in (1),
- partition p2 values in (2),
- partition p3 values in (3),
- partition p4 values in (4),
- partition p5 values in (5)
-);
-insert into t1 values ('a'),('bb'),('ccc'),('dddd'),('eeEee');
-select * from t1 where a>='a' and a <= 'dddd';
-explain partitions select * from t1 where a>='a' and a <= 'dddd';
-drop table t1;
+#create table t1 (a char(10) binary)
+#partition by list(ascii(a))
+# (partition p1 values in (ascii('a')),
+# partition p2 values in (ascii('b')),
+# partition p3 values in (ascii('c')),
+# partition p4 values in (ascii('d')),
+# partition p5 values in (ascii('e')));
+#insert into t1 values ('a'),('bb'),('ccc'),('dddd'),('eeEee');
+#select * from t1 where a>='a' and a <= 'dddd';
+#explain partitions select * from t1 where a>='a' and a <= 'dddd';
+#drop table t1;
# BUG#18659: Assertion failure when subpartitioning is used and partition is
# "IS NULL"
@@ -692,20 +691,47 @@ explain partitions select * from t1 where a = 18446744073709551000;
explain partitions select * from t1 where a = 18446744073709551613;
explain partitions select * from t1 where a = 18446744073709551614;
drop table t1;
-
-create table t1 (a int)
- partition by range((a & 0xFF) << 56) (
- partition p0 values less than (0x40 << 56),
- partition p1 values less than (0x80 << 56),
- partition p2 values less than (0xFF << 56)
+#
+# Test all variants of usage for interval_via_mapping
+# and interval_via_walking
+#
+# t1 will use interval_via_mapping since it uses a
+# monotonic function, whereas t2 will use
+# interval_via_walking since the intervals are short
+# and the function isn't monotonic (it is, but it isn't
+# discovered in this version).
+#
+ create table t1 (a int)
+ partition by range(a) (
+ partition p0 values less than (64),
+ partition p1 values less than (128),
+ partition p2 values less than (255)
);
-insert into t1 values (0x20), (0x20), (0x41), (0x41), (0xFE), (0xFE);
+create table t2 (a int)
+ partition by range(a+0) (
+ partition p0 values less than (64),
+ partition p1 values less than (128),
+ partition p2 values less than (255)
+);
+
+insert into t1 values (0x20), (0x20), (0x41), (0x41), (0xFE), (0xFE);
+insert into t2 values (0x20), (0x20), (0x41), (0x41), (0xFE), (0xFE);
explain partitions select * from t1 where a=0;
+explain partitions select * from t2 where a=0;
explain partitions select * from t1 where a=0xFE;
-explain partitions select * from t1 where a>0xFE and a<= 0xFF;
+explain partitions select * from t2 where a=0xFE;
+explain partitions select * from t1 where a > 0xFE AND a <= 0xFF;
+explain partitions select * from t2 where a > 0xFE AND a <= 0xFF;
+explain partitions select * from t1 where a >= 0xFE AND a <= 0xFF;
+explain partitions select * from t2 where a >= 0xFE AND a <= 0xFF;
+explain partitions select * from t1 where a < 64 AND a >= 63;
+explain partitions select * from t2 where a < 64 AND a >= 63;
+explain partitions select * from t1 where a <= 64 AND a >= 63;
+explain partitions select * from t2 where a <= 64 AND a >= 63;
drop table t1;
-
+drop table t2;
+
create table t1(a bigint unsigned not null) partition by range(a+0) (
partition p1 values less than (10),
partition p2 values less than (20),
diff --git a/mysql-test/t/partition_range.test b/mysql-test/t/partition_range.test
index 84f67febe8b..50d850913bc 100644
--- a/mysql-test/t/partition_range.test
+++ b/mysql-test/t/partition_range.test
@@ -12,45 +12,45 @@ drop table if exists t1;
#
# BUG 18198: Various tests for partition functions
#
-create table t1 (a varchar(10) charset latin1 collate latin1_bin, b int)
-partition by range (length(a) * b)
-(partition p0 values less than (2), partition p1 values less than (400));
-insert into t1 values ('a ', 2),('a',3);
-drop table t1;
-
-create table t1 (a varchar(10) charset latin1 collate latin1_bin, b int)
-partition by range (b* length(a) * b)
-(partition p0 values less than (2), partition p1 values less than (400));
-insert into t1 values ('a ', 2),('a',3);
-drop table t1;
-
-create table t1 (a varchar(10) charset latin1 collate latin1_bin,
- b varchar(10) charset latin1 collate latin1_bin)
-partition by range (length(b) * length(a))
-(partition p0 values less than (2), partition p1 values less than (400));
-insert into t1 values ('a ', 'b '),('a','b');
-drop table t1;
-
-create table t1 (a varchar(10) charset latin1 collate latin1_bin,
- b varchar(10) charset latin1 collate latin1_bin)
-partition by range (length(a) * length(b))
-(partition p0 values less than (2), partition p1 values less than (400));
-insert into t1 values ('a ', 'b '),('a','b');
-drop table t1;
-
-create table t1 (a varchar(10) charset latin1 collate latin1_bin,
- b varchar(10) charset latin1 collate latin1_bin, c int)
-partition by range (length(a) * c)
-(partition p0 values less than (2), partition p1 values less than (400));
-insert into t1 values ('a ', 'b ', 2),('a','b', 3);
-drop table t1;
-
-create table t1 (a varchar(10) charset latin1 collate latin1_bin,
- b varchar(10) charset latin1 collate latin1_bin, c int)
-partition by range (c * length(a))
-(partition p0 values less than (2), partition p1 values less than (400));
-insert into t1 values ('a ', 'b ', 2),('a','b', 3);
-drop table t1;
+#create table t1 (a varchar(10) charset latin1 collate latin1_bin, b int)
+#partition by range (ascii(a) * b)
+#(partition p0 values less than (2), partition p1 values less than (4000));
+#insert into t1 values ('a ', 2),('a',3);
+#drop table t1;
+
+#create table t1 (a varchar(10) charset latin1 collate latin1_bin, b int)
+#partition by range (b* ascii(a) * b)
+#(partition p0 values less than (2), partition p1 values less than (4000));
+#insert into t1 values ('a ', 2),('a',3);
+#drop table t1;
+
+#create table t1 (a varchar(10) charset latin1 collate latin1_bin,
+# b varchar(10) charset latin1 collate latin1_bin)
+#partition by range (ascii(b) * ascii(a))
+#(partition p0 values less than (2), partition p1 values less than (40000));
+#insert into t1 values ('a ', 'b '),('a','b');
+#drop table t1;
+
+#create table t1 (a varchar(10) charset latin1 collate latin1_bin,
+# b varchar(10) charset latin1 collate latin1_bin)
+#partition by range (ascii(a) * ascii(b))
+#(partition p0 values less than (2), partition p1 values less than (40000));
+#insert into t1 values ('a ', 'b '),('a','b');
+#drop table t1;
+
+#create table t1 (a varchar(10) charset latin1 collate latin1_bin,
+# b varchar(10) charset latin1 collate latin1_bin, c int)
+#partition by range (ascii(a) * c)
+#(partition p0 values less than (2), partition p1 values less than (4000));
+#insert into t1 values ('a ', 'b ', 2),('a','b', 3);
+#drop table t1;
+
+#create table t1 (a varchar(10) charset latin1 collate latin1_bin,
+# b varchar(10) charset latin1 collate latin1_bin, c int)
+#partition by range (c * ascii(a))
+#(partition p0 values less than (2), partition p1 values less than (4000));
+#insert into t1 values ('a ', 'b ', 2),('a','b', 3);
+#drop table t1;
#
# More checks for partition pruning
@@ -733,29 +733,27 @@ DROP TABLE t1;
#
# Bug 18198: Try with a couple of cases using VARCHAR fields in
# partition function.
-create table t1 (a varchar(20))
-partition by range (crc32(md5(a)))
-(partition p0 values less than (100),
- partition p1 values less than maxvalue);
-
-insert into t1 values ("12345678901234567890");
-insert into t1 values ("A2345678901234567890");
-insert into t1 values ("B2345678901234567890");
-insert into t1 values ("1234567890123456789");
-insert into t1 values ("1234567890123456");
-select * from t1;
-explain partitions select * from t1 where a = "12345678901234567890";
-explain partitions select * from t1 where a = "12345678901234567890" OR
- a = "A2345678901234567890" OR
- a = "B2345678901234567890" OR
- a = "C2345678901234567890";
-explain partitions select * from t1 where a = "01234567890123456";
-select * from t1 where a = "01234567890123456";
-select * from t1 where a = "12345678901234567890" OR
- a = "A2345678901234567890" OR
- a = "B2345678901234567890" OR
- a = "C2345678901234567890";
-select * from t1 where a = "12345678901234567890";
-
-
-drop table t1;
+#create table t1 (a varchar(20))
+#partition by range (ascii(a))
+#(partition p0 values less than (100),
+# partition p1 values less than maxvalue);
+
+#insert into t1 values ("12345678901234567890");
+#insert into t1 values ("A2345678901234567890");
+#insert into t1 values ("B2345678901234567890");
+#insert into t1 values ("1234567890123456789");
+#insert into t1 values ("1234567890123456");
+#select * from t1;
+#explain partitions select * from t1 where a = "12345678901234567890";
+#explain partitions select * from t1 where a = "12345678901234567890" OR
+# a = "A2345678901234567890" OR
+# a = "B2345678901234567890" OR
+# a = "C2345678901234567890";
+#explain partitions select * from t1 where a = "01234567890123456";
+#select * from t1 where a = "01234567890123456";
+#select * from t1 where a = "12345678901234567890" OR
+# a = "A2345678901234567890" OR
+# a = "B2345678901234567890" OR
+# a = "C2345678901234567890";
+#select * from t1 where a = "12345678901234567890";
+#drop table t1;
diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test
index 14ccea0fdc8..e0db99cf42b 100644
--- a/mysql-test/t/query_cache.test
+++ b/mysql-test/t/query_cache.test
@@ -878,7 +878,7 @@ drop procedure f4;
drop table t1;
set GLOBAL query_cache_size=0;
-# End of 4.1 tests
+--echo End of 4.1 tests
#
# Bug #10303: problem with last_query_cost
@@ -1057,7 +1057,79 @@ drop table t1;
set GLOBAL query_cache_size= default;
-# End of 5.0 tests
+#
+# Bug #28249 Query Cache returns wrong result with concurrent insert / certain lock
+#
+--echo Bug#28249 Query Cache returns wrong result with concurrent insert/ certain lock
+connect (user1,localhost,root,,test,,);
+connect (user2,localhost,root,,test,,);
+connect (user3,localhost,root,,test,,);
+
+connection user1;
+
+set GLOBAL query_cache_type=1;
+set GLOBAL query_cache_limit=10000;
+set GLOBAL query_cache_min_res_unit=0;
+set GLOBAL query_cache_size= 100000;
+
+flush tables;
+--disable_warnings
+drop table if exists t1, t2;
+--enable_warnings
+create table t1 (a int);
+create table t2 (a int);
+insert into t1 values (1),(2),(3);
+connection user2;
+--echo Locking table T2 with a write lock.
+lock table t2 write;
+
+connection user1;
+--echo Select blocked by write lock.
+--send select *, (select count(*) from t2) from t1;
+--echo Sleeing is ok, because selecting should be done very fast.
+sleep 5;
+
+connection user3;
+--echo Inserting into table T1.
+insert into t1 values (4);
+
+connection user2;
+--echo Unlocking the tables.
+unlock tables;
+
+connection user1;
+--echo Collecting result from previously blocked select.
+#
+# Since the lock ordering rule in thr_multi_lock depends on
+# pointer values, from execution to execution we might have
+# different lock order, and therefore, sometimes lock t1 and block
+# on t2, and sometimes block on t2 right away. In the second case,
+# the following insert succeeds, and only then this select can
+# proceed, and we actually test nothing, as the very first select
+# returns 4 rows right away.
+# It's fine to have a test case that covers the problematic area
+# at least once in a while.
+# We, however, need to disable the result log here to make the
+# test repeatable.
+--disable_result_log
+--reap
+--enable_result_log
+--echo Next select should contain 4 rows, as the insert is long finished.
+select *, (select count(*) from t2) from t1;
+reset query cache;
+select *, (select count(*) from t2) from t1;
+
+drop table t1,t2;
+
+connection default;
+disconnect user1;
+disconnect user2;
+disconnect user3;
+set GLOBAL query_cache_type=default;
+set GLOBAL query_cache_limit=default;
+set GLOBAL query_cache_min_res_unit=default;
+set GLOBAL query_cache_size=default;
+--echo End of 5.0 tests
#
@@ -1102,4 +1174,4 @@ show status like 'Qcache_queries_in_cache';
drop database db2;
drop database db3;
-# End of 5.1 tests
+--echo End of 5.1 tests
diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test
index 341c9039390..09c0b08a3cd 100644
--- a/mysql-test/t/show_check.test
+++ b/mysql-test/t/show_check.test
@@ -761,7 +761,23 @@ DROP VIEW v1;
DROP PROCEDURE p1;
DROP FUNCTION f1;
---echo End of 5.0 tests.
+#
+# Bug #28808: log_queries_not_using_indexes variable dynamic change is ignored
+#
+flush status;
+show variables like "log_queries_not_using_indexes";
+select 1 from information_schema.tables limit 1;
+show status like 'slow_queries';
+set global log_queries_not_using_indexes=OFF;
+show variables like "log_queries_not_using_indexes";
+select 1 from information_schema.tables limit 1;
+show status like 'slow_queries';
+set global log_queries_not_using_indexes=ON;
+show variables like "log_queries_not_using_indexes";
+select 1 from information_schema.tables limit 1;
+show status like 'slow_queries';
+
+--echo End of 5.0 tests
--disable_result_log
SHOW AUTHORS;
@@ -897,4 +913,68 @@ DROP TABLE t1;
DROP PROCEDURE p1;
DEALLOCATE PREPARE stmt1;
+#
+# BUG#10491: Server returns data as charset binary SHOW CREATE TABLE or SELECT
+# FROM INFORMATION_SCHEMA.
+#
+# Before the change performed to fix the bug, the metadata of the output of
+# SHOW CREATE statements would always describe the result as 'binary'. That
+# would ensure that the result is never converted to character_set_client
+# (which was essential to mysqldump). Now we return to the client the actual
+# character set of the object -- which is character_set_client of the
+# connection that issues the CREATE statement, and this triggers an automatic
+# conversion to character_set_results of the connection that issues SHOW CREATE
+# statement.
+#
+# This test demonstrates that this conversion indeed is taking place.
+#
+
+# Prepare: create objects in a one character set.
+
+set names koi8r;
+
+--disable_warnings
+DROP VIEW IF EXISTS v1;
+DROP PROCEDURE IF EXISTS p1;
+DROP FUNCTION IF EXISTS f1;
+DROP TABLE IF EXISTS t1;
+DROP EVENT IF EXISTS ev1;
+--enable_warnings
+
+CREATE VIEW v1 AS SELECT 'ÔÅÓÔ' AS test;
+
+CREATE PROCEDURE p1() SELECT 'ÔÅÓÔ' AS test;
+
+CREATE FUNCTION f1() RETURNS CHAR(10) RETURN 'ÔÅÓÔ';
+
+CREATE TABLE t1(c1 CHAR(10));
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1
+ FOR EACH ROW
+ SET NEW.c1 = 'ÔÅÓÔ';
+
+CREATE EVENT ev1 ON SCHEDULE AT '2030-01-01 00:00:00' DO SELECT 'ÔÅÓÔ' AS test;
+
+# Test: switch the character set and show that SHOW CREATE output is
+# automatically converted to the new character_set_client.
+
+set names utf8;
+
+SHOW CREATE VIEW v1;
+
+SHOW CREATE PROCEDURE p1;
+
+SHOW CREATE FUNCTION f1;
+
+SHOW CREATE TRIGGER t1_bi;
+
+SHOW CREATE EVENT ev1;
+
+# Cleanup.
+
+DROP VIEW v1;
+DROP PROCEDURE p1;
+DROP FUNCTION f1;
+DROP TABLE t1;
+DROP EVENT ev1;
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/sp-prelocking.test b/mysql-test/t/sp-prelocking.test
index ec5b7fbad7c..60e97260839 100644
--- a/mysql-test/t/sp-prelocking.test
+++ b/mysql-test/t/sp-prelocking.test
@@ -333,4 +333,27 @@ insert into bug_27907_t1(a) values (1);
drop table bug_27907_t1;
+--echo
+--echo Bug#22427 create table if not exists + stored function results in
+--echo inconsistent behavior
+--echo
+--echo Add a test case, the bug itself was fixed by the patch for
+--echo Bug#20662
+--echo
+--disable_warnings
+drop table if exists t1;
+drop function if exists f_bug22427;
+--enable_warnings
+create table t1 (i int);
+insert into t1 values (1);
+create function f_bug22427() returns int return (select max(i) from t1);
+select f_bug22427();
+# Until this bug was fixed, the following emitted error
+# ERROR 1213: Deadlock found when trying to get lock
+create table if not exists t1 select f_bug22427() as i;
+--error ER_TABLE_EXISTS_ERROR
+create table t1 select f_bug22427() as i;
+drop table t1;
+drop function f_bug22427;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index f5bad05a40a..7bd20d226c2 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -706,9 +706,9 @@ begin
insert into test.t1 values (concat(x, "2"), y+2);
end|
-# Remove spout file if it exists
---error 0,1
---remove_file $MYSQLTEST_VARDIR/tmp/spout
+# Check that file does not exists
+--error 1
+--file_exists $MYSQLTEST_VARDIR/tmp/spout
call into_outfile("ofile", 1)|
--remove_file $MYSQLTEST_VARDIR/tmp/spout
delete from t1|
@@ -725,9 +725,9 @@ begin
insert into test.t1 values (concat(x, "2"), y+2);
end|
-# Remove spdump file if it exists
---error 0,1
---remove_file $MYSQLTEST_VARDIR/tmp/spdump
+# Check that file does not exists
+--error 1
+--file_exists $MYSQLTEST_VARDIR/tmp/spdump
call into_dumpfile("dfile", 1)|
--remove_file $MYSQLTEST_VARDIR/tmp/spdump
delete from t1|
@@ -7250,6 +7250,43 @@ DROP VIEW v1;
DROP FUNCTION metered;
DROP TABLE t1;
+#
+# Bug#28551 "The warning 'No database selected' is reported when calling
+# stored procedures"
+#
+--disable_warnings
+drop database if exists mysqltest_db1;
+--enable_warnings
+create database mysqltest_db1;
+create procedure mysqltest_db1.sp_bug28551() begin end;
+call mysqltest_db1.sp_bug28551();
+show warnings;
+drop database mysqltest_db1;
+#
+# Bug#29050 Creation of a legal stored procedure fails if a database is not
+# selected prior
+#
+--disable_warnings
+drop database if exists mysqltest_db1;
+drop table if exists test.t1;
+--enable_warnings
+create database mysqltest_db1;
+use mysqltest_db1;
+# For the sake of its side effect
+drop database mysqltest_db1;
+# Now we have no current database selected.
+create table test.t1 (id int);
+insert into test.t1 (id) values (1);
+delimiter //;
+create procedure test.sp_bug29050() begin select * from t1; end//
+delimiter ;//
+show warnings;
+call test.sp_bug29050();
+show warnings;
+# Restore the old current database
+use test;
+drop procedure sp_bug29050;
+drop table t1;
#
# Bug#25411 (trigger code truncated)
diff --git a/mysql-test/t/ssl-big.test b/mysql-test/t/ssl-big.test
new file mode 100644
index 00000000000..099c64df08f
--- /dev/null
+++ b/mysql-test/t/ssl-big.test
@@ -0,0 +1,56 @@
+# Turn on ssl between the client and server
+# and run a number of tests
+
+-- source include/have_ssl.inc
+-- source include/big_test.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2;
+--enable_warnings
+
+#
+# Bug #29579 Clients using SSL can hang the server
+#
+
+connect (ssl_con,localhost,root,,,,,SSL);
+
+create table t1 (a int);
+
+disconnect ssl_con;
+
+
+--disable_query_log
+--disable_result_log
+
+let $count= 2000;
+while ($count)
+{
+ connect (ssl_con,localhost,root,,,,,SSL);
+
+ eval insert into t1 values ($count);
+ dec $count;
+
+ # This select causes the net buffer to fill as the server sends the results
+ # but the client doesn't reap the results. The results are larger each time
+ # through the loop, so that eventually the buffer is completely full
+ # at the exact moment the server attempts to the close the connection with
+ # the lock held.
+ send select * from t1;
+
+ # now send the quit the command so the server will initiate the shutdown.
+ send_quit ssl_con;
+
+ # if the server is hung, this will hang too:
+ connect (ssl_con2,localhost,root,,,,,SSL);
+
+ # no hang if we get here, close and retry
+ disconnect ssl_con2;
+ disconnect ssl_con;
+}
+--enable_query_log
+--enable_result_log
+
+connect (ssl_con,localhost,root,,,,,SSL);
+
+drop table t1;
+
diff --git a/mysql-test/t/status.test b/mysql-test/t/status.test
index 746d3a352a4..1208393aa09 100644
--- a/mysql-test/t/status.test
+++ b/mysql-test/t/status.test
@@ -22,11 +22,14 @@ connection con2;
lock tables t1 read;
unlock tables;
lock tables t1 read;
+let $ID= `select connection_id()`;
connection con1;
--send
update t1 set n = 3;
connection con2;
-sleep 0.5;
+# wait for the other query to start executing
+let $wait_condition= select 1 from INFORMATION_SCHEMA.PROCESSLIST where ID = $ID and STATE = 0;
+--source include/wait_condition.inc
unlock tables;
connection con1;
reap;
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test
index 4c046dfd3c6..95514fd773e 100644
--- a/mysql-test/t/subselect.test
+++ b/mysql-test/t/subselect.test
@@ -2970,7 +2970,7 @@ DROP TABLE t1,t2;
CREATE TABLE t1 (a INT, b INT);
INSERT INTO t1 VALUES (1, 2), (1,3), (1,4), (2,1), (2,2);
--- returns no rows, when it should
+# returns no rows, when it should
SELECT a1.a, COUNT(*) FROM t1 a1 WHERE a1.a = 1
AND EXISTS( SELECT a2.a FROM t1 a2 WHERE a2.a = a1.a)
GROUP BY a1.a;
diff --git a/mysql-test/t/symlink.test b/mysql-test/t/symlink.test
index 981206ca54c..15f50b11e73 100644
--- a/mysql-test/t/symlink.test
+++ b/mysql-test/t/symlink.test
@@ -174,4 +174,43 @@ drop table t1;
--echo End of 4.1 tests
+#
+# Bug #29325: create table overwrites .MYD file of other table (datadir)
+#
+
+CREATE DATABASE db1;
+CREATE DATABASE db2;
+
+USE db2;
+--disable_query_log
+eval CREATE TABLE t1 (b INT) ENGINE MYISAM
+DATA DIRECTORY = '$MYSQLTEST_VARDIR/master-data/db1/';
+--enable_query_log
+
+INSERT INTO db2.t1 VALUES (1);
+SELECT * FROM db2.t1;
+RESET QUERY CACHE;
+
+USE db1;
+
+#no warning from create table
+SET SESSION keep_files_on_create = TRUE;
+--disable_abort_on_error
+--error 1,1
+CREATE TABLE t1 (a INT) ENGINE MYISAM;
+--enable_abort_on_error
+
+CREATE TABLE t3 (a INT) Engine=MyISAM;
+INSERT INTO t3 VALUES (1),(2),(3);
+TRUNCATE TABLE t3;
+SELECT * from t3;
+
+SET SESSION keep_files_on_create = DEFAULT;
+
+DROP TABLE db2.t1, db1.t3;
+DROP DATABASE db1;
+DROP DATABASE db2;
+USE test;
+
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/trigger-trans.test b/mysql-test/t/trigger-trans.test
index 5c135d98878..8103a1ba0b1 100644
--- a/mysql-test/t/trigger-trans.test
+++ b/mysql-test/t/trigger-trans.test
@@ -49,4 +49,84 @@ insert into t1 values ('The Pie', 50, 1, 1);
select * from t1;
drop table t1;
-# End of 5.0 tests
+--echo
+--echo Bug#26141 mixing table types in trigger causes full
+--echo table lock on innodb table
+--echo
+--echo Ensure we do not open and lock tables for the triggers we do not
+--echo fire.
+--echo
+--disable_warnings
+drop table if exists t1, t2, t3;
+drop trigger if exists trg_bug26141_au;
+drop trigger if exists trg_bug26141_ai;
+--enable_warnings
+# Note, for InnoDB to allow concurrent UPDATE and INSERT the
+# table must have a unique key.
+create table t1 (c int primary key) engine=innodb;
+create table t2 (c int) engine=myisam;
+create table t3 (c int) engine=myisam;
+insert into t1 (c) values (1);
+delimiter |;
+
+create trigger trg_bug26141_ai after insert on t1
+for each row
+begin
+ insert into t2 (c) values (1);
+# We need the 'sync' lock to synchronously wait in connection 2 till
+# the moment when the trigger acquired all the locks.
+ select release_lock("lock_bug26141_sync") into @a;
+# 1000 is time in seconds of lock wait timeout -- this is a way
+# to cause a manageable sleep up to 1000 seconds
+ select get_lock("lock_bug26141_wait", 1000) into @a;
+end|
+
+create trigger trg_bug26141_au after update on t1
+for each row
+begin
+ insert into t3 (c) values (1);
+end|
+delimiter ;|
+
+# Establish an alternative connection.
+--connect (connection_aux,localhost,root,,test,,)
+--connect (connection_update,localhost,root,,test,,)
+
+connection connection_aux;
+# Lock the wait lock, it must not be locked, so specify zero timeout.
+select get_lock("lock_bug26141_wait", 0);
+
+#
+connection default;
+#
+# Run the trigger synchronously
+#
+select get_lock("lock_bug26141_sync", /* must not be priorly locked */ 0);
+# Will acquire the table level locks, perform the insert into t2,
+# release the sync lock and block on the wait lock.
+send insert into t1 (c) values (2);
+
+connection connection_update;
+# Wait for the trigger to acquire its locks and unlock the sync lock.
+select get_lock("lock_bug26141_sync", 1000);
+#
+# This must continue: after the fix for the bug, we do not
+# open tables for t2, and with c=4 innobase allows the update
+# to run concurrently with insert.
+update t1 set c=3 where c=1;
+select release_lock("lock_bug26141_sync");
+connection connection_aux;
+select release_lock("lock_bug26141_wait");
+connection default;
+reap;
+select * from t1;
+select * from t2;
+select * from t3;
+
+# Drops the trigger as well.
+drop table t1, t2, t3;
+disconnect connection_update;
+disconnect connection_aux;
+
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/trigger.test b/mysql-test/t/trigger.test
index 3df88f60a33..c7251040544 100644
--- a/mysql-test/t/trigger.test
+++ b/mysql-test/t/trigger.test
@@ -406,7 +406,7 @@ create table mysqltest.t1 (i int);
--error ER_TRG_IN_WRONG_SCHEMA
create trigger trg1 before insert on mysqltest.t1 for each row set @a:= 1;
use mysqltest;
---error ER_TRG_IN_WRONG_SCHEMA
+--error ER_NO_SUCH_TABLE
create trigger test.trg1 before insert on t1 for each row set @a:= 1;
drop database mysqltest;
use test;
@@ -1040,7 +1040,7 @@ drop table t1;
connection addconwithoutdb;
--error ER_NO_DB_ERROR
create trigger t1_bi before insert on test.t1 for each row set @a:=0;
---error ER_NO_DB_ERROR
+--error ER_NO_SUCH_TABLE
create trigger test.t1_bi before insert on t1 for each row set @a:=0;
--error ER_NO_DB_ERROR
drop trigger t1_bi;
@@ -1828,7 +1828,395 @@ DROP TRIGGER t1_test;
DROP TABLE t1,t2;
SET SESSION LOW_PRIORITY_UPDATES=DEFAULT;
SET GLOBAL LOW_PRIORITY_UPDATES=DEFAULT;
+--echo
+--echo Bug#28502 Triggers that update another innodb table will block
+--echo on X lock unnecessarily
+--echo
+--echo Ensure we do not open and lock tables for triggers we do not fire.
+--echo
+--disable_warnings
+drop table if exists t1, t2;
+drop trigger if exists trg_bug28502_au;
+--enable_warnings
+
+create table t1 (id int, count int);
+create table t2 (id int);
+delimiter |;
+
+create trigger trg_bug28502_au before update on t2
+for each row
+begin
+ if (new.id is not null) then
+ update t1 set count= count + 1 where id = old.id;
+ end if;
+end|
+
+delimiter ;|
+insert into t1 (id, count) values (1, 0);
+
+lock table t1 write;
+
+--connect (connection_insert, localhost, root, , test, , )
+connection connection_insert;
+# Is expected to pass.
+insert into t2 set id=1;
+connection default;
+unlock tables;
+update t2 set id=1 where id=1;
+select * from t1;
+select * from t2;
+# Will drop the trigger
+drop table t1, t2;
+disconnect connection_insert;
+--echo
+--echo Additionally, provide test coverage for triggers and
+--echo all MySQL data changing commands.
+--echo
+--disable_warnings
+drop table if exists t1, t2, t1_op_log;
+drop view if exists v1;
+drop trigger if exists trg_bug28502_bi;
+drop trigger if exists trg_bug28502_ai;
+drop trigger if exists trg_bug28502_bu;
+drop trigger if exists trg_bug28502_au;
+drop trigger if exists trg_bug28502_bd;
+drop trigger if exists trg_bug28502_ad;
+--enable_warnings
+create table t1 (id int primary key auto_increment, operation varchar(255));
+create table t2 (id int primary key);
+create table t1_op_log(operation varchar(255));
+create view v1 as select * from t1;
+create trigger trg_bug28502_bi before insert on t1
+for each row
+ insert into t1_op_log (operation)
+ values (concat("Before INSERT, new=", new.operation));
+
+create trigger trg_bug28502_ai after insert on t1
+for each row
+ insert into t1_op_log (operation)
+ values (concat("After INSERT, new=", new.operation));
+
+create trigger trg_bug28502_bu before update on t1
+for each row
+ insert into t1_op_log (operation)
+ values (concat("Before UPDATE, new=", new.operation,
+ ", old=", old.operation));
+
+create trigger trg_bug28502_au after update on t1
+for each row
+ insert into t1_op_log (operation)
+ values (concat("After UPDATE, new=", new.operation,
+ ", old=", old.operation));
+
+create trigger trg_bug28502_bd before delete on t1
+for each row
+ insert into t1_op_log (operation)
+ values (concat("Before DELETE, old=", old.operation));
+
+create trigger trg_bug28502_ad after delete on t1
+for each row
+ insert into t1_op_log (operation)
+ values (concat("After DELETE, old=", old.operation));
+
+insert into t1 (operation) values ("INSERT");
+
+set @id=last_insert_id();
+
+select * from t1;
+select * from t1_op_log;
+truncate t1_op_log;
+
+update t1 set operation="UPDATE" where id=@id;
+
+select * from t1;
+select * from t1_op_log;
+truncate t1_op_log;
+
+delete from t1 where id=@id;
+
+select * from t1;
+select * from t1_op_log;
+truncate t1;
+truncate t1_op_log;
+
+insert into t1 (id, operation) values
+(NULL, "INSERT ON DUPLICATE KEY UPDATE, inserting a new key")
+on duplicate key update id=NULL, operation="Should never happen";
+
+set @id=last_insert_id();
+
+select * from t1;
+select * from t1_op_log;
+truncate t1_op_log;
+
+insert into t1 (id, operation) values
+(@id, "INSERT ON DUPLICATE KEY UPDATE, the key value is the same")
+on duplicate key update id=NULL,
+operation="INSERT ON DUPLICATE KEY UPDATE, updating the duplicate";
+
+select * from t1;
+select * from t1_op_log;
+truncate t1;
+truncate t1_op_log;
+
+replace into t1 values (NULL, "REPLACE, inserting a new key");
+
+set @id=last_insert_id();
+
+select * from t1;
+select * from t1_op_log;
+truncate t1_op_log;
+
+replace into t1 values (@id, "REPLACE, deleting the duplicate");
+
+select * from t1;
+select * from t1_op_log;
+truncate t1;
+truncate t1_op_log;
+
+create table if not exists t1
+select NULL, "CREATE TABLE ... SELECT, inserting a new key";
+
+set @id=last_insert_id();
+
+select * from t1;
+select * from t1_op_log;
+truncate t1_op_log;
+
+create table if not exists t1 replace
+select @id, "CREATE TABLE ... REPLACE SELECT, deleting a duplicate key";
+
+select * from t1;
+select * from t1_op_log;
+truncate t1;
+truncate t1_op_log;
+
+insert into t1 (id, operation)
+select NULL, "INSERT ... SELECT, inserting a new key";
+
+set @id=last_insert_id();
+
+select * from t1;
+select * from t1_op_log;
+truncate t1_op_log;
+
+insert into t1 (id, operation)
+select @id,
+"INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate"
+on duplicate key update id=NULL,
+operation="INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate";
+
+select * from t1;
+select * from t1_op_log;
+truncate t1;
+truncate t1_op_log;
+
+replace into t1 (id, operation)
+select NULL, "REPLACE ... SELECT, inserting a new key";
+
+set @id=last_insert_id();
+
+select * from t1;
+select * from t1_op_log;
+truncate t1_op_log;
+
+replace into t1 (id, operation)
+select @id, "REPLACE ... SELECT, deleting a duplicate";
+select * from t1;
+select * from t1_op_log;
+truncate t1;
+truncate t1_op_log;
+
+insert into t1 (id, operation) values (1, "INSERT for multi-DELETE");
+insert into t2 (id) values (1);
+
+delete t1.*, t2.* from t1, t2 where t1.id=1;
+
+select * from t1;
+select * from t2;
+select * from t1_op_log;
+truncate t1;
+truncate t2;
+truncate t1_op_log;
+
+insert into t1 (id, operation) values (1, "INSERT for multi-UPDATE");
+insert into t2 (id) values (1);
+update t1, t2 set t1.id=2, operation="multi-UPDATE" where t1.id=1;
+update t1, t2
+set t2.id=3, operation="multi-UPDATE, SET for t2, but the trigger is fired" where t1.id=2;
+
+select * from t1;
+select * from t2;
+select * from t1_op_log;
+truncate table t1;
+truncate table t2;
+truncate table t1_op_log;
+
+--echo
+--echo Now do the same but use a view instead of the base table.
+--echo
+
+insert into v1 (operation) values ("INSERT");
+
+set @id=last_insert_id();
+
+select * from t1;
+select * from t1_op_log;
+truncate t1_op_log;
+
+update v1 set operation="UPDATE" where id=@id;
+
+select * from t1;
+select * from t1_op_log;
+truncate t1_op_log;
+
+delete from v1 where id=@id;
+
+select * from t1;
+select * from t1_op_log;
+truncate t1;
+truncate t1_op_log;
+
+insert into v1 (id, operation) values
+(NULL, "INSERT ON DUPLICATE KEY UPDATE, inserting a new key")
+on duplicate key update id=NULL, operation="Should never happen";
+
+set @id=last_insert_id();
+
+select * from t1;
+select * from t1_op_log;
+truncate t1_op_log;
+
+insert into v1 (id, operation) values
+(@id, "INSERT ON DUPLICATE KEY UPDATE, the key value is the same")
+on duplicate key update id=NULL,
+operation="INSERT ON DUPLICATE KEY UPDATE, updating the duplicate";
+
+select * from t1;
+select * from t1_op_log;
+truncate t1;
+truncate t1_op_log;
+
+replace into v1 values (NULL, "REPLACE, inserting a new key");
+
+set @id=last_insert_id();
+
+select * from t1;
+select * from t1_op_log;
+truncate t1_op_log;
+
+replace into v1 values (@id, "REPLACE, deleting the duplicate");
+
+select * from t1;
+select * from t1_op_log;
+truncate t1;
+truncate t1_op_log;
+
+create table if not exists v1
+select NULL, "CREATE TABLE ... SELECT, inserting a new key";
+
+set @id=last_insert_id();
+
+select * from t1;
+select * from t1_op_log;
+truncate t1_op_log;
+
+create table if not exists v1 replace
+select @id, "CREATE TABLE ... REPLACE SELECT, deleting a duplicate key";
+
+select * from t1;
+select * from t1_op_log;
+truncate t1;
+truncate t1_op_log;
+
+insert into v1 (id, operation)
+select NULL, "INSERT ... SELECT, inserting a new key";
+
+set @id=last_insert_id();
+
+select * from t1;
+select * from t1_op_log;
+truncate t1_op_log;
+
+insert into v1 (id, operation)
+select @id,
+"INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate"
+on duplicate key update id=NULL,
+operation="INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate";
+
+select * from t1;
+select * from t1_op_log;
+truncate t1;
+truncate t1_op_log;
+
+replace into v1 (id, operation)
+select NULL, "REPLACE ... SELECT, inserting a new key";
+
+set @id=last_insert_id();
+
+select * from t1;
+select * from t1_op_log;
+truncate t1_op_log;
+
+replace into v1 (id, operation)
+select @id, "REPLACE ... SELECT, deleting a duplicate";
+
+select * from t1;
+select * from t1_op_log;
+truncate t1;
+truncate t1_op_log;
+
+insert into v1 (id, operation) values (1, "INSERT for multi-DELETE");
+insert into t2 (id) values (1);
+
+delete v1.*, t2.* from v1, t2 where v1.id=1;
+
+select * from t1;
+select * from t2;
+select * from t1_op_log;
+truncate t1;
+truncate t2;
+truncate t1_op_log;
+
+insert into v1 (id, operation) values (1, "INSERT for multi-UPDATE");
+insert into t2 (id) values (1);
+update v1, t2 set v1.id=2, operation="multi-UPDATE" where v1.id=1;
+update v1, t2
+set t2.id=3, operation="multi-UPDATE, SET for t2, but the trigger is fired" where v1.id=2;
+
+select * from t1;
+select * from t2;
+select * from t1_op_log;
+
+drop view v1;
+drop table t1, t2, t1_op_log;
+
+#
+# TODO: test LOAD DATA INFILE
+#
+--echo
+--echo Bug#27248 Triggers: error if insert affects temporary table
+--echo
+--echo The bug was fixed by the fix for Bug#26141
+--echo
+--disable_warnings
+drop table if exists t1;
+drop temporary table if exists t2;
+--enable_warnings
+create table t1 (s1 int);
+create temporary table t2 (s1 int);
+create trigger t1_bi before insert on t1 for each row insert into t2 values (0);
+create trigger t1_bd before delete on t1 for each row delete from t2;
+insert into t1 values (0);
+insert into t1 values (0);
+select * from t1;
+select * from t2;
+delete from t1;
+select * from t1;
+select * from t2;
+drop table t1;
+drop temporary table t2;
--echo End of 5.0 tests
#
diff --git a/mysql-test/t/type_enum.test b/mysql-test/t/type_enum.test
index 1e5b53a2c6e..4d5d5ec8a86 100644
--- a/mysql-test/t/type_enum.test
+++ b/mysql-test/t/type_enum.test
@@ -183,4 +183,21 @@ insert into t1 values(''),(''),('a'),('b');
select * from t1 where f1='';
drop table t1;
+#
+# Bug#29360: Confluence of the special 0 enum value with the normal empty string
+# value during field to field copy.
+#
+
+CREATE TABLE t1 (c1 ENUM('a', '', 'b'));
+INSERT INTO t1 (c1) VALUES ('b');
+INSERT INTO t1 (c1) VALUES ('');
+INSERT INTO t1 (c1) VALUES (0);
+INSERT INTO t1 (c1) VALUES ('');
+
+SELECT c1 + 0, COUNT(c1) FROM t1 GROUP BY c1;
+
+CREATE TABLE t2 SELECT * FROM t1;
+SELECT c1 + 0 FROM t2;
+
+DROP TABLE t1,t2;
--echo End of 5.1 tests
diff --git a/mysql-test/t/type_newdecimal.test b/mysql-test/t/type_newdecimal.test
index e052ecfa82b..b1776d09744 100644
--- a/mysql-test/t/type_newdecimal.test
+++ b/mysql-test/t/type_newdecimal.test
@@ -1172,6 +1172,39 @@ drop table t1;
#
SELECT 1.000000000000 * 99.999999999998 / 100 a,1.000000000000 * (99.999999999998 / 100) b;
+
+#
+# Bug #29415: CAST AS DECIMAL(P,S) with too big precision/scale
+#
+
+SELECT CAST(1 AS decimal(65,10));
+--error ER_TOO_BIG_PRECISION
+SELECT CAST(1 AS decimal(66,10));
+
+SELECT CAST(1 AS decimal(65,30));
+--error ER_TOO_BIG_SCALE
+SELECT CAST(1 AS decimal(65,31));
+
+CREATE TABLE t1 (a int DEFAULT NULL, b int DEFAULT NULL);
+INSERT INTO t1 VALUES (3,30), (1,10), (2,10);
+SELECT a+CAST(1 AS decimal(65,30)) AS aa, SUM(b) FROM t1 GROUP BY aa;
+--error ER_TOO_BIG_SCALE
+SELECT a+CAST(1 AS decimal(65,31)) AS aa, SUM(b) FROM t1 GROUP BY aa;
+
+DROP TABLE t1;
+
+#
+# Bug #29417: assertion abort for a grouping query with decimal user variable
+#
+
+CREATE TABLE t1 (a int DEFAULT NULL, b int DEFAULT NULL);
+INSERT INTO t1 VALUES (3,30), (1,10), (2,10);
+
+SET @a= CAST(1 AS decimal);
+SELECT 1 FROM t1 GROUP BY @b := @a, @b;
+
+DROP TABLE t1;
+
--echo End of 5.0 tests
#
diff --git a/mysql-test/t/type_time.test b/mysql-test/t/type_time.test
index cb7e4f85ad1..5fc763be7fe 100644
--- a/mysql-test/t/type_time.test
+++ b/mysql-test/t/type_time.test
@@ -40,3 +40,40 @@ drop table t1;
# ##########################################################
# End of 4.1 tests
+
+#
+# Bug#29555: Comparing time values as strings may lead to a wrong result.
+#
+select cast('100:55:50' as time) < cast('24:00:00' as time);
+select cast('100:55:50' as time) < cast('024:00:00' as time);
+select cast('300:55:50' as time) < cast('240:00:00' as time);
+select cast('100:55:50' as time) > cast('24:00:00' as time);
+select cast('100:55:50' as time) > cast('024:00:00' as time);
+select cast('300:55:50' as time) > cast('240:00:00' as time);
+create table t1 (f1 time);
+insert into t1 values ('24:00:00');
+select cast('24:00:00' as time) = (select f1 from t1);
+drop table t1;
+
+#
+# Bug#29739: Incorrect time comparison in BETWEEN.
+#
+create table t1(f1 time, f2 time);
+insert into t1 values('20:00:00','150:00:00');
+select 1 from t1 where cast('100:00:00' as time) between f1 and f2;
+drop table t1;
+
+#
+# Bug#29729: Wrong conversion error led to an empty result set.
+#
+CREATE TABLE t1 (
+ f2 date NOT NULL,
+ f3 int(11) unsigned NOT NULL default '0',
+ PRIMARY KEY (f3, f2)
+);
+insert into t1 values('2007-07-01', 1);
+insert into t1 values('2007-07-01', 2);
+insert into t1 values('2007-07-02', 1);
+insert into t1 values('2007-07-02', 2);
+SELECT sum(f3) FROM t1 where f2='2007-07-01 00:00:00' group by f2;
+drop table t1;
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index ee807a1ae25..68b2a38aa27 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -3348,6 +3348,60 @@ EXPLAIN SELECT a, SUM(b) FROM v1 WHERE a=1 GROUP BY a;
DROP VIEW v1;
DROP TABLE t1;
+#
+# Bug #29392: SELECT over a multi-table view with ORDER BY
+# selecting the same view column with two different aliases
+#
+
+CREATE TABLE t1 (
+ person_id int NOT NULL PRIMARY KEY,
+ username varchar(40) default NULL,
+ status_flg char(1) NOT NULL default 'A'
+);
+
+CREATE TABLE t2 (
+ person_role_id int NOT NULL auto_increment PRIMARY KEY,
+ role_id int NOT NULL,
+ person_id int NOT NULL,
+ INDEX idx_person_id (person_id),
+ INDEX idx_role_id (role_id)
+);
+
+CREATE TABLE t3 (
+ role_id int NOT NULL auto_increment PRIMARY KEY,
+ role_name varchar(100) default NULL,
+ app_name varchar(40) NOT NULL,
+ INDEX idx_app_name(app_name)
+);
+
+CREATE VIEW v1 AS
+SELECT profile.person_id AS person_id
+ FROM t1 profile, t2 userrole, t3 role
+ WHERE userrole.person_id = profile.person_id AND
+ role.role_id = userrole.role_id AND
+ profile.status_flg = 'A'
+ ORDER BY profile.person_id,role.app_name,role.role_name;
+
+INSERT INTO t1 VALUES
+ (6,'Sw','A'), (-1136332546,'ols','e'), (0,' *\n','0'),
+ (-717462680,'ENTS Ta','0'), (-904346964,'ndard SQL\n','0');
+
+INSERT INTO t2 VALUES
+ (1,3,6),(2,4,7),(3,5,8),(4,6,9),(5,1,6),(6,1,7),(7,1,8),(8,1,9),(9,1,10);
+
+INSERT INTO t3 VALUES
+ (1,'NUCANS_APP_USER','NUCANSAPP'),(2,'NUCANS_TRGAPP_USER','NUCANSAPP'),
+ (3,'IA_INTAKE_COORDINATOR','IACANS'),(4,'IA_SCREENER','IACANS'),
+ (5,'IA_SUPERVISOR','IACANS'),(6,'IA_READONLY','IACANS'),
+ (7,'SOC_USER','SOCCANS'),(8,'CAYIT_USER','CAYITCANS'),
+ (9,'RTOS_DCFSPOS_SUPERVISOR','RTOS');
+
+EXPLAIN SELECT t.person_id AS a, t.person_id AS b FROM v1 t WHERE t.person_id=6;
+SELECT t.person_id AS a, t.person_id AS b FROM v1 t WHERE t.person_id=6;
+
+DROP VIEW v1;
+DROP TABLE t1,t2,t3;
+
--echo End of 5.0 tests.
#
diff --git a/mysql-test/t/windows_shm-master.opt b/mysql-test/t/windows_shm-master.opt
new file mode 100644
index 00000000000..4476ea16360
--- /dev/null
+++ b/mysql-test/t/windows_shm-master.opt
@@ -0,0 +1 @@
+--skip-grant-tables --loose-shared-memory-base-name=HeyMrBaseNameXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX --loose-shared-memory=1
diff --git a/mysql-test/t/windows_shm.test b/mysql-test/t/windows_shm.test
new file mode 100644
index 00000000000..1c6f05f2da0
--- /dev/null
+++ b/mysql-test/t/windows_shm.test
@@ -0,0 +1,9 @@
+# Windows-specific tests
+--source include/windows.inc
+
+#
+# Bug #24924: shared-memory-base-name that is too long causes buffer overflow
+#
+--exec $MYSQLADMIN --no-defaults --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --shared-memory-base-name=HeyMrBaseNameXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ping
+
+--echo End of 5.0 tests.
diff --git a/mysys/hash.c b/mysys/hash.c
index d8c914d13dd..47ddc5aa97d 100644
--- a/mysys/hash.c
+++ b/mysys/hash.c
@@ -593,6 +593,25 @@ my_bool hash_update(HASH *hash, uchar *record, uchar *old_key,
previous->next=pos->next; /* unlink pos */
/* Move data to correct position */
+ if (new_index == empty)
+ {
+ /*
+ At this point record is unlinked from the old chain, thus it holds
+ random position. By the chance this position is equal to position
+ for the first element in the new chain. That means updated record
+ is the only record in the new chain.
+ */
+ if (empty != idx)
+ {
+ /*
+ Record was moved while unlinking it from the old chain.
+ Copy data to a new position.
+ */
+ data[empty]= org_link;
+ }
+ data[empty].next= NO_RECORD;
+ DBUG_RETURN(0);
+ }
pos=data+new_index;
new_pos_index=hash_rec_mask(hash,pos,blength,records);
if (new_index != new_pos_index)
diff --git a/mysys/md5.c b/mysys/md5.c
index a88fb279a0b..0945f9ce5f4 100644
--- a/mysys/md5.c
+++ b/mysys/md5.c
@@ -45,7 +45,7 @@ documentation and/or software.
#include <my_global.h>
#include <m_string.h>
-#include "md5.h"
+#include "my_md5.h"
/* Constants for MD5Transform routine. */
diff --git a/mysys/my_conio.c b/mysys/my_conio.c
index 1ea1f7a820a..b78966446ee 100644
--- a/mysys/my_conio.c
+++ b/mysys/my_conio.c
@@ -187,15 +187,19 @@ char* my_cgets(char *buffer, size_t clen, size_t* plen)
while (GetLastError() == ERROR_NOT_ENOUGH_MEMORY);
*plen= plen_res;
+ /* We go here on error reading the string (Ctrl-C for example) */
+ if (!*plen)
+ result= NULL; /* purecov: inspected */
+
if (result != NULL)
{
- if (buffer[*plen - 2] == '\r')
+ if (*plen > 1 && buffer[*plen - 2] == '\r')
{
*plen= *plen - 2;
}
else
{
- if (buffer[*plen - 1] == '\r')
+ if (*plen > 0 && buffer[*plen - 1] == '\r')
{
char tmp[3];
int tmplen= sizeof(tmp);
diff --git a/mysys/my_symlink2.c b/mysys/my_symlink2.c
index 6ea22790998..2a46fb3abea 100644
--- a/mysys/my_symlink2.c
+++ b/mysys/my_symlink2.c
@@ -56,11 +56,13 @@ File my_create_with_symlink(const char *linkname, const char *filename,
{
if (!access(filename,F_OK))
{
+ my_errno= errno= EEXIST;
my_error(EE_CANTCREATEFILE, MYF(0), filename, EEXIST);
DBUG_RETURN(-1);
}
if (create_link && !access(linkname,F_OK))
{
+ my_errno= errno= EEXIST;
my_error(EE_CANTCREATEFILE, MYF(0), linkname, EEXIST);
DBUG_RETURN(-1);
}
diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh
index 02c97f59cb6..e7084d86f9c 100644
--- a/scripts/make_binary_distribution.sh
+++ b/scripts/make_binary_distribution.sh
@@ -301,7 +301,8 @@ rm -f $MYSQL_SHARE/Makefile* $MYSQL_SHARE/*/*.OLD
copyfileto $BASE/mysql-test \
mysql-test/mysql-test-run mysql-test/install_test_db \
mysql-test/mysql-test-run.pl mysql-test/README \
- mysql-test/valgrind.supp \
+ mysql-test/mysql-stress-test.pl \
+ mysql-test/valgrind.supp \
netware/mysql_test_run.nlm netware/install_test_db.ncf
MCP mysql-test/lib/*.pl $BASE/mysql-test/lib
diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist
index 6593e2c6039..480ea39b2cf 100755
--- a/scripts/make_win_bin_dist
+++ b/scripts/make_win_bin_dist
@@ -304,7 +304,7 @@ cp mysys/$TARGET/mysys.lib $DESTDIR/lib/opt/mysys_tls.lib
mkdir -p $DESTDIR/mysql-test/include $DESTDIR/mysql-test/lib \
$DESTDIR/mysql-test/r $DESTDIR/mysql-test/std_data \
- $DESTDIR/mysql-test/t
+ $DESTDIR/mysql-test/t $DESTDIR/mysql-test/suite
cp mysql-test/mysql-test-run.pl $DESTDIR/mysql-test/
cp mysql-test/README $DESTDIR/mysql-test/
cp mysql-test/install_test_db.sh $DESTDIR/mysql-test/install_test_db
@@ -324,7 +324,7 @@ cp mysql-test/std_data/*.pem $DESTDIR/mysql-test/std_data/
cp mysql-test/std_data/*.MY* $DESTDIR/mysql-test/std_data/
cp mysql-test/t/*.opt $DESTDIR/mysql-test/t/
cp mysql-test/t/*.sh $DESTDIR/mysql-test/t/
-cp mysql-test/t/*.slave-mi $DESTDIR/mysql-test/t/
+cp mysql-test/t/*.slave-mi $DESTDIR/mysql-test/t/ || /bin/true
cp mysql-test/t/*.sql $DESTDIR/mysql-test/t/
cp mysql-test/t/*.def $DESTDIR/mysql-test/t/
(cd mysql-test/t/ && cp *.test $ABS_DST/mysql-test/t/)
@@ -335,6 +335,12 @@ if [ -d mysql-test/extra ] ; then
cp -pR mysql-test/extra/* $DESTDIR/mysql-test/extra/
fi
+# Copy all directories in mysql-test/suite/
+for i in `cd mysql-test/suite && ls`; do \
+ mkdir -p $DESTDIR/mysql-test/suite/$i; \
+ cp -R mysql-test/suite/$i $DESTDIR/mysql-test/suite/; \
+done
+
# ----------------------------------------------------------------------
# Copy what could be usable in the "scripts" directory. Currently
# only SQL files, others are Bourne shell scripts or Perl scripts
diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh
index 357dd275d1f..597bf38a518 100644
--- a/scripts/mysqld_safe.sh
+++ b/scripts/mysqld_safe.sh
@@ -14,7 +14,7 @@
KILL_MYSQLD=1;
MYSQLD=
niceness=0
-# Default on, unless --log-err is specified (and before options are parsed)
+# Default on, unless --log-error is specified (and before options are parsed)
syslog=2
user=@MYSQLD_USER@
pid_file=
@@ -256,7 +256,7 @@ if [ -n "$err_log" -o $syslog -eq 0 ]
then
if [ -n "$err_log" ]
then
- # mysqld adds ".err" if there is no extension on the --log-err
+ # mysqld adds ".err" if there is no extension on the --log-error
# argument; must match that here, or mysqld_safe will write to a
# different log file than mysqld
@@ -289,6 +289,25 @@ then
syslog=0
fi
+USER_OPTION=""
+if test -w / -o "$USER" = "root"
+then
+ if test "$user" != "root" -o $SET_USER = 1
+ then
+ USER_OPTION="--user=$user"
+ fi
+ # Change the err log to the right user, if it is in use
+ if [ $syslog -eq 0 ]; then
+ touch $err_log
+ chown $user $err_log
+ fi
+ if test -n "$open_files"
+ then
+ ulimit -n $open_files
+ append_arg_to_args "--open-files-limit=$open_files"
+ fi
+fi
+
safe_mysql_unix_port=${mysql_unix_port:-${MYSQL_UNIX_PORT:-@MYSQL_UNIX_ADDR@}}
# Make sure that directory for $safe_mysql_unix_port exists
mysql_unix_port_dir=`dirname $safe_mysql_unix_port`
@@ -387,22 +406,6 @@ else
fi
fi
-USER_OPTION=""
-if test -w / -o "$USER" = "root"
-then
- if test "$user" != "root" -o $SET_USER = 1
- then
- USER_OPTION="--user=$user"
- fi
- # If we are root, change the err log to the right user.
- touch $err_log; chown $user $err_log
- if test -n "$open_files"
- then
- ulimit -n $open_files
- append_arg_to_args "--open-files-limit=$open_files"
- fi
-fi
-
# Try to set the core file size (even if we aren't root) because many systems
# don't specify a hard limit on core file size.
if test -n "$core_file_size"
diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt
index 85c2013d8e7..a8aa7d70586 100644
--- a/sql/CMakeLists.txt
+++ b/sql/CMakeLists.txt
@@ -15,9 +15,10 @@
INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
SET(CMAKE_CXX_FLAGS_DEBUG
- "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR")
+ "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR /Zi")
SET(CMAKE_C_FLAGS_DEBUG
- "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR")
+ "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR /Zi")
+SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /MAP /MAPINFO:EXPORTS")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/extra/yassl/include
@@ -40,7 +41,8 @@ SET_SOURCE_FILES_PROPERTIES(${CMAKE_SOURCE_DIR}/sql/message.rc
ADD_DEFINITIONS(-DMYSQL_SERVER -D_CONSOLE -DHAVE_DLOPEN)
-ADD_EXECUTABLE(mysqld ../sql-common/client.c derror.cc des_key_file.cc
+ADD_EXECUTABLE(mysqld${MYSQLD_EXE_SUFFIX}
+ ../sql-common/client.c derror.cc des_key_file.cc
discover.cc ../libmysql/errmsg.c field.cc field_conv.cc
filesort.cc gstream.cc
ha_partition.cc
@@ -81,7 +83,8 @@ ADD_EXECUTABLE(mysqld ../sql-common/client.c derror.cc des_key_file.cc
${PROJECT_SOURCE_DIR}/include/mysql_version.h
${PROJECT_SOURCE_DIR}/sql/sql_builtin.cc
${PROJECT_SOURCE_DIR}/sql/lex_hash.h)
-TARGET_LINK_LIBRARIES(mysqld heap myisam myisammrg mysys yassl zlib dbug yassl
+TARGET_LINK_LIBRARIES(mysqld${MYSQLD_EXE_SUFFIX}
+ heap myisam myisammrg mysys yassl zlib dbug yassl
taocrypt strings vio regex wsock32 ws2_32)
IF(EMBED_MANIFESTS)
@@ -97,16 +100,16 @@ IF(WITH_CSV_STORAGE_ENGINE)
TARGET_LINK_LIBRARIES(mysqld csv)
ENDIF(WITH_CSV_STORAGE_ENGINE)
IF(WITH_EXAMPLE_STORAGE_ENGINE)
- TARGET_LINK_LIBRARIES(mysqld example)
+ TARGET_LINK_LIBRARIES(mysqld${MYSQLD_EXE_SUFFIX} example)
ENDIF(WITH_EXAMPLE_STORAGE_ENGINE)
IF(WITH_FEDERATED_STORAGE_ENGINE)
TARGET_LINK_LIBRARIES(mysqld federated)
ENDIF(WITH_FEDERATED_STORAGE_ENGINE)
IF(WITH_INNOBASE_STORAGE_ENGINE)
- TARGET_LINK_LIBRARIES(mysqld innobase)
+ TARGET_LINK_LIBRARIES(mysqld${MYSQLD_EXE_SUFFIX} innobase)
ENDIF(WITH_INNOBASE_STORAGE_ENGINE)
-ADD_DEPENDENCIES(mysqld GenError)
+ADD_DEPENDENCIES(mysqld${MYSQLD_EXE_SUFFIX} GenError)
# Sql Parser custom command
ADD_CUSTOM_COMMAND(
@@ -138,8 +141,7 @@ ADD_CUSTOM_COMMAND(
COMMAND ${GEN_LEX_HASH_EXE} ARGS > lex_hash.h
DEPENDS ${GEN_LEX_HASH_EXE}
)
-
-ADD_DEPENDENCIES(mysqld gen_lex_hash)
+ADD_DEPENDENCIES(mysqld${MYSQLD_EXE_SUFFIX} gen_lex_hash)
ADD_LIBRARY(udf_example MODULE udf_example.c udf_example.def)
ADD_DEPENDENCIES(udf_example strings)
diff --git a/sql/Makefile.am b/sql/Makefile.am
index 36d066758bc..ff33c1cae0c 100644
--- a/sql/Makefile.am
+++ b/sql/Makefile.am
@@ -43,8 +43,7 @@ mysqld_LDADD = libndb.la \
@pstack_libs@ \
@mysql_plugin_libs@ \
$(LDADD) $(CXXLDFLAGS) $(WRAPLIBS) @LIBDL@ \
- $(yassl_libs) $(openssl_libs) \
- @MYSQLD_EXTRA_LIBS@
+ $(yassl_libs) $(openssl_libs) @MYSQLD_EXTRA_LIBS@
noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \
item_strfunc.h item_timefunc.h \
diff --git a/sql/events.cc b/sql/events.cc
index e48daeca63d..8d32580816f 100644
--- a/sql/events.cc
+++ b/sql/events.cc
@@ -717,7 +717,8 @@ send_show_create_event(THD *thd, Event_timed *et, Protocol *protocol)
protocol->store(et->name.str, et->name.length, system_charset_info);
protocol->store(sql_mode.str, sql_mode.length, system_charset_info);
protocol->store(tz_name->ptr(), tz_name->length(), system_charset_info);
- protocol->store(show_str.c_ptr(), show_str.length(), &my_charset_bin);
+ protocol->store(show_str.c_ptr(), show_str.length(),
+ et->creation_ctx->get_client_cs());
protocol->store(et->creation_ctx->get_client_cs()->csname,
strlen(et->creation_ctx->get_client_cs()->csname),
system_charset_info);
diff --git a/sql/field.cc b/sql/field.cc
index 55a93ed46d6..a970a6e4318 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -1360,6 +1360,18 @@ bool Field::send_binary(Protocol *protocol)
}
+int Field::store(const char *to, uint length, CHARSET_INFO *cs,
+ enum_check_fields check_level)
+{
+ int res;
+ enum_check_fields old_check_level= table->in_use->count_cuted_fields;
+ table->in_use->count_cuted_fields= check_level;
+ res= store(to, length, cs);
+ table->in_use->count_cuted_fields= old_check_level;
+ return res;
+}
+
+
my_decimal *Field::val_decimal(my_decimal *decimal)
{
/* This never have to be called */
@@ -2316,6 +2328,7 @@ Field_new_decimal::Field_new_decimal(uchar *ptr_arg,
unireg_check_arg, field_name_arg, dec_arg, zero_arg, unsigned_arg)
{
precision= my_decimal_length_to_precision(len_arg, dec_arg, unsigned_arg);
+ set_if_smaller(precision, DECIMAL_MAX_PRECISION);
DBUG_ASSERT((precision <= DECIMAL_MAX_PRECISION) &&
(dec <= DECIMAL_MAX_SCALE));
bin_size= my_decimal_get_binary_size(precision, dec);
@@ -2332,6 +2345,7 @@ Field_new_decimal::Field_new_decimal(uint32 len_arg,
NONE, name, dec_arg, 0, unsigned_arg)
{
precision= my_decimal_length_to_precision(len_arg, dec_arg, unsigned_arg);
+ set_if_smaller(precision, DECIMAL_MAX_PRECISION);
DBUG_ASSERT((precision <= DECIMAL_MAX_PRECISION) &&
(dec <= DECIMAL_MAX_SCALE));
bin_size= my_decimal_get_binary_size(precision, dec);
@@ -5392,7 +5406,8 @@ int Field_newdate::store(const char *from,uint len,CHARSET_INFO *cs)
else
{
tmp= l_time.day + l_time.month*32 + l_time.year*16*32;
- if (!error && (ret != MYSQL_TIMESTAMP_DATE))
+ if (!error && (ret != MYSQL_TIMESTAMP_DATE) &&
+ thd->count_cuted_fields != CHECK_FIELD_IGNORE)
error= 3; // Datetime was cut (note)
}
@@ -6457,6 +6472,7 @@ Field *Field_string::new_field(MEM_ROOT *root, struct st_table *new_table,
is 2.
****************************************************************************/
+const uint Field_varstring::MAX_SIZE= UINT_MAX16;
int Field_varstring::store(const char *from,uint length,CHARSET_INFO *cs)
{
diff --git a/sql/field.h b/sql/field.h
index a0fe0f2e57e..8bf087c7ebd 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -100,6 +100,8 @@ public:
virtual int store(longlong nr, bool unsigned_val)=0;
virtual int store_decimal(const my_decimal *d)=0;
virtual int store_time(MYSQL_TIME *ltime, timestamp_type t_type);
+ int store(const char *to, uint length, CHARSET_INFO *cs,
+ enum_check_fields check_level);
virtual double val_real(void)=0;
virtual longlong val_int(void)=0;
virtual my_decimal *val_decimal(my_decimal *);
@@ -1183,7 +1185,7 @@ public:
The maximum space available in a Field_varstring, in bytes. See
length_bytes.
*/
- static const uint MAX_SIZE= UINT_MAX16;
+ static const uint MAX_SIZE;
/* Store number of bytes used to store length (1 or 2) */
uint32 length_bytes;
Field_varstring(uchar *ptr_arg,
diff --git a/sql/field_conv.cc b/sql/field_conv.cc
index 44aea9acee0..33c7897c3db 100644
--- a/sql/field_conv.cc
+++ b/sql/field_conv.cc
@@ -795,11 +795,18 @@ int field_conv(Field *to,Field *from)
blob->value.copy();
return blob->store(blob->value.ptr(),blob->value.length(),from->charset());
}
- if ((from->result_type() == STRING_RESULT &&
- (to->result_type() == STRING_RESULT ||
- (from->real_type() != MYSQL_TYPE_ENUM &&
- from->real_type() != MYSQL_TYPE_SET))) ||
- to->type() == MYSQL_TYPE_DECIMAL)
+ if (from->real_type() == MYSQL_TYPE_ENUM &&
+ to->real_type() == MYSQL_TYPE_ENUM &&
+ from->val_int() == 0)
+ {
+ ((Field_enum *)(to))->store_type(0);
+ return 0;
+ }
+ else if ((from->result_type() == STRING_RESULT &&
+ (to->result_type() == STRING_RESULT ||
+ (from->real_type() != MYSQL_TYPE_ENUM &&
+ from->real_type() != MYSQL_TYPE_SET))) ||
+ to->type() == MYSQL_TYPE_DECIMAL)
{
char buff[MAX_FIELD_WIDTH];
String result(buff,sizeof(buff),from->charset());
diff --git a/sql/filesort.cc b/sql/filesort.cc
index b1dfb4d5e71..b6a5d844eac 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -1120,7 +1120,8 @@ int merge_buffers(SORTPARAM *param, IO_CACHE *from_file,
int flag)
{
int error;
- uint rec_length,sort_length,res_length,offset;
+ uint rec_length,res_length,offset;
+ size_t sort_length;
ulong maxcount;
ha_rows max_rows,org_max_rows;
my_off_t to_start_filepos;
@@ -1128,6 +1129,7 @@ int merge_buffers(SORTPARAM *param, IO_CACHE *from_file,
BUFFPEK *buffpek;
QUEUE queue;
qsort2_cmp cmp;
+ void *first_cmp_arg;
volatile THD::killed_state *killed= &current_thd->killed;
THD::killed_state not_killable;
DBUG_ENTER("merge_buffers");
@@ -1152,9 +1154,18 @@ int merge_buffers(SORTPARAM *param, IO_CACHE *from_file,
/* The following will fire if there is not enough space in sort_buffer */
DBUG_ASSERT(maxcount!=0);
+ if (param->unique_buff)
+ {
+ cmp= param->compare;
+ first_cmp_arg= (void *) &param->cmp_context;
+ }
+ else
+ {
+ cmp= get_ptr_compare(sort_length);
+ first_cmp_arg= (void*) &sort_length;
+ }
if (init_queue(&queue, (uint) (Tb-Fb)+1, offsetof(BUFFPEK,key), 0,
- (queue_compare) (cmp= get_ptr_compare(sort_length)),
- (void*) &sort_length))
+ (queue_compare) cmp, first_cmp_arg))
DBUG_RETURN(1); /* purecov: inspected */
for (buffpek= Fb ; buffpek <= Tb ; buffpek++)
{
@@ -1207,7 +1218,7 @@ int merge_buffers(SORTPARAM *param, IO_CACHE *from_file,
buffpek= (BUFFPEK*) queue_top(&queue);
if (cmp) // Remove duplicates
{
- if (!(*cmp)(&sort_length, &(param->unique_buff),
+ if (!(*cmp)(first_cmp_arg, &(param->unique_buff),
(uchar**) &buffpek->key))
goto skip_duplicate;
memcpy(param->unique_buff, (uchar*) buffpek->key, rec_length);
@@ -1259,7 +1270,7 @@ int merge_buffers(SORTPARAM *param, IO_CACHE *from_file,
*/
if (cmp)
{
- if (!(*cmp)(&sort_length, &(param->unique_buff), (uchar**) &buffpek->key))
+ if (!(*cmp)(first_cmp_arg, &(param->unique_buff), (uchar**) &buffpek->key))
{
buffpek->key+= rec_length; // Remove duplicate
--buffpek->mem_count;
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index c78cb4e65b4..0b8ffd4a2fb 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -7033,9 +7033,6 @@ int ndbcluster_find_files(handlerton *hton, THD *thd,
}
}
- // Lock mutex before deleting and creating frm files
- pthread_mutex_lock(&LOCK_open);
-
if (!global_read_lock)
{
// Delete old files
@@ -7049,15 +7046,17 @@ int ndbcluster_find_files(handlerton *hton, THD *thd,
table_list.db= (char*) db;
table_list.alias= table_list.table_name= (char*)file_name;
(void)mysql_rm_table_part2(thd, &table_list,
- /* if_exists */ FALSE,
- /* drop_temporary */ FALSE,
- /* drop_view */ FALSE,
- /* dont_log_query*/ TRUE);
+ FALSE, /* if_exists */
+ FALSE, /* drop_temporary */
+ FALSE, /* drop_view */
+ TRUE /* dont_log_query*/);
+
/* Clear error message that is returned when table is deleted */
thd->clear_error();
}
}
+ pthread_mutex_lock(&LOCK_open);
// Create new files
List_iterator_fast<char> it2(create_list);
while ((file_name=it2++))
@@ -7068,7 +7067,7 @@ int ndbcluster_find_files(handlerton *hton, THD *thd,
}
pthread_mutex_unlock(&LOCK_open);
-
+
hash_free(&ok_tables);
hash_free(&ndb_tables);
@@ -10141,6 +10140,10 @@ static int ndbcluster_fill_files_table(handlerton *hton,
{
if (ndberr.classification == NdbError::SchemaError)
continue;
+
+ if (ndberr.classification == NdbError::UnknownResultError)
+ continue;
+
ERR_RETURN(ndberr);
}
NdbDictionary::Tablespace ts= dict->getTablespace(df.getTablespace());
@@ -10220,6 +10223,8 @@ static int ndbcluster_fill_files_table(handlerton *hton,
{
if (ndberr.classification == NdbError::SchemaError)
continue;
+ if (ndberr.classification == NdbError::UnknownResultError)
+ continue;
ERR_RETURN(ndberr);
}
NdbDictionary::LogfileGroup lfg=
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index d874525c4ad..e4924e8e8f2 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -2961,8 +2961,34 @@ int ha_partition::rnd_init(bool scan)
uint32 part_id;
DBUG_ENTER("ha_partition::rnd_init");
- include_partition_fields_in_used_fields();
-
+ /*
+ For operations that may need to change data, we may need to extend
+ read_set.
+ */
+ if (m_lock_type == F_WRLCK)
+ {
+ /*
+ If write_set contains any of the fields used in partition and
+ subpartition expression, we need to set all bits in read_set because
+ the row may need to be inserted in a different [sub]partition. In
+ other words update_row() can be converted into write_row(), which
+ requires a complete record.
+ */
+ if (bitmap_is_overlapping(&m_part_info->full_part_field_set,
+ table->write_set))
+ bitmap_set_all(table->read_set);
+ else
+ {
+ /*
+ Some handlers only read fields as specified by the bitmap for the
+ read set. For partitioned handlers we always require that the
+ fields of the partition functions are read such that we can
+ calculate the partition id to place updated and deleted records.
+ */
+ bitmap_union(table->read_set, &m_part_info->full_part_field_set);
+ }
+ }
+
/* Now we see what the index of our first important partition is */
DBUG_PRINT("info", ("m_part_info->used_partitions: 0x%lx",
(long) m_part_info->used_partitions.bitmap));
@@ -3118,7 +3144,7 @@ int ha_partition::rnd_next(uchar *buf)
continue; // Probably MyISAM
if (result != HA_ERR_END_OF_FILE)
- break; // Return error
+ goto end_dont_reset_start_part; // Return error
/* End current partition */
late_extra_no_cache(part_id);
@@ -3144,6 +3170,7 @@ int ha_partition::rnd_next(uchar *buf)
end:
m_part_spec.start_part= NO_CURRENT_PART_ID;
+end_dont_reset_start_part:
table->status= STATUS_NOT_FOUND;
DBUG_RETURN(result);
}
@@ -3275,7 +3302,15 @@ int ha_partition::index_init(uint inx, bool sorted)
m_start_key.length= 0;
m_ordered= sorted;
m_curr_key_info= table->key_info+inx;
- include_partition_fields_in_used_fields();
+ /*
+ Some handlers only read fields as specified by the bitmap for the
+ read set. For partitioned handlers we always require that the
+ fields of the partition functions are read such that we can
+ calculate the partition id to place updated and deleted records.
+ But this is required for operations that may need to change data only.
+ */
+ if (m_lock_type == F_WRLCK)
+ bitmap_union(table->read_set, &m_part_info->full_part_field_set);
file= m_file;
do
{
@@ -4144,35 +4179,6 @@ int ha_partition::handle_ordered_prev(uchar *buf)
}
-/*
- Set fields in partition functions in read set for underlying handlers
-
- SYNOPSIS
- include_partition_fields_in_used_fields()
-
- RETURN VALUE
- NONE
-
- DESCRIPTION
- Some handlers only read fields as specified by the bitmap for the
- read set. For partitioned handlers we always require that the
- fields of the partition functions are read such that we can
- calculate the partition id to place updated and deleted records.
-*/
-
-void ha_partition::include_partition_fields_in_used_fields()
-{
- Field **ptr= m_part_field_array;
- DBUG_ENTER("ha_partition::include_partition_fields_in_used_fields");
-
- do
- {
- bitmap_set_bit(table->read_set, (*ptr)->field_index);
- } while (*(++ptr));
- DBUG_VOID_RETURN;
-}
-
-
/****************************************************************************
MODULE information calls
****************************************************************************/
@@ -4714,6 +4720,12 @@ void ha_partition::get_dynamic_partition_info(PARTITION_INFO *stat_info,
HA_EXTRA_KEY_CACHE:
HA_EXTRA_NO_KEY_CACHE:
This parameters are no longer used and could be removed.
+
+ 7) Parameters only used by federated tables for query processing
+ ----------------------------------------------------------------
+ HA_EXTRA_INSERT_WITH_UPDATE:
+ Inform handler that an "INSERT...ON DUPLICATE KEY UPDATE" will be
+ executed. This condition is unset by HA_EXTRA_NO_IGNORE_DUP_KEY.
*/
int ha_partition::extra(enum ha_extra_function operation)
@@ -4795,6 +4807,9 @@ int ha_partition::extra(enum ha_extra_function operation)
*/
break;
}
+ /* Category 7), used by federated handlers */
+ case HA_EXTRA_INSERT_WITH_UPDATE:
+ DBUG_RETURN(loop_extra(operation));
default:
{
/* Temporary crash to discover what is wrong */
diff --git a/sql/ha_partition.h b/sql/ha_partition.h
index a168007ea04..895f001fa6a 100644
--- a/sql/ha_partition.h
+++ b/sql/ha_partition.h
@@ -449,7 +449,6 @@ private:
int handle_ordered_next(uchar * buf, bool next_same);
int handle_ordered_prev(uchar * buf);
void return_top_record(uchar * buf);
- void include_partition_fields_in_used_fields();
public:
/*
-------------------------------------------------------------------------
diff --git a/sql/handler.h b/sql/handler.h
index 4095a2f4cb1..f45b28c55f5 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -328,13 +328,21 @@ typedef ulonglong my_xid; // this line is the same as in log_event.h
#define MYSQL_XID_OFFSET (MYSQL_XID_PREFIX_LEN+sizeof(server_id))
#define MYSQL_XID_GTRID_LEN (MYSQL_XID_OFFSET+sizeof(my_xid))
-#define XIDDATASIZE 128
+#define XIDDATASIZE MYSQL_XIDDATASIZE
#define MAXGTRIDSIZE 64
#define MAXBQUALSIZE 64
#define COMPATIBLE_DATA_YES 0
#define COMPATIBLE_DATA_NO 1
+/**
+ struct xid_t is binary compatible with the XID structure as
+ in the X/Open CAE Specification, Distributed Transaction Processing:
+ The XA Specification, X/Open Company Ltd., 1991.
+ http://www.opengroup.org/bookstore/catalog/c193.htm
+
+ @see MYSQL_XID in mysql/plugin.h
+*/
struct xid_t {
long formatID;
long gtrid_length;
@@ -655,7 +663,7 @@ struct handlerton
uint (*alter_table_flags)(uint flags);
int (*alter_tablespace)(handlerton *hton, THD *thd, st_alter_tablespace *ts_info);
int (*fill_files_table)(handlerton *hton, THD *thd,
- struct st_table_list *tables,
+ TABLE_LIST *tables,
class Item *cond);
uint32 flags; /* global handler flags */
/*
@@ -1631,16 +1639,49 @@ public:
/* Type of table for caching query */
virtual uint8 table_cache_type() { return HA_CACHE_TBL_NONTRANSACT; }
- /* ask handler about permission to cache table when query is to be cached */
+
+
+ /**
+ @brief Register a named table with a call back function to the query cache.
+
+ @param thd The thread handle
+ @param table_key A pointer to the table name in the table cache
+ @param key_length The length of the table name
+ @param[out] engine_callback The pointer to the storage engine call back
+ function
+ @param[out] engine_data Storage engine specific data which could be
+ anything
+
+ This method offers the storage engine, the possibility to store a reference
+ to a table name which is going to be used with query cache.
+ The method is called each time a statement is written to the cache and can
+ be used to verify if a specific statement is cachable. It also offers
+ the possibility to register a generic (but static) call back function which
+ is called each time a statement is matched against the query cache.
+
+ @note If engine_data supplied with this function is different from
+ engine_data supplied with the callback function, and the callback returns
+ FALSE, a table invalidation on the current table will occur.
+
+ @return Upon success the engine_callback will point to the storage engine
+ call back function, if any, and engine_data will point to any storage
+ engine data used in the specific implementation.
+ @retval TRUE Success
+ @retval FALSE The specified table or current statement should not be
+ cached
+ */
+
virtual my_bool register_query_cache_table(THD *thd, char *table_key,
- uint key_length,
- qc_engine_callback
- *engine_callback,
- ulonglong *engine_data)
+ uint key_length,
+ qc_engine_callback
+ *engine_callback,
+ ulonglong *engine_data)
{
*engine_callback= 0;
- return 1;
+ return TRUE;
}
+
+
/*
RETURN
true Primary key (if there is one) is clustered key covering all fields
diff --git a/sql/item.cc b/sql/item.cc
index d7743c491eb..711a21ecbec 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -5899,7 +5899,7 @@ bool Item_insert_value::fix_fields(THD *thd, Item **items)
if (!arg->fixed)
{
bool res;
- st_table_list *orig_next_table= context->last_name_resolution_table;
+ TABLE_LIST *orig_next_table= context->last_name_resolution_table;
context->last_name_resolution_table= context->first_name_resolution_table;
res= arg->fix_fields(thd, &arg);
context->last_name_resolution_table= orig_next_table;
diff --git a/sql/item.h b/sql/item.h
index 6df85476f03..432da6c3a1c 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -19,7 +19,7 @@
#endif
class Protocol;
-struct st_table_list;
+struct TABLE_LIST;
void item_init(void); /* Init item functions */
class Item_field;
@@ -843,8 +843,7 @@ public:
german character for double s is equal to 2 s.
The default is that an item is not allowed
- in a partition function. However all mathematical functions, string
- manipulation functions, date functions are allowed. Allowed functions
+ in a partition function. Allowed functions
can never depend on server version, they cannot depend on anything
related to the environment. They can also only depend on a set of
fields in the table itself. They cannot depend on other tables and
@@ -1633,6 +1632,7 @@ public:
uint decimal_precision() const
{ return (uint)(max_length - test(value < 0)); }
bool eq(const Item *, bool binary_cmp) const;
+ bool check_partition_func_processor(uchar *bool_arg) { return FALSE;}
};
@@ -1650,6 +1650,7 @@ public:
void print(String *str);
Item_num *neg ();
uint decimal_precision() const { return max_length; }
+ bool check_partition_func_processor(uchar *bool_arg) { return FALSE;}
};
@@ -1692,6 +1693,7 @@ public:
uint decimal_precision() const { return decimal_value.precision(); }
bool eq(const Item *, bool binary_cmp) const;
void set_decimal_value(my_decimal *value_par);
+ bool check_partition_func_processor(uchar *bool_arg) { return FALSE;}
};
@@ -1752,7 +1754,6 @@ public:
{}
void print(String *str) { str->append(func_name); }
Item *safe_charset_converter(CHARSET_INFO *tocs);
- bool check_partition_func_processor(uchar *int_arg) {return TRUE;}
};
@@ -1861,7 +1862,6 @@ public:
CHARSET_INFO *cs= NULL):
Item_string(name, length, cs)
{}
- bool check_partition_func_processor(uchar *int_arg) {return TRUE;}
};
@@ -1915,7 +1915,6 @@ public:
unsigned_flag=1;
}
enum_field_types field_type() const { return int_field_type; }
- bool check_partition_func_processor(uchar *int_arg) {return TRUE;}
};
@@ -2116,6 +2115,12 @@ public:
bool fix_fields(THD *, Item **);
bool eq(const Item *item, bool binary_cmp) const;
+ Item *get_tmp_table_item(THD *thd)
+ {
+ Item *item= Item_ref::get_tmp_table_item(thd);
+ item->name= name;
+ return item;
+ }
virtual Ref_Type ref_type() { return VIEW_REF; }
};
@@ -2237,7 +2242,6 @@ public:
}
Item *clone_item();
virtual Item *real_item() { return ref; }
- bool check_partition_func_processor(uchar *int_arg) {return TRUE;}
};
#ifdef MYSQL_SERVER
@@ -2438,14 +2442,6 @@ enum trg_action_time_type
TRG_ACTION_BEFORE= 0, TRG_ACTION_AFTER= 1, TRG_ACTION_MAX
};
-/*
- Event on which trigger is invoked.
-*/
-enum trg_event_type
-{
- TRG_EVENT_INSERT= 0 , TRG_EVENT_UPDATE= 1, TRG_EVENT_DELETE= 2, TRG_EVENT_MAX
-};
-
class Table_triggers_list;
/*
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 3477ce84b21..755e711e383 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -719,6 +719,67 @@ Arg_comparator::can_compare_as_dates(Item *a, Item *b, ulonglong *const_value)
}
+/*
+ Retrieves correct TIME value from the given item.
+
+ SYNOPSIS
+ get_time_value()
+ thd thread handle
+ item_arg [in/out] item to retrieve TIME value from
+ cache_arg [in/out] pointer to place to store the cache item to
+ warn_item [in] unused
+ is_null [out] TRUE <=> the item_arg is null
+
+ DESCRIPTION
+ Retrieves the correct TIME value from given item for comparison by the
+ compare_datetime() function.
+ If item's result can be compared as longlong then its int value is used
+ and a value returned by get_time function is used otherwise.
+ If an item is a constant one then its value is cached and it isn't
+ get parsed again. An Item_cache_int object is used for for cached values.
+ It seamlessly substitutes the original item. The cache item is marked as
+ non-constant to prevent re-caching it again.
+
+ RETURN
+ obtained value
+*/
+
+ulonglong
+get_time_value(THD *thd, Item ***item_arg, Item **cache_arg,
+ Item *warn_item, bool *is_null)
+{
+ ulonglong value;
+ Item *item= **item_arg;
+ MYSQL_TIME ltime;
+
+ if (item->result_as_longlong())
+ {
+ value= item->val_int();
+ *is_null= item->null_value;
+ }
+ else
+ {
+ *is_null= item->get_time(&ltime);
+ value= !*is_null ? TIME_to_ulonglong_datetime(&ltime) : 0;
+ }
+ /*
+ Do not cache GET_USER_VAR() function as its const_item() may return TRUE
+ for the current thread but it still may change during the execution.
+ */
+ if (item->const_item() && cache_arg && (item->type() != Item::FUNC_ITEM ||
+ ((Item_func*)item)->functype() != Item_func::GUSERVAR_FUNC))
+ {
+ Item_cache_int *cache= new Item_cache_int();
+ /* Mark the cache as non-const to prevent re-caching. */
+ cache->set_used_tables(1);
+ cache->store(item, value);
+ *cache_arg= cache;
+ *item_arg= cache_arg;
+ }
+ return value;
+}
+
+
int Arg_comparator::set_cmp_func(Item_bool_func2 *owner_arg,
Item **a1, Item **a2,
Item_result type)
@@ -757,8 +818,23 @@ int Arg_comparator::set_cmp_func(Item_bool_func2 *owner_arg,
}
is_nulls_eq= test(owner && owner->functype() == Item_func::EQUAL_FUNC);
func= &Arg_comparator::compare_datetime;
+ get_value_func= &get_datetime_value;
return 0;
}
+ else if (type == STRING_RESULT && (*a)->field_type() == MYSQL_TYPE_TIME &&
+ (*b)->field_type() == MYSQL_TYPE_TIME)
+ {
+ /* Compare TIME values as integers. */
+ thd= current_thd;
+ owner= owner_arg;
+ a_cache= 0;
+ b_cache= 0;
+ is_nulls_eq= test(owner && owner->functype() == Item_func::EQUAL_FUNC);
+ func= &Arg_comparator::compare_datetime;
+ get_value_func= &get_time_value;
+ return 0;
+ }
+
return set_compare_func(owner_arg, type);
}
@@ -776,8 +852,10 @@ void Arg_comparator::set_datetime_cmp_func(Item **a1, Item **b1)
b_cache= 0;
is_nulls_eq= FALSE;
func= &Arg_comparator::compare_datetime;
+ get_value_func= &get_datetime_value;
}
+
/*
Retrieves correct DATETIME value from given item.
@@ -891,8 +969,8 @@ int Arg_comparator::compare_datetime()
bool is_null= FALSE;
ulonglong a_value, b_value;
- /* Get DATE/DATETIME value of the 'a' item. */
- a_value= get_datetime_value(thd, &a, &a_cache, *b, &is_null);
+ /* Get DATE/DATETIME/TIME value of the 'a' item. */
+ a_value= (*get_value_func)(thd, &a, &a_cache, *b, &is_null);
if (!is_nulls_eq && is_null)
{
if (owner)
@@ -900,8 +978,8 @@ int Arg_comparator::compare_datetime()
return -1;
}
- /* Get DATE/DATETIME value of the 'b' item. */
- b_value= get_datetime_value(thd, &b, &b_cache, *a, &is_null);
+ /* Get DATE/DATETIME/TIME value of the 'b' item. */
+ b_value= (*get_value_func)(thd, &b, &b_cache, *a, &is_null);
if (is_null)
{
if (owner)
@@ -1771,6 +1849,7 @@ void Item_func_between::fix_length_and_dec()
max_length= 1;
int i;
bool datetime_found= FALSE;
+ int time_items_found= 0;
compare_as_dates= TRUE;
THD *thd= current_thd;
@@ -1791,17 +1870,19 @@ void Item_func_between::fix_length_and_dec()
At least one of items should be a DATE/DATETIME item and other items
should return the STRING result.
*/
- for (i= 0; i < 3; i++)
+ if (cmp_type == STRING_RESULT)
{
- if (args[i]->is_datetime())
+ for (i= 0; i < 3; i++)
{
- datetime_found= TRUE;
- continue;
+ if (args[i]->is_datetime())
+ {
+ datetime_found= TRUE;
+ continue;
+ }
+ if (args[i]->field_type() == MYSQL_TYPE_TIME &&
+ args[i]->result_as_longlong())
+ time_items_found++;
}
- if (args[i]->result_type() == STRING_RESULT)
- continue;
- compare_as_dates= FALSE;
- break;
}
if (!datetime_found)
compare_as_dates= FALSE;
@@ -1811,6 +1892,11 @@ void Item_func_between::fix_length_and_dec()
ge_cmp.set_datetime_cmp_func(args, args + 1);
le_cmp.set_datetime_cmp_func(args, args + 2);
}
+ else if (time_items_found == 3)
+ {
+ /* Compare TIME items as integers. */
+ cmp_type= INT_RESULT;
+ }
else if (args[0]->real_item()->type() == FIELD_ITEM &&
thd->lex->sql_command != SQLCOM_CREATE_VIEW &&
thd->lex->sql_command != SQLCOM_SHOW_CREATE)
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index 1bc52ea093c..fcbacc32d88 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -42,6 +42,8 @@ class Arg_comparator: public Sql_alloc
bool is_nulls_eq; // TRUE <=> compare for the EQUAL_FUNC
enum enum_date_cmp_type { CMP_DATE_DFLT= 0, CMP_DATE_WITH_DATE,
CMP_DATE_WITH_STR, CMP_STR_WITH_DATE };
+ ulonglong (*get_value_func)(THD *thd, Item ***item_arg, Item **cache_arg,
+ Item *warn_item, bool *is_null);
public:
DTCollation cmp_collation;
@@ -355,7 +357,6 @@ public:
}
Item *neg_transformer(THD *thd);
virtual Item *negated_item();
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
bool subst_argument_checker(uchar **arg) { return TRUE; }
};
@@ -367,7 +368,6 @@ public:
enum Functype functype() const { return NOT_FUNC; }
const char *func_name() const { return "not"; }
Item *neg_transformer(THD *thd);
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
void print(String *str);
};
@@ -598,7 +598,6 @@ public:
bool is_bool_func() { return 1; }
CHARSET_INFO *compare_collation() { return cmp_collation.collation; }
uint decimal_precision() const { return 1; }
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -610,7 +609,6 @@ public:
optimize_type select_optimize() const { return OPTIMIZE_NONE; }
const char *func_name() const { return "strcmp"; }
void print(String *str) { Item_func::print(str); }
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -673,7 +671,6 @@ public:
const char *func_name() const { return "ifnull"; }
Field *tmp_table_field(TABLE *table);
uint decimal_precision() const;
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -714,7 +711,6 @@ public:
void print(String *str) { Item_func::print(str); }
table_map not_null_tables() const { return 0; }
bool is_null();
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
/* Functions to handle the optimized IN */
@@ -1141,7 +1137,6 @@ public:
void print(String *str);
Item *find_item(String *str);
CHARSET_INFO *compare_collation() { return cmp_collation.collation; }
- bool check_partition_func_processor(uchar *bool_arg) { return FALSE;}
void cleanup();
};
@@ -1211,7 +1206,6 @@ public:
bool nulls_in_row();
bool is_bool_func() { return 1; }
CHARSET_INFO *compare_collation() { return cmp_collation.collation; }
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
class cmp_item_row :public cmp_item
@@ -1283,7 +1277,6 @@ public:
optimize_type select_optimize() const { return OPTIMIZE_NULL; }
Item *neg_transformer(THD *thd);
CHARSET_INFO *compare_collation() { return args[0]->collation.collation; }
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
/* Functions used by HAVING for rewriting IN subquery */
@@ -1310,7 +1303,6 @@ public:
*/
table_map used_tables() const
{ return used_tables_cache | RAND_TABLE_BIT; }
- bool check_partition_func_processor(uchar *int_arg) {return TRUE;}
};
@@ -1333,7 +1325,6 @@ public:
void print(String *str);
CHARSET_INFO *compare_collation() { return args[0]->collation.collation; }
void top_level_item() { abort_on_null=1; }
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -1372,7 +1363,6 @@ public:
const char *func_name() const { return "like"; }
bool fix_fields(THD *thd, Item **ref);
void cleanup();
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
#ifdef USE_REGEX
@@ -1395,7 +1385,6 @@ public:
const char *func_name() const { return "regexp"; }
void print(String *str) { print_op(str); }
CHARSET_INFO *compare_collation() { return cmp_collation.collation; }
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
#else
@@ -1452,7 +1441,6 @@ public:
Item *transform(Item_transformer transformer, uchar *arg);
void traverse_cond(Cond_traverser, void *arg, traverse_order order);
void neg_arguments(THD *thd);
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
bool subst_argument_checker(uchar **arg) { return TRUE; }
Item *compile(Item_analyzer analyzer, uchar **arg_p,
Item_transformer transformer, uchar *arg_t);
diff --git a/sql/item_create.cc b/sql/item_create.cc
index 20041b1176a..fa15b992e5c 100644
--- a/sql/item_create.cc
+++ b/sql/item_create.cc
@@ -2326,7 +2326,7 @@ Item*
Create_qfunc::create(THD *thd, LEX_STRING name, List<Item> *item_list)
{
LEX_STRING db;
- if (thd->copy_db_to(&db.str, &db.length))
+ if (thd->lex->copy_db_to(&db.str, &db.length))
return NULL;
return create(thd, db, name, false, item_list);
@@ -5039,6 +5039,18 @@ create_func_cast(THD *thd, Item *a, Cast_target cast_type,
my_error(ER_M_BIGGER_THAN_D, MYF(0), "");
return 0;
}
+ if (len > DECIMAL_MAX_PRECISION)
+ {
+ my_error(ER_TOO_BIG_PRECISION, MYF(0), len, a->name,
+ DECIMAL_MAX_PRECISION);
+ return 0;
+ }
+ if (dec > DECIMAL_MAX_SCALE)
+ {
+ my_error(ER_TOO_BIG_SCALE, MYF(0), dec, a->name,
+ DECIMAL_MAX_SCALE);
+ return 0;
+ }
res= new (thd->mem_root) Item_decimal_typecast(a, len, dec);
break;
}
diff --git a/sql/item_func.h b/sql/item_func.h
index 8fc68f93e12..568effb2f63 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -253,7 +253,6 @@ public:
void fix_num_length_and_dec();
void find_num_type();
String *str_op(String *str) { DBUG_ASSERT(0); return 0; }
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -311,7 +310,6 @@ public:
{ max_length=args[0]->max_length; unsigned_flag=0; }
void print(String *str);
uint decimal_precision() const { return args[0]->decimal_precision(); }
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -345,7 +343,6 @@ public:
void fix_length_and_dec() {};
const char *func_name() const { return "decimal_typecast"; }
void print(String *);
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -442,6 +439,7 @@ public:
void fix_length_and_dec();
void fix_num_length_and_dec();
uint decimal_precision() const { return args[0]->decimal_precision(); }
+ bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -454,6 +452,7 @@ public:
my_decimal *decimal_op(my_decimal *);
const char *func_name() const { return "abs"; }
void fix_length_and_dec();
+ bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
// A class to handle logarithmic and trigonometric functions
@@ -488,7 +487,6 @@ public:
Item_func_exp(Item *a) :Item_dec_func(a) {}
double val_real();
const char *func_name() const { return "exp"; }
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -498,7 +496,6 @@ public:
Item_func_ln(Item *a) :Item_dec_func(a) {}
double val_real();
const char *func_name() const { return "ln"; }
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -509,7 +506,6 @@ public:
Item_func_log(Item *a,Item *b) :Item_dec_func(a,b) {}
double val_real();
const char *func_name() const { return "log"; }
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -519,7 +515,6 @@ public:
Item_func_log2(Item *a) :Item_dec_func(a) {}
double val_real();
const char *func_name() const { return "log2"; }
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -529,7 +524,6 @@ public:
Item_func_log10(Item *a) :Item_dec_func(a) {}
double val_real();
const char *func_name() const { return "log10"; }
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -539,7 +533,6 @@ public:
Item_func_sqrt(Item *a) :Item_dec_func(a) {}
double val_real();
const char *func_name() const { return "sqrt"; }
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -549,7 +542,6 @@ public:
Item_func_pow(Item *a,Item *b) :Item_dec_func(a,b) {}
double val_real();
const char *func_name() const { return "pow"; }
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -559,7 +551,6 @@ public:
Item_func_acos(Item *a) :Item_dec_func(a) {}
double val_real();
const char *func_name() const { return "acos"; }
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
class Item_func_asin :public Item_dec_func
@@ -568,7 +559,6 @@ public:
Item_func_asin(Item *a) :Item_dec_func(a) {}
double val_real();
const char *func_name() const { return "asin"; }
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
class Item_func_atan :public Item_dec_func
@@ -578,7 +568,6 @@ public:
Item_func_atan(Item *a,Item *b) :Item_dec_func(a,b) {}
double val_real();
const char *func_name() const { return "atan"; }
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
class Item_func_cos :public Item_dec_func
@@ -587,7 +576,6 @@ public:
Item_func_cos(Item *a) :Item_dec_func(a) {}
double val_real();
const char *func_name() const { return "cos"; }
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
class Item_func_sin :public Item_dec_func
@@ -596,7 +584,6 @@ public:
Item_func_sin(Item *a) :Item_dec_func(a) {}
double val_real();
const char *func_name() const { return "sin"; }
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
class Item_func_tan :public Item_dec_func
@@ -605,7 +592,6 @@ public:
Item_func_tan(Item *a) :Item_dec_func(a) {}
double val_real();
const char *func_name() const { return "tan"; }
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
class Item_func_integer :public Item_int_func
@@ -633,6 +619,7 @@ public:
longlong int_op();
double real_op();
my_decimal *decimal_op(my_decimal *);
+ bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -644,6 +631,7 @@ public:
longlong int_op();
double real_op();
my_decimal *decimal_op(my_decimal *);
+ bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
/* This handles round and truncate */
@@ -684,7 +672,6 @@ public:
Item_func_sign(Item *a) :Item_int_func(a) {}
const char *func_name() const { return "sign"; }
longlong val_int();
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -699,7 +686,6 @@ public:
const char *func_name() const { return name; }
void fix_length_and_dec()
{ decimals= NOT_FIXED_DEC; max_length= float_length(decimals); }
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -725,7 +711,6 @@ public:
void fix_length_and_dec();
enum Item_result result_type () const { return cmp_type; }
bool result_as_longlong() { return compare_as_dates; };
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
uint cmp_datetimes(ulonglong *value);
};
@@ -781,7 +766,6 @@ public:
longlong val_int();
const char *func_name() const { return "length"; }
void fix_length_and_dec() { max_length=10; }
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
class Item_func_bit_length :public Item_func_length
@@ -801,7 +785,6 @@ public:
longlong val_int();
const char *func_name() const { return "char_length"; }
void fix_length_and_dec() { max_length=10; }
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
class Item_func_coercibility :public Item_int_func
@@ -825,7 +808,6 @@ public:
longlong val_int();
void fix_length_and_dec();
void print(String *str);
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -850,7 +832,6 @@ public:
longlong val_int();
const char *func_name() const { return "ascii"; }
void fix_length_and_dec() { max_length=3; }
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
class Item_func_ord :public Item_int_func
@@ -860,7 +841,6 @@ public:
Item_func_ord(Item *a) :Item_int_func(a) {}
longlong val_int();
const char *func_name() const { return "ord"; }
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
class Item_func_find_in_set :public Item_int_func
@@ -874,7 +854,6 @@ public:
longlong val_int();
const char *func_name() const { return "find_in_set"; }
void fix_length_and_dec();
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
/* Base class for all bit functions: '~', '|', '^', '&', '>>', '<<' */
@@ -886,7 +865,6 @@ public:
Item_func_bit(Item *a) :Item_int_func(a) {}
void fix_length_and_dec() { unsigned_flag= 1; }
void print(String *str) { print_op(str); }
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
class Item_func_bit_or :public Item_func_bit
@@ -912,7 +890,6 @@ public:
longlong val_int();
const char *func_name() const { return "bit_count"; }
void fix_length_and_dec() { max_length=2; }
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
class Item_func_shift_left :public Item_func_bit
@@ -1363,7 +1340,6 @@ public:
longlong val_int();
const char *func_name() const { return "inet_aton"; }
void fix_length_and_dec() { decimals= 0; max_length= 21; maybe_null= 1; unsigned_flag= 1;}
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index a376504512f..d54b9961562 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -25,7 +25,7 @@
#include "mysql_priv.h"
#include <m_ctype.h>
-#include "md5.h"
+#include "my_md5.h"
#include "sha1.h"
#include "my_aes.h"
#include <zlib.h>
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h
index c036ec490db..6d2d9c199c9 100644
--- a/sql/item_strfunc.h
+++ b/sql/item_strfunc.h
@@ -50,7 +50,6 @@ public:
String *val_str(String *);
void fix_length_and_dec();
const char *func_name() const { return "md5"; }
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -94,7 +93,6 @@ public:
String *val_str(String *);
void fix_length_and_dec();
const char *func_name() const { return "concat"; }
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
class Item_func_concat_ws :public Item_str_func
@@ -116,7 +114,6 @@ public:
String *val_str(String *);
void fix_length_and_dec();
const char *func_name() const { return "reverse"; }
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -154,7 +151,6 @@ protected:
public:
Item_str_conv(Item *item) :Item_str_func(item) {}
String *val_str(String *);
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -455,7 +451,6 @@ public:
String *val_str(String *);
void fix_length_and_dec();
const char *func_name() const { return "soundex"; }
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -549,7 +544,6 @@ public:
String *val_str(String *);
void fix_length_and_dec();
const char *func_name() const { return "rpad"; }
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -562,7 +556,6 @@ public:
String *val_str(String *);
void fix_length_and_dec();
const char *func_name() const { return "lpad"; }
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -577,7 +570,6 @@ public:
collation.set(default_charset());
max_length= 64;
}
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -594,7 +586,6 @@ public:
decimals=0;
max_length=args[0]->max_length*2*collation.collation->mbmaxlen;
}
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
class Item_func_unhex :public Item_str_func
@@ -614,7 +605,6 @@ public:
decimals=0;
max_length=(1+args[0]->max_length)/2;
}
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -638,7 +628,6 @@ public:
}
void print(String *str);
const char *func_name() const { return "cast_as_binary"; }
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -678,7 +667,6 @@ public:
String* val_str(String* str);
const char *func_name() const { return "inet_ntoa"; }
void fix_length_and_dec() { decimals = 0; max_length=3*8+7; }
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
class Item_func_quote :public Item_str_func
@@ -693,7 +681,6 @@ public:
collation.set(args[0]->collation);
max_length= args[0]->max_length * 2 + 2;
}
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
class Item_func_conv_charset :public Item_str_func
@@ -794,7 +781,6 @@ public:
const char *func_name() const { return "crc32"; }
void fix_length_and_dec() { max_length=10; }
longlong val_int();
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
class Item_func_uncompressed_length : public Item_int_func
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 0fa46d231a9..8fe843a2a2d 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -3089,6 +3089,7 @@ Item_func_group_concat::Item_func_group_concat(THD *thd,
original(item)
{
quick_group= item->quick_group;
+ result.set_charset(collation.collation);
}
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index 95ff7dfd336..a87efa9e68c 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -2534,11 +2534,8 @@ longlong Item_date_typecast::val_int()
{
DBUG_ASSERT(fixed == 1);
MYSQL_TIME ltime;
- if (args[0]->get_date(&ltime, TIME_FUZZY_DATE))
- {
- null_value= 1;
+ if ((null_value= args[0]->get_date(&ltime, TIME_FUZZY_DATE)))
return 0;
- }
return (longlong) (ltime.year * 10000L + ltime.month * 100 + ltime.day);
}
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h
index bd0954e6bdb..32f5bcf8e52 100644
--- a/sql/item_timefunc.h
+++ b/sql/item_timefunc.h
@@ -38,7 +38,6 @@ public:
{
max_length=6*MY_CHARSET_BIN_MB_MAXLEN;
}
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -53,7 +52,6 @@ public:
decimals=0;
max_length=6*MY_CHARSET_BIN_MB_MAXLEN;
}
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -129,6 +127,7 @@ public:
max_length=10*my_charset_bin.mbmaxlen;
maybe_null=1;
}
+ bool check_partition_func_processor(uchar *int_arg) {return TRUE;}
};
@@ -224,7 +223,6 @@ public:
max_length=2*MY_CHARSET_BIN_MB_MAXLEN;
maybe_null=1;
}
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
class Item_func_yearweek :public Item_int_func
@@ -303,6 +301,7 @@ class Item_func_dayname :public Item_func_weekday
max_length=9*MY_CHARSET_BIN_MB_MAXLEN;
maybe_null=1;
}
+ bool check_partition_func_processor(uchar *int_arg) {return TRUE;}
};
@@ -319,7 +318,6 @@ public:
decimals=0;
max_length=10*MY_CHARSET_BIN_MB_MAXLEN;
}
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -603,7 +601,6 @@ public:
void fix_length_and_dec();
uint format_length(const String *format);
bool eq(const Item *item, bool binary_cmp) const;
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -617,7 +614,6 @@ class Item_func_from_unixtime :public Item_date_func
const char *func_name() const { return "from_unixtime"; }
void fix_length_and_dec();
bool get_date(MYSQL_TIME *res, uint fuzzy_date);
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -676,7 +672,6 @@ public:
}
const char *func_name() const { return "sec_to_time"; }
bool result_as_longlong() { return TRUE; }
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -698,7 +693,6 @@ public:
bool get_date(MYSQL_TIME *res, uint fuzzy_date);
bool eq(const Item *item, bool binary_cmp) const;
void print(String *str);
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -753,7 +747,6 @@ public:
max_length=args[0]->max_length;
maybe_null= 1;
}
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -773,7 +766,6 @@ public:
String *val_str(String *a);
void fix_length_and_dec();
void print(String *str);
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -884,7 +876,6 @@ public:
max_length=MAX_DATE_WIDTH*MY_CHARSET_BIN_MB_MAXLEN;
}
longlong val_int();
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -907,7 +898,6 @@ public:
}
void print(String *str);
const char *func_name() const { return "add_time"; }
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
double val_real() { return val_real_from_decimal(); }
my_decimal *val_decimal(my_decimal *decimal_value)
{
@@ -949,7 +939,6 @@ public:
:Item_str_timefunc(a, b ,c) {}
String *val_str(String *str);
const char *func_name() const { return "maketime"; }
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
class Item_func_microsecond :public Item_int_func
@@ -981,7 +970,6 @@ public:
maybe_null=1;
}
void print(String *str);
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
@@ -1028,7 +1016,6 @@ public:
{
return tmp_table_field_from_field_type(table, 1);
}
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
diff --git a/sql/item_xmlfunc.h b/sql/item_xmlfunc.h
index 650893fa7bd..278c98baf7c 100644
--- a/sql/item_xmlfunc.h
+++ b/sql/item_xmlfunc.h
@@ -41,7 +41,6 @@ public:
Item_func_xml_extractvalue(Item *a,Item *b) :Item_xml_str_func(a,b) {}
const char *func_name() const { return "extractvalue"; }
String *val_str(String *);
- bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
};
diff --git a/sql/lock.cc b/sql/lock.cc
index 50922a682a2..4260a031def 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -1033,6 +1033,102 @@ end:
}
+/**
+ @brief Lock all tables in list with an exclusive table name lock.
+
+ @param thd Thread handle.
+ @param table_list Names of tables to lock.
+
+ @note This function needs to be protected by LOCK_open. If we're
+ under LOCK TABLES, this function does not work as advertised. Namely,
+ it does not exclude other threads from using this table and does not
+ put an exclusive name lock on this table into the table cache.
+
+ @see lock_table_names
+ @see unlock_table_names
+
+ @retval TRUE An error occured.
+ @retval FALSE Name lock successfully acquired.
+*/
+
+bool lock_table_names_exclusively(THD *thd, TABLE_LIST *table_list)
+{
+ if (lock_table_names(thd, table_list))
+ return TRUE;
+
+ /*
+ Upgrade the table name locks from semi-exclusive to exclusive locks.
+ */
+ for (TABLE_LIST *table= table_list; table; table= table->next_global)
+ {
+ if (table->table)
+ table->table->open_placeholder= 1;
+ }
+ return FALSE;
+}
+
+
+/**
+ @brief Test is 'table' is protected by an exclusive name lock.
+
+ @param[in] thd The current thread handler
+ @param[in] table Table container containing the single table to be tested
+
+ @note Needs to be protected by LOCK_open mutex.
+
+ @return Error status code
+ @retval TRUE Table is protected
+ @retval FALSE Table is not protected
+*/
+
+bool
+is_table_name_exclusively_locked_by_this_thread(THD *thd,
+ TABLE_LIST *table_list)
+{
+ char key[MAX_DBKEY_LENGTH];
+ uint key_length;
+
+ key_length= create_table_def_key(thd, key, table_list, 0);
+
+ return is_table_name_exclusively_locked_by_this_thread(thd, (uchar *)key,
+ key_length);
+}
+
+
+/**
+ @brief Test is 'table key' is protected by an exclusive name lock.
+
+ @param[in] thd The current thread handler.
+ @param[in] table Table container containing the single table to be tested.
+
+ @note Needs to be protected by LOCK_open mutex
+
+ @retval TRUE Table is protected
+ @retval FALSE Table is not protected
+ */
+
+bool
+is_table_name_exclusively_locked_by_this_thread(THD *thd, uchar *key,
+ int key_length)
+{
+ HASH_SEARCH_STATE state;
+ TABLE *table;
+
+ for (table= (TABLE*) hash_first(&open_cache, key,
+ key_length, &state);
+ table ;
+ table= (TABLE*) hash_next(&open_cache, key,
+ key_length, &state))
+ {
+ if (table->in_use == thd &&
+ table->open_placeholder == 1 &&
+ table->s->version == 0)
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
/*
Unlock all tables in list with a name lock
diff --git a/sql/log.cc b/sql/log.cc
index 6dc204265b0..0bf77d68410 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -1445,7 +1445,7 @@ static int binlog_close_connection(handlerton *hton, THD *thd)
{
binlog_trx_data *const trx_data=
(binlog_trx_data*) thd->ha_data[binlog_hton->slot];
- DBUG_ASSERT(mysql_bin_log.is_open() && trx_data->empty());
+ DBUG_ASSERT(trx_data->empty());
thd->ha_data[binlog_hton->slot]= 0;
trx_data->~binlog_trx_data();
my_free((uchar*)trx_data, MYF(0));
@@ -1570,7 +1570,6 @@ static int binlog_commit(handlerton *hton, THD *thd, bool all)
DBUG_ENTER("binlog_commit");
binlog_trx_data *const trx_data=
(binlog_trx_data*) thd->ha_data[binlog_hton->slot];
- DBUG_ASSERT(mysql_bin_log.is_open());
if (trx_data->empty())
{
@@ -1598,7 +1597,6 @@ static int binlog_rollback(handlerton *hton, THD *thd, bool all)
int error=0;
binlog_trx_data *const trx_data=
(binlog_trx_data*) thd->ha_data[binlog_hton->slot];
- DBUG_ASSERT(mysql_bin_log.is_open());
if (trx_data->empty()) {
trx_data->reset();
@@ -1659,7 +1657,6 @@ static int binlog_savepoint_set(handlerton *hton, THD *thd, void *sv)
static int binlog_savepoint_rollback(handlerton *hton, THD *thd, void *sv)
{
DBUG_ENTER("binlog_savepoint_rollback");
- DBUG_ASSERT(mysql_bin_log.is_open());
/*
Write ROLLBACK TO SAVEPOINT to the binlog cache if we have updated some
@@ -3945,13 +3942,120 @@ int MYSQL_BIN_LOG::write_cache(IO_CACHE *cache, bool lock_log, bool sync_log)
if (reinit_io_cache(cache, READ_CACHE, 0, 0, 0))
return ER_ERROR_ON_WRITE;
- uint bytes= my_b_bytes_in_cache(cache);
+ uint length= my_b_bytes_in_cache(cache), group, carry, hdr_offs;
+ long val;
+ uchar header[LOG_EVENT_HEADER_LEN];
+
+ /*
+ The events in the buffer have incorrect end_log_pos data
+ (relative to beginning of group rather than absolute),
+ so we'll recalculate them in situ so the binlog is always
+ correct, even in the middle of a group. This is possible
+ because we now know the start position of the group (the
+ offset of this cache in the log, if you will); all we need
+ to do is to find all event-headers, and add the position of
+ the group to the end_log_pos of each event. This is pretty
+ straight forward, except that we read the cache in segments,
+ so an event-header might end up on the cache-border and get
+ split.
+ */
+
+ group= (uint)my_b_tell(&log_file);
+ hdr_offs= carry= 0;
+
do
{
- if (my_b_write(&log_file, cache->read_pos, bytes))
+
+ /*
+ if we only got a partial header in the last iteration,
+ get the other half now and process a full header.
+ */
+ if (unlikely(carry > 0))
+ {
+ DBUG_ASSERT(carry < LOG_EVENT_HEADER_LEN);
+
+ /* assemble both halves */
+ memcpy(&header[carry], (char *)cache->read_pos, LOG_EVENT_HEADER_LEN - carry);
+
+ /* fix end_log_pos */
+ val= uint4korr(&header[LOG_POS_OFFSET]) + group;
+ int4store(&header[LOG_POS_OFFSET], val);
+
+ /* write the first half of the split header */
+ if (my_b_write(&log_file, header, carry))
+ return ER_ERROR_ON_WRITE;
+
+ /*
+ copy fixed second half of header to cache so the correct
+ version will be written later.
+ */
+ memcpy((char *)cache->read_pos, &header[carry], LOG_EVENT_HEADER_LEN - carry);
+
+ /* next event header at ... */
+ hdr_offs = uint4korr(&header[EVENT_LEN_OFFSET]) - carry;
+
+ carry= 0;
+ }
+
+ /* if there is anything to write, process it. */
+
+ if (likely(length > 0))
+ {
+ /*
+ process all event-headers in this (partial) cache.
+ if next header is beyond current read-buffer,
+ we'll get it later (though not necessarily in the
+ very next iteration, just "eventually").
+ */
+
+ while (hdr_offs < length)
+ {
+ /*
+ partial header only? save what we can get, process once
+ we get the rest.
+ */
+
+ if (hdr_offs + LOG_EVENT_HEADER_LEN > length)
+ {
+ carry= length - hdr_offs;
+ memcpy(header, (char *)cache->read_pos + hdr_offs, carry);
+ length= hdr_offs;
+ }
+ else
+ {
+ /* we've got a full event-header, and it came in one piece */
+
+ uchar *log_pos= (uchar *)cache->read_pos + hdr_offs + LOG_POS_OFFSET;
+
+ /* fix end_log_pos */
+ val= uint4korr(log_pos) + group;
+ int4store(log_pos, val);
+
+ /* next event header at ... */
+ log_pos= (uchar *)cache->read_pos + hdr_offs + EVENT_LEN_OFFSET;
+ hdr_offs += uint4korr(log_pos);
+
+ }
+ }
+
+ /*
+ Adjust hdr_offs. Note that it may still point beyond the segment
+ read in the next iteration; if the current event is very long,
+ it may take a couple of read-iterations (and subsequent adjustments
+ of hdr_offs) for it to point into the then-current segment.
+ If we have a split header (!carry), hdr_offs will be set at the
+ beginning of the next iteration, overwriting the value we set here:
+ */
+ hdr_offs -= length;
+ }
+
+ /* Write data to the binary log file */
+ if (my_b_write(&log_file, cache->read_pos, length))
return ER_ERROR_ON_WRITE;
- cache->read_pos= cache->read_end;
- } while ((bytes= my_b_fill(cache)));
+ cache->read_pos=cache->read_end; // Mark buffer used up
+ } while ((length= my_b_fill(cache)));
+
+ DBUG_ASSERT(carry == 0);
if (sync_log)
flush_and_sync();
@@ -4028,7 +4132,7 @@ bool MYSQL_BIN_LOG::write(THD *thd, IO_CACHE *cache, Log_event *commit_event)
if ((write_error= write_cache(cache, false, false)))
goto err;
-
+
if (commit_event && commit_event->write(&log_file))
goto err;
if (flush_and_sync())
@@ -5140,6 +5244,29 @@ err1:
return 1;
}
+
+#ifdef INNODB_COMPATIBILITY_HOOKS
+/**
+ Get the file name of the MySQL binlog.
+ @return the name of the binlog file
+*/
+extern "C"
+const char* mysql_bin_log_file_name(void)
+{
+ return mysql_bin_log.get_log_fname();
+}
+/**
+ Get the current position of the MySQL binlog.
+ @return byte offset from the beginning of the binlog
+*/
+extern "C"
+ulonglong mysql_bin_log_file_pos(void)
+{
+ return (ulonglong) mysql_bin_log.get_log_file()->pos_in_file;
+}
+#endif /* INNODB_COMPATIBILITY_HOOKS */
+
+
struct st_mysql_storage_engine binlog_storage_engine=
{ MYSQL_HANDLERTON_INTERFACE_VERSION };
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 89a126a74c5..dc492d08c10 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -6109,8 +6109,9 @@ int Rows_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
default:
rli->report(ERROR_LEVEL, thd->net.last_errno,
- "Error in %s event: row application failed",
- get_type_str());
+ "Error in %s event: row application failed. %s",
+ get_type_str(),
+ thd->net.last_error ? thd->net.last_error : "");
thd->query_error= 1;
break;
}
@@ -6131,9 +6132,10 @@ int Rows_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
{ /* error has occured during the transaction */
rli->report(ERROR_LEVEL, thd->net.last_errno,
"Error in %s event: error during transaction execution "
- "on table %s.%s",
+ "on table %s.%s. %s",
get_type_str(), table->s->db.str,
- table->s->table_name.str);
+ table->s->table_name.str,
+ thd->net.last_error ? thd->net.last_error : "");
/*
If one day we honour --skip-slave-errors in row-based replication, and
@@ -7097,7 +7099,12 @@ replace_record(THD *thd, TABLE *table,
}
if ((keynum= table->file->get_dup_key(error)) < 0)
{
- /* We failed to retrieve the duplicate key */
+ table->file->print_error(error, MYF(0));
+ /*
+ We failed to retrieve the duplicate key
+ - either because the error was not "duplicate key" error
+ - or because the information which key is not available
+ */
DBUG_RETURN(error);
}
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index ae7c4ca5f3f..7b7bc81957e 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -98,7 +98,7 @@ char* query_table_status(THD *thd,const char *db,const char *table_name);
DBUG_ASSERT(strncmp(Ver, MYSQL_SERVER_VERSION, sizeof(Ver)-1) > 0); \
if (((uchar*)Thd) != NULL) \
push_warning_printf(((THD *)Thd), MYSQL_ERROR::WARN_LEVEL_WARN, \
- ER_WARN_DEPRECATED_SYNTAX, ER(ER_WARN_DEPRECATED_SYNTAX), \
+ ER_WARN_DEPRECATED_SYNTAX, ER(ER_WARN_DEPRECATED_SYNTAX_WITH_VER), \
(Old), (Ver), (New)); \
else \
sql_print_warning("The syntax '%s' is deprecated and will be removed " \
@@ -531,9 +531,9 @@ void debug_sync_point(const char* lock_name, uint lock_timeout);
#define SHOW_LOG_STATUS_FREE "FREE"
#define SHOW_LOG_STATUS_INUSE "IN USE"
-struct st_table_list;
+struct TABLE_LIST;
class String;
-void view_store_options(THD *thd, st_table_list *table, String *buff);
+void view_store_options(THD *thd, TABLE_LIST *table, String *buff);
/* Options to add_table_to_list() */
#define TL_OPTION_UPDATING 1
@@ -574,6 +574,13 @@ enum enum_parsing_place
struct st_table;
class THD;
+enum enum_check_fields
+{
+ CHECK_FIELD_IGNORE,
+ CHECK_FIELD_WARN,
+ CHECK_FIELD_ERROR_FOR_NULL
+};
+
/* Struct to handle simple linked lists */
typedef struct st_sql_list {
@@ -712,6 +719,26 @@ bool end_active_trans(THD *thd);
int end_trans(THD *thd, enum enum_mysql_completiontype completion);
Item *negate_expression(THD *thd, Item *expr);
+
+/* log.cc */
+int vprint_msg_to_log(enum loglevel level, const char *format, va_list args);
+void sql_print_error(const char *format, ...) ATTRIBUTE_FORMAT(printf, 1, 2);
+void sql_print_warning(const char *format, ...) ATTRIBUTE_FORMAT(printf, 1, 2);
+void sql_print_information(const char *format, ...)
+ ATTRIBUTE_FORMAT(printf, 1, 2);
+typedef void (*sql_print_message_func)(const char *format, ...)
+ ATTRIBUTE_FORMAT(printf, 1, 2);
+extern sql_print_message_func sql_print_message_handlers[];
+
+int error_log_print(enum loglevel level, const char *format,
+ va_list args);
+
+bool slow_log_print(THD *thd, const char *query, uint query_length,
+ time_t query_start_arg);
+
+bool general_log_print(THD *thd, enum enum_server_command command,
+ const char *format,...);
+
#include "sql_class.h"
#include "sql_acl.h"
#include "tztime.h"
@@ -901,10 +928,7 @@ void mysql_client_binlog_statement(THD *thd);
bool mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists,
my_bool drop_temporary);
int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
- bool drop_temporary, bool drop_view, bool log_query);
-int mysql_rm_table_part2_with_lock(THD *thd, TABLE_LIST *tables,
- bool if_exists, bool drop_temporary,
- bool log_query);
+ bool drop_temporary, bool drop_view, bool log_query);
bool quick_rm_table(handlerton *base,const char *db,
const char *table_name, uint flags);
void close_cached_table(THD *thd, TABLE *table);
@@ -1175,7 +1199,11 @@ bool mysqld_show_open_tables(THD *thd,const char *wild);
bool mysqld_show_logs(THD *thd);
void append_identifier(THD *thd, String *packet, const char *name,
uint length);
+#endif /* MYSQL_SERVER */
+#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
int get_quote_char_for_identifier(THD *thd, const char *name, uint length);
+#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
+#ifdef MYSQL_SERVER
void mysqld_list_fields(THD *thd,TABLE_LIST *table, const char *wild);
int mysqld_dump_create_info(THD *thd, TABLE_LIST *table_list, int fd);
bool mysqld_show_create(THD *thd, TABLE_LIST *table_list);
@@ -1204,9 +1232,6 @@ void reset_status_vars();
/* information schema */
extern LEX_STRING INFORMATION_SCHEMA_NAME;
extern const LEX_STRING partition_keywords[];
-LEX_STRING *make_lex_string(THD *thd, LEX_STRING *lex_str,
- const char* str, uint length,
- bool allocate_lex_string);
ST_SCHEMA_TABLE *find_schema_table(THD *thd, const char* table_name);
ST_SCHEMA_TABLE *get_schema_table(enum enum_schema_tables schema_table_idx);
int prepare_schema_table(THD *thd, LEX *lex, Table_ident *table_ident,
@@ -1367,7 +1392,7 @@ bool close_thread_table(THD *thd, TABLE **table_ptr);
void close_temporary_tables(THD *thd);
void close_tables_for_reopen(THD *thd, TABLE_LIST **tables);
TABLE_LIST *find_table_in_list(TABLE_LIST *table,
- st_table_list *TABLE_LIST::*link,
+ TABLE_LIST *TABLE_LIST::*link,
const char *db_name,
const char *table_name);
TABLE_LIST *unique_table(THD *thd, TABLE_LIST *table, TABLE_LIST *table_list,
@@ -1612,25 +1637,6 @@ bool init_errmessage(void);
#endif /* MYSQL_SERVER */
void sql_perror(const char *message);
-
-int vprint_msg_to_log(enum loglevel level, const char *format, va_list args);
-void sql_print_error(const char *format, ...) ATTRIBUTE_FORMAT(printf, 1, 2);
-void sql_print_warning(const char *format, ...) ATTRIBUTE_FORMAT(printf, 1, 2);
-void sql_print_information(const char *format, ...)
- ATTRIBUTE_FORMAT(printf, 1, 2);
-typedef void (*sql_print_message_func)(const char *format, ...)
- ATTRIBUTE_FORMAT(printf, 1, 2);
-extern sql_print_message_func sql_print_message_handlers[];
-
-int error_log_print(enum loglevel level, const char *format,
- va_list args);
-
-bool slow_log_print(THD *thd, const char *query, uint query_length,
- time_t query_start_arg);
-
-bool general_log_print(THD *thd, enum enum_server_command command,
- const char *format,...);
-
bool fn_format_relative_to_data_home(char * to, const char *name,
const char *dir, const char *extension);
#ifdef MYSQL_SERVER
@@ -1684,9 +1690,14 @@ extern int creating_table; // How many mysql_create_table() are running
*/
extern time_t server_start_time;
+#endif /* MYSQL_SERVER */
+#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
extern uint mysql_data_home_len;
extern char *mysql_data_home,server_version[SERVER_VERSION_LENGTH],
- mysql_real_data_home[], *opt_mysql_tmpdir, mysql_charsets_dir[],
+ mysql_real_data_home[];
+#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
+#ifdef MYSQL_SERVER
+extern char *opt_mysql_tmpdir, mysql_charsets_dir[],
def_ft_boolean_syntax[sizeof(ft_boolean_syntax)];
#define mysql_tmpdir (my_tmpdir(&mysql_tmpdir_list))
extern MY_TMPDIR mysql_tmpdir_list;
@@ -1703,8 +1714,13 @@ extern Gt_creator gt_creator;
extern Lt_creator lt_creator;
extern Ge_creator ge_creator;
extern Le_creator le_creator;
-extern char language[FN_REFLEN], reg_ext[FN_EXTLEN];
+extern char language[FN_REFLEN];
+#endif /* MYSQL_SERVER */
+#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
+extern char reg_ext[FN_EXTLEN];
extern uint reg_ext_length;
+#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
+#ifdef MYSQL_SERVER
extern char glob_hostname[FN_REFLEN], mysql_home[FN_REFLEN];
extern char pidfile_name[FN_REFLEN], system_time_zone[30], *opt_init_file;
extern char log_error_file[FN_REFLEN], *opt_tc_log_file;
@@ -1733,17 +1749,32 @@ extern ulong max_binlog_size, max_relay_log_size;
extern ulong opt_binlog_rows_event_max_size;
extern ulong rpl_recovery_rank, thread_cache_size, thread_pool_size;
extern ulong back_log;
-extern ulong specialflag, current_pid;
+#endif /* MYSQL_SERVER */
+#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
+extern ulong specialflag;
+#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
+#ifdef MYSQL_SERVER
+extern ulong current_pid;
extern ulong expire_logs_days, sync_binlog_period, sync_binlog_counter;
extern ulong opt_tc_log_size, tc_log_max_pages_used, tc_log_page_size;
extern ulong tc_log_page_waits;
extern my_bool relay_log_purge, opt_innodb_safe_binlog, opt_innodb;
extern uint test_flags,select_errors,ha_open_options;
extern uint protocol_version, mysqld_port, dropping_tables;
-extern uint delay_key_write_options, lower_case_table_names;
+extern uint delay_key_write_options;
+#endif /* MYSQL_SERVER */
+#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
+extern uint lower_case_table_names;
+#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
+#ifdef MYSQL_SERVER
extern bool opt_endinfo, using_udf_functions;
extern my_bool locked_in_memory;
-extern bool opt_using_transactions, mysqld_embedded;
+extern bool opt_using_transactions;
+#endif /* MYSQL_SERVER */
+#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
+extern bool mysqld_embedded;
+#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
+#ifdef MYSQL_SERVER
extern bool using_update_log, opt_large_files, server_id_supplied;
extern bool opt_update_log, opt_bin_log, opt_error_log;
extern my_bool opt_log, opt_slow_log;
@@ -1767,8 +1798,12 @@ extern uint opt_crash_binlog_innodb;
extern char *shared_memory_base_name, *mysqld_unix_port;
extern my_bool opt_enable_shared_memory;
extern char *default_tz_name;
+#endif /* MYSQL_SERVER */
+#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
extern my_bool opt_large_pages;
extern uint opt_large_page_size;
+#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
+#ifdef MYSQL_SERVER
extern char *opt_logname, *opt_slow_logname;
extern const char *log_output_str;
@@ -1804,7 +1839,11 @@ extern MY_BITMAP temp_pool;
extern String my_empty_string;
extern const String my_null_string;
extern SHOW_VAR status_vars[];
+#endif /* MYSQL_SERVER */
+#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
extern struct system_variables global_system_variables;
+#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
+#ifdef MYSQL_SERVER
extern struct system_variables max_system_variables;
extern struct system_status_var global_status_var;
extern struct rand_struct sql_rand;
@@ -1882,6 +1921,11 @@ bool wait_for_locked_table_names(THD *thd, TABLE_LIST *table_list);
bool lock_table_names(THD *thd, TABLE_LIST *table_list);
void unlock_table_names(THD *thd, TABLE_LIST *table_list,
TABLE_LIST *last_table);
+bool lock_table_names_exclusively(THD *thd, TABLE_LIST *table_list);
+bool is_table_name_exclusively_locked_by_this_thread(THD *thd,
+ TABLE_LIST *table_list);
+bool is_table_name_exclusively_locked_by_this_thread(THD *thd, uchar *key,
+ int key_length);
/* old unireg functions */
@@ -2002,10 +2046,14 @@ int wild_case_compare(CHARSET_INFO *cs, const char *str,const char *wildstr);
char *fn_rext(char *name);
/* Conversion functions */
+#endif /* MYSQL_SERVER */
+#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
uint strconvert(CHARSET_INFO *from_cs, const char *from,
CHARSET_INFO *to_cs, char *to, uint to_length, uint *errors);
uint filename_to_tablename(const char *from, char *to, uint to_length);
uint tablename_to_filename(const char *from, char *to, uint to_length);
+#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
+#ifdef MYSQL_SERVER
uint build_table_filename(char *buff, size_t bufflen, const char *db,
const char *table, const char *ext, uint flags);
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 39a7c4e9095..6d22047b9db 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -762,6 +762,7 @@ static void close_connections(void)
DBUG_PRINT("info",("Waiting for select thread"));
#ifndef DONT_USE_THR_ALARM
+ if (pthread_kill(select_thread, thr_client_alarm))
break; // allready dead
#endif
set_timespec(abstime, 2);
@@ -7819,8 +7820,6 @@ static void get_options(int *argc,char **argv)
if (opt_short_log_format)
opt_specialflag|= SPECIAL_SHORT_LOG_FORMAT;
- if (opt_log_queries_not_using_indexes)
- opt_specialflag|= SPECIAL_LOG_QUERIES_NOT_USING_INDEXES;
if (init_global_datetime_format(MYSQL_TIMESTAMP_DATE,
&global_system_variables.date_format) ||
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 4944c994d3d..948b268d9a3 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -1264,8 +1264,16 @@ int QUICK_RANGE_SELECT::init_ror_merged_scan(bool reuse_handler)
thd= head->in_use;
if (!(file= head->file->clone(thd->mem_root)))
{
+ /*
+ Manually set the error flag. Note: there seems to be quite a few
+ places where a failure could cause the server to "hang" the client by
+ sending no response to a query. ATM those are not real errors because
+ the storage engine calls in question happen to never fail with the
+ existing storage engines.
+ */
+ thd->net.report_error= 1; /* purecov: inspected */
/* Caller will free the memory */
- goto failure;
+ goto failure; /* purecov: inspected */
}
head->column_bitmaps_set(&column_bitmap, &column_bitmap);
@@ -7244,6 +7252,11 @@ check_quick_select(PARAM *param,uint idx,SEL_ARG *tree, bool update_tbl_stats)
param->is_ror_scan is cleared if the function detects that the key scan is
not a Rowid-Ordered Retrieval scan ( see comments for is_key_scan_ror
function for description of which key scans are ROR scans)
+
+ RETURN
+ #records E(#records) for given subtree
+ HA_POS_ERROR if subtree cannot be used for record retrieval
+
*/
static ha_rows
@@ -7445,27 +7458,24 @@ check_quick_keys(PARAM *param, uint idx, SEL_ARG *key_tree,
ROR (Rowid Ordered Retrieval) key scan is a key scan that produces
ordered sequence of rowids (ha_xxx::cmp_ref is the comparison function)
- An index scan is a ROR scan if it is done using a condition in form
+ This function is needed to handle a practically-important special case:
+ an index scan is a ROR scan if it is done using a condition in form
- "key1_1=c_1 AND ... AND key1_n=c_n" (1)
+ "key1_1=c_1 AND ... AND key1_n=c_n"
where the index is defined on (key1_1, ..., key1_N [,a_1, ..., a_n])
- and the table has a clustered Primary Key
-
- PRIMARY KEY(a_1, ..., a_n, b1, ..., b_k) with first key parts being
- identical to uncovered parts ot the key being scanned (2)
-
- Scans on HASH indexes are not ROR scans,
- any range scan on clustered primary key is ROR scan (3)
+ and the table has a clustered Primary Key defined as
- Check (1) is made in check_quick_keys()
- Check (3) is made check_quick_select()
- Check (2) is made by this function.
+ PRIMARY KEY(a_1, ..., a_n, b1, ..., b_k)
+
+ i.e. the first key parts of it are identical to uncovered parts ot the
+ key being scanned. This function assumes that the index flags do not
+ include HA_KEY_SCAN_NOT_ROR flag (that is checked elsewhere).
RETURN
- TRUE If the scan is ROR-scan
- FALSE otherwise
+ TRUE The scan is ROR-scan
+ FALSE Otherwise
*/
static bool is_key_scan_ror(PARAM *param, uint keynr, uint8 nparts)
diff --git a/sql/partition_info.cc b/sql/partition_info.cc
index 23bc3c96e8f..308b96d84f8 100644
--- a/sql/partition_info.cc
+++ b/sql/partition_info.cc
@@ -905,7 +905,6 @@ bool partition_info::set_up_charset_field_preps()
Field *field, **ptr;
uchar **char_ptrs;
unsigned i;
- bool found;
size_t size;
uint tot_fields= 0;
uint tot_part_fields= 0;
@@ -918,7 +917,6 @@ bool partition_info::set_up_charset_field_preps()
{
ptr= part_field_array;
/* Set up arrays and buffers for those fields */
- i= 0;
while ((field= *(ptr++)))
{
if (field_is_partition_charset(field))
@@ -954,7 +952,7 @@ bool partition_info::set_up_charset_field_preps()
}
part_charset_field_array[i]= NULL;
}
- if (is_sub_partitioned() && list_of_subpart_fields &&
+ if (is_sub_partitioned() && !list_of_subpart_fields &&
check_part_func_fields(subpart_field_array, FALSE))
{
/* Set up arrays and buffers for those fields */
@@ -962,7 +960,10 @@ bool partition_info::set_up_charset_field_preps()
while ((field= *(ptr++)))
{
if (field_is_partition_charset(field))
+ {
tot_subpart_fields++;
+ tot_fields++;
+ }
}
size= tot_subpart_fields * sizeof(char*);
if (!(char_ptrs= (uchar**) sql_calloc(size)))
@@ -975,10 +976,10 @@ bool partition_info::set_up_charset_field_preps()
if (!(char_ptrs= (uchar**) sql_alloc(size)))
goto error;
subpart_charset_field_array= (Field**)char_ptrs;
+ ptr= subpart_field_array;
i= 0;
while ((field= *(ptr++)))
{
- unsigned j= 0;
CHARSET_INFO *cs;
uchar *field_buf;
LINT_INIT(field_buf);
@@ -987,28 +988,16 @@ bool partition_info::set_up_charset_field_preps()
continue;
cs= ((Field_str*)field)->charset();
size= field->pack_length();
- found= FALSE;
- for (j= 0; j < tot_part_fields; j++)
- {
- if (field == part_charset_field_array[i])
- found= TRUE;
- }
- if (!found)
- {
- tot_fields++;
- if (!(field_buf= (uchar*) sql_calloc(size)))
- goto error;
- }
+ if (!(field_buf= (uchar*) sql_calloc(size)))
+ goto error;
+ subpart_charset_field_array[i]= field;
subpart_field_buffers[i++]= field_buf;
}
- if (!(char_ptrs= (uchar**) sql_calloc(size)))
- goto error;
- restore_subpart_field_ptrs= char_ptrs;
+ subpart_charset_field_array[i]= NULL;
}
if (tot_fields)
{
- uint j,k,l;
-
+ uint k;
size= tot_fields*sizeof(char**);
if (!(char_ptrs= (uchar**)sql_calloc(size)))
goto error;
@@ -1026,11 +1015,12 @@ bool partition_info::set_up_charset_field_preps()
full_part_field_buffers[i]= part_field_buffers[i];
}
k= tot_part_fields;
- l= 0;
for (i= 0; i < tot_subpart_fields; i++)
{
+ uint j;
+ bool found= FALSE;
field= subpart_charset_field_array[i];
- found= FALSE;
+
for (j= 0; j < tot_part_fields; j++)
{
if (field == part_charset_field_array[i])
@@ -1038,12 +1028,12 @@ bool partition_info::set_up_charset_field_preps()
}
if (!found)
{
- full_part_charset_field_array[l]= subpart_charset_field_array[k];
- full_part_field_buffers[l]= subpart_field_buffers[k];
- k++; l++;
+ full_part_charset_field_array[k]= subpart_charset_field_array[i];
+ full_part_field_buffers[k]= subpart_field_buffers[i];
+ k++;
}
}
- full_part_charset_field_array[tot_fields]= NULL;
+ full_part_charset_field_array[k]= NULL;
}
DBUG_RETURN(FALSE);
error:
diff --git a/sql/partition_info.h b/sql/partition_info.h
index ce2f2a7b358..10edea074c0 100644
--- a/sql/partition_info.h
+++ b/sql/partition_info.h
@@ -81,6 +81,13 @@ public:
*/
Field **full_part_field_array;
Field **full_part_charset_field_array;
+ /*
+ Set of all fields used in partition and subpartition expression.
+ Required for testing of partition fields in write_set when
+ updating. We need to set all bits in read_set because the row may
+ need to be inserted in a different [sub]partition.
+ */
+ MY_BITMAP full_part_field_set;
/*
When we have a field that requires transformation before calling the
diff --git a/sql/rpl_utility.h b/sql/rpl_utility.h
index 2ce8def4577..79e69aecaeb 100644
--- a/sql/rpl_utility.h
+++ b/sql/rpl_utility.h
@@ -128,7 +128,7 @@ private:
slave thread, but nowhere else.
*/
struct RPL_TABLE_LIST
- : public st_table_list
+ : public TABLE_LIST
{
bool m_tabledef_valid;
table_def m_tabledef;
diff --git a/sql/set_var.cc b/sql/set_var.cc
index d9869ce6809..7f3e808090d 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -616,6 +616,8 @@ sys_var_thd_time_zone sys_time_zone(&vars, "time_zone");
/* Global read-only variable containing hostname */
static sys_var_const_str sys_hostname(&vars, "hostname", glob_hostname);
+sys_var_thd_bool sys_keep_files_on_create(&vars, "keep_files_on_create",
+ &SV::keep_files_on_create);
/* Read only variables */
static sys_var_have_variable sys_have_compress(&vars, "have_compress", &have_compress);
@@ -2218,9 +2220,9 @@ void sys_var_log_output::set_default(THD *thd, enum_var_type type)
{
pthread_mutex_lock(&LOCK_global_system_variables);
logger.lock();
- logger.init_slow_log(LOG_TABLE);
- logger.init_general_log(LOG_TABLE);
- *value= LOG_TABLE;
+ logger.init_slow_log(LOG_FILE);
+ logger.init_general_log(LOG_FILE);
+ *value= LOG_FILE;
logger.unlock();
pthread_mutex_unlock(&LOCK_global_system_variables);
}
diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt
index 0e3544415d1..682eee06e02 100644
--- a/sql/share/errmsg.txt
+++ b/sql/share/errmsg.txt
@@ -1478,6 +1478,8 @@ ER_DUP_KEYNAME 42000 S1009
spa "Nombre de clave duplicado '%-.192s'"
swe "Nyckelnamn '%-.192s' finns flera gånger"
ukr "äÕÂÌÀÀÞÅ ¦Í'Ñ ËÌÀÞÁ '%-.192s'"
+# When using this error code, please use ER(ER_DUP_ENTRY_WITH_KEY_NAME)
+# for the message string. See, for example, code in handler.cc.
ER_DUP_ENTRY 23000 S1009
cze "Zdvojen-Bý klíè '%-.192s' (èíslo klíèe %d)"
dan "Ens værdier '%-.192s' for indeks %d"
@@ -5022,7 +5024,9 @@ ER_UNKNOWN_STORAGE_ENGINE 42000
ger "Unbekannte Speicher-Engine '%s'"
por "Motor de tabela desconhecido '%s'"
spa "Desconocido motor de tabla '%s'"
-ER_UNUSED_1
+# When using this error code, use ER(ER_WARN_DEPRECATED_SYNTAX_WITH_VER)
+# for the message string. See, for example, code in mysql_priv.h.
+ER_WARN_DEPRECATED_SYNTAX
eng "'%s' is deprecated; use '%s' instead"
ger "'%s' ist veraltet. Bitte benutzen Sie '%s'"
por "'%s' é desatualizado. Use '%s' em seu lugar"
@@ -5606,8 +5610,6 @@ ER_SP_RECURSION_LIMIT
ER_SP_PROC_TABLE_CORRUPT
eng "Failed to load routine %-.192s. The table mysql.proc is missing, corrupt, or contains bad data (internal code %d)"
ger "Routine %-.192s konnte nicht geladen werden. Die Tabelle mysql.proc fehlt, ist beschädigt, oder enthält fehlerhaften Daten (interner Code: %d)"
-ER_FOREIGN_SERVER_EXISTS
- eng "The foreign server, %s, you are trying to create already exists."
ER_SP_WRONG_NAME 42000
eng "Incorrect routine name '%-.192s'"
ger "Ungültiger Routinenname '%-.192s'"
@@ -5629,6 +5631,34 @@ ER_NON_GROUPING_FIELD_USED 42000
ER_TABLE_CANT_HANDLE_SPKEYS
eng "The used table type doesn't support SPATIAL indexes"
ger "Der verwendete Tabellentyp unterstützt keine SPATIAL-Indizes"
+ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA
+ eng "Triggers can not be created on system tables"
+ ger "Trigger können nicht auf Systemtabellen erzeugt werden"
+ER_REMOVED_SPACES
+ eng "Leading spaces are removed from name '%s'"
+ ger "Führende Leerzeichen werden aus dem Namen '%s' entfernt"
+ER_AUTOINC_READ_FAILED
+ eng "Failed to read auto-increment value from storage engine"
+ ger "Lesen des Autoincrement-Werts von der Speicher-Engine fehlgeschlagen"
+ER_USERNAME
+ eng "user name"
+ ger "Benutzername"
+ER_HOSTNAME
+ eng "host name"
+ ger "Hostname"
+ER_WRONG_STRING_LENGTH
+ eng "String '%-.70s' is too long for %s (should be no longer than %d)"
+ ger "String '%-.70s' ist zu lang für %s (sollte nicht länger sein als %d)"
+ER_NON_INSERTABLE_TABLE
+ eng "The target table %-.100s of the %s is not insertable-into"
+ ger "Die Zieltabelle %-.100s von %s ist nicht einfügbar"
+ER_ADMIN_WRONG_MRG_TABLE
+ eng "Table '%-.64s' is differently defined or of non-MyISAM type or doesn't exist"
+ER_FOREIGN_SERVER_EXISTS
+ eng "The foreign server, %s, you are trying to create already exists."
+ER_FOREIGN_SERVER_DOESNT_EXIST
+ eng "The foreign server name you are trying to reference does not exist. Data source error: %-.64s"
+ ger "Die externe Verbindung, auf die Sie zugreifen wollen, existiert nicht. Datenquellenfehlermeldung: %-.64s"
ER_ILLEGAL_HA_CREATE_OPTION
eng "Table storage engine '%-.64s' does not support the create option '%.64s'"
ger "Speicher-Engine '%-.64s' der Tabelle unterstützt die Option '%.64s' nicht"
@@ -5848,9 +5878,6 @@ ER_BINLOG_ROW_WRONG_TABLE_DEF
ER_BINLOG_ROW_RBR_TO_SBR
eng "Slave running with --log-slave-updates must use row-based binary logging to be able to replicate row-based binary log events"
ger "Slave, die mit --log-slave-updates laufen, müssen zeilenbasiertes Loggen verwenden, um zeilenbasierte Binärlog-Ereignisse loggen zu können"
-ER_FOREIGN_SERVER_DOESNT_EXIST
- eng "The foreign server name you are trying to reference does not exist. Data source error: %-.64s"
- ger "Die externe Verbindung, auf die Sie zugreifen wollen, existiert nicht. Datenquellenfehlermeldung: %-.64s"
ER_EVENT_ALREADY_EXISTS
eng "Event '%-.192s' already exists"
ger "Event '%-.192s' existiert bereits"
@@ -5901,7 +5928,9 @@ ER_EVENT_DATA_TOO_LONG
ER_DROP_INDEX_FK
eng "Cannot drop index '%-.192s': needed in a foreign key constraint"
ger "Kann Index '%-.192s' nicht löschen: wird für einen Fremdschlüssel benötigt"
-ER_WARN_DEPRECATED_SYNTAX
+# When using this error message, use the ER_WARN_DEPRECATED_SYNTAX error
+# code. See, for example, code in mysql_priv.h.
+ER_WARN_DEPRECATED_SYNTAX_WITH_VER
eng "The syntax '%s' is deprecated and will be removed in MySQL %s. Please use %s instead"
ger "Die Syntax '%s' ist veraltet und wird in MySQL %s entfernt. Bitte benutzen Sie statt dessen %s"
ER_CANT_WRITE_LOCK_LOG_TABLE
@@ -5916,9 +5945,6 @@ ER_FOREIGN_DUPLICATE_KEY 23000 S1009
ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE
eng "Column count of mysql.%s is wrong. Expected %d, found %d. Created with MySQL %d, now running %d. Please use mysql_upgrade to fix this error."
ger "Spaltenanzahl von mysql.%s falsch. %d erwartet, aber %d erhalten. Erzeugt mit MySQL %d, jetzt unter %d. Bitte benutzen Sie mysql_upgrade, um den Fehler zu beheben"
-ER_REMOVED_SPACES
- eng "Leading spaces are removed from name '%s'"
- ger "Führende Leerzeichen werden aus dem Namen '%s' entfernt"
ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR
eng "Cannot switch out of the row-based binary log format when the session has open temporary tables"
ger "Kann nicht aus dem zeilenbasierten Binärlog-Format herauswechseln, wenn die Sitzung offene temporäre Tabellen hat"
@@ -5975,9 +6001,6 @@ ER_BASE64_DECODE_ERROR
eng "Decoding of base64 string failed"
swe "Avkodning av base64 sträng misslyckades"
ger "Der Server hat keine zeilenbasierte Replikation"
-ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA
- eng "Triggers can not be created on system tables"
- ger "Trigger können nicht auf Systemtabellen erzeugt werden"
ER_EVENT_RECURSION_FORBIDDEN
eng "Recursion of EVENT DDL statements is forbidden when body is present"
ger "Rekursivität von EVENT-DDL-Anweisungen ist unzulässig wenn ein Hauptteil (Body) existiert"
@@ -5987,27 +6010,12 @@ ER_EVENTS_DB_ERROR
ER_ONLY_INTEGERS_ALLOWED
eng "Only integers allowed as number here"
ger "An dieser Stelle sind nur Ganzzahlen zulässig"
-ER_AUTOINC_READ_FAILED
- eng "Failed to read auto-increment value from storage engine"
- ger "Lesen des Autoincrement-Werts von der Speicher-Engine fehlgeschlagen"
-ER_USERNAME
- eng "user name"
- ger "Benutzername"
-ER_HOSTNAME
- eng "host name"
- ger "Hostname"
-ER_WRONG_STRING_LENGTH
- eng "String '%-.70s' is too long for %s (should be no longer than %d)"
- ger "String '%-.70s' ist zu lang für %s (sollte nicht länger sein als %d)"
ER_UNSUPORTED_LOG_ENGINE
eng "This storage engine cannot be used for log tables""
ger "Diese Speicher-Engine kann für Logtabellen nicht verwendet werden"
ER_BAD_LOG_STATEMENT
eng "You cannot '%s' a log table if logging is enabled"
ger "Sie können eine Logtabelle nicht '%s', wenn Loggen angeschaltet ist"
-ER_NON_INSERTABLE_TABLE
- eng "The target table %-.100s of the %s is not insertable-into"
- ger "Die Zieltabelle %-.100s von %s ist nicht einfügbar"
ER_CANT_RENAME_LOG_TABLE
eng "Cannot rename '%s'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to '%s'"
ger "Kann '%s' nicht umbenennen. Wenn Loggen angeschaltet ist, müssen beim Umbenennen zu/von einer Logtabelle zwei Tabellen angegeben werden: die Logtabelle zu einer Archivtabelle und eine weitere Tabelle zurück zu '%s'"
@@ -6023,6 +6031,8 @@ ER_WRONG_PARAMETERS_TO_STORED_FCT 42000
ER_NATIVE_FCT_NAME_COLLISION
eng "This function '%-.192s' has the same name as a native function"
ger "Die Funktion '%-.192s' hat denselben Namen wie eine native Funktion"
+# When using this error message, use the ER_DUP_ENTRY error code. See, for
+# example, code in handler.cc.
ER_DUP_ENTRY_WITH_KEY_NAME 23000 S1009
cze "Zvojen-Bý klíè '%-.64s' (èíslo klíèe '%-.192s')"
dan "Ens værdier '%-.64s' for indeks '%-.192s'"
@@ -6052,15 +6062,13 @@ ER_BINLOG_PURGE_EMFILE
eng "Too many files opened, please execute the command again"
ger "Zu viele offene Dateien, bitte führen Sie den Befehl noch einmal aus"
ER_EVENT_CANNOT_CREATE_IN_THE_PAST
- eng "Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created"
+ eng "Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation."
ER_EVENT_CANNOT_ALTER_IN_THE_PAST
- eng "Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been altered"
+ eng "Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation."
ER_SLAVE_INCIDENT
eng "The incident %s occured on the master. Message: %-.64s"
ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT
eng "Table has no partition for some existing values"
-ER_ADMIN_WRONG_MRG_TABLE
- eng "Table '%-.64s' is differently defined or of non-MyISAM type or doesn't exist"
ER_BINLOG_UNSAFE_STATEMENT
eng "Statement is not safe to log in statement format."
swe "Detta är inte säkert att logga i statement-format."
diff --git a/sql/slave.cc b/sql/slave.cc
index 6c7968c2b3f..2e8e3f582de 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -27,6 +27,7 @@
#include <my_dir.h>
#include <sql_common.h>
#include <errmsg.h>
+#include <mysys_err.h>
#ifdef HAVE_REPLICATION
@@ -59,6 +60,58 @@ ulonglong relay_log_space_limit = 0;
int disconnect_slave_event_count = 0, abort_slave_event_count = 0;
int events_till_abort = -1;
+enum enum_slave_reconnect_actions
+{
+ SLAVE_RECON_ACT_REG= 0,
+ SLAVE_RECON_ACT_DUMP= 1,
+ SLAVE_RECON_ACT_EVENT= 2,
+ SLAVE_RECON_ACT_MAX
+};
+
+enum enum_slave_reconnect_messages
+{
+ SLAVE_RECON_MSG_WAIT= 0,
+ SLAVE_RECON_MSG_KILLED_WAITING= 1,
+ SLAVE_RECON_MSG_AFTER= 2,
+ SLAVE_RECON_MSG_FAILED= 3,
+ SLAVE_RECON_MSG_COMMAND= 4,
+ SLAVE_RECON_MSG_KILLED_AFTER= 5,
+ SLAVE_RECON_MSG_MAX
+};
+
+static const char *reconnect_messages[SLAVE_RECON_ACT_MAX][SLAVE_RECON_MSG_MAX]=
+{
+ {
+ "Waiting to reconnect after a failed registration on master",
+ "Slave I/O thread killed while waitnig to reconnect after a failed \
+registration on master",
+ "Reconnecting after a failed registration on master",
+ "failed registering on master, reconnecting to try again, \
+log '%s' at postion %s",
+ "COM_REGISTER_SLAVE",
+ "Slave I/O thread killed during or after reconnect"
+ },
+ {
+ "Waiting to reconnect after a failed binlog dump request",
+ "Slave I/O thread killed while retrying master dump",
+ "Reconnecting after a failed binlog dump request",
+ "failed dump request, reconnecting to try again, log '%s' at postion %s",
+ "COM_BINLOG_DUMP",
+ "Slave I/O thread killed during or after reconnect"
+ },
+ {
+ "Waiting to reconnect after a failed master event read",
+ "Slave I/O thread killed while waiting to reconnect after a failed read",
+ "Reconnecting after a failed master event read",
+ "Slave I/O thread: Failed reading log event, reconnecting to retry, \
+log '%s' at postion %s",
+ "",
+ "Slave I/O thread killed during or after a reconnect done to recover from \
+failed read"
+ }
+};
+
+
typedef enum { SLAVE_THD_IO, SLAVE_THD_SQL} SLAVE_THD_TYPE;
static int process_io_rotate(MASTER_INFO* mi, Rotate_log_event* rev);
@@ -1098,12 +1151,14 @@ static void write_ignored_events_info_to_relay_log(THD *thd, MASTER_INFO *mi)
}
-int register_slave_on_master(MYSQL* mysql, MASTER_INFO *mi)
+int register_slave_on_master(MYSQL* mysql, MASTER_INFO *mi,
+ bool *suppress_warnings)
{
uchar buf[1024], *pos= buf;
uint report_host_len, report_user_len=0, report_password_len=0;
DBUG_ENTER("register_slave_on_master");
+ *suppress_warnings= FALSE;
if (!report_host)
DBUG_RETURN(0);
report_host_len= strlen(report_host);
@@ -1127,11 +1182,18 @@ int register_slave_on_master(MYSQL* mysql, MASTER_INFO *mi)
if (simple_command(mysql, COM_REGISTER_SLAVE, buf, (size_t) (pos- buf), 0))
{
- char buf[256];
- my_snprintf(buf, sizeof(buf),
- "%s (Errno: %d)", mysql_error(mysql), mysql_errno(mysql));
- mi->report(ERROR_LEVEL, ER_SLAVE_MASTER_COM_FAILURE,
- ER(ER_SLAVE_MASTER_COM_FAILURE), "COM_REGISTER_SLAVE", buf);
+ if (mysql_errno(mysql) == ER_NET_READ_INTERRUPTED)
+ {
+ *suppress_warnings= TRUE; // Suppress reconnect warning
+ }
+ else
+ {
+ char buf[256];
+ my_snprintf(buf, sizeof(buf), "%s (Errno: %d)", mysql_error(mysql),
+ mysql_errno(mysql));
+ mi->report(ERROR_LEVEL, ER_SLAVE_MASTER_COM_FAILURE,
+ ER(ER_SLAVE_MASTER_COM_FAILURE), "COM_REGISTER_SLAVE", buf);
+ }
DBUG_RETURN(1);
}
DBUG_RETURN(0);
@@ -1460,6 +1522,8 @@ static int request_dump(MYSQL* mysql, MASTER_INFO* mi,
int binlog_flags = 0; // for now
char* logname = mi->master_log_name;
DBUG_ENTER("request_dump");
+
+ *suppress_warnings= FALSE;
// TODO if big log files: Change next to int8store()
int4store(buf, (ulong) mi->master_log_pos);
@@ -1475,7 +1539,7 @@ static int request_dump(MYSQL* mysql, MASTER_INFO* mi,
now we just fill up the error log :-)
*/
if (mysql_errno(mysql) == ER_NET_READ_INTERRUPTED)
- *suppress_warnings= 1; // Suppress reconnect warning
+ *suppress_warnings= TRUE; // Suppress reconnect warning
else
sql_print_error("Error on COM_BINLOG_DUMP: %d %s, will retry in %d secs",
mysql_errno(mysql), mysql_error(mysql),
@@ -1539,7 +1603,7 @@ static ulong read_event(MYSQL* mysql, MASTER_INFO *mi, bool* suppress_warnings)
ulong len;
DBUG_ENTER("read_event");
- *suppress_warnings= 0;
+ *suppress_warnings= FALSE;
/*
my_real_read() will time us out
We check if we were told to die, and if not, try reading again
@@ -1879,6 +1943,94 @@ on this slave.\
}
+static bool check_io_slave_killed(THD *thd, MASTER_INFO *mi, const char *info)
+{
+ if (io_slave_killed(thd, mi))
+ {
+ if (global_system_variables.log_warnings)
+ sql_print_information(info);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+
+/**
+ @brief Try to reconnect slave IO thread.
+
+ @details Terminates current connection to master, sleeps for
+ @c mi->connect_retry msecs and initiates new connection with
+ @c safe_reconnect(). Variable pointed by @c retry_count is increased -
+ if it exceeds @c master_retry_count then connection is not re-established
+ and function signals error.
+ Unless @c suppres_warnings is TRUE, a warning is put in the server error log
+ when reconnecting. The warning message and messages used to report errors
+ are taken from @c messages array. In case @c master_retry_count is exceeded,
+ no messages are added to the log.
+
+ @param[in] thd Thread context.
+ @param[in] mysql MySQL connection.
+ @param[in] mi Master connection information.
+ @param[in,out] retry_count Number of attempts to reconnect.
+ @param[in] suppress_warnings TRUE when a normal net read timeout
+ has caused to reconnecting.
+ @param[in] messages Messages to print/log, see
+ reconnect_messages[] array.
+
+ @retval 0 OK.
+ @retval 1 There was an error.
+*/
+
+static int try_to_reconnect(THD *thd, MYSQL *mysql, MASTER_INFO *mi,
+ uint *retry_count, bool suppress_warnings,
+ const char *messages[SLAVE_RECON_MSG_MAX])
+{
+ mi->slave_running= MYSQL_SLAVE_RUN_NOT_CONNECT;
+ thd->proc_info= messages[SLAVE_RECON_MSG_WAIT];
+#ifdef SIGNAL_WITH_VIO_CLOSE
+ thd->clear_active_vio();
+#endif
+ end_server(mysql);
+ if ((*retry_count)++)
+ {
+ if (*retry_count > master_retry_count)
+ return 1; // Don't retry forever
+ safe_sleep(thd, mi->connect_retry, (CHECK_KILLED_FUNC) io_slave_killed,
+ (void *) mi);
+ }
+ if (check_io_slave_killed(thd, mi, messages[SLAVE_RECON_MSG_KILLED_WAITING]))
+ return 1;
+ thd->proc_info = messages[SLAVE_RECON_MSG_AFTER];
+ if (!suppress_warnings)
+ {
+ char buf[256], llbuff[22];
+ my_snprintf(buf, sizeof(buf), messages[SLAVE_RECON_MSG_FAILED],
+ IO_RPL_LOG_NAME, llstr(mi->master_log_pos, llbuff));
+ /*
+ Raise a warining during registering on master/requesting dump.
+ Log a message reading event.
+ */
+ if (messages[SLAVE_RECON_MSG_COMMAND][0])
+ {
+ mi->report(WARNING_LEVEL, ER_SLAVE_MASTER_COM_FAILURE,
+ ER(ER_SLAVE_MASTER_COM_FAILURE),
+ messages[SLAVE_RECON_MSG_COMMAND], buf);
+ }
+ else
+ {
+ sql_print_information(buf);
+ }
+ }
+ if (safe_reconnect(thd, mysql, mi, 1) || io_slave_killed(thd, mi))
+ {
+ if (global_system_variables.log_warnings)
+ sql_print_information(messages[SLAVE_RECON_MSG_KILLED_AFTER]);
+ return 1;
+ }
+ return 0;
+}
+
+
/* Slave I/O Thread entry point */
pthread_handler_t handle_slave_io(void *arg)
@@ -1889,7 +2041,10 @@ pthread_handler_t handle_slave_io(void *arg)
RELAY_LOG_INFO *rli= &mi->rli;
char llbuff[22];
uint retry_count;
-
+ bool suppress_warnings;
+#ifndef DBUG_OFF
+ uint retry_count_reg= 0, retry_count_dump= 0, retry_count_event= 0;
+#endif
// needs to call my_thread_init(), otherwise we get a coredump in DBUG_ stuff
my_thread_init();
DBUG_ENTER("handle_slave_io");
@@ -1975,79 +2130,56 @@ connected:
Register ourselves with the master.
*/
thd->proc_info = "Registering slave on master";
- if (register_slave_on_master(mysql, mi))
+ if (register_slave_on_master(mysql, mi, &suppress_warnings))
{
sql_print_error("Slave I/O thread couldn't register on master");
- goto err;
+ if (check_io_slave_killed(thd, mi, "Slave I/O thread killed while \
+registering slave on master") ||
+ try_to_reconnect(thd, mysql, mi, &retry_count, suppress_warnings,
+ reconnect_messages[SLAVE_RECON_ACT_REG]))
+ goto err;
+ goto connected;
}
+ DBUG_EXECUTE_IF("FORCE_SLAVE_TO_RECONNECT_REG",
+ if (!retry_count_reg)
+ {
+ retry_count_reg++;
+ sql_print_information("Forcing to reconnect slave I/O thread");
+ if (try_to_reconnect(thd, mysql, mi, &retry_count, suppress_warnings,
+ reconnect_messages[SLAVE_RECON_ACT_REG]))
+ goto err;
+ goto connected;
+ });
}
DBUG_PRINT("info",("Starting reading binary log from master"));
while (!io_slave_killed(thd,mi))
{
- bool suppress_warnings= 0;
thd->proc_info = "Requesting binlog dump";
if (request_dump(mysql, mi, &suppress_warnings))
{
sql_print_error("Failed on request_dump()");
- if (io_slave_killed(thd,mi))
- {
- sql_print_information("Slave I/O thread killed while requesting master \
-dump");
- goto err;
- }
-
- mi->slave_running= MYSQL_SLAVE_RUN_NOT_CONNECT;
- thd->proc_info= "Waiting to reconnect after a failed binlog dump request";
-#ifdef SIGNAL_WITH_VIO_CLOSE
- thd->clear_active_vio();
-#endif
- end_server(mysql);
- /*
- First time retry immediately, assuming that we can recover
- right away - if first time fails, sleep between re-tries
- hopefuly the admin can fix the problem sometime
- */
- if (retry_count++)
- {
- if (retry_count > master_retry_count)
- goto err; // Don't retry forever
- safe_sleep(thd,mi->connect_retry,(CHECK_KILLED_FUNC)io_slave_killed,
- (void*)mi);
- }
- if (io_slave_killed(thd,mi))
- {
- sql_print_information("Slave I/O thread killed while retrying master \
-dump");
+ if (check_io_slave_killed(thd, mi, "Slave I/O thread killed while \
+requesting master dump") ||
+ try_to_reconnect(thd, mysql, mi, &retry_count, suppress_warnings,
+ reconnect_messages[SLAVE_RECON_ACT_DUMP]))
goto err;
- }
-
- thd->proc_info = "Reconnecting after a failed binlog dump request";
- if (!suppress_warnings) {
- char buf[256];
- my_snprintf(buf, sizeof(buf),
- "failed dump request, reconnecting to try again,"
- " log '%s' at postion %s",
- IO_RPL_LOG_NAME,
- llstr(mi->master_log_pos,llbuff));
- mi->report(WARNING_LEVEL, ER_SLAVE_MASTER_COM_FAILURE,
- ER(ER_SLAVE_MASTER_COM_FAILURE), "COM_BINLOG_DUMP", buf);
- }
- if (safe_reconnect(thd, mysql, mi, suppress_warnings) ||
- io_slave_killed(thd,mi))
- {
- sql_print_information("Slave I/O thread killed during or \
-after reconnect");
- goto err;
- }
-
goto connected;
}
+ DBUG_EXECUTE_IF("FORCE_SLAVE_TO_RECONNECT_DUMP",
+ if (!retry_count_dump)
+ {
+ retry_count_dump++;
+ sql_print_information("Forcing to reconnect slave I/O thread");
+ if (try_to_reconnect(thd, mysql, mi, &retry_count, suppress_warnings,
+ reconnect_messages[SLAVE_RECON_ACT_DUMP]))
+ goto err;
+ goto connected;
+ });
while (!io_slave_killed(thd,mi))
{
ulong event_len;
- suppress_warnings= 0;
/*
We say "waiting" because read_event() will wait if there's nothing to
read. But if there's something to read, it will not wait. The
@@ -2056,64 +2188,44 @@ after reconnect");
*/
thd->proc_info= "Waiting for master to send event";
event_len= read_event(mysql, mi, &suppress_warnings);
- if (io_slave_killed(thd,mi))
- {
- if (global_system_variables.log_warnings)
- sql_print_information("Slave I/O thread killed while reading event");
+ if (check_io_slave_killed(thd, mi, "Slave I/O thread killed while \
+reading event"))
goto err;
- }
+ DBUG_EXECUTE_IF("FORCE_SLAVE_TO_RECONNECT_EVENT",
+ if (!retry_count_event)
+ {
+ retry_count_event++;
+ sql_print_information("Forcing to reconnect slave I/O thread");
+ if (try_to_reconnect(thd, mysql, mi, &retry_count, suppress_warnings,
+ reconnect_messages[SLAVE_RECON_ACT_EVENT]))
+ goto err;
+ goto connected;
+ });
if (event_len == packet_error)
{
uint mysql_error_number= mysql_errno(mysql);
- if (mysql_error_number == CR_NET_PACKET_TOO_LARGE)
- {
+ switch (mysql_error_number) {
+ case CR_NET_PACKET_TOO_LARGE:
sql_print_error("\
Log entry on master is longer than max_allowed_packet (%ld) on \
slave. If the entry is correct, restart the server with a higher value of \
max_allowed_packet",
thd->variables.max_allowed_packet);
goto err;
- }
- if (mysql_error_number == ER_MASTER_FATAL_ERROR_READING_BINLOG)
- {
+ case ER_MASTER_FATAL_ERROR_READING_BINLOG:
sql_print_error(ER(mysql_error_number), mysql_error_number,
mysql_error(mysql));
goto err;
- }
- mi->slave_running= MYSQL_SLAVE_RUN_NOT_CONNECT;
- thd->proc_info = "Waiting to reconnect after a failed master event read";
-#ifdef SIGNAL_WITH_VIO_CLOSE
- thd->clear_active_vio();
-#endif
- end_server(mysql);
- if (retry_count++)
- {
- if (retry_count > master_retry_count)
- goto err; // Don't retry forever
- safe_sleep(thd,mi->connect_retry,(CHECK_KILLED_FUNC)io_slave_killed,
- (void*) mi);
- }
- if (io_slave_killed(thd,mi))
- {
- if (global_system_variables.log_warnings)
- sql_print_information("Slave I/O thread killed while waiting to \
-reconnect after a failed read");
+ case EE_OUTOFMEMORY:
+ case ER_OUTOFMEMORY:
+ sql_print_error("\
+Stopping slave I/O thread due to out-of-memory error from master");
goto err;
}
- thd->proc_info = "Reconnecting after a failed master event read";
- if (!suppress_warnings)
- sql_print_information("Slave I/O thread: Failed reading log event, \
-reconnecting to retry, log '%s' position %s", IO_RPL_LOG_NAME,
- llstr(mi->master_log_pos, llbuff));
- if (safe_reconnect(thd, mysql, mi, suppress_warnings) ||
- io_slave_killed(thd,mi))
- {
- if (global_system_variables.log_warnings)
- sql_print_information("Slave I/O thread killed during or after a \
-reconnect done to recover from failed read");
+ if (try_to_reconnect(thd, mysql, mi, &retry_count, suppress_warnings,
+ reconnect_messages[SLAVE_RECON_ACT_EVENT]))
goto err;
- }
goto connected;
} // if (event_len == packet_error)
diff --git a/sql/sp.cc b/sql/sp.cc
index 66c6c05c930..aed4976f839 100644
--- a/sql/sp.cc
+++ b/sql/sp.cc
@@ -602,6 +602,15 @@ db_load_routine(THD *thd, int type, sp_name *name, sp_head **sphp,
(*sphp)->set_info(created, modified, &chistics, sql_mode);
(*sphp)->set_creation_ctx(creation_ctx);
(*sphp)->optimize();
+ /*
+ Not strictly necessary to invoke this method here, since we know
+ that we've parsed CREATE PROCEDURE/FUNCTION and not an
+ UPDATE/DELETE/INSERT/REPLACE/LOAD/CREATE TABLE, but we try to
+ maintain the invariant that this method is called for each
+ distinct statement, in case its logic is extended with other
+ types of analyses in future.
+ */
+ newlex.set_trg_event_type_for_tables();
}
}
@@ -1912,32 +1921,40 @@ sp_cache_routines_and_add_tables_for_triggers(THD *thd, LEX *lex,
TABLE_LIST *table)
{
int ret= 0;
- Table_triggers_list *triggers= table->table->triggers;
- if (add_used_routine(lex, thd->stmt_arena, &triggers->sroutines_key,
- table->belong_to_view))
+
+ Sroutine_hash_entry **last_cached_routine_ptr=
+ (Sroutine_hash_entry **)lex->sroutines_list.next;
+
+ if (static_cast<int>(table->lock_type) >=
+ static_cast<int>(TL_WRITE_ALLOW_WRITE))
{
- Sroutine_hash_entry **last_cached_routine_ptr=
- (Sroutine_hash_entry **)lex->sroutines_list.next;
for (int i= 0; i < (int)TRG_EVENT_MAX; i++)
{
- for (int j= 0; j < (int)TRG_ACTION_MAX; j++)
+ if (table->trg_event_map &
+ static_cast<uint8>(1 << static_cast<int>(i)))
{
- sp_head *trigger_body= triggers->bodies[i][j];
- if (trigger_body)
+ for (int j= 0; j < (int)TRG_ACTION_MAX; j++)
{
- (void)trigger_body->
- add_used_tables_to_table_list(thd, &lex->query_tables_last,
- table->belong_to_view);
- sp_update_stmt_used_routines(thd, lex,
- &trigger_body->m_sroutines,
- table->belong_to_view);
- trigger_body->propagate_attributes(lex);
+ /* We can have only one trigger per action type currently */
+ sp_head *trigger= table->table->triggers->bodies[i][j];
+ if (trigger &&
+ add_used_routine(lex, thd->stmt_arena, &trigger->m_sroutines_key,
+ table->belong_to_view))
+ {
+ trigger->add_used_tables_to_table_list(thd, &lex->query_tables_last,
+ table->belong_to_view);
+ trigger->propagate_attributes(lex);
+ sp_update_stmt_used_routines(thd, lex,
+ &trigger->m_sroutines,
+ table->belong_to_view);
+ }
}
}
}
- ret= sp_cache_routines_and_add_tables_aux(thd, lex,
- *last_cached_routine_ptr, FALSE);
}
+ ret= sp_cache_routines_and_add_tables_aux(thd, lex,
+ *last_cached_routine_ptr,
+ FALSE);
return ret;
}
@@ -2044,15 +2061,11 @@ sp_use_new_db(THD *thd, LEX_STRING new_db, LEX_STRING *old_db,
DBUG_PRINT("enter", ("newdb: %s", new_db.str));
/*
- Set new_db to an empty string if it's NULL, because mysql_change_db
- requires a non-NULL argument.
- new_db.str can be NULL only if we're restoring the old database after
- execution of a stored procedure and there were no current database
- selected. The stored procedure itself must always have its database
- initialized.
+ A stored routine always belongs to some database. The
+ old database (old_db) might be NULL, but to restore the
+ old database we will use mysql_change_db.
*/
- if (new_db.str == NULL)
- new_db.str= empty_c_string;
+ DBUG_ASSERT(new_db.str && new_db.length);
if (thd->db)
{
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index f0cc5204749..9b67a89bed2 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -512,12 +512,35 @@ sp_head::init(LEX *lex)
*/
lex->trg_table_fields.empty();
my_init_dynamic_array(&m_instr, sizeof(sp_instr *), 16, 8);
- m_param_begin= m_param_end= m_body_begin= 0;
- m_qname.str= m_db.str= m_name.str= m_params.str=
- m_body.str= m_defstr.str= 0;
- m_qname.length= m_db.length= m_name.length= m_params.length=
- m_body.length= m_defstr.length= 0;
+
+ m_param_begin= NULL;
+ m_param_end= NULL;
+
+ m_body_begin= NULL ;
+
+ m_qname.str= NULL;
+ m_qname.length= 0;
+
+ m_db.str= NULL;
+ m_db.length= 0;
+
+ m_name.str= NULL;
+ m_name.length= 0;
+
+ m_params.str= NULL;
+ m_params.length= 0;
+
+ m_body.str= NULL;
+ m_body.length= 0;
+
+ 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;
}
@@ -543,9 +566,14 @@ sp_head::init_sp_name(THD *thd, sp_name *spname)
if (spname->m_qname.length == 0)
spname->init_qname(thd);
- m_qname.length= spname->m_qname.length;
- m_qname.str= strmake_root(thd->mem_root, spname->m_qname.str,
- m_qname.length);
+ 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;
DBUG_VOID_RETURN;
}
@@ -1924,8 +1952,11 @@ sp_head::restore_lex(THD *thd)
{
DBUG_ENTER("sp_head::restore_lex");
LEX *sublex= thd->lex;
- LEX *oldlex= (LEX *)m_lex.pop();
+ LEX *oldlex;
+
+ sublex->set_trg_event_type_for_tables();
+ oldlex= (LEX *)m_lex.pop();
if (! oldlex)
return; // Nothing to restore
@@ -2260,7 +2291,8 @@ sp_head::show_create_routine(THD *thd, int type)
protocol->store(sql_mode.str, sql_mode.length, system_charset_info);
if (full_access)
- protocol->store(m_defstr.str, m_defstr.length, &my_charset_bin);
+ protocol->store(m_defstr.str, m_defstr.length,
+ m_creation_ctx->get_client_cs());
else
protocol->store_null();
@@ -3544,6 +3576,7 @@ typedef struct st_sp_table
thr_lock_type lock_type; /* lock type used for prelocking */
uint lock_count;
uint query_lock_count;
+ uint8 trg_event_map;
} SP_TABLE;
uchar *
@@ -3630,6 +3663,7 @@ sp_head::merge_table_list(THD *thd, TABLE_LIST *table, LEX *lex_for_tmp_check)
tab->query_lock_count++;
if (tab->query_lock_count > tab->lock_count)
tab->lock_count++;
+ tab->trg_event_map|= table->trg_event_map;
}
else
{
@@ -3651,6 +3685,7 @@ sp_head::merge_table_list(THD *thd, TABLE_LIST *table, LEX *lex_for_tmp_check)
tab->db_length= table->db_length;
tab->lock_type= table->lock_type;
tab->lock_count= tab->query_lock_count= 1;
+ tab->trg_event_map= table->trg_event_map;
my_hash_insert(&m_sptabs, (uchar *)tab);
}
}
@@ -3728,6 +3763,7 @@ sp_head::add_used_tables_to_table_list(THD *thd,
table->cacheable_table= 1;
table->prelocking_placeholder= 1;
table->belong_to_view= belong_to_view;
+ table->trg_event_map= stab->trg_event_map;
/* Everyting else should be zeroed */
diff --git a/sql/sp_head.h b/sql/sp_head.h
index 490fda67bfe..f6764fbc90e 100644
--- a/sql/sp_head.h
+++ b/sql/sp_head.h
@@ -184,6 +184,12 @@ public:
st_sp_chistics *m_chistics;
ulong m_sql_mode; // For SHOW CREATE and execution
LEX_STRING m_qname; // db.name
+ /**
+ Key representing routine in the set of stored routines used by statement.
+ [routine_type]db.name\0
+ @sa sp_name::m_sroutines_key
+ */
+ LEX_STRING m_sroutines_key;
LEX_STRING m_db;
LEX_STRING m_name;
LEX_STRING m_params;
diff --git a/sql/spatial.cc b/sql/spatial.cc
index e0680ed182c..97e5fcfa27a 100644
--- a/sql/spatial.cc
+++ b/sql/spatial.cc
@@ -17,7 +17,28 @@
#ifdef HAVE_SPATIAL
-#define MAX_DIGITS_IN_DOUBLE 16
+/*
+ exponential notation :
+ 1 sign
+ 1 number before the decimal point
+ 1 decimal point
+ 14 number of significant digits (see String::qs_append(double))
+ 1 'e' sign
+ 1 exponent sign
+ 3 exponent digits
+ ==
+ 22
+
+ "f" notation :
+ 1 optional 0
+ 1 sign
+ 14 number significant digits (see String::qs_append(double) )
+ 1 decimal point
+ ==
+ 17
+*/
+
+#define MAX_DIGITS_IN_DOUBLE 22
/***************************** Gis_class_info *******************************/
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index fb5fd2ec627..0cd46a7c6fb 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -64,11 +64,11 @@ Prelock_error_handler::handle_error(uint sql_errno,
if (sql_errno == ER_NO_SUCH_TABLE)
{
m_handled_errors++;
- return TRUE; // 'TRUE', as per coding style
+ return TRUE;
}
m_unhandled_errors++;
- return FALSE; // 'FALSE', as per coding style
+ return FALSE;
}
@@ -1476,7 +1476,7 @@ void close_temporary_tables(THD *thd)
*/
TABLE_LIST *find_table_in_list(TABLE_LIST *table,
- st_table_list *TABLE_LIST::*link,
+ TABLE_LIST *TABLE_LIST::*link,
const char *db_name,
const char *table_name)
{
@@ -3533,7 +3533,7 @@ int open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags)
*/
for (tables= *start; tables ;tables= tables->next_global)
{
- safe_to_ignore_table= FALSE; // 'FALSE', as per coding style
+ safe_to_ignore_table= FALSE;
if (tables->lock_type == TL_WRITE_DEFAULT)
{
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index 719c67aff6a..cab9ef94d6d 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -268,6 +268,39 @@ are stored in one block.
If join_results allocated new block(s) then we need call pack_cache again.
+7. Interface
+The query cache interfaces with the rest of the server code through 7
+functions:
+ 1. Query_cache::send_result_to_client
+ - Called before parsing and used to match a statement with the stored
+ queries hash.
+ If a match is found the cached result set is sent through repeated
+ calls to net_real_write. (note: calling thread doesn't have a regis-
+ tered result set writer: thd->net.query_cache_query=0)
+ 2. Query_cache::store_query
+ - Called just before handle_select() and is used to register a result
+ set writer to the statement currently being processed
+ (thd->net.query_cache_query).
+ 3. query_cache_insert
+ - Called from net_real_write to append a result set to a cached query
+ if (and only if) this query has a registered result set writer
+ (thd->net.query_cache_query).
+ 4. Query_cache::invalidate
+ - Called from various places to invalidate query cache based on data-
+ base, table and myisam file name. During an on going invalidation
+ the query cache is temporarily disabled.
+ 5. Query_cache::flush
+ - Used when a RESET QUERY CACHE is issued. This clears the entire
+ cache block by block.
+ 6. Query_cache::resize
+ - Used to change the available memory used by the query cache. This
+ will also invalidate the entrie query cache in one free operation.
+ 7. Query_cache::pack
+ - Used when a FLUSH QUERY CACHE is issued. This changes the order of
+ the used memory blocks in physical memory order and move all avail-
+ able memory to the 'bottom' of the memory.
+
+
TODO list:
- Delayed till after-parsing qache answer (for column rights processing)
@@ -615,49 +648,55 @@ void query_cache_insert(NET *net, const char *packet, ulong length)
DBUG_VOID_RETURN;
STRUCT_LOCK(&query_cache.structure_guard_mutex);
+ bool interrupt;
+ query_cache.wait_while_table_flush_is_in_progress(&interrupt);
+ if (interrupt)
+ {
+ STRUCT_UNLOCK(&query_cache.structure_guard_mutex);
+ return;
+ }
- if (unlikely(query_cache.query_cache_size == 0 ||
- query_cache.flush_in_progress))
+ Query_cache_block *query_block= (Query_cache_block*)net->query_cache_query;
+ if (!query_block)
{
+ /*
+ We lost the writer and the currently processed query has been
+ invalidated; there is nothing left to do.
+ */
STRUCT_UNLOCK(&query_cache.structure_guard_mutex);
DBUG_VOID_RETURN;
}
- Query_cache_block *query_block = ((Query_cache_block*)
- net->query_cache_query);
- if (query_block)
- {
- Query_cache_query *header = query_block->query();
- Query_cache_block *result = header->result();
+ Query_cache_query *header= query_block->query();
+ Query_cache_block *result= header->result();
- DUMP(&query_cache);
- BLOCK_LOCK_WR(query_block);
- DBUG_PRINT("qcache", ("insert packet %lu bytes long",length));
+ DUMP(&query_cache);
+ BLOCK_LOCK_WR(query_block);
+ DBUG_PRINT("qcache", ("insert packet %lu bytes long",length));
- /*
- On success STRUCT_UNLOCK(&query_cache.structure_guard_mutex) will be
- done by query_cache.append_result_data if success (if not we need
- query_cache.structure_guard_mutex locked to free query)
- */
- if (!query_cache.append_result_data(&result, length, (uchar*) packet,
- query_block))
- {
- DBUG_PRINT("warning", ("Can't append data"));
- header->result(result);
- DBUG_PRINT("qcache", ("free query 0x%lx", (ulong) query_block));
- // The following call will remove the lock on query_block
- query_cache.free_query(query_block);
- // append_result_data no success => we need unlock
- STRUCT_UNLOCK(&query_cache.structure_guard_mutex);
- DBUG_VOID_RETURN;
- }
+ /*
+ On success, STRUCT_UNLOCK is done by append_result_data. Otherwise, we
+ still need structure_guard_mutex to free the query, and therefore unlock
+ it later in this function.
+ */
+ if (!query_cache.append_result_data(&result, length, (uchar*) packet,
+ query_block))
+ {
+ DBUG_PRINT("warning", ("Can't append data"));
header->result(result);
- header->last_pkt_nr= net->pkt_nr;
- BLOCK_UNLOCK_WR(query_block);
- DBUG_EXECUTE("check_querycache",query_cache.check_integrity(0););
- }
- else
+ DBUG_PRINT("qcache", ("free query 0x%lx", (ulong) query_block));
+ // The following call will remove the lock on query_block
+ query_cache.free_query(query_block);
+ // append_result_data no success => we need unlock
STRUCT_UNLOCK(&query_cache.structure_guard_mutex);
+ DBUG_VOID_RETURN;
+ }
+
+ header->result(result);
+ header->last_pkt_nr= net->pkt_nr;
+ BLOCK_UNLOCK_WR(query_block);
+ DBUG_EXECUTE("check_querycache",query_cache.check_integrity(0););
+
DBUG_VOID_RETURN;
}
@@ -671,17 +710,21 @@ void query_cache_abort(NET *net)
DBUG_VOID_RETURN;
STRUCT_LOCK(&query_cache.structure_guard_mutex);
-
- if (unlikely(query_cache.query_cache_size == 0 ||
- query_cache.flush_in_progress))
+ bool interrupt;
+ query_cache.wait_while_table_flush_is_in_progress(&interrupt);
+ if (interrupt)
{
STRUCT_UNLOCK(&query_cache.structure_guard_mutex);
DBUG_VOID_RETURN;
}
+ /*
+ While we were waiting another thread might have changed the status
+ of the writer. Make sure the writer still exists before continue.
+ */
Query_cache_block *query_block= ((Query_cache_block*)
net->query_cache_query);
- if (query_block) // Test if changed by other thread
+ if (query_block)
{
DUMP(&query_cache);
BLOCK_LOCK_WR(query_block);
@@ -713,13 +756,22 @@ void query_cache_end_of_result(THD *thd)
STRUCT_LOCK(&query_cache.structure_guard_mutex);
- if (unlikely(query_cache.query_cache_size == 0 ||
- query_cache.flush_in_progress))
- goto end;
+ bool interrupt;
+ query_cache.wait_while_table_flush_is_in_progress(&interrupt);
+ if (interrupt)
+ {
+ STRUCT_UNLOCK(&query_cache.structure_guard_mutex);
+ DBUG_VOID_RETURN;
+ }
query_block= ((Query_cache_block*) thd->net.query_cache_query);
if (query_block)
{
+ /*
+ The writer is still present; finish last result block by chopping it to
+ suitable size if needed and setting block type. Since this is the last
+ block, the writer should be dropped.
+ */
DUMP(&query_cache);
BLOCK_LOCK_WR(query_block);
Query_cache_query *header= query_block->query();
@@ -741,19 +793,22 @@ void query_cache_end_of_result(THD *thd)
query_cache.wreck() switched query cache off but left content
untouched for investigation (it is debugging method).
*/
- goto end;
+ STRUCT_UNLOCK(&query_cache.structure_guard_mutex);
+ DBUG_VOID_RETURN;
}
#endif
header->found_rows(current_thd->limit_found_rows);
header->result()->type= Query_cache_block::RESULT;
+
+ /* Drop the writer. */
header->writer(0);
thd->net.query_cache_query= 0;
+
BLOCK_UNLOCK_WR(query_block);
DBUG_EXECUTE("check_querycache",query_cache.check_integrity(1););
}
-end:
STRUCT_UNLOCK(&query_cache.structure_guard_mutex);
DBUG_VOID_RETURN;
}
@@ -765,6 +820,18 @@ void query_cache_invalidate_by_MyISAM_filename(const char *filename)
}
+/*
+ The following function forms part of the C plugin API
+*/
+extern "C"
+void mysql_query_cache_invalidate4(THD *thd,
+ const char *key, unsigned key_length,
+ int using_trx)
+{
+ query_cache.invalidate(thd, key, (uint32) key_length, (my_bool) using_trx);
+}
+
+
/*****************************************************************************
Query_cache methods
*****************************************************************************/
@@ -801,9 +868,9 @@ ulong Query_cache::resize(ulong query_cache_size_arg)
DBUG_ASSERT(initialized);
STRUCT_LOCK(&structure_guard_mutex);
- while (flush_in_progress)
- pthread_cond_wait(&COND_flush_finished, &structure_guard_mutex);
- flush_in_progress= TRUE;
+ while (is_flushing())
+ pthread_cond_wait(&COND_cache_status_changed, &structure_guard_mutex);
+ m_cache_status= Query_cache::FLUSH_IN_PROGRESS;
STRUCT_UNLOCK(&structure_guard_mutex);
free_cache();
@@ -814,8 +881,8 @@ ulong Query_cache::resize(ulong query_cache_size_arg)
DBUG_EXECUTE("check_querycache",check_integrity(0););
STRUCT_LOCK(&structure_guard_mutex);
- flush_in_progress= FALSE;
- pthread_cond_signal(&COND_flush_finished);
+ m_cache_status= Query_cache::NO_FLUSH_IN_PROGRESS;
+ pthread_cond_signal(&COND_cache_status_changed);
STRUCT_UNLOCK(&structure_guard_mutex);
DBUG_RETURN(new_query_cache_size);
@@ -910,8 +977,13 @@ def_week_frmt: %lu",
ha_release_temporary_latches(thd);
STRUCT_LOCK(&structure_guard_mutex);
- if (query_cache_size == 0 || flush_in_progress)
+ if (query_cache_size == 0 || is_flushing())
{
+ /*
+ A table- or a full flush operation can potentially take a long time to
+ finish. We choose not to wait for them and skip caching statements
+ instead.
+ */
STRUCT_UNLOCK(&structure_guard_mutex);
DBUG_VOID_RETURN;
}
@@ -954,7 +1026,7 @@ def_week_frmt: %lu",
Query_cache_block *query_block;
query_block= write_block_data(tot_length, (uchar*) thd->query,
ALIGN_SIZE(sizeof(Query_cache_query)),
- Query_cache_block::QUERY, local_tables, 1);
+ Query_cache_block::QUERY, local_tables);
if (query_block != 0)
{
DBUG_PRINT("qcache", ("query block 0x%lx allocated, %lu",
@@ -1088,13 +1160,21 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length)
}
STRUCT_LOCK(&structure_guard_mutex);
- if (query_cache_size == 0 || flush_in_progress)
+
+ if (query_cache_size == 0)
+ goto err_unlock;
+
+ if (is_flushing())
{
- DBUG_PRINT("qcache", ("query cache disabled"));
+ /* Return; Query cache is temporarily disabled while we flush. */
+ DBUG_PRINT("qcache",("query cache disabled"));
goto err_unlock;
}
- /* Check that we haven't forgot to reset the query cache variables */
+ /*
+ Check that we haven't forgot to reset the query cache variables;
+ make sure there are no attached query cache writer to this thread.
+ */
DBUG_ASSERT(thd->net.query_cache_query == 0);
Query_cache_block *query_block;
@@ -1267,7 +1347,9 @@ def_week_frmt: %lu",
("Handler require invalidation queries of %s.%s %lu-%lu",
table_list.db, table_list.alias,
(ulong) engine_data, (ulong) table->engine_data()));
- invalidate_table((uchar *) table->db(), table->key_length());
+ invalidate_table_internal(thd,
+ (uchar *) table->db(),
+ table->key_length());
}
else
thd->lex->safe_to_cache_query= 0; // Don't try to cache this
@@ -1330,32 +1412,26 @@ void Query_cache::invalidate(THD *thd, TABLE_LIST *tables_used,
my_bool using_transactions)
{
DBUG_ENTER("Query_cache::invalidate (table list)");
- STRUCT_LOCK(&structure_guard_mutex);
- if (query_cache_size > 0 && !flush_in_progress)
- {
- DUMP(this);
- using_transactions= using_transactions &&
- (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN));
- for (; tables_used; tables_used= tables_used->next_local)
- {
- DBUG_ASSERT(!using_transactions || tables_used->table!=0);
- if (tables_used->derived)
- continue;
- if (using_transactions &&
- (tables_used->table->file->table_cache_type() ==
- HA_CACHE_TBL_TRANSACT))
- /*
- Tables_used->table can't be 0 in transaction.
- Only 'drop' invalidate not opened table, but 'drop'
- force transaction finish.
- */
- thd->add_changed_table(tables_used->table);
- else
- invalidate_table(tables_used);
- }
+ using_transactions= using_transactions &&
+ (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN));
+ for (; tables_used; tables_used= tables_used->next_local)
+ {
+ DBUG_ASSERT(!using_transactions || tables_used->table!=0);
+ if (tables_used->derived)
+ continue;
+ if (using_transactions &&
+ (tables_used->table->file->table_cache_type() ==
+ HA_CACHE_TBL_TRANSACT))
+ /*
+ tables_used->table can't be 0 in transaction.
+ Only 'drop' invalidate not opened table, but 'drop'
+ force transaction finish.
+ */
+ thd->add_changed_table(tables_used->table);
+ else
+ invalidate_table(thd, tables_used);
}
- STRUCT_UNLOCK(&structure_guard_mutex);
DBUG_VOID_RETURN;
}
@@ -1363,21 +1439,13 @@ void Query_cache::invalidate(THD *thd, TABLE_LIST *tables_used,
void Query_cache::invalidate(CHANGED_TABLE_LIST *tables_used)
{
DBUG_ENTER("Query_cache::invalidate (changed table list)");
- if (tables_used)
+ THD *thd= current_thd;
+ for (; tables_used; tables_used= tables_used->next)
{
- STRUCT_LOCK(&structure_guard_mutex);
- if (query_cache_size > 0 && !flush_in_progress)
- {
- DUMP(this);
- for (; tables_used; tables_used= tables_used->next)
- {
- invalidate_table((uchar*) tables_used->key, tables_used->key_length);
- DBUG_PRINT("qcache", ("db: %s table: %s", tables_used->key,
- tables_used->key+
- strlen(tables_used->key)+1));
- }
- }
- STRUCT_UNLOCK(&structure_guard_mutex);
+ invalidate_table(thd, (uchar*) tables_used->key, tables_used->key_length);
+ DBUG_PRINT("qcache", ("db: %s table: %s", tables_used->key,
+ tables_used->key+
+ strlen(tables_used->key)+1));
}
DBUG_VOID_RETURN;
}
@@ -1396,20 +1464,14 @@ void Query_cache::invalidate(CHANGED_TABLE_LIST *tables_used)
void Query_cache::invalidate_locked_for_write(TABLE_LIST *tables_used)
{
DBUG_ENTER("Query_cache::invalidate_locked_for_write");
- if (tables_used)
+ for (; tables_used; tables_used= tables_used->next_local)
{
- STRUCT_LOCK(&structure_guard_mutex);
- if (query_cache_size > 0 && !flush_in_progress)
+ if (tables_used->lock_type & (TL_WRITE_LOW_PRIORITY | TL_WRITE) &&
+ tables_used->table)
{
- DUMP(this);
- for (; tables_used; tables_used= tables_used->next_local)
- {
- if (tables_used->lock_type & (TL_WRITE_LOW_PRIORITY | TL_WRITE) &&
- tables_used->table)
- invalidate_table(tables_used->table);
- }
+ THD *thd= current_thd;
+ invalidate_table(thd, tables_used->table);
}
- STRUCT_UNLOCK(&structure_guard_mutex);
}
DBUG_VOID_RETURN;
}
@@ -1423,18 +1485,14 @@ void Query_cache::invalidate(THD *thd, TABLE *table,
{
DBUG_ENTER("Query_cache::invalidate (table)");
- STRUCT_LOCK(&structure_guard_mutex);
- if (query_cache_size > 0 && !flush_in_progress)
- {
- using_transactions= using_transactions &&
- (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN));
- if (using_transactions &&
- (table->file->table_cache_type() == HA_CACHE_TBL_TRANSACT))
- thd->add_changed_table(table);
- else
- invalidate_table(table);
- }
- STRUCT_UNLOCK(&structure_guard_mutex);
+ using_transactions= using_transactions &&
+ (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN));
+ if (using_transactions &&
+ (table->file->table_cache_type() == HA_CACHE_TBL_TRANSACT))
+ thd->add_changed_table(table);
+ else
+ invalidate_table(thd, table);
+
DBUG_VOID_RETURN;
}
@@ -1443,31 +1501,80 @@ void Query_cache::invalidate(THD *thd, const char *key, uint32 key_length,
my_bool using_transactions)
{
DBUG_ENTER("Query_cache::invalidate (key)");
-
- STRUCT_LOCK(&structure_guard_mutex);
- if (query_cache_size > 0 && !flush_in_progress)
- {
- using_transactions= using_transactions &&
- (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN));
- if (using_transactions) // used for innodb => has_transactions() is TRUE
- thd->add_changed_table(key, key_length);
- else
- invalidate_table((uchar*)key, key_length);
- }
- STRUCT_UNLOCK(&structure_guard_mutex);
+
+ using_transactions= using_transactions &&
+ (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN));
+ if (using_transactions) // used for innodb => has_transactions() is TRUE
+ thd->add_changed_table(key, key_length);
+ else
+ invalidate_table(thd, (uchar*)key, key_length);
DBUG_VOID_RETURN;
}
+
+/**
+ @brief Synchronize the thread with any flushing operations.
+
+ This helper function is called whenever a thread needs to operate on the
+ query cache structure (example: during invalidation). If a table flush is in
+ progress this function will wait for it to stop. If a full flush is in
+ progress, the function will set the interrupt parameter to indicate that the
+ current operation is redundant and should be interrupted.
+
+ @param[out] interrupt This out-parameter will be set to TRUE if the calling
+ function is redundant and should be interrupted.
+
+ @return If the interrupt-parameter is TRUE then m_cache_status is set to
+ NO_FLUSH_IN_PROGRESS. If the interrupt-parameter is FALSE then
+ m_cache_status is set to FLUSH_IN_PROGRESS.
+ The structure_guard_mutex will in any case be locked.
+*/
+
+void Query_cache::wait_while_table_flush_is_in_progress(bool *interrupt)
+{
+ while (is_flushing())
+ {
+ /*
+ If there already is a full flush in progress query cache isn't enabled
+ and additional flushes are redundant; just return instead.
+ */
+ if (m_cache_status == Query_cache::FLUSH_IN_PROGRESS)
+ {
+ *interrupt= TRUE;
+ return;
+ }
+ /*
+ If a table flush is in progress; wait on cache status to change.
+ */
+ if (m_cache_status == Query_cache::TABLE_FLUSH_IN_PROGRESS)
+ pthread_cond_wait(&COND_cache_status_changed, &structure_guard_mutex);
+ }
+ *interrupt= FALSE;
+}
+
+
/**
@brief Remove all cached queries that uses the given database
*/
+
void Query_cache::invalidate(char *db)
{
bool restart= FALSE;
DBUG_ENTER("Query_cache::invalidate (db)");
+
STRUCT_LOCK(&structure_guard_mutex);
- if (query_cache_size > 0 && !flush_in_progress)
+ bool interrupt;
+ wait_while_table_flush_is_in_progress(&interrupt);
+ if (interrupt)
+ {
+ STRUCT_UNLOCK(&structure_guard_mutex);
+ return;
+ }
+
+ THD *thd= current_thd;
+
+ if (query_cache_size > 0)
{
if (tables_blocks)
{
@@ -1479,7 +1586,10 @@ void Query_cache::invalidate(char *db)
Query_cache_block *next= table_block->next;
Query_cache_table *table = table_block->table();
if (strcmp(table->db(),db) == 0)
- invalidate_table(table_block);
+ {
+ Query_cache_block_table *list_root= table_block->table(0);
+ invalidate_query_block_list(thd,list_root);
+ }
table_block= next;
@@ -1526,21 +1636,12 @@ void Query_cache::invalidate_by_MyISAM_filename(const char *filename)
{
DBUG_ENTER("Query_cache::invalidate_by_MyISAM_filename");
- STRUCT_LOCK(&structure_guard_mutex);
- if (query_cache_size > 0 && !flush_in_progress)
- {
- /* Calculate the key outside the lock to make the lock shorter */
- char key[MAX_DBKEY_LENGTH];
- uint32 db_length;
- uint key_length= filename_2_table_key(key, filename, &db_length);
- Query_cache_block *table_block;
- if ((table_block = (Query_cache_block*) hash_search(&tables,
- (uchar*) key,
- key_length)))
- invalidate_table(table_block);
- }
- STRUCT_UNLOCK(&structure_guard_mutex);
-
+ /* Calculate the key outside the lock to make the lock shorter */
+ char key[MAX_DBKEY_LENGTH];
+ uint32 db_length;
+ uint key_length= filename_2_table_key(key, filename, &db_length);
+ THD *thd= current_thd;
+ invalidate_table(thd,(uchar *)key, key_length);
DBUG_VOID_RETURN;
}
@@ -1562,16 +1663,43 @@ void Query_cache::flush()
DBUG_VOID_RETURN;
}
- /* Join result in cache in 1 block (if result length > join_limit) */
+
+/**
+ @brief Rearrange the memory blocks and join result in cache in 1 block (if
+ result length > join_limit)
+
+ @param[in] join_limit If the minimum length of a result block to be joined.
+ @param[in] iteration_limit The maximum number of packing and joining
+ sequences.
+
+*/
void Query_cache::pack(ulong join_limit, uint iteration_limit)
{
DBUG_ENTER("Query_cache::pack");
+
+ bool interrupt;
+ STRUCT_LOCK(&structure_guard_mutex);
+ wait_while_table_flush_is_in_progress(&interrupt);
+ if (interrupt)
+ {
+ STRUCT_UNLOCK(&structure_guard_mutex);
+ DBUG_VOID_RETURN;
+ }
+
+ if (query_cache_size == 0)
+ {
+ STRUCT_UNLOCK(&structure_guard_mutex);
+ DBUG_VOID_RETURN;
+ }
+
uint i = 0;
do
{
pack_cache();
} while ((++i < iteration_limit) && join_results(join_limit));
+
+ STRUCT_UNLOCK(&structure_guard_mutex);
DBUG_VOID_RETURN;
}
@@ -1590,7 +1718,7 @@ void Query_cache::destroy()
free_cache();
STRUCT_UNLOCK(&structure_guard_mutex);
- pthread_cond_destroy(&COND_flush_finished);
+ pthread_cond_destroy(&COND_cache_status_changed);
pthread_mutex_destroy(&structure_guard_mutex);
initialized = 0;
}
@@ -1606,8 +1734,8 @@ void Query_cache::init()
{
DBUG_ENTER("Query_cache::init");
pthread_mutex_init(&structure_guard_mutex,MY_MUTEX_INIT_FAST);
- pthread_cond_init(&COND_flush_finished, NULL);
- flush_in_progress= FALSE;
+ pthread_cond_init(&COND_cache_status_changed, NULL);
+ m_cache_status= Query_cache::NO_FLUSH_IN_PROGRESS;
initialized = 1;
DBUG_VOID_RETURN;
}
@@ -1809,9 +1937,10 @@ void Query_cache::make_disabled()
/**
@class Query_cache
@brief Free all resources allocated by the cache.
- @details This function frees all resources allocated by the cache. You
- have to call init_cache() before using the cache again. This function requires
- the structure_guard_mutex to be locked.
+
+ This function frees all resources allocated by the cache. You
+ have to call init_cache() before using the cache again. This function
+ requires the structure_guard_mutex to be locked.
*/
void Query_cache::free_cache()
@@ -1830,24 +1959,17 @@ void Query_cache::free_cache()
*****************************************************************************/
-/*
- flush_cache() - flush the cache.
-
- SYNOPSIS
- flush_cache()
-
- DESCRIPTION
- This function will flush cache contents. It assumes we have
- 'structure_guard_mutex' locked. The function sets the
- flush_in_progress flag and releases the lock, so other threads may
- proceed skipping the cache as if it is disabled. Concurrent
- flushes are performed in turn.
-
- After flush_cache() call, the cache is flushed, all the freed
- memory is accumulated in bin[0], and the 'structure_guard_mutex'
- is locked. However, since we could release the mutex during
- execution, the rest of the cache state could have been changed,
- and should not be relied on.
+/**
+ @brief Flush the cache.
+
+ This function will flush cache contents. It assumes we have
+ 'structure_guard_mutex' locked. The function sets the m_cache_status flag and
+ releases the lock, so other threads may proceed skipping the cache as if it
+ is disabled. Concurrent flushes are performed in turn.
+ After flush_cache() call, the cache is flushed, all the freed memory is
+ accumulated in bin[0], and the 'structure_guard_mutex' is locked. However,
+ since we could release the mutex during execution, the rest of the cache
+ state could have been changed, and should not be relied on.
*/
void Query_cache::flush_cache()
@@ -1859,15 +1981,15 @@ void Query_cache::flush_cache()
Query_cache::free_cache()) depends on the fact that after the
flush the cache is empty.
*/
- while (flush_in_progress)
- pthread_cond_wait(&COND_flush_finished, &structure_guard_mutex);
+ while (is_flushing())
+ pthread_cond_wait(&COND_cache_status_changed, &structure_guard_mutex);
/*
- Setting 'flush_in_progress' will prevent other threads from using
+ Setting 'FLUSH_IN_PROGRESS' will prevent other threads from using
the cache while we are in the middle of the flush, and we release
the lock so that other threads won't block.
*/
- flush_in_progress= TRUE;
+ m_cache_status= Query_cache::FLUSH_IN_PROGRESS;
STRUCT_UNLOCK(&structure_guard_mutex);
my_hash_reset(&queries);
@@ -1878,8 +2000,8 @@ void Query_cache::flush_cache()
}
STRUCT_LOCK(&structure_guard_mutex);
- flush_in_progress= FALSE;
- pthread_cond_signal(&COND_flush_finished);
+ m_cache_status= Query_cache::NO_FLUSH_IN_PROGRESS;
+ pthread_cond_signal(&COND_cache_status_changed);
}
/*
@@ -1897,7 +2019,7 @@ my_bool Query_cache::free_old_query()
sequence is breached.
Also we don't need remove locked queries at this point.
*/
- Query_cache_block *query_block = 0;
+ Query_cache_block *query_block= 0;
if (queries_blocks != 0)
{
Query_cache_block *block = queries_blocks;
@@ -2035,8 +2157,7 @@ Query_cache_block *
Query_cache::write_block_data(ulong data_len, uchar* data,
ulong header_len,
Query_cache_block::block_type type,
- TABLE_COUNTER_TYPE ntab,
- my_bool under_guard)
+ TABLE_COUNTER_TYPE ntab)
{
ulong all_headers_len = (ALIGN_SIZE(sizeof(Query_cache_block)) +
ALIGN_SIZE(ntab*sizeof(Query_cache_block_table)) +
@@ -2046,9 +2167,8 @@ Query_cache::write_block_data(ulong data_len, uchar* data,
DBUG_ENTER("Query_cache::write_block_data");
DBUG_PRINT("qcache", ("data: %ld, header: %ld, all header: %ld",
data_len, header_len, all_headers_len));
- Query_cache_block *block = allocate_block(max(align_len,
- min_allocation_unit),
- 1, 0, under_guard);
+ Query_cache_block *block= allocate_block(max(align_len,
+ min_allocation_unit),1, 0);
if (block != 0)
{
block->type = type;
@@ -2265,8 +2385,7 @@ my_bool Query_cache::allocate_data_chain(Query_cache_block **result_block,
if (!(new_block= allocate_block(max(min_size, align_len),
min_result_data_size == 0,
- all_headers_len + min_result_data_size,
- 1)))
+ all_headers_len + min_result_data_size)))
{
DBUG_PRINT("warning", ("Can't allocate block for results"));
DBUG_RETURN(FALSE);
@@ -2308,51 +2427,109 @@ my_bool Query_cache::allocate_data_chain(Query_cache_block **result_block,
Invalidate the first table in the table_list
*/
-void Query_cache::invalidate_table(TABLE_LIST *table_list)
+void Query_cache::invalidate_table(THD *thd, TABLE_LIST *table_list)
{
if (table_list->table != 0)
- invalidate_table(table_list->table); // Table is open
+ invalidate_table(thd, table_list->table); // Table is open
else
{
char key[MAX_DBKEY_LENGTH];
uint key_length;
- Query_cache_block *table_block;
+
key_length=(uint) (strmov(strmov(key,table_list->db)+1,
table_list->table_name) -key)+ 1;
// We don't store temporary tables => no key_length+=4 ...
- if ((table_block = (Query_cache_block*)
- hash_search(&tables,(uchar*) key,key_length)))
- invalidate_table(table_block);
+ invalidate_table(thd, (uchar *)key, key_length);
}
}
-void Query_cache::invalidate_table(TABLE *table)
+void Query_cache::invalidate_table(THD *thd, TABLE *table)
{
- invalidate_table((uchar*) table->s->table_cache_key.str,
+ invalidate_table(thd, (uchar*) table->s->table_cache_key.str,
table->s->table_cache_key.length);
}
-void Query_cache::invalidate_table(uchar * key, uint32 key_length)
+void Query_cache::invalidate_table(THD *thd, uchar * key, uint32 key_length)
+{
+ bool interrupt;
+ STRUCT_LOCK(&structure_guard_mutex);
+ wait_while_table_flush_is_in_progress(&interrupt);
+ if (interrupt)
+ {
+ STRUCT_UNLOCK(&structure_guard_mutex);
+ return;
+ }
+
+ /*
+ Setting 'TABLE_FLUSH_IN_PROGRESS' will temporarily disable the cache
+ so that structural changes to cache won't block the entire server.
+ However, threads requesting to change the query cache will still have
+ to wait for the flush to finish.
+ */
+ m_cache_status= Query_cache::TABLE_FLUSH_IN_PROGRESS;
+ STRUCT_UNLOCK(&structure_guard_mutex);
+
+ if (query_cache_size > 0)
+ invalidate_table_internal(thd, key, key_length);
+
+ STRUCT_LOCK(&structure_guard_mutex);
+ m_cache_status= Query_cache::NO_FLUSH_IN_PROGRESS;
+
+ /*
+ net_real_write might be waiting on a change on the m_cache_status
+ variable.
+ */
+ pthread_cond_signal(&COND_cache_status_changed);
+ STRUCT_UNLOCK(&structure_guard_mutex);
+}
+
+
+/**
+ Try to locate and invalidate a table by name.
+ The caller must ensure that no other thread is trying to work with
+ the query cache when this function is executed.
+
+ @pre structure_guard_mutex is acquired or TABLE_FLUSH_IN_PROGRESS is set.
+*/
+
+void
+Query_cache::invalidate_table_internal(THD *thd, uchar *key, uint32 key_length)
{
- Query_cache_block *table_block;
- if ((table_block = ((Query_cache_block*)
- hash_search(&tables, key, key_length))))
- invalidate_table(table_block);
+ Query_cache_block *table_block=
+ (Query_cache_block*)hash_search(&tables, key, key_length);
+ if (table_block)
+ {
+ Query_cache_block_table *list_root= table_block->table(0);
+ invalidate_query_block_list(thd, list_root);
+ }
}
-void Query_cache::invalidate_table(Query_cache_block *table_block)
+/**
+ @brief Invalidate a linked list of query cache blocks.
+
+ Each block tries to aquire a block level lock before
+ free_query is a called. This function will in turn affect
+ related table- and result-blocks.
+
+ @param[in,out] thd Thread context.
+ @param[in,out] list_root A pointer to a circular list of query blocks.
+
+*/
+
+void
+Query_cache::invalidate_query_block_list(THD *thd,
+ Query_cache_block_table *list_root)
{
- Query_cache_block_table *list_root = table_block->table(0);
while (list_root->next != list_root)
{
- Query_cache_block *query_block = list_root->next->block();
+ Query_cache_block *query_block= list_root->next->block();
BLOCK_LOCK_WR(query_block);
free_query(query_block);
+ DBUG_EXECUTE_IF("debug_cache_locks", sleep(10););
}
}
-
/*
Register given table list begining with given position in tables table of
block
@@ -2495,9 +2672,13 @@ my_bool Query_cache::register_all_tables(Query_cache_block *block,
return (n);
}
-/*
- Insert used tablename in cache
- Returns 0 on error
+
+/**
+ @brief Insert used table name into the cache.
+
+ @return Error status
+ @retval FALSE On error
+ @retval TRUE On success
*/
my_bool
@@ -2511,9 +2692,10 @@ Query_cache::insert_table(uint key_len, char *key,
DBUG_PRINT("qcache", ("insert table node 0x%lx, len %d",
(ulong)node, key_len));
- Query_cache_block *table_block = ((Query_cache_block *)
- hash_search(&tables, (uchar*) key,
- key_len));
+ THD *thd= current_thd;
+
+ Query_cache_block *table_block=
+ (Query_cache_block *)hash_search(&tables, (uchar*) key, key_len);
if (table_block &&
table_block->table()->engine_data() != engine_data)
@@ -2528,7 +2710,11 @@ Query_cache::insert_table(uint key_len, char *key,
as far as we delete all queries with this table, table block will be
deleted, too
*/
- invalidate_table(table_block);
+ {
+ Query_cache_block_table *list_root= table_block->table(0);
+ invalidate_query_block_list(thd, list_root);
+ }
+
table_block= 0;
}
@@ -2536,21 +2722,29 @@ Query_cache::insert_table(uint key_len, char *key,
{
DBUG_PRINT("qcache", ("new table block from 0x%lx (%u)",
(ulong) key, (int) key_len));
- table_block = write_block_data(key_len, (uchar*) key,
- ALIGN_SIZE(sizeof(Query_cache_table)),
- Query_cache_block::TABLE,
- 1, 1);
+ table_block= write_block_data(key_len, (uchar*) key,
+ ALIGN_SIZE(sizeof(Query_cache_table)),
+ Query_cache_block::TABLE, 1);
if (table_block == 0)
{
DBUG_PRINT("qcache", ("Can't write table name to cache"));
DBUG_RETURN(0);
}
- Query_cache_table *header = table_block->table();
+ Query_cache_table *header= table_block->table();
double_linked_list_simple_include(table_block,
- &tables_blocks);
- Query_cache_block_table *list_root = table_block->table(0);
- list_root->n = 0;
- list_root->next = list_root->prev = list_root;
+ &tables_blocks);
+ /*
+ First node in the Query_cache_block_table-chain is the table-type
+ block. This block will only have one Query_cache_block_table (n=0).
+ */
+ Query_cache_block_table *list_root= table_block->table(0);
+ list_root->n= 0;
+
+ /*
+ The node list is circular in nature.
+ */
+ list_root->next= list_root->prev= list_root;
+
if (my_hash_insert(&tables, (const uchar *) table_block))
{
DBUG_PRINT("qcache", ("Can't insert table to hash"));
@@ -2558,20 +2752,37 @@ Query_cache::insert_table(uint key_len, char *key,
free_memory_block(table_block);
DBUG_RETURN(0);
}
- char *db = header->db();
+ char *db= header->db();
header->table(db + db_length + 1);
header->key_length(key_len);
header->type(cache_type);
header->callback(callback);
header->engine_data(engine_data);
+
+ /*
+ We insert this table without the assumption that it isn't refrenenced by
+ any queries.
+ */
+ header->m_cached_query_count= 0;
}
- Query_cache_block_table *list_root = table_block->table(0);
- node->next = list_root->next;
- list_root->next = node;
- node->next->prev = node;
- node->prev = list_root;
- node->parent = table_block->table();
+ /*
+ Table is now in the cache; link the table_block-node associated
+ with the currently processed query into the chain of queries depending
+ on the cached table.
+ */
+ Query_cache_block_table *list_root= table_block->table(0);
+ node->next= list_root->next;
+ list_root->next= node;
+ node->next->prev= node;
+ node->prev= list_root;
+ node->parent= table_block->table();
+ /*
+ Increase the counter to keep track on how long this chain
+ of queries is.
+ */
+ Query_cache_table *table_block_data= table_block->table();
+ table_block_data->m_cached_query_count++;
DBUG_RETURN(1);
}
@@ -2579,15 +2790,27 @@ Query_cache::insert_table(uint key_len, char *key,
void Query_cache::unlink_table(Query_cache_block_table *node)
{
DBUG_ENTER("Query_cache::unlink_table");
- node->prev->next = node->next;
- node->next->prev = node->prev;
- Query_cache_block_table *neighbour = node->next;
+ node->prev->next= node->next;
+ node->next->prev= node->prev;
+ Query_cache_block_table *neighbour= node->next;
+ Query_cache_table *table_block_data= node->parent;
+ table_block_data->m_cached_query_count--;
+
+ DBUG_ASSERT(table_block_data->m_cached_query_count >= 0);
+
if (neighbour->next == neighbour)
{
- // list is empty (neighbor is root of list)
- Query_cache_block *table_block = neighbour->block();
+ DBUG_ASSERT(table_block_data->m_cached_query_count == 0);
+ /*
+ If neighbor is root of list, the list is empty.
+ The root of the list is always a table-type block
+ which contain exactly one Query_cache_block_table
+ node object, thus we can use the block() method
+ to calculate the Query_cache_block address.
+ */
+ Query_cache_block *table_block= neighbour->block();
double_linked_list_exclude(table_block,
- &tables_blocks);
+ &tables_blocks);
hash_delete(&tables,(uchar *) table_block);
free_memory_block(table_block);
}
@@ -2599,12 +2822,11 @@ void Query_cache::unlink_table(Query_cache_block_table *node)
*****************************************************************************/
Query_cache_block *
-Query_cache::allocate_block(ulong len, my_bool not_less, ulong min,
- my_bool under_guard)
+Query_cache::allocate_block(ulong len, my_bool not_less, ulong min)
{
DBUG_ENTER("Query_cache::allocate_block");
- DBUG_PRINT("qcache", ("len %lu, not less %d, min %lu, uder_guard %d",
- len, not_less,min,under_guard));
+ DBUG_PRINT("qcache", ("len %lu, not less %d, min %lu",
+ len, not_less,min));
if (len >= min(query_cache_size, query_cache_limit))
{
@@ -2613,17 +2835,6 @@ Query_cache::allocate_block(ulong len, my_bool not_less, ulong min,
DBUG_RETURN(0); // in any case we don't have such piece of memory
}
- if (!under_guard)
- {
- STRUCT_LOCK(&structure_guard_mutex);
-
- if (unlikely(query_cache.query_cache_size == 0 || flush_in_progress))
- {
- STRUCT_UNLOCK(&structure_guard_mutex);
- DBUG_RETURN(0);
- }
- }
-
/* Free old queries until we have enough memory to store this block */
Query_cache_block *block;
do
@@ -2638,8 +2849,6 @@ Query_cache::allocate_block(ulong len, my_bool not_less, ulong min,
split_block(block,ALIGN_SIZE(len));
}
- if (!under_guard)
- STRUCT_UNLOCK(&structure_guard_mutex);
DBUG_RETURN(block);
}
@@ -2874,9 +3083,7 @@ uint Query_cache::find_bin(ulong size)
}
uint bin = steps[left].idx -
(uint)((size - steps[left].size)/steps[left].increment);
-#ifndef DBUG_OFF
- bins_dump();
-#endif
+
DBUG_PRINT("qcache", ("bin %u step %u, size %lu step size %lu",
bin, left, size, steps[left].size));
DBUG_RETURN(bin);
@@ -3165,18 +3372,17 @@ my_bool Query_cache::ask_handler_allowance(THD *thd,
Packing
*****************************************************************************/
+
+/**
+ @brief Rearrange all memory blocks so that free memory joins at the
+ 'bottom' of the allocated memory block containing all cache data.
+ @see Query_cache::pack(ulong join_limit, uint iteration_limit)
+*/
+
void Query_cache::pack_cache()
{
DBUG_ENTER("Query_cache::pack_cache");
- STRUCT_LOCK(&structure_guard_mutex);
-
- if (unlikely(query_cache_size == 0 || flush_in_progress))
- {
- STRUCT_UNLOCK(&structure_guard_mutex);
- DBUG_VOID_RETURN;
- }
-
DBUG_EXECUTE("check_querycache",query_cache.check_integrity(1););
uchar *border = 0;
@@ -3210,7 +3416,6 @@ void Query_cache::pack_cache()
}
DBUG_EXECUTE("check_querycache",query_cache.check_integrity(1););
- STRUCT_UNLOCK(&structure_guard_mutex);
DBUG_VOID_RETURN;
}
@@ -3485,8 +3690,7 @@ my_bool Query_cache::join_results(ulong join_limit)
my_bool has_moving = 0;
DBUG_ENTER("Query_cache::join_results");
- STRUCT_LOCK(&structure_guard_mutex);
- if (queries_blocks != 0 && !flush_in_progress)
+ if (queries_blocks != 0)
{
DBUG_ASSERT(query_cache_size > 0);
Query_cache_block *block = queries_blocks;
@@ -3549,7 +3753,6 @@ my_bool Query_cache::join_results(ulong join_limit)
block = block->next;
} while ( block != queries_blocks );
}
- STRUCT_UNLOCK(&structure_guard_mutex);
DBUG_RETURN(has_moving);
}
@@ -3785,6 +3988,14 @@ void Query_cache::tables_dump()
}
+/**
+ @brief Checks integrity of the various linked lists
+
+ @return Error status code
+ @retval FALSE Query cache is operational.
+ @retval TRUE Query cache is broken.
+*/
+
my_bool Query_cache::check_integrity(bool locked)
{
my_bool result = 0;
@@ -3794,14 +4005,8 @@ my_bool Query_cache::check_integrity(bool locked)
if (!locked)
STRUCT_LOCK(&structure_guard_mutex);
- if (unlikely(query_cache_size == 0 || flush_in_progress))
- {
- if (!locked)
- STRUCT_UNLOCK(&query_cache.structure_guard_mutex);
-
- DBUG_PRINT("qcache", ("Query Cache not initialized"));
- DBUG_RETURN(0);
- }
+ while (is_flushing())
+ pthread_cond_wait(&COND_cache_status_changed,&structure_guard_mutex);
if (hash_check(&queries))
{
diff --git a/sql/sql_cache.h b/sql/sql_cache.h
index 3c5d784ce94..c4c7e1dbc5e 100644
--- a/sql/sql_cache.h
+++ b/sql/sql_cache.h
@@ -65,17 +65,44 @@ struct Query_cache_query;
struct Query_cache_result;
class Query_cache;
+/**
+ @brief This class represents a node in the linked chain of queries
+ belonging to one table.
+ @note The root of this linked list is not a query-type block, but the table-
+ type block which all queries has in common.
+*/
struct Query_cache_block_table
{
Query_cache_block_table() {} /* Remove gcc warning */
- TABLE_COUNTER_TYPE n; // numbr in table (from 0)
+
+ /**
+ This node holds a position in a static table list belonging
+ to the associated query (base 0).
+ */
+ TABLE_COUNTER_TYPE n;
+
+ /**
+ Pointers to the next and previous node, linking all queries with
+ a common table.
+ */
Query_cache_block_table *next, *prev;
+
+ /**
+ A pointer to the table-type block which all
+ linked queries has in common.
+ */
Query_cache_table *parent;
+
+ /**
+ A method to calculate the address of the query cache block
+ owning this node. The purpose of this calculation is to
+ make it easier to move the query cache block without having
+ to modify all the pointer addresses.
+ */
inline Query_cache_block *block();
};
-
struct Query_cache_block
{
Query_cache_block() {} /* Remove gcc warning */
@@ -151,6 +178,11 @@ struct Query_cache_table
/* data need by some engines */
ulonglong engine_data_buff;
+ /**
+ The number of queries depending of this table.
+ */
+ int32 m_cached_query_count;
+
inline char *db() { return (char *) data(); }
inline char *table() { return tbl; }
inline void table(char *table_arg) { tbl= table_arg; }
@@ -237,11 +269,17 @@ public:
ulong free_memory, queries_in_cache, hits, inserts, refused,
free_memory_blocks, total_blocks, lowmem_prunes;
+
private:
- pthread_cond_t COND_flush_finished;
- bool flush_in_progress;
+ pthread_cond_t COND_cache_status_changed;
+
+ enum Cache_status { NO_FLUSH_IN_PROGRESS, FLUSH_IN_PROGRESS,
+ TABLE_FLUSH_IN_PROGRESS };
+
+ Cache_status m_cache_status;
void free_query_internal(Query_cache_block *point);
+ void invalidate_table_internal(THD *thd, uchar *key, uint32 key_length);
protected:
/*
@@ -253,7 +291,7 @@ protected:
2. query block (for operation inside query (query block/results))
Thread doing cache flush releases the mutex once it sets
- flush_in_progress flag, so other threads may bypass the cache as
+ m_cache_status flag, so other threads may bypass the cache as
if it is disabled, not waiting for reset to finish. The exception
is other threads that were going to do cache flush---they'll wait
till the end of a flush operation.
@@ -270,6 +308,7 @@ protected:
/* options */
ulong min_allocation_unit, min_result_data_size;
uint def_query_hash_size, def_table_hash_size;
+
uint mem_bin_num, mem_bin_steps; // See at init_cache & find_bin
my_bool initialized;
@@ -295,10 +334,13 @@ protected:
ulong data_len,
Query_cache_block *query_block,
my_bool first_block);
- void invalidate_table(TABLE_LIST *table);
- void invalidate_table(TABLE *table);
- void invalidate_table(uchar *key, uint32 key_length);
- void invalidate_table(Query_cache_block *table_block);
+ void invalidate_table(THD *thd, TABLE_LIST *table);
+ void invalidate_table(THD *thd, TABLE *table);
+ void invalidate_table(THD *thd, uchar *key, uint32 key_length);
+ void invalidate_table(THD *thd, Query_cache_block *table_block);
+ void invalidate_query_block_list(THD *thd,
+ Query_cache_block_table *list_root);
+
TABLE_COUNTER_TYPE
register_tables_from_list(TABLE_LIST *tables_used,
TABLE_COUNTER_TYPE counter,
@@ -337,6 +379,8 @@ protected:
Query_cache_block *pprev);
my_bool join_results(ulong join_limit);
+ void wait_while_table_flush_is_in_progress(bool *interrupt);
+
/*
Following function control structure_guard_mutex
by themself or don't need structure_guard_mutex
@@ -347,8 +391,7 @@ protected:
Query_cache_block *write_block_data(ulong data_len, uchar* data,
ulong header_len,
Query_cache_block::block_type type,
- TABLE_COUNTER_TYPE ntab = 0,
- my_bool under_guard=0);
+ TABLE_COUNTER_TYPE ntab = 0);
my_bool append_result_data(Query_cache_block **result,
ulong data_len, uchar* data,
Query_cache_block *parent);
@@ -360,8 +403,7 @@ protected:
inline ulong get_min_first_result_data_size();
inline ulong get_min_append_result_data_size();
Query_cache_block *allocate_block(ulong len, my_bool not_less,
- ulong min,
- my_bool under_guard=0);
+ ulong min);
/*
If query is cacheable return number tables in query
(query without tables not cached)
@@ -424,6 +466,11 @@ protected:
friend void query_cache_end_of_result(THD *thd);
friend void query_cache_abort(NET *net);
+ bool is_flushing(void)
+ {
+ return (m_cache_status != Query_cache::NO_FLUSH_IN_PROGRESS);
+ }
+
/*
The following functions are only used when debugging
We don't protect these with ifndef DBUG_OFF to not have to recompile
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 40b37ed7405..da975ee3103 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -207,6 +207,31 @@ Open_tables_state::Open_tables_state(ulong version_arg)
The following functions form part of the C plugin API
*/
+extern "C" int mysql_tmpfile(const char *prefix)
+{
+ char filename[FN_REFLEN];
+ File fd = create_temp_file(filename, mysql_tmpdir, prefix,
+#ifdef __WIN__
+ O_BINARY | O_TRUNC | O_SEQUENTIAL |
+ O_SHORT_LIVED |
+#endif /* __WIN__ */
+ O_CREAT | O_EXCL | O_RDWR | O_TEMPORARY,
+ MYF(MY_WME));
+ if (fd >= 0) {
+#ifndef __WIN__
+ /*
+ This can be removed once the following bug is fixed:
+ Bug #28903 create_temp_file() doesn't honor O_TEMPORARY option
+ (file not removed) (Unix)
+ */
+ unlink(filename);
+#endif /* !__WIN__ */
+ }
+
+ return fd;
+}
+
+
extern "C"
int thd_in_lock_tables(const THD *thd)
{
@@ -253,6 +278,11 @@ int thd_tx_isolation(const THD *thd)
return (int) thd->variables.tx_isolation;
}
+extern "C"
+void thd_inc_row_count(THD *thd)
+{
+ thd->row_count++;
+}
/*
Dumps a text description of a thread, its security context
@@ -381,7 +411,7 @@ THD::THD()
current_linfo = 0;
slave_thread = 0;
bzero(&variables, sizeof(variables));
- thread_id= variables.pseudo_thread_id= 0;
+ thread_id= 0;
one_shot_set= 0;
file_id = 0;
query_id= 0;
@@ -483,6 +513,49 @@ void THD::pop_internal_handler()
m_internal_handler= NULL;
}
+extern "C"
+void *thd_alloc(MYSQL_THD thd, unsigned int size)
+{
+ return thd->alloc(size);
+}
+
+extern "C"
+void *thd_calloc(MYSQL_THD thd, unsigned int size)
+{
+ return thd->calloc(size);
+}
+
+extern "C"
+char *thd_strdup(MYSQL_THD thd, const char *str)
+{
+ return thd->strdup(str);
+}
+
+extern "C"
+char *thd_strmake(MYSQL_THD thd, const char *str, unsigned int size)
+{
+ return thd->strmake(str, size);
+}
+
+extern "C"
+LEX_STRING *thd_make_lex_string(THD *thd, LEX_STRING *lex_str,
+ const char *str, unsigned int size,
+ int allocate_lex_string)
+{
+ return thd->make_lex_string(lex_str, str, size,
+ (bool) allocate_lex_string);
+}
+
+extern "C"
+void *thd_memdup(MYSQL_THD thd, const void* str, unsigned int size)
+{
+ return thd->memdup(str, size);
+}
+
+void thd_get_xid(const MYSQL_THD thd, MYSQL_XID *xid)
+{
+ *xid = *(MYSQL_XID *) &thd->transaction.xid_state.xid;
+}
/*
Init common variables that has to be reset on start and on change_user
@@ -498,6 +571,12 @@ void THD::init(void)
variables.date_format);
variables.datetime_format= date_time_format_copy((THD*) 0,
variables.datetime_format);
+ /*
+ variables= global_system_variables above has reset
+ variables.pseudo_thread_id to 0. We need to correct it here to
+ avoid temporary tables replication failure.
+ */
+ variables.pseudo_thread_id= thread_id;
pthread_mutex_unlock(&LOCK_global_system_variables);
server_status= SERVER_STATUS_AUTOCOMMIT;
if (variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES)
@@ -851,6 +930,30 @@ void THD::cleanup_after_query()
}
+/**
+ Create a LEX_STRING in this connection
+
+ @param lex_str pointer to LEX_STRING object to be initialized
+ @param str initializer to be copied into lex_str
+ @param length length of str, in bytes
+ @param allocate_lex_string if TRUE, allocate new LEX_STRING object,
+ instead of using lex_str value
+ @return NULL on failure, or pointer to the LEX_STRING object
+*/
+LEX_STRING *THD::make_lex_string(LEX_STRING *lex_str,
+ const char* str, uint length,
+ bool allocate_lex_string)
+{
+ if (allocate_lex_string)
+ if (!(lex_str= (LEX_STRING *)alloc(sizeof(LEX_STRING))))
+ return 0;
+ if (!(lex_str->str= strmake_root(mem_root, str, length)))
+ return 0;
+ lex_str->length= length;
+ return lex_str;
+}
+
+
/*
Convert a string to another character set
@@ -1445,6 +1548,8 @@ select_export::prepare(List<Item> &list, SELECT_LEX_UNIT *u)
field_sep_char= (exchange->enclosed->length() ? (*exchange->enclosed)[0] :
field_term_length ? (*exchange->field_term)[0] : INT_MAX);
escape_char= (exchange->escaped->length() ? (*exchange->escaped)[0] : -1);
+ is_ambiguous_field_sep= test(strchr(ESCAPE_CHARS, field_sep_char));
+ is_unsafe_field_sep= test(strchr(NUMERIC_CHARS, field_sep_char));
line_sep_char= (exchange->line_term->length() ?
(*exchange->line_term)[0] : INT_MAX);
if (!field_term_length)
@@ -1519,7 +1624,8 @@ bool select_export::send_data(List<Item> &items)
used_length=min(res->length(),item->max_length);
else
used_length=res->length();
- if (result_type == STRING_RESULT && escape_char != -1)
+ if ((result_type == STRING_RESULT || is_unsafe_field_sep) &&
+ escape_char != -1)
{
char *pos, *start, *end;
CHARSET_INFO *res_charset= res->charset();
@@ -1585,7 +1691,9 @@ bool select_export::send_data(List<Item> &items)
NEED_ESCAPING(pos[1])))
{
char tmp_buff[2];
- tmp_buff[0]= escape_char;
+ tmp_buff[0]= ((int) *pos == field_sep_char &&
+ is_ambiguous_field_sep) ?
+ field_sep_char : escape_char;
tmp_buff[1]= *pos ? *pos : '0';
if (my_b_write(&cache,(uchar*) start,(uint) (pos-start)) ||
my_b_write(&cache,(uchar*) tmp_buff,2))
@@ -2436,7 +2544,43 @@ void THD::restore_backup_open_tables_state(Open_tables_state *backup)
DBUG_VOID_RETURN;
}
+/**
+ Check the killed state of a user thread
+ @param thd user thread
+ @retval 0 the user thread is active
+ @retval 1 the user thread has been killed
+*/
+extern "C" int thd_killed(const MYSQL_THD thd)
+{
+ return(thd->killed);
+}
+
+#ifdef INNODB_COMPATIBILITY_HOOKS
+extern "C" struct charset_info_st *thd_charset(MYSQL_THD thd)
+{
+ return(thd->charset());
+}
+extern "C" char **thd_query(MYSQL_THD thd)
+{
+ return(&thd->query);
+}
+
+extern "C" int thd_slave_thread(const MYSQL_THD thd)
+{
+ return(thd->slave_thread);
+}
+
+extern "C" int thd_non_transactional_update(const MYSQL_THD thd)
+{
+ return(thd->no_trans_update.all);
+}
+
+extern "C" int thd_binlog_format(const MYSQL_THD thd)
+{
+ return (int) thd->variables.binlog_format;
+}
+#endif // INNODB_COMPATIBILITY_HOOKS */
/****************************************************************************
Handling of statement states in functions and triggers.
diff --git a/sql/sql_class.h b/sql/sql_class.h
index a8d62d93b21..71c13e001ee 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -39,8 +39,6 @@ enum enum_ha_read_modes { RFIRST, RNEXT, RPREV, RLAST, RKEY, RNEXT_SAME };
enum enum_duplicates { DUP_ERROR, DUP_REPLACE, DUP_UPDATE };
enum enum_delay_key_write { DELAY_KEY_WRITE_NONE, DELAY_KEY_WRITE_ON,
DELAY_KEY_WRITE_ALL };
-enum enum_check_fields
-{ CHECK_FIELD_IGNORE, CHECK_FIELD_WARN, CHECK_FIELD_ERROR_FOR_NULL };
enum enum_mark_columns
{ MARK_COLUMNS_NONE, MARK_COLUMNS_READ, MARK_COLUMNS_WRITE};
@@ -67,11 +65,23 @@ typedef struct st_user_var_events
#define RP_LOCK_LOG_IS_ALREADY_LOCKED 1
#define RP_FORCE_ROTATE 2
+/*
+ The COPY_INFO structure is used by INSERT/REPLACE code.
+ The schema of the row counting by the INSERT/INSERT ... ON DUPLICATE KEY
+ UPDATE code:
+ If a row is inserted then the copied variable is incremented.
+ If a row is updated by the INSERT ... ON DUPLICATE KEY UPDATE and the
+ new data differs from the old one then the copied and the updated
+ variables are incremented.
+ The touched variable is incremented if a row was touched by the update part
+ of the INSERT ... ON DUPLICATE KEY UPDATE no matter whether the row
+ was actually changed or not.
+*/
typedef struct st_copy_info {
- ha_rows records;
- ha_rows deleted;
- ha_rows updated;
- ha_rows copied;
+ ha_rows records; /* Number of processed records */
+ ha_rows deleted; /* Number of deleted records */
+ ha_rows updated; /* Number of updated records */
+ ha_rows copied; /* Number of copied records */
ha_rows error_count;
ha_rows touched; /* Number of touched records */
enum enum_duplicates handle_duplicates;
@@ -179,7 +189,7 @@ public:
Table_ident *table, List<Key_part_spec> &ref_cols,
uint delete_opt_arg, uint update_opt_arg, uint match_opt_arg)
:Key(FOREIGN_KEY, name_arg, &default_key_create_info, 0, cols),
- ref_table(table), ref_columns(cols),
+ ref_table(table), ref_columns(ref_cols),
delete_opt(delete_opt_arg), update_opt(update_opt_arg),
match_opt(match_opt_arg)
{}
@@ -305,6 +315,7 @@ struct system_variables
my_bool old_mode;
my_bool query_cache_wlock_invalidate;
my_bool engine_condition_pushdown;
+ my_bool keep_files_on_create;
my_bool ndb_force_send;
my_bool ndb_use_copying_alter_table;
my_bool ndb_use_exact_count;
@@ -492,13 +503,6 @@ public:
{ return strdup_root(mem_root,str); }
inline char *strmake(const char *str, size_t size)
{ return strmake_root(mem_root,str,size); }
- inline bool LEX_STRING_make(LEX_STRING *lex_str, const char *str,
- size_t size)
- {
- return ((lex_str->str=
- strmake_root(mem_root, str, (lex_str->length= size)))) == 0;
- }
-
inline void *memdup(const void *str, size_t size)
{ return memdup_root(mem_root,str,size); }
inline void *memdup_w_gap(const void *str, size_t size, uint gap)
@@ -1566,11 +1570,27 @@ public:
proc_info = old_msg;
pthread_mutex_unlock(&mysys_var->mutex);
}
+
+ static inline void safe_time(time_t *t)
+ {
+ /**
+ Wrapper around time() which retries on error (-1)
+
+ @details
+ This is needed because, despite the documentation, time() may fail
+ in some circumstances. Here we retry time() until it succeeds, and
+ log the failure so that performance problems related to this can be
+ identified.
+ */
+ while(unlikely(time(t) == ((time_t) -1)))
+ sql_print_information("time() failed with %d", errno);
+ }
+
inline time_t query_start() { query_start_used=1; return start_time; }
- inline void set_time() { if (user_time) start_time=time_after_lock=user_time; else time_after_lock=time(&start_time); }
- inline void end_time() { time(&start_time); }
+ inline void set_time() { if (user_time) start_time=time_after_lock=user_time; else { safe_time(&start_time); time_after_lock= start_time; }}
+ inline void end_time() { safe_time(&start_time); }
inline void set_time(time_t t) { time_after_lock=start_time=user_time=t; }
- inline void lock_time() { time(&time_after_lock); }
+ inline void lock_time() { safe_time(&time_after_lock); }
inline ulonglong found_rows(void)
{
return limit_found_rows;
@@ -1596,6 +1616,10 @@ public:
return alloc_root(&transaction.mem_root,size);
}
+ LEX_STRING *make_lex_string(LEX_STRING *lex_str,
+ const char* str, uint length,
+ bool allocate_lex_string);
+
bool convert_string(LEX_STRING *to, CHARSET_INFO *to_cs,
const char *from, uint from_length,
CHARSET_INFO *from_cs);
@@ -1949,9 +1973,30 @@ public:
};
+#define ESCAPE_CHARS "ntrb0ZN" // keep synchronous with READ_INFO::unescape
+
+
+/*
+ List of all possible characters of a numeric value text representation.
+*/
+#define NUMERIC_CHARS ".0123456789e+-"
+
+
class select_export :public select_to_file {
uint field_term_length;
int field_sep_char,escape_char,line_sep_char;
+ /*
+ The is_ambiguous_field_sep field is true if a value of the field_sep_char
+ field is one of the 'n', 't', 'r' etc characters
+ (see the READ_INFO::unescape method and the ESCAPE_CHARS constant value).
+ */
+ bool is_ambiguous_field_sep;
+ /*
+ The is_unsafe_field_sep field is true if a value of the field_sep_char
+ field is one of the '0'..'9', '+', '-', '.' and 'e' characters
+ (see the NUMERIC_CHARS constant value).
+ */
+ bool is_unsafe_field_sep;
bool fixed_row_size;
public:
select_export(sql_exchange *ex) :select_to_file(ex) {}
@@ -1999,8 +2044,8 @@ class select_insert :public select_result_interceptor {
class select_create: public select_insert {
ORDER *group;
TABLE_LIST *create_table;
- TABLE_LIST *select_tables;
HA_CREATE_INFO *create_info;
+ TABLE_LIST *select_tables;
Alter_info *alter_info;
Field **field;
public:
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index 43d84740f0b..575db5b80f7 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -1113,7 +1113,7 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db,
}
}
if (thd->killed ||
- (tot_list && mysql_rm_table_part2_with_lock(thd, tot_list, 1, 0, 1)))
+ (tot_list && mysql_rm_table_part2(thd, tot_list, 1, 0, 1, 1)))
goto err;
/* Remove RAID directories */
@@ -1397,10 +1397,10 @@ bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch)
{
if (force_switch)
{
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
- ER_NO_DB_ERROR, ER(ER_NO_DB_ERROR));
-
- /* Change db to NULL. */
+ /*
+ This can only happen when we restore the old db in THD after
+ execution of a routine is complete. Change db to NULL.
+ */
mysql_change_db_impl(thd, NULL, 0, thd->variables.collation_server);
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index eeac5e7c4fe..b747c706f75 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -661,7 +661,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
/*
Fill in the given fields and dump it to the table file
*/
- info.records= info.deleted= info.copied= info.updated= 0;
+ bzero((char*) &info,sizeof(info));
info.ignore= ignore;
info.handle_duplicates=duplic;
info.update_fields= &update_fields;
@@ -695,6 +695,8 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
if (duplic == DUP_REPLACE &&
(!table->triggers || !table->triggers->has_delete_triggers()))
table->file->extra(HA_EXTRA_WRITE_CAN_REPLACE);
+ if (duplic == DUP_UPDATE)
+ table->file->extra(HA_EXTRA_INSERT_WITH_UPDATE);
/*
let's *try* to start bulk inserts. It won't necessary
start them as values_list.elements should be greater than
@@ -1419,7 +1421,12 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
goto before_trg_err;
table->file->restore_auto_increment(prev_insert_id);
- if ((table->file->ha_table_flags() & HA_PARTIAL_COLUMN_READ) ||
+ if (table->next_number_field)
+ table->file->adjust_next_insert_id_after_explicit_value(
+ table->next_number_field->val_int());
+ info->touched++;
+ if ((table->file->ha_table_flags() & HA_PARTIAL_COLUMN_READ &&
+ !bitmap_is_subset(table->write_set, table->read_set)) ||
compare_record(table))
{
if ((error=table->file->ha_update_row(table->record[1],
@@ -1446,9 +1453,6 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
handled separately by THD::arg_of_last_insert_id_function.
*/
insert_id_for_cur_row= table->file->insert_id_for_cur_row= 0;
- if (table->next_number_field)
- table->file->adjust_next_insert_id_after_explicit_value(
- table->next_number_field->val_int());
trg_error= (table->triggers &&
table->triggers->process_triggers(thd, TRG_EVENT_UPDATE,
TRG_ACTION_AFTER, TRUE));
@@ -1759,18 +1763,18 @@ Delayed_insert *find_handler(THD *thd, TABLE_LIST *table_list)
thd->proc_info="waiting for delay_list";
pthread_mutex_lock(&LOCK_delayed_insert); // Protect master list
I_List_iterator<Delayed_insert> it(delayed_threads);
- Delayed_insert *tmp;
- while ((tmp=it++))
+ Delayed_insert *di;
+ while ((di= it++))
{
- if (!strcmp(tmp->thd.db, table_list->db) &&
- !strcmp(table_list->table_name, tmp->table->s->table_name.str))
+ if (!strcmp(table_list->db, di->table_list.db) &&
+ !strcmp(table_list->table_name, di->table_list.table_name))
{
- tmp->lock();
+ di->lock();
break;
}
}
pthread_mutex_unlock(&LOCK_delayed_insert); // For unlink from list
- return tmp;
+ return di;
}
@@ -1796,21 +1800,41 @@ Delayed_insert *find_handler(THD *thd, TABLE_LIST *table_list)
Two latter cases indicate a request for lock upgrade.
XXX: why do we regard INSERT DELAYED into a view as an error and
- do not simply a lock upgrade?
+ do not simply perform a lock upgrade?
+
+ TODO: The approach with using two mutexes to work with the
+ delayed thread list -- LOCK_delayed_insert and
+ LOCK_delayed_create -- is redundant, and we only need one of
+ them to protect the list. The reason we have two locks is that
+ we do not want to block look-ups in the list while we're waiting
+ for the newly created thread to open the delayed table. However,
+ this wait itself is redundant -- we always call get_local_table
+ later on, and there wait again until the created thread acquires
+ a table lock.
+
+ As is redundant the concept of locks_in_memory, since we already
+ have another counter with similar semantics - tables_in_use,
+ both of them are devoted to counting the number of producers for
+ a given consumer (delayed insert thread), only at different
+ stages of producer-consumer relationship.
+
+ 'dead' and 'status' variables in Delayed_insert are redundant
+ too, since there is already 'di->thd.killed' and
+ di->stacked_inserts.
*/
static
bool delayed_get_table(THD *thd, TABLE_LIST *table_list)
{
int error;
- Delayed_insert *tmp;
+ Delayed_insert *di;
DBUG_ENTER("delayed_get_table");
/* Must be set in the parser */
DBUG_ASSERT(table_list->db);
/* Find the thread which handles this table. */
- if (!(tmp=find_handler(thd,table_list)))
+ if (!(di= find_handler(thd, table_list)))
{
/*
No match. Create a new thread to handle the table, but
@@ -1824,9 +1848,9 @@ bool delayed_get_table(THD *thd, TABLE_LIST *table_list)
The first search above was done without LOCK_delayed_create.
Another thread might have created the handler in between. Search again.
*/
- if (! (tmp= find_handler(thd, table_list)))
+ if (! (di= find_handler(thd, table_list)))
{
- if (!(tmp=new Delayed_insert()))
+ if (!(di= new Delayed_insert()))
{
my_error(ER_OUTOFMEMORY,MYF(0),sizeof(Delayed_insert));
thd->fatal_error();
@@ -1835,28 +1859,30 @@ bool delayed_get_table(THD *thd, TABLE_LIST *table_list)
pthread_mutex_lock(&LOCK_thread_count);
thread_count++;
pthread_mutex_unlock(&LOCK_thread_count);
- tmp->thd.set_db(table_list->db, strlen(table_list->db));
- tmp->thd.query= my_strdup(table_list->table_name,MYF(MY_WME));
- if (tmp->thd.db == NULL || tmp->thd.query == NULL)
+ di->thd.set_db(table_list->db, strlen(table_list->db));
+ di->thd.query= my_strdup(table_list->table_name, MYF(MY_WME));
+ if (di->thd.db == NULL || di->thd.query == NULL)
{
/* The error is reported */
- delete tmp;
+ delete di;
thd->fatal_error();
goto end_create;
}
- tmp->table_list= *table_list; // Needed to open table
- tmp->table_list.alias= tmp->table_list.table_name= tmp->thd.query;
- tmp->lock();
- pthread_mutex_lock(&tmp->mutex);
- if ((error=pthread_create(&tmp->thd.real_id,&connection_attrib,
- handle_delayed_insert,(void*) tmp)))
+ di->table_list= *table_list; // Needed to open table
+ /* Replace volatile strings with local copies */
+ di->table_list.alias= di->table_list.table_name= di->thd.query;
+ di->table_list.db= di->thd.db;
+ di->lock();
+ pthread_mutex_lock(&di->mutex);
+ if ((error= pthread_create(&di->thd.real_id, &connection_attrib,
+ handle_delayed_insert, (void*) di)))
{
DBUG_PRINT("error",
("Can't create thread to handle delayed insert (error %d)",
error));
- pthread_mutex_unlock(&tmp->mutex);
- tmp->unlock();
- delete tmp;
+ pthread_mutex_unlock(&di->mutex);
+ di->unlock();
+ delete di;
my_error(ER_CANT_CREATE_THREAD, MYF(0), error);
thd->fatal_error();
goto end_create;
@@ -1864,15 +1890,15 @@ bool delayed_get_table(THD *thd, TABLE_LIST *table_list)
/* Wait until table is open */
thd->proc_info="waiting for handler open";
- while (!tmp->thd.killed && !tmp->table && !thd->killed)
+ while (!di->thd.killed && !di->table && !thd->killed)
{
- pthread_cond_wait(&tmp->cond_client,&tmp->mutex);
+ pthread_cond_wait(&di->cond_client, &di->mutex);
}
- pthread_mutex_unlock(&tmp->mutex);
+ pthread_mutex_unlock(&di->mutex);
thd->proc_info="got old table";
- if (tmp->thd.killed)
+ if (di->thd.killed)
{
- if (tmp->thd.net.report_error)
+ if (di->thd.net.report_error)
{
/*
Copy the error message. Note that we don't treat fatal
@@ -1880,31 +1906,34 @@ bool delayed_get_table(THD *thd, TABLE_LIST *table_list)
main thread. Use of my_message will enable stored
procedures continue handlers.
*/
- my_message(tmp->thd.net.last_errno, tmp->thd.net.last_error,
+ my_message(di->thd.net.last_errno, di->thd.net.last_error,
MYF(0));
}
- tmp->unlock();
+ di->unlock();
goto end_create;
}
if (thd->killed)
{
- tmp->unlock();
+ di->unlock();
goto end_create;
}
+ pthread_mutex_lock(&LOCK_delayed_insert);
+ delayed_threads.append(di);
+ pthread_mutex_unlock(&LOCK_delayed_insert);
}
pthread_mutex_unlock(&LOCK_delayed_create);
}
- pthread_mutex_lock(&tmp->mutex);
- table_list->table= tmp->get_local_table(thd);
- pthread_mutex_unlock(&tmp->mutex);
+ pthread_mutex_lock(&di->mutex);
+ table_list->table= di->get_local_table(thd);
+ pthread_mutex_unlock(&di->mutex);
if (table_list->table)
{
DBUG_ASSERT(thd->net.report_error == 0);
- thd->di=tmp;
+ thd->di= di;
}
/* Unlock the delayed insert object after its last access. */
- tmp->unlock();
+ di->unlock();
DBUG_RETURN((table_list->table == NULL));
end_create:
@@ -1934,7 +1963,7 @@ TABLE *Delayed_insert::get_local_table(THD* client_thd)
my_ptrdiff_t adjust_ptrs;
Field **field,**org_field, *found_next_number_field;
TABLE *copy;
- TABLE_SHARE *share= table->s;
+ TABLE_SHARE *share;
uchar *bitmap;
DBUG_ENTER("Delayed_insert::get_local_table");
@@ -1958,6 +1987,7 @@ TABLE *Delayed_insert::get_local_table(THD* client_thd)
goto error;
}
}
+ share= table->s;
/*
Allocate memory for the TABLE object, the field pointers array, and
@@ -2153,26 +2183,26 @@ void kill_delayed_threads(void)
VOID(pthread_mutex_lock(&LOCK_delayed_insert)); // For unlink from list
I_List_iterator<Delayed_insert> it(delayed_threads);
- Delayed_insert *tmp;
- while ((tmp=it++))
+ Delayed_insert *di;
+ while ((di= it++))
{
- tmp->thd.killed= THD::KILL_CONNECTION;
- if (tmp->thd.mysys_var)
+ di->thd.killed= THD::KILL_CONNECTION;
+ if (di->thd.mysys_var)
{
- pthread_mutex_lock(&tmp->thd.mysys_var->mutex);
- if (tmp->thd.mysys_var->current_cond)
+ pthread_mutex_lock(&di->thd.mysys_var->mutex);
+ if (di->thd.mysys_var->current_cond)
{
/*
We need the following test because the main mutex may be locked
in handle_delayed_insert()
*/
- if (&tmp->mutex != tmp->thd.mysys_var->current_mutex)
- pthread_mutex_lock(tmp->thd.mysys_var->current_mutex);
- pthread_cond_broadcast(tmp->thd.mysys_var->current_cond);
- if (&tmp->mutex != tmp->thd.mysys_var->current_mutex)
- pthread_mutex_unlock(tmp->thd.mysys_var->current_mutex);
+ if (&di->mutex != di->thd.mysys_var->current_mutex)
+ pthread_mutex_lock(di->thd.mysys_var->current_mutex);
+ pthread_cond_broadcast(di->thd.mysys_var->current_cond);
+ if (&di->mutex != di->thd.mysys_var->current_mutex)
+ pthread_mutex_unlock(di->thd.mysys_var->current_mutex);
}
- pthread_mutex_unlock(&tmp->thd.mysys_var->mutex);
+ pthread_mutex_unlock(&di->thd.mysys_var->mutex);
}
}
VOID(pthread_mutex_unlock(&LOCK_delayed_insert)); // For unlink from list
@@ -2246,11 +2276,6 @@ pthread_handler_t handle_delayed_insert(void *arg)
}
di->table->copy_blobs=1;
- /* One can now use this */
- pthread_mutex_lock(&LOCK_delayed_insert);
- delayed_threads.append(di);
- pthread_mutex_unlock(&LOCK_delayed_insert);
-
/* Tell client that the thread is initialized */
pthread_cond_signal(&di->cond_client);
@@ -2546,6 +2571,8 @@ bool Delayed_insert::handle_inserts(void)
table->file->extra(HA_EXTRA_WRITE_CAN_REPLACE);
using_opt_replace= 1;
}
+ if (info.handle_duplicates == DUP_UPDATE)
+ table->file->extra(HA_EXTRA_INSERT_WITH_UPDATE);
thd.clear_error(); // reset error for binlog
if (write_record(&thd, table, &info))
{
@@ -2890,6 +2917,8 @@ select_insert::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
if (info.handle_duplicates == DUP_REPLACE &&
(!table->triggers || !table->triggers->has_delete_triggers()))
table->file->extra(HA_EXTRA_WRITE_CAN_REPLACE);
+ if (info.handle_duplicates == DUP_UPDATE)
+ table->file->extra(HA_EXTRA_INSERT_WITH_UPDATE);
thd->no_trans_update.stmt= FALSE;
thd->abort_on_warning= (!info.ignore &&
(thd->variables.sql_mode &
@@ -3481,6 +3510,8 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
if (info.handle_duplicates == DUP_REPLACE &&
(!table->triggers || !table->triggers->has_delete_triggers()))
table->file->extra(HA_EXTRA_WRITE_CAN_REPLACE);
+ if (info.handle_duplicates == DUP_UPDATE)
+ table->file->extra(HA_EXTRA_INSERT_WITH_UPDATE);
if (!thd->prelocked_mode)
table->file->ha_start_bulk_insert((ha_rows) 0);
thd->no_trans_update.stmt= FALSE;
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 639f0d2325d..e493dc05047 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -124,7 +124,7 @@ Lex_input_stream::Lex_input_stream(THD *thd,
m_tok_start_prev(NULL),
m_buf(buffer),
m_buf_length(length),
- m_echo(true),
+ m_echo(TRUE),
m_cpp_tok_start(NULL),
m_cpp_tok_start_prev(NULL),
m_cpp_tok_end(NULL),
@@ -1200,7 +1200,7 @@ int MYSQLlex(void *arg, void *yythd)
{
lip->in_comment= DISCARD_COMMENT;
/* Accept '/' '*' '!', but do not keep this marker. */
- lip->set_echo(false);
+ lip->set_echo(FALSE);
lip->yySkip();
lip->yySkip();
lip->yySkip();
@@ -1233,7 +1233,7 @@ int MYSQLlex(void *arg, void *yythd)
if (version <= MYSQL_VERSION_ID)
{
/* Expand the content of the special comment as real code */
- lip->set_echo(true);
+ lip->set_echo(TRUE);
state=MY_LEX_START;
break;
}
@@ -1241,7 +1241,7 @@ int MYSQLlex(void *arg, void *yythd)
else
{
state=MY_LEX_START;
- lip->set_echo(true);
+ lip->set_echo(TRUE);
break;
}
}
@@ -1261,7 +1261,7 @@ int MYSQLlex(void *arg, void *yythd)
if (! lip->eof())
lip->yySkip(); // remove last '/'
state = MY_LEX_START; // Try again
- lip->set_echo(true);
+ lip->set_echo(TRUE);
break;
case MY_LEX_END_LONG_COMMENT:
if ((lip->in_comment != NO_COMMENT) && lip->yyPeek() == '/')
@@ -1272,7 +1272,7 @@ int MYSQLlex(void *arg, void *yythd)
lip->set_echo(lip->in_comment == PRESERVE_COMMENT);
lip->yySkipn(2);
/* And start recording the tokens again */
- lip->set_echo(true);
+ lip->set_echo(TRUE);
lip->in_comment=NO_COMMENT;
state=MY_LEX_START;
}
@@ -1297,7 +1297,7 @@ int MYSQLlex(void *arg, void *yythd)
lip->found_semicolon= lip->get_ptr();
thd->server_status|= SERVER_MORE_RESULTS_EXISTS;
lip->next_state= MY_LEX_END;
- lip->set_echo(true);
+ lip->set_echo(TRUE);
return (END_OF_INPUT);
}
state= MY_LEX_CHAR; // Return ';'
@@ -1309,9 +1309,9 @@ int MYSQLlex(void *arg, void *yythd)
if (lip->eof())
{
lip->yyUnget(); // Reject the last '\0'
- lip->set_echo(false);
+ lip->set_echo(FALSE);
lip->yySkip();
- lip->set_echo(true);
+ lip->set_echo(TRUE);
lip->next_state=MY_LEX_END; // Mark for next loop
return(END_OF_INPUT);
}
@@ -2297,7 +2297,7 @@ bool st_lex::need_correct_ident()
VIEW_CHECK_CASCADED CHECK OPTION CASCADED
*/
-uint8 st_lex::get_effective_with_check(st_table_list *view)
+uint8 st_lex::get_effective_with_check(TABLE_LIST *view)
{
if (view->select_lex->master_unit() == &unit &&
which_check_option_applicable())
@@ -2306,6 +2306,43 @@ uint8 st_lex::get_effective_with_check(st_table_list *view)
}
+/**
+ This method should be called only during parsing.
+ It is aware of compound statements (stored routine bodies)
+ and will initialize the destination with the default
+ database of the stored routine, rather than the default
+ database of the connection it is parsed in.
+ E.g. if one has no current database selected, or current database
+ set to 'bar' and then issues:
+
+ CREATE PROCEDURE foo.p1() BEGIN SELECT * FROM t1 END//
+
+ t1 is meant to refer to foo.t1, not to bar.t1.
+
+ This method is needed to support this rule.
+
+ @return TRUE in case of error (parsing should be aborted, FALSE in
+ case of success
+*/
+
+bool
+st_lex::copy_db_to(char **p_db, size_t *p_db_length) const
+{
+ if (sphead)
+ {
+ DBUG_ASSERT(sphead->m_db.str && sphead->m_db.length);
+ /*
+ It is safe to assign the string by-pointer, both sphead and
+ its statements reside in the same memory root.
+ */
+ *p_db= sphead->m_db.str;
+ if (p_db_length)
+ *p_db_length= sphead->m_db.length;
+ return FALSE;
+ }
+ return thd->copy_db_to(p_db, p_db_length);
+}
+
/*
initialize limit counters
@@ -2329,6 +2366,27 @@ void st_select_lex_unit::set_limit(SELECT_LEX *sl)
}
+/**
+ Update the parsed tree with information about triggers that
+ may be fired when executing this statement.
+*/
+
+void st_lex::set_trg_event_type_for_tables()
+{
+ /*
+ Do not iterate over sub-selects, only the tables in the outermost
+ SELECT_LEX can be modified, if any.
+ */
+ TABLE_LIST *tables= select_lex.get_table_list();
+
+ while (tables)
+ {
+ tables->set_trg_event_type(this);
+ tables= tables->next_local;
+ }
+}
+
+
/*
Unlink the first table from the global table list and the first table from
outer select (lex->select_lex) local list
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index 254403fe736..9ac7f2835f0 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -1239,19 +1239,19 @@ public:
}
/** Get the raw query buffer. */
- const char* get_buf()
+ const char *get_buf()
{
return m_buf;
}
/** Get the pre-processed query buffer. */
- const char* get_cpp_buf()
+ const char *get_cpp_buf()
{
return m_cpp_buf;
}
/** Get the end of the raw query buffer. */
- const char* get_end_of_query()
+ const char *get_end_of_query()
{
return m_end_of_query;
}
@@ -1279,43 +1279,43 @@ public:
}
/** Get the token start position, in the raw buffer. */
- const char* get_tok_start()
+ const char *get_tok_start()
{
return m_tok_start;
}
/** Get the token start position, in the pre-processed buffer. */
- const char* get_cpp_tok_start()
+ const char *get_cpp_tok_start()
{
return m_cpp_tok_start;
}
/** Get the token end position, in the raw buffer. */
- const char* get_tok_end()
+ const char *get_tok_end()
{
return m_tok_end;
}
/** Get the token end position, in the pre-processed buffer. */
- const char* get_cpp_tok_end()
+ const char *get_cpp_tok_end()
{
return m_cpp_tok_end;
}
/** Get the previous token start position, in the raw buffer. */
- const char* get_tok_start_prev()
+ const char *get_tok_start_prev()
{
return m_tok_start_prev;
}
/** Get the current stream pointer, in the raw buffer. */
- const char* get_ptr()
+ const char *get_ptr()
{
return m_ptr;
}
/** Get the current stream pointer, in the pre-processed buffer. */
- const char* get_cpp_ptr()
+ const char *get_cpp_ptr()
{
return m_cpp_ptr;
}
@@ -1365,22 +1365,22 @@ public:
private:
/** Pointer to the current position in the raw input stream. */
- const char* m_ptr;
+ const char *m_ptr;
/** Starting position of the last token parsed, in the raw buffer. */
- const char* m_tok_start;
+ const char *m_tok_start;
/** Ending position of the previous token parsed, in the raw buffer. */
- const char* m_tok_end;
+ const char *m_tok_end;
/** End of the query text in the input stream, in the raw buffer. */
- const char* m_end_of_query;
+ const char *m_end_of_query;
/** Starting position of the previous token parsed, in the raw buffer. */
- const char* m_tok_start_prev;
+ const char *m_tok_start_prev;
/** Begining of the query text in the input stream, in the raw buffer. */
- const char* m_buf;
+ const char *m_buf;
/** Length of the raw buffer. */
uint m_buf_length;
@@ -1389,28 +1389,28 @@ private:
bool m_echo;
/** Pre-processed buffer. */
- char* m_cpp_buf;
+ char *m_cpp_buf;
/** Pointer to the current position in the pre-processed input stream. */
- char* m_cpp_ptr;
+ char *m_cpp_ptr;
/**
Starting position of the last token parsed,
in the pre-processed buffer.
*/
- const char* m_cpp_tok_start;
+ const char *m_cpp_tok_start;
/**
Starting position of the previous token parsed,
in the pre-procedded buffer.
*/
- const char* m_cpp_tok_start_prev;
+ const char *m_cpp_tok_start_prev;
/**
Ending position of the previous token parsed,
in the pre-processed buffer.
*/
- const char* m_cpp_tok_end;
+ const char *m_cpp_tok_end;
/** UTF8-body buffer created during parsing. */
char *m_body_utf8;
@@ -1433,7 +1433,7 @@ public:
Position of ';' in the stream, to delimit multiple queries.
This delimiter is in the raw buffer.
*/
- const char* found_semicolon;
+ const char *found_semicolon;
/** SQL_MODE = IGNORE_SPACE. */
bool ignore_space;
@@ -1732,6 +1732,8 @@ typedef struct st_lex : public Query_tables_list
un->uncacheable|= cause;
}
}
+ void set_trg_event_type_for_tables();
+
TABLE_LIST *unlink_first_table(bool *link_to_local);
void link_first_table_back(TABLE_LIST *first, bool link_to_local);
void first_lists_tables_same();
@@ -1741,7 +1743,7 @@ typedef struct st_lex : public Query_tables_list
bool can_not_use_merged();
bool only_view_structure();
bool need_correct_ident();
- uint8 get_effective_with_check(st_table_list *view);
+ uint8 get_effective_with_check(TABLE_LIST *view);
/*
Is this update command where 'WHITH CHECK OPTION' clause is important
@@ -1780,6 +1782,8 @@ typedef struct st_lex : public Query_tables_list
context_stack.pop();
}
+ bool copy_db_to(char **p_db, size_t *p_db_length) const;
+
Name_resolution_context *current_context()
{
return context_stack.head();
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index 0138030487b..3ffbdf83815 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -851,6 +851,7 @@ continue_loop:;
char
READ_INFO::unescape(char chr)
{
+ /* keep this switch synchornous with the ESCAPE_CHARS macro */
switch(chr) {
case 'n': return '\n';
case 't': return '\t';
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index bd151dc2028..f2a61b7f7c5 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1025,8 +1025,8 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
HA_CREATE_INFO create_info;
status_var_increment(thd->status_var.com_stat[SQLCOM_CREATE_DB]);
- if (thd->LEX_STRING_make(&db, packet, packet_length -1) ||
- thd->LEX_STRING_make(&alias, db.str, db.length) ||
+ if (thd->make_lex_string(&db, packet, packet_length - 1, FALSE) ||
+ thd->make_lex_string(&alias, db.str, db.length, FALSE) ||
check_db_name(&db))
{
my_error(ER_WRONG_DB_NAME, MYF(0), db.str ? db.str : "NULL");
@@ -1046,7 +1046,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
status_var_increment(thd->status_var.com_stat[SQLCOM_DROP_DB]);
LEX_STRING db;
- if (thd->LEX_STRING_make(&db, packet, packet_length - 1) ||
+ if (thd->make_lex_string(&db, packet, packet_length - 1, FALSE) ||
check_db_name(&db))
{
my_error(ER_WRONG_DB_NAME, MYF(0), db.str ? db.str : "NULL");
@@ -1323,7 +1323,7 @@ void log_slow_statement(THD *thd)
thd->variables.long_query_time ||
((thd->server_status &
(SERVER_QUERY_NO_INDEX_USED | SERVER_QUERY_NO_GOOD_INDEX_USED)) &&
- (specialflag & SPECIAL_LOG_QUERIES_NOT_USING_INDEXES)))
+ opt_log_queries_not_using_indexes))
{
thd->status_var.long_query_count++;
slow_log_print(thd, thd->query, thd->query_length, start_of_query);
@@ -1391,7 +1391,7 @@ int prepare_schema_table(THD *thd, LEX *lex, Table_ident *table_ident,
LEX_STRING db;
size_t dummy;
if (lex->select_lex.db == NULL &&
- thd->copy_db_to(&lex->select_lex.db, &dummy))
+ lex->copy_db_to(&lex->select_lex.db, &dummy))
{
DBUG_RETURN(1);
}
@@ -2449,7 +2449,7 @@ end_with_restore_list:
check_grant(thd, INSERT_ACL | CREATE_ACL, &new_list, 0, 1, 0)))
goto error;
}
- query_cache_invalidate3(thd, first_table, 0);
+
if (end_active_trans(thd) || mysql_rename_tables(thd, first_table, 0))
goto error;
break;
@@ -5392,8 +5392,9 @@ void mysql_parse(THD *thd, const char *inBuf, uint length,
(thd->query_length= (ulong)(*found_semicolon - thd->query)))
thd->query_length--;
/* Actually execute the query */
- mysql_execute_command(thd);
- query_cache_end_of_result(thd);
+ lex->set_trg_event_type_for_tables();
+ mysql_execute_command(thd);
+ query_cache_end_of_result(thd);
}
}
}
@@ -5680,7 +5681,7 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd,
ptr->db= table->db.str;
ptr->db_length= table->db.length;
}
- else if (thd->copy_db_to(&ptr->db, &ptr->db_length))
+ else if (lex->copy_db_to(&ptr->db, &ptr->db_length))
DBUG_RETURN(0);
ptr->alias= alias_str;
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index f3253e5b086..5cfb46a99ab 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -36,7 +36,7 @@
#include "mysql_priv.h"
#include <errno.h>
#include <m_ctype.h>
-#include "md5.h"
+#include "my_md5.h"
#ifdef WITH_PARTITION_STORAGE_ENGINE
#include "ha_partition.h"
@@ -523,6 +523,7 @@ static bool set_up_field_array(TABLE *table,
SYNOPSIS
create_full_part_field_array()
+ thd Thread handle
table TABLE object for which partition fields are set-up
part_info Reference to partitioning data structure
@@ -537,11 +538,12 @@ static bool set_up_field_array(TABLE *table,
This function is called from fix_partition_func
*/
-static bool create_full_part_field_array(TABLE *table,
+static bool create_full_part_field_array(THD *thd, TABLE *table,
partition_info *part_info)
{
bool result= FALSE;
Field **ptr;
+ my_bitmap_map *bitmap_buf;
DBUG_ENTER("create_full_part_field_array");
if (!part_info->is_sub_partitioned())
@@ -578,6 +580,35 @@ static bool create_full_part_field_array(TABLE *table,
part_info->full_part_field_array= field_array;
part_info->no_full_part_fields= no_part_fields;
}
+
+ /*
+ Initialize the set of all fields used in partition and subpartition
+ expression. Required for testing of partition fields in write_set
+ when updating. We need to set all bits in read_set because the row
+ may need to be inserted in a different [sub]partition.
+ */
+ if (!(bitmap_buf= (my_bitmap_map*)
+ thd->alloc(bitmap_buffer_size(table->s->fields))))
+ {
+ mem_alloc_error(bitmap_buffer_size(table->s->fields));
+ result= TRUE;
+ goto end;
+ }
+ if (bitmap_init(&part_info->full_part_field_set, bitmap_buf,
+ table->s->fields, FALSE))
+ {
+ mem_alloc_error(table->s->fields);
+ result= TRUE;
+ goto end;
+ }
+ /*
+ full_part_field_array may be NULL if storage engine supports native
+ partitioning.
+ */
+ if ((ptr= part_info->full_part_field_array))
+ for (; *ptr; ptr++)
+ bitmap_set_bit(&part_info->full_part_field_set, (*ptr)->field_index);
+
end:
DBUG_RETURN(result);
}
@@ -1636,7 +1667,7 @@ bool fix_partition_func(THD *thd, TABLE *table,
my_error(ER_PARTITION_FUNCTION_IS_NOT_ALLOWED, MYF(0));
goto end;
}
- if (unlikely(create_full_part_field_array(table, part_info)))
+ if (unlikely(create_full_part_field_array(thd, table, part_info)))
goto end;
if (unlikely(check_primary_key(table)))
goto end;
@@ -2869,6 +2900,8 @@ uint32 get_partition_id_range_for_endpoint(partition_info *part_info,
}
if (unsigned_flag)
part_func_value-= 0x8000000000000000ULL;
+ if (left_endpoint && !include_endpoint)
+ part_func_value++;
while (max_part_id > min_part_id)
{
loc_part_id= (max_part_id + min_part_id + 1) >> 1;
@@ -3294,7 +3327,9 @@ static uint32 get_sub_part_id_from_key(const TABLE *table,uchar *buf,
key_restore(buf, (uchar*)key_spec->key, key_info, key_spec->length);
if (likely(rec0 == buf))
+ {
part_id= part_info->get_subpartition_id(part_info);
+ }
else
{
Field **part_field_array= part_info->subpart_field_array;
@@ -3337,8 +3372,10 @@ bool get_part_id_from_key(const TABLE *table, uchar *buf, KEY *key_info,
key_restore(buf, (uchar*)key_spec->key, key_info, key_spec->length);
if (likely(rec0 == buf))
+ {
result= part_info->get_part_partition_id(part_info, part_id,
&func_value);
+ }
else
{
Field **part_field_array= part_info->part_field_array;
@@ -3384,8 +3421,10 @@ void get_full_part_id_from_key(const TABLE *table, uchar *buf,
key_restore(buf, (uchar*)key_spec->key, key_info, key_spec->length);
if (likely(rec0 == buf))
+ {
result= part_info->get_partition_id(part_info, &part_spec->start_part,
&func_value);
+ }
else
{
Field **part_field_array= part_info->full_part_field_array;
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index 406e242cada..a97bd908468 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -1941,13 +1941,6 @@ void mysql_stmt_prepare(THD *thd, const char *packet, uint packet_length)
/* Statement map deletes statement on erase */
thd->stmt_map.erase(stmt);
}
- else
- {
- const char *format= "[%lu] %.*b";
- general_log_print(thd, COM_STMT_PREPARE, format, stmt->id,
- stmt->query_length, stmt->query);
-
- }
/* check_prepared_statemnt sends the metadata packet in case of success */
DBUG_VOID_RETURN;
}
@@ -2330,12 +2323,6 @@ void mysql_stmt_execute(THD *thd, char *packet_arg, uint packet_length)
test(flags & (ulong) CURSOR_TYPE_READ_ONLY));
if (!(specialflag & SPECIAL_NO_PRIOR))
my_pthread_setprio(pthread_self(), WAIT_PRIOR);
- if (error == 0)
- {
- const char *format= "[%lu] %.*b";
- general_log_print(thd, COM_STMT_EXECUTE, format, stmt->id,
- thd->query_length, thd->query);
- }
DBUG_VOID_RETURN;
set_params_data_err:
@@ -2880,6 +2867,7 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len)
error= parse_sql(thd, &lip, NULL) ||
thd->net.report_error ||
init_param_array(this);
+ lex->set_trg_event_type_for_tables();
/*
While doing context analysis of the query (in check_prepared_statement)
@@ -2929,6 +2917,29 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len)
init_stmt_after_parse(lex);
state= Query_arena::PREPARED;
flags&= ~ (uint) IS_IN_USE;
+
+ /*
+ Log COM_EXECUTE to the general log. Note, that in case of SQL
+ prepared statements this causes two records to be output:
+
+ Query PREPARE stmt from @user_variable
+ Prepare <statement SQL text>
+
+ This is considered user-friendly, since in the
+ second log entry we output the actual statement text.
+
+ Do not print anything if this is an SQL prepared statement and
+ we're inside a stored procedure (also called Dynamic SQL) --
+ sub-statements inside stored procedures are not logged into
+ the general log.
+ */
+ if (thd->spcont == NULL)
+ {
+ const char *format= "[%lu] %.*b";
+ general_log_print(thd, COM_STMT_PREPARE, format, id,
+ query_length, query);
+
+ }
}
DBUG_RETURN(error);
}
@@ -3075,6 +3086,28 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor)
if (state == Query_arena::PREPARED)
state= Query_arena::EXECUTED;
+ /*
+ Log COM_EXECUTE to the general log. Note, that in case of SQL
+ prepared statements this causes two records to be output:
+
+ Query EXECUTE <statement name>
+ Execute <statement SQL text>
+
+ This is considered user-friendly, since in the
+ second log entry we output values of parameter markers.
+
+ Do not print anything if this is an SQL prepared statement and
+ we're inside a stored procedure (also called Dynamic SQL) --
+ sub-statements inside stored procedures are not logged into
+ the general log.
+ */
+ if (error == 0 && thd->spcont == NULL)
+ {
+ const char *format= "[%lu] %.*b";
+ general_log_print(thd, COM_STMT_EXECUTE, format, id,
+ thd->query_length, thd->query);
+ }
+
error:
flags&= ~ (uint) IS_IN_USE;
return error;
diff --git a/sql/sql_rename.cc b/sql/sql_rename.cc
index 866d82377c0..f5e1b8988f3 100644
--- a/sql/sql_rename.cc
+++ b/sql/sql_rename.cc
@@ -144,10 +144,13 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list, bool silent)
}
}
- VOID(pthread_mutex_lock(&LOCK_open));
- if (lock_table_names(thd, table_list))
+ pthread_mutex_lock(&LOCK_open);
+ if (lock_table_names_exclusively(thd, table_list))
+ {
+ pthread_mutex_unlock(&LOCK_open);
goto err;
-
+ }
+
error=0;
if ((ren_table=rename_tables(thd,table_list,0)))
{
@@ -170,6 +173,17 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list, bool silent)
error= 1;
}
+ /*
+ An exclusive lock on table names is satisfactory to ensure
+ no other thread accesses this table.
+ However, NDB assumes that handler::rename_tables is called under
+ LOCK_open. And it indeed is, from ALTER TABLE.
+ TODO: remove this limitation.
+ We still should unlock LOCK_open as early as possible, to provide
+ higher concurrency - query_cache_invalidate can take minutes to
+ complete.
+ */
+ pthread_mutex_unlock(&LOCK_open);
/* Lets hope this doesn't fail as the result will be messy */
if (!silent && !error)
@@ -178,10 +192,14 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list, bool silent)
send_ok(thd);
}
+ if (!error)
+ query_cache_invalidate3(thd, table_list, 0);
+
+ pthread_mutex_lock(&LOCK_open);
unlock_table_names(thd, table_list, (TABLE_LIST*) 0);
+ pthread_mutex_unlock(&LOCK_open);
err:
- pthread_mutex_unlock(&LOCK_open);
/* enable logging back if needed */
if (disable_logs)
{
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index 1616e895107..5d9d30b6020 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -1442,13 +1442,11 @@ err:
}
if (errmsg)
- {
my_error(ER_ERROR_WHEN_EXECUTING_COMMAND, MYF(0),
"SHOW BINLOG EVENTS", errmsg);
- DBUG_RETURN(TRUE);
- }
+ else
+ send_eof(thd);
- send_eof(thd);
pthread_mutex_lock(&LOCK_thread_count);
thd->current_linfo = 0;
pthread_mutex_unlock(&LOCK_thread_count);
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 3cda4029161..be6d1f74852 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -8703,9 +8703,15 @@ static void restore_prev_nj_state(JOIN_TAB *last)
{
TABLE_LIST *last_emb= last->table->pos_in_table_list->embedding;
JOIN *join= last->join;
- while (last_emb && !(--last_emb->nested_join->counter))
+ while (last_emb)
{
- join->cur_embedding_map &= last_emb->nested_join->nj_map;
+ if (!(--last_emb->nested_join->counter))
+ join->cur_embedding_map&= ~last_emb->nested_join->nj_map;
+ else if (last_emb->nested_join->join_list.elements-1 ==
+ last_emb->nested_join->counter)
+ join->cur_embedding_map|= last_emb->nested_join->nj_map;
+ else
+ break;
last_emb= last_emb->embedding;
}
}
@@ -15752,11 +15758,11 @@ static void print_join(THD *thd, String *str, List<TABLE_LIST> *tables)
Print table as it should be in join list
SYNOPSIS
- st_table_list::print();
+ TABLE_LIST::print();
str string where table should bbe printed
*/
-void st_table_list::print(THD *thd, String *str)
+void TABLE_LIST::print(THD *thd, String *str)
{
if (nested_join)
{
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index f66897df671..5b8cb93baab 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -639,7 +639,8 @@ mysqld_show_create(THD *thd, TABLE_LIST *table_list)
if (table_list->view)
{
- protocol->store(buffer.ptr(), buffer.length(), &my_charset_bin);
+ protocol->store(buffer.ptr(), buffer.length(),
+ table_list->view_creation_ctx->get_client_cs());
protocol->store(table_list->view_creation_ctx->get_client_cs()->csname,
system_charset_info);
@@ -2175,20 +2176,6 @@ void calc_sum_of_all_status(STATUS_VAR *to)
}
-LEX_STRING *make_lex_string(THD *thd, LEX_STRING *lex_str,
- const char* str, uint length,
- bool allocate_lex_string)
-{
- MEM_ROOT *mem= thd->mem_root;
- if (allocate_lex_string)
- if (!(lex_str= (LEX_STRING *)thd->alloc(sizeof(LEX_STRING))))
- return 0;
- lex_str->str= strmake_root(mem, str, length);
- lex_str->length= length;
- return lex_str;
-}
-
-
/* INFORMATION_SCHEMA name */
LEX_STRING INFORMATION_SCHEMA_NAME= { C_STRING_WITH_LEN("information_schema")};
@@ -2273,11 +2260,9 @@ bool uses_only_table_name_fields(Item *item, TABLE_LIST *table)
if (item->type() == Item::FUNC_ITEM)
{
Item_func *item_func= (Item_func*)item;
- Item **child;
- Item **item_end= (item_func->arguments()) + item_func->argument_count();
- for (child= item_func->arguments(); child != item_end; child++)
+ for (uint i=0; i<item_func->argument_count(); i++)
{
- if (!uses_only_table_name_fields(*child, table))
+ if (!uses_only_table_name_fields(item_func->arguments()[i], table))
return 0;
}
}
@@ -2839,7 +2824,7 @@ int fill_schema_shemata(THD *thd, TABLE_LIST *tables, COND *cond)
}
-static int get_schema_tables_record(THD *thd, struct st_table_list *tables,
+static int get_schema_tables_record(THD *thd, TABLE_LIST *tables,
TABLE *table, bool res,
const char *base_name,
const char *file_name)
@@ -3031,7 +3016,7 @@ static int get_schema_tables_record(THD *thd, struct st_table_list *tables,
}
-static int get_schema_column_record(THD *thd, struct st_table_list *tables,
+static int get_schema_column_record(THD *thd, TABLE_LIST *tables,
TABLE *table, bool res,
const char *base_name,
const char *file_name)
@@ -3538,7 +3523,7 @@ err:
}
-static int get_schema_stat_record(THD *thd, struct st_table_list *tables,
+static int get_schema_stat_record(THD *thd, TABLE_LIST *tables,
TABLE *table, bool res,
const char *base_name,
const char *file_name)
@@ -3628,7 +3613,7 @@ static int get_schema_stat_record(THD *thd, struct st_table_list *tables,
}
-static int get_schema_views_record(THD *thd, struct st_table_list *tables,
+static int get_schema_views_record(THD *thd, TABLE_LIST *tables,
TABLE *table, bool res,
const char *base_name,
const char *file_name)
@@ -3746,7 +3731,7 @@ bool store_constraints(THD *thd, TABLE *table, const char *db,
}
-static int get_schema_constraints_record(THD *thd, struct st_table_list *tables,
+static int get_schema_constraints_record(THD *thd, TABLE_LIST *tables,
TABLE *table, bool res,
const char *base_name,
const char *file_name)
@@ -3847,7 +3832,7 @@ static bool store_trigger(THD *thd, TABLE *table, const char *db,
}
-static int get_schema_triggers_record(THD *thd, struct st_table_list *tables,
+static int get_schema_triggers_record(THD *thd, TABLE_LIST *tables,
TABLE *table, bool res,
const char *base_name,
const char *file_name)
@@ -3924,7 +3909,7 @@ void store_key_column_usage(TABLE *table, const char*db, const char *tname,
static int get_schema_key_column_usage_record(THD *thd,
- struct st_table_list *tables,
+ TABLE_LIST *tables,
TABLE *table, bool res,
const char *base_name,
const char *file_name)
@@ -4109,7 +4094,7 @@ static void store_schema_partitions_record(THD *thd, TABLE *schema_table,
}
-static int get_schema_partitions_record(THD *thd, struct st_table_list *tables,
+static int get_schema_partitions_record(THD *thd, TABLE_LIST *tables,
TABLE *table, bool res,
const char *base_name,
const char *file_name)
@@ -4655,7 +4640,7 @@ int fill_status(THD *thd, TABLE_LIST *tables, COND *cond)
*/
static int
-get_referential_constraints_record(THD *thd, struct st_table_list *tables,
+get_referential_constraints_record(THD *thd, TABLE_LIST *tables,
TABLE *table, bool res,
const char *base_name, const char *file_name)
{
@@ -5194,10 +5179,10 @@ int make_schema_select(THD *thd, SELECT_LEX *sel,
We have to make non const db_name & table_name
because of lower_case_table_names
*/
- make_lex_string(thd, &db, INFORMATION_SCHEMA_NAME.str,
- INFORMATION_SCHEMA_NAME.length, 0);
- make_lex_string(thd, &table, schema_table->table_name,
- strlen(schema_table->table_name), 0);
+ thd->make_lex_string(&db, INFORMATION_SCHEMA_NAME.str,
+ INFORMATION_SCHEMA_NAME.length, 0);
+ thd->make_lex_string(&table, schema_table->table_name,
+ strlen(schema_table->table_name), 0);
if (schema_table->old_format(thd, schema_table) || /* Handle old syntax */
!sel->add_table_to_list(thd, new Table_ident(thd, db, table, 0),
0, 0, TL_READ))
@@ -5920,12 +5905,17 @@ int initialize_schema_table(st_plugin_int *plugin)
schema_table->idx_field1= -1,
schema_table->idx_field2= -1;
+ /* Make the name available to the init() function. */
+ schema_table->table_name= plugin->name.str;
+
if (plugin->plugin->init(schema_table))
{
sql_print_error("Plugin '%s' init function returned error.",
plugin->name.str);
goto err;
}
+
+ /* Make sure the plugin name is not set inside the init() function. */
schema_table->table_name= plugin->name.str;
}
@@ -5983,6 +5973,8 @@ static bool show_create_trigger_impl(THD *thd,
LEX_STRING trg_connection_cl_name;
LEX_STRING trg_db_cl_name;
+ CHARSET_INFO *trg_client_cs;
+
/*
TODO: Check privileges here. This functionality will be added by
implementation of the following WL items:
@@ -6008,6 +6000,11 @@ static bool show_create_trigger_impl(THD *thd,
trg_sql_mode,
&trg_sql_mode_str);
+ /* Resolve trigger client character set. */
+
+ if (resolve_charset(trg_client_cs_name.str, NULL, &trg_client_cs))
+ return TRUE;
+
/* Send header. */
fields.push_back(new Item_empty_string("Trigger", NAME_LEN));
@@ -6054,7 +6051,7 @@ static bool show_create_trigger_impl(THD *thd,
p->store(trg_sql_original_stmt.str,
trg_sql_original_stmt.length,
- &my_charset_bin);
+ trg_client_cs);
p->store(trg_client_cs_name.str,
trg_client_cs_name.length,
diff --git a/sql/sql_show.h b/sql/sql_show.h
index d5c3f3bf675..57004323ca9 100644
--- a/sql/sql_show.h
+++ b/sql/sql_show.h
@@ -20,9 +20,8 @@
class String;
class THD;
struct st_ha_create_information;
-struct st_table_list;
typedef st_ha_create_information HA_CREATE_INFO;
-typedef st_table_list TABLE_LIST;
+struct TABLE_LIST;
enum find_files_result {
FIND_FILES_OK,
diff --git a/sql/sql_sort.h b/sql/sql_sort.h
index da28ca07e2c..1e9322f7f5b 100644
--- a/sql/sql_sort.h
+++ b/sql/sql_sort.h
@@ -50,6 +50,12 @@ typedef struct st_buffpek { /* Struktur om sorteringsbuffrarna */
ulong max_keys; /* Max keys in buffert */
} BUFFPEK;
+struct BUFFPEK_COMPARE_CONTEXT
+{
+ qsort_cmp2 key_compare;
+ void *key_compare_arg;
+};
+
typedef struct st_sort_param {
uint rec_length; /* Length of sorted records */
uint sort_length; /* Length of sorted columns */
@@ -65,6 +71,9 @@ typedef struct st_sort_param {
uchar *unique_buff;
bool not_killable;
char* tmp_buffer;
+ /* The fields below are used only by Unique class */
+ qsort2_cmp compare;
+ BUFFPEK_COMPARE_CONTEXT cmp_context;
} SORTPARAM;
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 047c210d6a5..dc3e72554fa 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -1430,19 +1430,8 @@ bool mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists,
LOCK_open during wait_if_global_read_lock(), other threads could not
close their tables. This would make a pretty deadlock.
*/
- thd->mysys_var->current_mutex= &LOCK_open;
- thd->mysys_var->current_cond= &COND_refresh;
- VOID(pthread_mutex_lock(&LOCK_open));
-
error= mysql_rm_table_part2(thd, tables, if_exists, drop_temporary, 0, 0);
- pthread_mutex_unlock(&LOCK_open);
-
- pthread_mutex_lock(&thd->mysys_var->mutex);
- thd->mysys_var->current_mutex= 0;
- thd->mysys_var->current_cond= 0;
- pthread_mutex_unlock(&thd->mysys_var->mutex);
-
if (need_start_waiters)
start_waiting_global_read_lock(thd);
@@ -1452,49 +1441,6 @@ bool mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists,
DBUG_RETURN(FALSE);
}
-
-/*
- delete (drop) tables.
-
- SYNOPSIS
- mysql_rm_table_part2_with_lock()
- thd Thread handle
- tables List of tables to delete
- if_exists If 1, don't give error if one table doesn't exists
- dont_log_query Don't write query to log files. This will also not
- generate warnings if the handler files doesn't exists
-
- NOTES
- Works like documented in mysql_rm_table(), but don't check
- global_read_lock and don't send_ok packet to server.
-
- RETURN
- 0 ok
- 1 error
-*/
-
-int mysql_rm_table_part2_with_lock(THD *thd,
- TABLE_LIST *tables, bool if_exists,
- bool drop_temporary, bool dont_log_query)
-{
- int error;
- thd->mysys_var->current_mutex= &LOCK_open;
- thd->mysys_var->current_cond= &COND_refresh;
- VOID(pthread_mutex_lock(&LOCK_open));
-
- error= mysql_rm_table_part2(thd, tables, if_exists, drop_temporary, 1,
- dont_log_query);
-
- pthread_mutex_unlock(&LOCK_open);
-
- pthread_mutex_lock(&thd->mysys_var->mutex);
- thd->mysys_var->current_mutex= 0;
- thd->mysys_var->current_cond= 0;
- pthread_mutex_unlock(&thd->mysys_var->mutex);
- return error;
-}
-
-
/*
Execute the drop of a normal or temporary table
@@ -1541,7 +1487,6 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
LINT_INIT(alias);
LINT_INIT(path_length);
- safe_mutex_assert_owner(&LOCK_open);
if (thd->current_stmt_binlog_row_based && !dont_log_query)
{
@@ -1551,6 +1496,9 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
else
built_query.append("DROP TABLE ");
}
+
+ pthread_mutex_lock(&LOCK_open);
+
/*
If we have the table in the definition cache, we don't have to check the
.frm file to find if the table is a normal table (not view) and what
@@ -1570,12 +1518,16 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
table->table_name_length, table->table_name, 1))
{
my_error(ER_BAD_LOG_STATEMENT, MYF(0), "DROP");
+ pthread_mutex_unlock(&LOCK_open);
DBUG_RETURN(1);
}
}
- if (!drop_temporary && lock_table_names(thd, tables))
+ if (!drop_temporary && lock_table_names_exclusively(thd, tables))
+ {
+ pthread_mutex_unlock(&LOCK_open);
DBUG_RETURN(1);
+ }
/* Don't give warnings for not found errors, as we already generate notes */
thd->no_warnings_for_error= 1;
@@ -1586,7 +1538,7 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
handlerton *table_type;
enum legacy_db_type frm_db_type;
- mysql_ha_flush(thd, table, MYSQL_HA_CLOSE_FINAL, TRUE);
+ mysql_ha_flush(thd, table, MYSQL_HA_CLOSE_FINAL, 1);
if (!close_temporary_table(thd, table))
{
tmp_table_deleted=1;
@@ -1635,8 +1587,8 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
if (thd->killed)
{
- thd->no_warnings_for_error= 0;
- DBUG_RETURN(-1);
+ error= -1;
+ goto err_with_placeholders;
}
alias= (lower_case_table_names == 2) ? table->alias : table->table_name;
/* remove .frm file and engine files */
@@ -1699,6 +1651,11 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
wrong_tables.append(String(table->table_name,system_charset_info));
}
}
+ /*
+ It's safe to unlock LOCK_open: we have an exclusive lock
+ on the table name.
+ */
+ pthread_mutex_unlock(&LOCK_open);
thd->tmp_table_used= tmp_table_deleted;
error= 0;
if (wrong_tables.length())
@@ -1758,9 +1715,10 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
*/
}
}
-
- if (!drop_temporary)
- unlock_table_names(thd, tables, (TABLE_LIST*) 0);
+ pthread_mutex_lock(&LOCK_open);
+err_with_placeholders:
+ unlock_table_names(thd, tables, (TABLE_LIST*) 0);
+ pthread_mutex_unlock(&LOCK_open);
thd->no_warnings_for_error= 0;
DBUG_RETURN(error);
}
@@ -4697,8 +4655,11 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, TABLE_LIST* src_table,
DBUG_EXECUTE_IF("sleep_create_like_before_ha_create", my_sleep(6000000););
dst_path[dst_path_length - reg_ext_length]= '\0'; // Remove .frm
+ if (thd->variables.keep_files_on_create)
+ create_info->options|= HA_CREATE_KEEP_FILES;
err= ha_create_table(thd, dst_path, db, table_name, create_info, 1);
VOID(pthread_mutex_unlock(&LOCK_open));
+
if (create_info->options & HA_LEX_CREATE_TMP_TABLE)
{
if (err || !open_temporary_table(thd, dst_path, db, table_name, 1))
diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc
index 06dd0dded43..fa0154dc39e 100644
--- a/sql/sql_trigger.cc
+++ b/sql/sql_trigger.cc
@@ -1212,17 +1212,6 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db,
table->triggers= triggers;
/*
- Construct key that will represent triggers for this table in the set
- of routines used by statement.
- */
- triggers->sroutines_key.length= 1+strlen(db)+1+strlen(table_name)+1;
- if (!(triggers->sroutines_key.str= (char*)
- alloc_root(&table->mem_root, triggers->sroutines_key.length)))
- DBUG_RETURN(1);
- triggers->sroutines_key.str[0]= TYPE_ENUM_TRIGGER;
- strxmov(triggers->sroutines_key.str+1, db, ".", table_name, NullS);
-
- /*
TODO: This could be avoided if there is no triggers
for UPDATE and DELETE.
*/
@@ -1270,6 +1259,15 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db,
DBUG_ASSERT(lex.sphead == 0);
goto err_with_lex_cleanup;
}
+ /*
+ Not strictly necessary to invoke this method here, since we know
+ that we've parsed CREATE TRIGGER and not an
+ UPDATE/DELETE/INSERT/REPLACE/LOAD/CREATE TABLE, but we try to
+ maintain the invariant that this method is called for each
+ distinct statement, in case its logic is extended with other
+ types of analyses in future.
+ */
+ lex.set_trg_event_type_for_tables();
lex.sphead->set_info(0, 0, &lex.sp_chistics, (ulong) *trg_sql_mode);
@@ -1606,8 +1604,6 @@ bool Table_triggers_list::drop_all_triggers(THD *thd, char *db, char *name)
bzero(&table, sizeof(table));
init_alloc_root(&table.mem_root, 8192, 0);
- safe_mutex_assert_owner(&LOCK_open);
-
if (Table_triggers_list::check_n_load(thd, db, name, &table, 1))
{
result= 1;
@@ -1774,26 +1770,24 @@ Table_triggers_list::change_table_name_in_trignames(const char *db_name,
}
-/*
- Update .TRG and .TRN files after renaming triggers' subject table.
+/**
+ @brief Update .TRG and .TRN files after renaming triggers' subject table.
- SYNOPSIS
- change_table_name()
- thd Thread context
- db Old database of subject table
- old_table Old name of subject table
- new_db New database for subject table
- new_table New name of subject table
+ @param[in,out] thd Thread context
+ @param[in] db Old database of subject table
+ @param[in] old_table Old name of subject table
+ @param[in] new_db New database for subject table
+ @param[in] new_table New name of subject table
- NOTE
+ @note
This method tries to leave trigger related files in consistent state,
i.e. it either will complete successfully, or will fail leaving files
in their initial state.
Also this method assumes that subject table is not renamed to itself.
+ This method needs to be called under an exclusive table name lock.
- RETURN VALUE
- FALSE Success
- TRUE Error
+ @retval FALSE Success
+ @retval TRUE Error
*/
bool Table_triggers_list::change_table_name(THD *thd, const char *db,
@@ -1809,7 +1803,19 @@ bool Table_triggers_list::change_table_name(THD *thd, const char *db,
bzero(&table, sizeof(table));
init_alloc_root(&table.mem_root, 8192, 0);
- safe_mutex_assert_owner(&LOCK_open);
+ /*
+ This method interfaces the mysql server code protected by
+ either LOCK_open mutex or with an exclusive table name lock.
+ In the future, only an exclusive table name lock will be enough.
+ */
+#ifndef DBUG_OFF
+ uchar key[MAX_DBKEY_LENGTH];
+ uint key_length= (uint) (strmov(strmov((char*)&key[0], db)+1,
+ old_table)-(char*)&key[0])+1;
+
+ if (!is_table_name_exclusively_locked_by_this_thread(thd, key, key_length))
+ safe_mutex_assert_owner(&LOCK_open);
+#endif
DBUG_ASSERT(my_strcasecmp(table_alias_charset, db, new_db) ||
my_strcasecmp(table_alias_charset, old_table, new_table));
@@ -1891,8 +1897,9 @@ bool Table_triggers_list::process_triggers(THD *thd,
{
bool err_status;
Sub_statement_state statement_state;
+ sp_head *sp_trigger= bodies[event][time_type];
- if (!bodies[event][time_type])
+ if (sp_trigger == NULL)
return FALSE;
if (old_row_is_record1)
@@ -1905,15 +1912,20 @@ bool Table_triggers_list::process_triggers(THD *thd,
new_field= record1_field;
old_field= trigger_table->field;
}
+ /*
+ This trigger must have been processed by the pre-locking
+ algorithm.
+ */
+ DBUG_ASSERT(trigger_table->pos_in_table_list->trg_event_map &
+ static_cast<uint>(1 << static_cast<int>(event)));
thd->reset_sub_statement_state(&statement_state, SUB_STMT_TRIGGER);
err_status=
- bodies[event][time_type]->execute_trigger(
- thd,
- &trigger_table->s->db,
- &trigger_table->s->table_name,
- &subject_table_grants[event][time_type]);
+ sp_trigger->execute_trigger(thd,
+ &trigger_table->s->db,
+ &trigger_table->s->table_name,
+ &subject_table_grants[event][time_type]);
thd->restore_sub_statement_state(&statement_state);
@@ -1927,7 +1939,7 @@ bool Table_triggers_list::process_triggers(THD *thd,
SYNOPSIS
mark_fields_used()
thd Current thread context
- event Type of event triggers for which we are going to inspect
+ event Type of event triggers for which we are going to ins
DESCRIPTION
This method marks fields of subject table which are read/set in its
diff --git a/sql/sql_trigger.h b/sql/sql_trigger.h
index bfdbae12bdc..8f6b08c927f 100644
--- a/sql/sql_trigger.h
+++ b/sql/sql_trigger.h
@@ -56,14 +56,6 @@ class Table_triggers_list: public Sql_alloc
updating trigger definitions during RENAME TABLE.
*/
List<LEX_STRING> on_table_names_list;
- /*
- Key representing triggers for this table in set of all stored
- routines used by statement.
- TODO: We won't need this member once triggers namespace will be
- database-wide instead of table-wide because then we will be able
- to use key based on sp_name as for other stored routines.
- */
- LEX_STRING sroutines_key;
/*
Grant information for each trigger (pair: subject table, trigger definer).
diff --git a/sql/sql_udf.h b/sql/sql_udf.h
index 3cd9343610c..4b8b492698e 100644
--- a/sql/sql_udf.h
+++ b/sql/sql_udf.h
@@ -47,7 +47,6 @@ typedef struct st_udf_func
} udf_func;
class Item_result_field;
-struct st_table_list;
class udf_handler :public Sql_alloc
{
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index ef1f46bfdd2..1016a23b5ae 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -83,6 +83,75 @@ static bool check_fields(THD *thd, List<Item> &items)
}
+/**
+ @brief Re-read record if more columns are needed for error message.
+
+ @detail If we got a duplicate key error, we want to write an error
+ message containing the value of the duplicate key. If we do not have
+ all fields of the key value in record[0], we need to re-read the
+ record with a proper read_set.
+
+ @param[in] error error number
+ @param[in] table table
+*/
+
+static void prepare_record_for_error_message(int error, TABLE *table)
+{
+ Field **field_p;
+ Field *field;
+ uint keynr;
+ MY_BITMAP unique_map; /* Fields in offended unique. */
+ my_bitmap_map unique_map_buf[bitmap_buffer_size(MAX_FIELDS)];
+ DBUG_ENTER("prepare_record_for_error_message");
+
+ /*
+ Only duplicate key errors print the key value.
+ If storage engine does always read all columns, we have the value alraedy.
+ */
+ if ((error != HA_ERR_FOUND_DUPP_KEY) ||
+ !(table->file->ha_table_flags() & HA_PARTIAL_COLUMN_READ))
+ DBUG_VOID_RETURN;
+
+ /*
+ Get the number of the offended index.
+ We will see MAX_KEY if the engine cannot determine the affected index.
+ */
+ if ((keynr= table->file->get_dup_key(error)) >= MAX_KEY)
+ DBUG_VOID_RETURN;
+
+ /* Create unique_map with all fields used by that index. */
+ bitmap_init(&unique_map, unique_map_buf, table->s->fields, FALSE);
+ table->mark_columns_used_by_index_no_reset(keynr, &unique_map);
+
+ /* Subtract read_set and write_set. */
+ bitmap_subtract(&unique_map, table->read_set);
+ bitmap_subtract(&unique_map, table->write_set);
+
+ /*
+ If the unique index uses columns that are neither in read_set
+ nor in write_set, we must re-read the record.
+ Otherwise no need to do anything.
+ */
+ if (bitmap_is_clear_all(&unique_map))
+ DBUG_VOID_RETURN;
+
+ /* Get identifier of last read record into table->file->ref. */
+ table->file->position(table->record[0]);
+ /* Add all fields used by unique index to read_set. */
+ bitmap_union(table->read_set, &unique_map);
+ /* Tell the engine about the new set. */
+ table->file->column_bitmaps_signal();
+ /* Read record that is identified by table->file->ref. */
+ (void) table->file->rnd_pos(table->record[1], table->file->ref);
+ /* Copy the newly read columns into the new record. */
+ for (field_p= table->field; (field= *field_p); field_p++)
+ if (bitmap_is_set(&unique_map, field->field_index))
+ field->copy_from_tmp(table->s->rec_buff_length);
+
+ DBUG_VOID_RETURN;
+}
+
+
/*
Process usual UPDATE
@@ -231,6 +300,17 @@ int mysql_update(THD *thd,
if (cond_value == Item::COND_FALSE)
limit= 0; // Impossible WHERE
}
+
+ /*
+ If a timestamp field settable on UPDATE is present then to avoid wrong
+ update force the table handler to retrieve write-only fields to be able
+ to compare records and detect data change.
+ */
+ if (table->file->ha_table_flags() & HA_PARTIAL_COLUMN_READ &&
+ table->timestamp_field &&
+ (table->timestamp_field_type == TIMESTAMP_AUTO_SET_ON_UPDATE ||
+ table->timestamp_field_type == TIMESTAMP_AUTO_SET_ON_BOTH))
+ bitmap_union(table->read_set, table->write_set);
// Don't count on usage of 'only index' when calculating which key to use
table->covering_keys.clear_all();
@@ -471,6 +551,13 @@ int mysql_update(THD *thd,
will_batch= !table->file->start_bulk_update();
/*
+ Assure that we can use position()
+ if we need to create an error message.
+ */
+ if (table->file->ha_table_flags() & HA_PARTIAL_COLUMN_READ)
+ table->prepare_for_position();
+
+ /*
We can use compare_record() to optimize away updates if
the table handler is returning all columns OR if
if all updated columns are read
@@ -573,6 +660,8 @@ int mysql_update(THD *thd,
*/
if (table->file->is_fatal_error(error, HA_CHECK_DUP_KEY))
thd->fatal_error(); /* Other handler errors are fatal */
+
+ prepare_record_for_error_message(error, table);
table->file->print_error(error,MYF(0));
error= 1;
break;
@@ -596,13 +685,16 @@ int mysql_update(THD *thd,
{
if (error)
{
+ /* purecov: begin inspected */
/*
The handler should not report error of duplicate keys if they
are ignored. This is a requirement on batching handlers.
*/
+ prepare_record_for_error_message(error, table);
table->file->print_error(error,MYF(0));
error= 1;
break;
+ /* purecov: end */
}
/*
Either an error was found and we are ignoring errors or there
@@ -668,9 +760,12 @@ int mysql_update(THD *thd,
in the batched update.
*/
{
+ /* purecov: begin inspected */
thd->fatal_error();
+ prepare_record_for_error_message(loc_error, table);
table->file->print_error(loc_error,MYF(0));
error= 1;
+ /* purecov: end */
}
else
updated-= dup_key_found;
@@ -1540,6 +1635,8 @@ bool multi_update::send_data(List<Item> &not_used_values)
*/
if (table->file->is_fatal_error(error, HA_CHECK_DUP_KEY))
thd->fatal_error(); /* Other handler errors are fatal */
+
+ prepare_record_for_error_message(error, table);
table->file->print_error(error,MYF(0));
DBUG_RETURN(1);
}
@@ -1676,7 +1773,7 @@ int multi_update::do_updates(bool from_send_error)
ha_rows org_updated;
TABLE *table, *tmp_table;
List_iterator_fast<TABLE> check_opt_it(unupdated_check_opt_tables);
- DBUG_ENTER("do_updates");
+ DBUG_ENTER("multi_update::do_updates");
do_update= 0; // Don't retry this function
if (!found)
@@ -1819,6 +1916,7 @@ err:
if (!from_send_error)
{
thd->fatal_error();
+ prepare_record_for_error_message(local_error, table);
table->file->print_error(local_error,MYF(0));
}
@@ -1849,6 +1947,7 @@ bool multi_update::send_eof()
{
char buff[STRING_BUFFER_USUAL_SIZE];
ulonglong id;
+ DBUG_ENTER("multi_update::send_eof");
thd->proc_info="updating reference tables";
/* Does updates for the last n - 1 tables, returns 0 if ok */
@@ -1904,7 +2003,7 @@ bool multi_update::send_eof()
/* Safety: If we haven't got an error before (can happen in do_updates) */
my_message(ER_UNKNOWN_ERROR, "An error occured in multi-table update",
MYF(0));
- return TRUE;
+ DBUG_RETURN(TRUE);
}
id= thd->arg_of_last_insert_id_function ?
@@ -1914,5 +2013,5 @@ bool multi_update::send_eof()
thd->row_count_func=
(thd->client_capabilities & CLIENT_FOUND_ROWS) ? found : updated;
::send_ok(thd, (ulong) thd->row_count_func, id, buff);
- return FALSE;
+ DBUG_RETURN(FALSE);
}
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index ce311f5d4a2..9a46bbc39e4 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -1199,7 +1199,20 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table,
*/
for (tbl= view_main_select_tables; tbl; tbl= tbl->next_local)
tbl->lock_type= table->lock_type;
+ /*
+ If the view is mergeable, we might want to
+ INSERT/UPDATE/DELETE into tables of this view. Preserve the
+ original sql command and 'duplicates' of the outer lex.
+ This is used later in set_trg_event_type_for_command.
+ */
+ lex->sql_command= old_lex->sql_command;
+ lex->duplicates= old_lex->duplicates;
}
+ /*
+ This method has a dependency on the proper lock type being set,
+ so in case of views should be called here.
+ */
+ lex->set_trg_event_type_for_tables();
/*
If we are opening this view as part of implicit LOCK TABLES, then
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 3bd930f6041..d9a808bf8f7 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -1941,12 +1941,13 @@ sp_name:
| ident
{
THD *thd= YYTHD;
+ LEX *lex= thd->lex;
LEX_STRING db;
if (check_routine_name(&$1))
{
MYSQL_YYABORT;
}
- if (thd->copy_db_to(&db.str, &db.length))
+ if (lex->copy_db_to(&db.str, &db.length))
MYSQL_YYABORT;
$$= new sp_name(db, $1, false);
if ($$)
@@ -4107,8 +4108,7 @@ part_bit_expr:
}
Lex->part_info->curr_part_elem->has_null_value= TRUE;
}
- else if (part_expr->result_type() != INT_RESULT &&
- !part_expr->null_value)
+ else if (part_expr->result_type() != INT_RESULT)
{
my_parse_error(ER(ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR));
MYSQL_YYABORT;
@@ -5131,14 +5131,13 @@ alter:
Lex->create_info.default_table_charset= NULL;
Lex->create_info.used_fields= 0;
}
- opt_create_database_options
+ create_database_options
{
- THD *thd= YYTHD;
- LEX *lex= thd->lex;
+ LEX *lex=Lex;
lex->sql_command=SQLCOM_ALTER_DB;
lex->name= $3;
if (lex->name.str == NULL &&
- thd->copy_db_to(&lex->name.str, &lex->name.length))
+ lex->copy_db_to(&lex->name.str, &lex->name.length))
MYSQL_YYABORT;
}
| ALTER PROCEDURE sp_name
@@ -5592,12 +5591,11 @@ alter_list_item:
}
| RENAME opt_to table_ident
{
- THD *thd= YYTHD;
- LEX *lex= thd->lex;
+ LEX *lex=Lex;
size_t dummy;
lex->select_lex.db=$3->db.str;
if (lex->select_lex.db == NULL &&
- thd->copy_db_to(&lex->select_lex.db, &dummy))
+ lex->copy_db_to(&lex->select_lex.db, &dummy))
{
MYSQL_YYABORT;
}
@@ -10882,10 +10880,9 @@ require_list_element:
grant_ident:
'*'
{
- THD *thd= YYTHD;
- LEX *lex= thd->lex;
+ LEX *lex= Lex;
size_t dummy;
- if (thd->copy_db_to(&lex->current_select->db, &dummy))
+ if (lex->copy_db_to(&lex->current_select->db, &dummy))
MYSQL_YYABORT;
if (lex->grant == GLOBAL_ACLS)
lex->grant = DB_ACLS & ~GRANT_ACL;
@@ -11531,12 +11528,12 @@ trigger_tail:
MYSQL_YYABORT;
sp->reset_thd_mem_root(thd);
sp->init(lex);
+ sp->m_type= TYPE_ENUM_TRIGGER;
sp->init_sp_name(thd, $3);
lex->stmt_definition_begin= $2;
lex->ident.str= $7;
lex->ident.length= $11 - $7;
- sp->m_type= TYPE_ENUM_TRIGGER;
lex->sphead= sp;
lex->spname= $3;
/*
@@ -11612,9 +11609,9 @@ sp_tail:
sp= new sp_head();
sp->reset_thd_mem_root(YYTHD);
sp->init(lex);
+ sp->m_type= TYPE_ENUM_PROCEDURE;
sp->init_sp_name(YYTHD, $3);
- sp->m_type= TYPE_ENUM_PROCEDURE;
lex->sphead= sp;
/*
* We have to turn of CLIENT_MULTI_QUERIES while parsing a
diff --git a/sql/stacktrace.c b/sql/stacktrace.c
index 40507907120..b1267e20774 100644
--- a/sql/stacktrace.c
+++ b/sql/stacktrace.c
@@ -228,6 +228,15 @@ void write_core(int sig)
void write_core(int sig)
{
signal(sig, SIG_DFL);
+#ifdef HAVE_gcov
+ /*
+ For GCOV build, crashing will prevent the writing of code coverage
+ information from this process, causing gcov output to be incomplete.
+ So we force the writing of coverage information here before terminating.
+ */
+ extern void __gcov_flush(void);
+ __gcov_flush();
+#endif
pthread_kill(pthread_self(), sig);
#if defined(P_MYID) && !defined(SCO)
/* On Solaris, the above kill is not enough */
diff --git a/sql/table.cc b/sql/table.cc
index 27a93b85fb5..a58f59d3a75 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -19,7 +19,7 @@
#include "mysql_priv.h"
#include "sql_trigger.h"
#include <m_ctype.h>
-#include "md5.h"
+#include "my_md5.h"
/* Functions defined in this file */
@@ -98,7 +98,7 @@ View_creation_ctx *View_creation_ctx::create(THD *thd)
/*************************************************************************/
View_creation_ctx * View_creation_ctx::create(THD *thd,
- st_table_list *view)
+ TABLE_LIST *view)
{
View_creation_ctx *ctx= new (thd->mem_root) View_creation_ctx(thd);
@@ -2849,15 +2849,144 @@ void st_table::reset_item_list(List<Item> *item_list) const
}
}
+
+/**
+ Set the initial purpose of this TABLE_LIST object in the list of
+ used tables. We need to track this information on table-by-
+ table basis, since when this table becomes an element of the
+ pre-locked list, it's impossible to identify which SQL
+ sub-statement it has been originally used in.
+
+ E.g.:
+
+ User request: SELECT * FROM t1 WHERE f1();
+ FUNCTION f1(): DELETE FROM t2; RETURN 1;
+ BEFORE DELETE trigger on t2: INSERT INTO t3 VALUES (old.a);
+
+ For this user request, the pre-locked list will contain t1, t2, t3
+ table elements, each needed for different DML.
+
+ This method is called immediately after parsing for tables
+ of the table list of the top-level select lex.
+
+ The trigger event map is updated to reflect INSERT, UPDATE, DELETE,
+ REPLACE, LOAD DATA, CREATE TABLE .. SELECT, CREATE TABLE ..
+ REPLACE SELECT statements, and additionally ON DUPLICATE KEY UPDATE
+ clause.
+*/
+
+void
+TABLE_LIST::set_trg_event_type(const st_lex *lex)
+{
+ enum trg_event_type trg_event;
+
+ /*
+ Some auxiliary operations
+ (e.g. GRANT processing) create TABLE_LIST instances outside
+ the parser. Additionally, some commands (e.g. OPTIMIZE) change
+ the lock type for a table only after parsing is done. Luckily,
+ these do not fire triggers and do not need to pre-load them.
+ For these TABLE_LISTs set_trg_event_type is never called, and
+ trg_event_map is always empty. That means that the pre-locking
+ algorithm will ignore triggers defined on these tables, if
+ any, and the execution will either fail with an assert in
+ sql_trigger.cc or with an error that a used table was not
+ pre-locked, in case of a production build.
+
+ TODO: this usage pattern creates unnecessary module dependencies
+ and should be rewritten to go through the parser.
+ Table list instances created outside the parser in most cases
+ refer to mysql.* system tables. It is not allowed to have
+ a trigger on a system table, but keeping track of
+ initialization provides extra safety in case this limitation
+ is circumvented.
+ */
+
+ /*
+ This is a fast check to filter out statements that do
+ not change data, or tables on the right side, in case of
+ INSERT .. SELECT, CREATE TABLE .. SELECT and so on.
+ Here we also filter out OPTIMIZE statement and non-updateable
+ views, for which lock_type is TL_UNLOCK or TL_READ after
+ parsing.
+ */
+ if (static_cast<int>(lock_type) < static_cast<int>(TL_WRITE_ALLOW_WRITE))
+ return;
+
+ switch (lex->sql_command) {
+ /*
+ Basic INSERT. If there is an additional ON DUPLIATE KEY UPDATE
+ clause, it will be handled later in this method.
+ */
+ case SQLCOM_INSERT: /* fall through */
+ case SQLCOM_INSERT_SELECT:
+ /*
+ LOAD DATA ... INFILE is expected to fire BEFORE/AFTER INSERT
+ triggers.
+ If the statement also has REPLACE clause, it will be
+ handled later in this method.
+ */
+ case SQLCOM_LOAD: /* fall through */
+ /*
+ REPLACE is semantically equivalent to INSERT. In case
+ of a primary or unique key conflict, it deletes the old
+ record and inserts a new one. So we also may need to
+ fire ON DELETE triggers. This functionality is handled
+ later in this method.
+ */
+ case SQLCOM_REPLACE: /* fall through */
+ case SQLCOM_REPLACE_SELECT:
+ /*
+ CREATE TABLE ... SELECT defaults to INSERT if the table or
+ view already exists. REPLACE option of CREATE TABLE ...
+ REPLACE SELECT is handled later in this method.
+ */
+ case SQLCOM_CREATE_TABLE:
+ trg_event= TRG_EVENT_INSERT;
+ break;
+ /* Basic update and multi-update */
+ case SQLCOM_UPDATE: /* fall through */
+ case SQLCOM_UPDATE_MULTI:
+ trg_event= TRG_EVENT_UPDATE;
+ break;
+ /* Basic delete and multi-delete */
+ case SQLCOM_DELETE: /* fall through */
+ case SQLCOM_DELETE_MULTI:
+ trg_event= TRG_EVENT_DELETE;
+ break;
+ default:
+ /*
+ OK to return, since value of 'duplicates' is irrelevant
+ for non-updating commands.
+ */
+ return;
+ }
+ trg_event_map|= static_cast<uint8>(1 << static_cast<int>(trg_event));
+
+ switch (lex->duplicates) {
+ case DUP_UPDATE:
+ trg_event= TRG_EVENT_UPDATE;
+ break;
+ case DUP_REPLACE:
+ trg_event= TRG_EVENT_DELETE;
+ break;
+ case DUP_ERROR:
+ default:
+ return;
+ }
+ trg_event_map|= static_cast<uint8>(1 << static_cast<int>(trg_event));
+}
+
+
/*
calculate md5 of query
SYNOPSIS
- st_table_list::calc_md5()
+ TABLE_LIST::calc_md5()
buffer buffer for md5 writing
*/
-void st_table_list::calc_md5(char *buffer)
+void TABLE_LIST::calc_md5(char *buffer)
{
my_MD5_CTX context;
uchar digest[16];
@@ -2882,10 +3011,10 @@ void st_table_list::calc_md5(char *buffer)
it (it is a kind of optimisation)
SYNOPSIS
- st_table_list::set_underlying_merge()
+ TABLE_LIST::set_underlying_merge()
*/
-void st_table_list::set_underlying_merge()
+void TABLE_LIST::set_underlying_merge()
{
TABLE_LIST *tbl;
@@ -2920,7 +3049,7 @@ void st_table_list::set_underlying_merge()
setup fields of placeholder of merged VIEW
SYNOPSIS
- st_table_list::setup_underlying()
+ TABLE_LIST::setup_underlying()
thd - thread handler
DESCRIPTION
@@ -2933,9 +3062,9 @@ void st_table_list::set_underlying_merge()
TRUE - error
*/
-bool st_table_list::setup_underlying(THD *thd)
+bool TABLE_LIST::setup_underlying(THD *thd)
{
- DBUG_ENTER("st_table_list::setup_underlying");
+ DBUG_ENTER("TABLE_LIST::setup_underlying");
if (!field_translation && merge_underlying_list)
{
@@ -2998,7 +3127,7 @@ bool st_table_list::setup_underlying(THD *thd)
Prepare where expression of view
SYNOPSIS
- st_table_list::prep_where()
+ TABLE_LIST::prep_where()
thd - thread handler
conds - condition of this JOIN
no_where_clause - do not build WHERE or ON outer qwery do not need it
@@ -3012,10 +3141,10 @@ bool st_table_list::setup_underlying(THD *thd)
TRUE - error
*/
-bool st_table_list::prep_where(THD *thd, Item **conds,
+bool TABLE_LIST::prep_where(THD *thd, Item **conds,
bool no_where_clause)
{
- DBUG_ENTER("st_table_list::prep_where");
+ DBUG_ENTER("TABLE_LIST::prep_where");
for (TABLE_LIST *tbl= merge_underlying_list; tbl; tbl= tbl->next_local)
{
@@ -3115,7 +3244,7 @@ merge_on_conds(THD *thd, TABLE_LIST *table, bool is_cascaded)
Prepare check option expression of table
SYNOPSIS
- st_table_list::prep_check_option()
+ TABLE_LIST::prep_check_option()
thd - thread handler
check_opt_type - WITH CHECK OPTION type (VIEW_CHECK_NONE,
VIEW_CHECK_LOCAL, VIEW_CHECK_CASCADED)
@@ -3130,16 +3259,16 @@ merge_on_conds(THD *thd, TABLE_LIST *table, bool is_cascaded)
This method builds check option condition to use it later on
every call (usual execution or every SP/PS call).
This method have to be called after WHERE preparation
- (st_table_list::prep_where)
+ (TABLE_LIST::prep_where)
RETURN
FALSE - OK
TRUE - error
*/
-bool st_table_list::prep_check_option(THD *thd, uint8 check_opt_type)
+bool TABLE_LIST::prep_check_option(THD *thd, uint8 check_opt_type)
{
- DBUG_ENTER("st_table_list::prep_check_option");
+ DBUG_ENTER("TABLE_LIST::prep_check_option");
bool is_cascaded= check_opt_type == VIEW_CHECK_CASCADED;
for (TABLE_LIST *tbl= merge_underlying_list; tbl; tbl= tbl->next_local)
@@ -3198,12 +3327,12 @@ bool st_table_list::prep_check_option(THD *thd, uint8 check_opt_type)
Hide errors which show view underlying table information
SYNOPSIS
- st_table_list::hide_view_error()
+ TABLE_LIST::hide_view_error()
thd thread handler
*/
-void st_table_list::hide_view_error(THD *thd)
+void TABLE_LIST::hide_view_error(THD *thd)
{
/* Hide "Unknown column" or "Unknown function" error */
if (thd->net.last_errno == ER_BAD_FIELD_ERROR ||
@@ -3234,7 +3363,7 @@ void st_table_list::hide_view_error(THD *thd)
table_to_find (TABLE)
SYNOPSIS
- st_table_list::find_underlying_table()
+ TABLE_LIST::find_underlying_table()
table_to_find table to find
RETURN
@@ -3242,7 +3371,7 @@ void st_table_list::hide_view_error(THD *thd)
found table reference
*/
-st_table_list *st_table_list::find_underlying_table(TABLE *table_to_find)
+TABLE_LIST *TABLE_LIST::find_underlying_table(TABLE *table_to_find)
{
/* is this real table and table which we are looking for? */
if (table == table_to_find && merge_underlying_list == 0)
@@ -3261,10 +3390,10 @@ st_table_list *st_table_list::find_underlying_table(TABLE *table_to_find)
cleunup items belonged to view fields translation table
SYNOPSIS
- st_table_list::cleanup_items()
+ TABLE_LIST::cleanup_items()
*/
-void st_table_list::cleanup_items()
+void TABLE_LIST::cleanup_items()
{
if (!field_translation)
return;
@@ -3280,7 +3409,7 @@ void st_table_list::cleanup_items()
check CHECK OPTION condition
SYNOPSIS
- st_table_list::view_check_option()
+ TABLE_LIST::view_check_option()
ignore_failure ignore check option fail
RETURN
@@ -3289,7 +3418,7 @@ void st_table_list::cleanup_items()
VIEW_CHECK_SKIP FAILED, but continue
*/
-int st_table_list::view_check_option(THD *thd, bool ignore_failure)
+int TABLE_LIST::view_check_option(THD *thd, bool ignore_failure)
{
if (check_option && check_option->val_int() == 0)
{
@@ -3314,7 +3443,7 @@ int st_table_list::view_check_option(THD *thd, bool ignore_failure)
table belong to given mask
SYNOPSIS
- st_table_list::check_single_table()
+ TABLE_LIST::check_single_table()
table_arg reference on variable where to store found table
(should be 0 on call, to find table, or point to table for
unique test)
@@ -3326,9 +3455,9 @@ int st_table_list::view_check_option(THD *thd, bool ignore_failure)
TRUE found several tables
*/
-bool st_table_list::check_single_table(st_table_list **table_arg,
+bool TABLE_LIST::check_single_table(TABLE_LIST **table_arg,
table_map map,
- st_table_list *view_arg)
+ TABLE_LIST *view_arg)
{
for (TABLE_LIST *tbl= merge_underlying_list; tbl; tbl= tbl->next_local)
{
@@ -3361,7 +3490,7 @@ bool st_table_list::check_single_table(st_table_list **table_arg,
TRUE - out of memory
*/
-bool st_table_list::set_insert_values(MEM_ROOT *mem_root)
+bool TABLE_LIST::set_insert_values(MEM_ROOT *mem_root)
{
if (table)
{
@@ -3385,7 +3514,7 @@ bool st_table_list::set_insert_values(MEM_ROOT *mem_root)
Test if this is a leaf with respect to name resolution.
SYNOPSIS
- st_table_list::is_leaf_for_name_resolution()
+ TABLE_LIST::is_leaf_for_name_resolution()
DESCRIPTION
A table reference is a leaf with respect to name resolution if
@@ -3397,7 +3526,7 @@ bool st_table_list::set_insert_values(MEM_ROOT *mem_root)
RETURN
TRUE if a leaf, FALSE otherwise.
*/
-bool st_table_list::is_leaf_for_name_resolution()
+bool TABLE_LIST::is_leaf_for_name_resolution()
{
return (view || is_natural_join || is_join_columns_complete ||
!nested_join);
@@ -3409,7 +3538,7 @@ bool st_table_list::is_leaf_for_name_resolution()
respect to name resolution.
SYNOPSIS
- st_table_list::first_leaf_for_name_resolution()
+ TABLE_LIST::first_leaf_for_name_resolution()
DESCRIPTION
Given that 'this' is a nested table reference, recursively walk
@@ -3427,7 +3556,7 @@ bool st_table_list::is_leaf_for_name_resolution()
else return 'this'
*/
-TABLE_LIST *st_table_list::first_leaf_for_name_resolution()
+TABLE_LIST *TABLE_LIST::first_leaf_for_name_resolution()
{
TABLE_LIST *cur_table_ref;
NESTED_JOIN *cur_nested_join;
@@ -3467,7 +3596,7 @@ TABLE_LIST *st_table_list::first_leaf_for_name_resolution()
respect to name resolution.
SYNOPSIS
- st_table_list::last_leaf_for_name_resolution()
+ TABLE_LIST::last_leaf_for_name_resolution()
DESCRIPTION
Given that 'this' is a nested table reference, recursively walk
@@ -3485,7 +3614,7 @@ TABLE_LIST *st_table_list::first_leaf_for_name_resolution()
- else - 'this'
*/
-TABLE_LIST *st_table_list::last_leaf_for_name_resolution()
+TABLE_LIST *TABLE_LIST::last_leaf_for_name_resolution()
{
TABLE_LIST *cur_table_ref= this;
NESTED_JOIN *cur_nested_join;
@@ -3527,7 +3656,7 @@ TABLE_LIST *st_table_list::last_leaf_for_name_resolution()
want_access Acess which we require
*/
-void st_table_list::register_want_access(ulong want_access)
+void TABLE_LIST::register_want_access(ulong want_access)
{
/* Remove SHOW_VIEW_ACL, because it will be checked during making view */
want_access&= ~SHOW_VIEW_ACL;
@@ -3546,7 +3675,7 @@ void st_table_list::register_want_access(ulong want_access)
Load security context information for this view
SYNOPSIS
- st_table_list::prepare_view_securety_context()
+ TABLE_LIST::prepare_view_securety_context()
thd [in] thread handler
RETURN
@@ -3555,9 +3684,9 @@ void st_table_list::register_want_access(ulong want_access)
*/
#ifndef NO_EMBEDDED_ACCESS_CHECKS
-bool st_table_list::prepare_view_securety_context(THD *thd)
+bool TABLE_LIST::prepare_view_securety_context(THD *thd)
{
- DBUG_ENTER("st_table_list::prepare_view_securety_context");
+ DBUG_ENTER("TABLE_LIST::prepare_view_securety_context");
DBUG_PRINT("enter", ("table: %s", alias));
DBUG_ASSERT(!prelocking_placeholder && view);
@@ -3606,17 +3735,17 @@ bool st_table_list::prepare_view_securety_context(THD *thd)
Find security context of current view
SYNOPSIS
- st_table_list::find_view_security_context()
+ TABLE_LIST::find_view_security_context()
thd [in] thread handler
*/
#ifndef NO_EMBEDDED_ACCESS_CHECKS
-Security_context *st_table_list::find_view_security_context(THD *thd)
+Security_context *TABLE_LIST::find_view_security_context(THD *thd)
{
Security_context *sctx;
TABLE_LIST *upper_view= this;
- DBUG_ENTER("st_table_list::find_view_security_context");
+ DBUG_ENTER("TABLE_LIST::find_view_security_context");
DBUG_ASSERT(view);
while (upper_view && !upper_view->view_suid)
@@ -3645,7 +3774,7 @@ Security_context *st_table_list::find_view_security_context(THD *thd)
Prepare security context and load underlying tables priveleges for view
SYNOPSIS
- st_table_list::prepare_security()
+ TABLE_LIST::prepare_security()
thd [in] thread handler
RETURN
@@ -3653,11 +3782,11 @@ Security_context *st_table_list::find_view_security_context(THD *thd)
TRUE Error
*/
-bool st_table_list::prepare_security(THD *thd)
+bool TABLE_LIST::prepare_security(THD *thd)
{
List_iterator_fast<TABLE_LIST> tb(*view_tables);
TABLE_LIST *tbl;
- DBUG_ENTER("st_table_list::prepare_security");
+ DBUG_ENTER("TABLE_LIST::prepare_security");
#ifndef NO_EMBEDDED_ACCESS_CHECKS
Security_context *save_security_ctx= thd->security_ctx;
@@ -4406,10 +4535,10 @@ void st_table::mark_columns_needed_for_insert()
Cleanup this table for re-execution.
SYNOPSIS
- st_table_list::reinit_before_use()
+ TABLE_LIST::reinit_before_use()
*/
-void st_table_list::reinit_before_use(THD *thd)
+void TABLE_LIST::reinit_before_use(THD *thd)
{
/*
Reset old pointers to TABLEs: they are not valid since the tables
@@ -4436,7 +4565,7 @@ void st_table_list::reinit_before_use(THD *thd)
Return subselect that contains the FROM list this table is taken from
SYNOPSIS
- st_table_list::containing_subselect()
+ TABLE_LIST::containing_subselect()
RETURN
Subselect item for the subquery that contains the FROM list
@@ -4445,7 +4574,7 @@ void st_table_list::reinit_before_use(THD *thd)
*/
-Item_subselect *st_table_list::containing_subselect()
+Item_subselect *TABLE_LIST::containing_subselect()
{
return (select_lex ? select_lex->master_unit()->item : 0);
}
@@ -4459,7 +4588,7 @@ Item_subselect *st_table_list::containing_subselect()
DESCRIPTION
The parser collects the index hints for each table in a "tagged list"
- (st_table_list::index_hints). Using the information in this tagged list
+ (TABLE_LIST::index_hints). Using the information in this tagged list
this function sets the members st_table::keys_in_use_for_query,
st_table::keys_in_use_for_group_by, st_table::keys_in_use_for_order_by,
st_table::force_index and st_table::covering_keys.
@@ -4501,7 +4630,7 @@ Item_subselect *st_table_list::containing_subselect()
FALSE no errors found
TRUE found and reported an error.
*/
-bool st_table_list::process_index_hints(TABLE *table)
+bool TABLE_LIST::process_index_hints(TABLE *table)
{
/* initialize the result variables */
table->keys_in_use_for_query= table->keys_in_use_for_group_by=
diff --git a/sql/table.h b/sql/table.h
index 4c98f5146ab..494b74d564c 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -38,7 +38,7 @@ public:
static View_creation_ctx *create(THD *thd);
static View_creation_ctx *create(THD *thd,
- struct st_table_list *view);
+ TABLE_LIST *view);
private:
View_creation_ctx(THD *thd)
@@ -85,6 +85,15 @@ enum tmp_table_type
INTERNAL_TMP_TABLE, SYSTEM_TMP_TABLE
};
+/** Event on which trigger is invoked. */
+enum trg_event_type
+{
+ TRG_EVENT_INSERT= 0,
+ TRG_EVENT_UPDATE= 1,
+ TRG_EVENT_DELETE= 2,
+ TRG_EVENT_MAX
+};
+
enum frm_type_enum
{
FRMTYPE_ERROR= 0,
@@ -386,7 +395,7 @@ struct st_table {
/* Table's triggers, 0 if there are no of them */
Table_triggers_list *triggers;
- struct st_table_list *pos_in_table_list;/* Element referring to this table */
+ TABLE_LIST *pos_in_table_list;/* Element referring to this table */
ORDER *group;
const char *alias; /* alias or table name */
uchar *null_flags;
@@ -625,7 +634,7 @@ typedef struct st_field_info
} ST_FIELD_INFO;
-struct st_table_list;
+struct TABLE_LIST;
typedef class Item COND;
typedef struct st_schema_table
@@ -633,12 +642,12 @@ typedef struct st_schema_table
const char* table_name;
ST_FIELD_INFO *fields_info;
/* Create information_schema table */
- TABLE *(*create_table) (THD *thd, struct st_table_list *table_list);
+ TABLE *(*create_table) (THD *thd, TABLE_LIST *table_list);
/* Fill table with data */
- int (*fill_table) (THD *thd, struct st_table_list *tables, COND *cond);
+ int (*fill_table) (THD *thd, TABLE_LIST *tables, COND *cond);
/* Handle fileds for old SHOW */
int (*old_format) (THD *thd, struct st_schema_table *schema_table);
- int (*process_table) (THD *thd, struct st_table_list *tables,
+ int (*process_table) (THD *thd, TABLE_LIST *tables,
TABLE *table, bool res, const char *base_name,
const char *file_name);
int idx_field1, idx_field2;
@@ -671,7 +680,7 @@ struct st_lex;
class select_union;
class TMP_TABLE_PARAM;
-Item *create_view_field(THD *thd, st_table_list *view, Item **field_ref,
+Item *create_view_field(THD *thd, TABLE_LIST *view, Item **field_ref,
const char *name);
struct Field_translator
@@ -692,7 +701,7 @@ class Natural_join_column: public Sql_alloc
public:
Field_translator *view_field; /* Column reference of merge view. */
Field *table_field; /* Column reference of table or temp view. */
- st_table_list *table_ref; /* Original base table/view reference. */
+ TABLE_LIST *table_ref; /* Original base table/view reference. */
/*
True if a common join column of two NATURAL/USING join operands. Notice
that when we have a hierarchy of nested NATURAL/USING joins, a column can
@@ -702,8 +711,8 @@ public:
*/
bool is_common;
public:
- Natural_join_column(Field_translator *field_param, st_table_list *tab);
- Natural_join_column(Field *field_param, st_table_list *tab);
+ Natural_join_column(Field_translator *field_param, TABLE_LIST *tab);
+ Natural_join_column(Field *field_param, TABLE_LIST *tab);
const char *name();
Item *create_item(THD *thd);
Field *field();
@@ -746,9 +755,9 @@ public:
*/
class index_hint;
-typedef struct st_table_list
+struct TABLE_LIST
{
- st_table_list() {} /* Remove gcc warning */
+ TABLE_LIST() {} /* Remove gcc warning */
/**
Prepare TABLE_LIST that consists of one table instance to use in
@@ -769,9 +778,9 @@ typedef struct st_table_list
views as leaves (unlike 'next_leaf' below). Created at parse time
in st_select_lex::add_table_to_list() -> table_list.link_in_list().
*/
- struct st_table_list *next_local;
+ TABLE_LIST *next_local;
/* link in a global list of all queries tables */
- struct st_table_list *next_global, **prev_global;
+ TABLE_LIST *next_global, **prev_global;
char *db, *alias, *table_name, *schema_table_name;
char *option; /* Used by cache index */
Item *on_expr; /* Used with outer join */
@@ -791,7 +800,7 @@ typedef struct st_table_list
'this' represents a NATURAL or USING join operation. Thus after
parsing 'this' is a NATURAL/USING join iff (natural_join != NULL).
*/
- struct st_table_list *natural_join;
+ TABLE_LIST *natural_join;
/*
True if 'this' represents a nested join that is a NATURAL JOIN.
For one of the operands of 'this', the member 'natural_join' points
@@ -815,7 +824,7 @@ typedef struct st_table_list
base tables. All of these TABLE_LIST instances contain a
materialized list of columns. The list is local to a subquery.
*/
- struct st_table_list *next_name_resolution_table;
+ TABLE_LIST *next_name_resolution_table;
/* Index names in a "... JOIN ... USE/IGNORE INDEX ..." clause. */
List<index_hint> *index_hints;
TABLE *table; /* opened table */
@@ -832,7 +841,7 @@ typedef struct st_table_list
here it will be reference of first occurrence of t1 to second (as you
can see this lists can't be merged)
*/
- st_table_list *correspondent_table;
+ TABLE_LIST *correspondent_table;
st_select_lex_unit *derived; /* SELECT_LEX_UNIT of derived table */
ST_SCHEMA_TABLE *schema_table; /* Information_schema table */
st_select_lex *schema_select_lex;
@@ -853,20 +862,20 @@ typedef struct st_table_list
does not include the tables of subqueries used in the view. Is set only
for merged views.
*/
- st_table_list *merge_underlying_list;
+ TABLE_LIST *merge_underlying_list;
/*
- 0 for base tables
- in case of the view it is the list of all (not only underlying
tables but also used in subquery ones) tables of the view.
*/
- List<st_table_list> *view_tables;
+ List<TABLE_LIST> *view_tables;
/* most upper view this table belongs to */
- st_table_list *belong_to_view;
+ TABLE_LIST *belong_to_view;
/*
The view directly referencing this table
(non-zero only for merged underlying tables of a view).
*/
- st_table_list *referencing_view;
+ TABLE_LIST *referencing_view;
/*
Security context (non-zero only for tables which belong
to view with SQL SECURITY DEFINER)
@@ -883,7 +892,7 @@ typedef struct st_table_list
leaves. Created in setup_tables() -> make_leaves_list().
*/
bool allowed_show;
- st_table_list *next_leaf;
+ TABLE_LIST *next_leaf;
Item *where; /* VIEW WHERE clause condition */
Item *check_option; /* WITH CHECK OPTION condition */
LEX_STRING select_stmt; /* text of (CREATE/SELECT) statement */
@@ -923,8 +932,8 @@ typedef struct st_table_list
table_map dep_tables; /* tables the table depends on */
table_map on_expr_dep_tables; /* tables on expression depends on */
struct st_nested_join *nested_join; /* if the element is a nested join */
- st_table_list *embedding; /* nested join containing the table */
- List<struct st_table_list> *join_list;/* join list the table belongs to */
+ TABLE_LIST *embedding; /* nested join containing the table */
+ List<TABLE_LIST> *join_list;/* join list the table belongs to */
bool cacheable_table; /* stop PS caching */
/* used in multi-upd/views privilege check */
bool table_in_first_from_clause;
@@ -979,6 +988,13 @@ typedef struct st_table_list
/* End of view definition context. */
+ /**
+ Indicates what triggers we need to pre-load for this TABLE_LIST
+ when opening an associated TABLE. This is filled after
+ the parsed tree is created.
+ */
+ uint8 trg_event_map;
+
enum enum_schema_table_state schema_table_state;
void calc_md5(char *buffer);
void set_underlying_merge();
@@ -991,15 +1007,15 @@ typedef struct st_table_list
!table;
}
void print(THD *thd, String *str);
- bool check_single_table(st_table_list **table, table_map map,
- st_table_list *view);
+ bool check_single_table(TABLE_LIST **table, table_map map,
+ TABLE_LIST *view);
bool set_insert_values(MEM_ROOT *mem_root);
void hide_view_error(THD *thd);
- st_table_list *find_underlying_table(TABLE *table);
- st_table_list *first_leaf_for_name_resolution();
- st_table_list *last_leaf_for_name_resolution();
+ TABLE_LIST *find_underlying_table(TABLE *table);
+ TABLE_LIST *first_leaf_for_name_resolution();
+ TABLE_LIST *last_leaf_for_name_resolution();
bool is_leaf_for_name_resolution();
- inline st_table_list *top_table()
+ inline TABLE_LIST *top_table()
{ return belong_to_view ? belong_to_view : this; }
inline bool prepare_check_option(THD *thd)
{
@@ -1036,6 +1052,7 @@ typedef struct st_table_list
*/
bool process_index_hints(TABLE *table);
+ void set_trg_event_type(const st_lex *lex);
private:
bool prep_check_option(THD *thd, uint8 check_opt_type);
bool prep_where(THD *thd, Item **conds, bool no_where_clause);
@@ -1043,7 +1060,7 @@ private:
Cleanup for re-execution in a prepared statement or a stored
procedure.
*/
-} TABLE_LIST;
+};
class Item;
diff --git a/sql/uniques.cc b/sql/uniques.cc
index 7a05ceaddfc..0394eee9c6d 100644
--- a/sql/uniques.cc
+++ b/sql/uniques.cc
@@ -360,17 +360,12 @@ Unique::reset()
}
/*
- The comparison function, passed to queue_init() in merge_walk() must
+ The comparison function, passed to queue_init() in merge_walk() and in
+ merge_buffers() when the latter is called from Uniques::get() must
use comparison function of Uniques::tree, but compare members of struct
BUFFPEK.
*/
-struct BUFFPEK_COMPARE_CONTEXT
-{
- qsort_cmp2 key_compare;
- void *key_compare_arg;
-};
-
C_MODE_START
static int buffpek_compare(void *arg, uchar *key_ptr1, uchar *key_ptr2)
@@ -629,6 +624,10 @@ bool Unique::get(TABLE *table)
sort_param.unique_buff= sort_buffer+(sort_param.keys*
sort_param.sort_length);
+ sort_param.compare= (qsort2_cmp) buffpek_compare;
+ sort_param.cmp_context.key_compare= tree.compare;
+ sort_param.cmp_context.key_compare_arg= tree.custom_arg;
+
/* Merge the buffers to one file, removing duplicates */
if (merge_many_buff(&sort_param,sort_buffer,file_ptr,&maxbuffer,&file))
goto err;
diff --git a/sql/unireg.cc b/sql/unireg.cc
index 57847bc70c6..f9e8e54439a 100644
--- a/sql/unireg.cc
+++ b/sql/unireg.cc
@@ -355,6 +355,8 @@ int rea_create_table(THD *thd, const char *path,
// Make sure mysql_create_frm din't remove extension
DBUG_ASSERT(*fn_rext(frm_name));
+ if (thd->variables.keep_files_on_create)
+ create_info->options|= HA_CREATE_KEEP_FILES;
if (file->create_handler_files(path, NULL, CHF_CREATE_FLAG, create_info))
goto err_handler;
if (!create_info->frm_only && ha_create_table(thd, path, db, table_name,
diff --git a/sql/unireg.h b/sql/unireg.h
index 5b73c6e9caa..6c26f30f116 100644
--- a/sql/unireg.h
+++ b/sql/unireg.h
@@ -124,7 +124,7 @@
#define SPECIAL_NO_HOST_CACHE 512 /* Don't cache hosts */
#define SPECIAL_SHORT_LOG_FORMAT 1024
#define SPECIAL_SAFE_MODE 2048
-#define SPECIAL_LOG_QUERIES_NOT_USING_INDEXES 4096 /* Log q not using indexes */
+#define SPECIAL_LOG_QUERIES_NOT_USING_INDEXES 4096 /* Obsolete */
/* Extern defines */
#define store_record(A,B) bmove_align((A)->B,(A)->record[0],(size_t) (A)->s->reclength)
diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc
index d1482de18ec..bdc59cbe795 100644
--- a/storage/archive/ha_archive.cc
+++ b/storage/archive/ha_archive.cc
@@ -1548,7 +1548,6 @@ bool ha_archive::is_crashed() const
int ha_archive::check(THD* thd, HA_CHECK_OPT* check_opt)
{
int rc= 0;
- uchar *buf;
const char *old_proc_info;
ha_rows count= share->rows_recorded;
DBUG_ENTER("ha_archive::check");
@@ -1557,27 +1556,14 @@ int ha_archive::check(THD* thd, HA_CHECK_OPT* check_opt)
/* Flush any waiting data */
azflush(&(share->archive_write), Z_SYNC_FLUSH);
- /*
- First we create a buffer that we can use for reading rows, and can pass
- to get_row().
- */
- if (!(buf= (uchar*) my_malloc(table->s->reclength, MYF(MY_WME))))
- rc= HA_ERR_OUT_OF_MEM;
-
/*
Now we will rewind the archive file so that we are positioned at the
start of the file.
*/
init_archive_reader();
-
- if (!rc)
- read_data_header(&archive);
-
- if (!rc)
- while (!(rc= get_row(&archive, buf)))
- count--;
-
- my_free((char*)buf, MYF(0));
+ read_data_header(&archive);
+ while (!(rc= get_row(&archive, table->record[0])))
+ count--;
thd_proc_info(thd, old_proc_info);
diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc
index 6de153c82d7..34c1fcde58d 100644
--- a/storage/csv/ha_tina.cc
+++ b/storage/csv/ha_tina.cc
@@ -46,10 +46,9 @@ TODO:
#endif
#include "mysql_priv.h"
-
+#include <mysql/plugin.h>
#include "ha_tina.h"
-#include <mysql/plugin.h>
/*
uchar + uchar + ulonglong + ulonglong + ulonglong + ulonglong + uchar
@@ -164,6 +163,7 @@ static TINA_SHARE *get_share(const char *table_name, TABLE *table)
share->rows_recorded= 0;
share->update_file_opened= FALSE;
share->tina_write_opened= FALSE;
+ share->data_file_version= 0;
strmov(share->table_name, table_name);
fn_format(share->data_file_name, table_name, "", CSV_EXT,
MY_REPLACE_EXT|MY_UNPACK_FILENAME);
@@ -441,7 +441,7 @@ ha_tina::ha_tina(handlerton *hton, TABLE_SHARE *table_arg)
*/
current_position(0), next_position(0), local_saved_data_file_length(0),
file_buff(0), chain_alloced(0), chain_size(DEFAULT_CHAIN_LENGTH),
- records_is_known(0)
+ local_data_file_version(0), records_is_known(0)
{
/* Set our original buffers from pre-allocated memory */
buffer.set((char*)byte_buffer, IO_SIZE, &my_charset_bin);
@@ -590,6 +590,7 @@ int ha_tina::find_current_row(uchar *buf)
int eoln_len;
my_bitmap_map *org_bitmap;
int error;
+ bool read_all;
DBUG_ENTER("ha_tina::find_current_row");
/*
@@ -601,6 +602,8 @@ int ha_tina::find_current_row(uchar *buf)
local_saved_data_file_length, &eoln_len)) == 0)
DBUG_RETURN(HA_ERR_END_OF_FILE);
+ /* We must read all columns in case a table is opened for update */
+ read_all= !bitmap_is_clear_all(table->write_set);
/* Avoid asserts in ::store() for columns that are not going to be updated */
org_bitmap= dbug_tmp_use_all_columns(table, table->write_set);
error= HA_ERR_CRASHED_ON_USAGE;
@@ -609,37 +612,41 @@ int ha_tina::find_current_row(uchar *buf)
for (Field **field=table->field ; *field ; field++)
{
+ char curr_char;
+
buffer.length(0);
- if (curr_offset < end_offset &&
- file_buff->get_value(curr_offset) == '"')
+ if (curr_offset >= end_offset)
+ goto err;
+ curr_char= file_buff->get_value(curr_offset);
+ if (curr_char == '"')
{
curr_offset++; // Incrementpast the first quote
- for(;curr_offset < end_offset; curr_offset++)
+ for(; curr_offset < end_offset; curr_offset++)
{
+ curr_char= file_buff->get_value(curr_offset);
// Need to convert line feeds!
- if (file_buff->get_value(curr_offset) == '"' &&
- ((file_buff->get_value(curr_offset + 1) == ',') ||
- (curr_offset == end_offset -1 )))
+ if (curr_char == '"' &&
+ (curr_offset == end_offset - 1 ||
+ file_buff->get_value(curr_offset + 1) == ','))
{
curr_offset+= 2; // Move past the , and the "
break;
}
- if (file_buff->get_value(curr_offset) == '\\' &&
- curr_offset != (end_offset - 1))
+ if (curr_char == '\\' && curr_offset != (end_offset - 1))
{
curr_offset++;
- if (file_buff->get_value(curr_offset) == 'r')
+ curr_char= file_buff->get_value(curr_offset);
+ if (curr_char == 'r')
buffer.append('\r');
- else if (file_buff->get_value(curr_offset) == 'n' )
+ else if (curr_char == 'n' )
buffer.append('\n');
- else if ((file_buff->get_value(curr_offset) == '\\') ||
- (file_buff->get_value(curr_offset) == '"'))
- buffer.append(file_buff->get_value(curr_offset));
+ else if (curr_char == '\\' || curr_char == '"')
+ buffer.append(curr_char);
else /* This could only happed with an externally created file */
{
buffer.append('\\');
- buffer.append(file_buff->get_value(curr_offset));
+ buffer.append(curr_char);
}
}
else // ordinary symbol
@@ -650,36 +657,30 @@ int ha_tina::find_current_row(uchar *buf)
*/
if (curr_offset == end_offset - 1)
goto err;
- buffer.append(file_buff->get_value(curr_offset));
+ buffer.append(curr_char);
}
}
}
- else if (my_isdigit(system_charset_info,
- file_buff->get_value(curr_offset)))
+ else
{
- for(;curr_offset < end_offset; curr_offset++)
+ for(; curr_offset < end_offset; curr_offset++)
{
- if (file_buff->get_value(curr_offset) == ',')
+ curr_char= file_buff->get_value(curr_offset);
+ if (curr_char == ',')
{
- curr_offset+= 1; // Move past the ,
+ curr_offset++; // Skip the ,
break;
}
-
- if (my_isdigit(system_charset_info, file_buff->get_value(curr_offset)))
- buffer.append(file_buff->get_value(curr_offset));
- else if (file_buff->get_value(curr_offset) == '.')
- buffer.append(file_buff->get_value(curr_offset));
- else
- goto err;
+ buffer.append(curr_char);
}
}
- else
+
+ if (read_all || bitmap_is_set(table->read_set, (*field)->field_index))
{
- goto err;
+ if ((*field)->store(buffer.ptr(), buffer.length(), buffer.charset(),
+ CHECK_FIELD_WARN))
+ goto err;
}
-
- if (bitmap_is_set(table->read_set, (*field)->field_index))
- (*field)->store(buffer.ptr(), buffer.length(), buffer.charset());
}
next_position= end_offset + eoln_len;
error= 0;
@@ -815,6 +816,7 @@ int ha_tina::open(const char *name, int mode, uint open_options)
DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
}
+ local_data_file_version= share->data_file_version;
if ((data_file= my_open(share->data_file_name, O_RDONLY, MYF(0))) == -1)
DBUG_RETURN(0);
@@ -904,6 +906,7 @@ int ha_tina::open_update_temp_file_if_needed()
0, O_RDWR | O_TRUNC, MYF(MY_WME))) < 0)
return 1;
share->update_file_opened= TRUE;
+ temp_file_length= 0;
}
return 0;
}
@@ -928,6 +931,13 @@ int ha_tina::update_row(const uchar * old_data, uchar * new_data)
size= encode_quote(new_data);
+ /*
+ During update we mark each updating record as deleted
+ (see the chain_append()) then write new one to the temporary data file.
+ At the end of the sequence in the rnd_end() we append all non-marked
+ records from the data file to the temporary data file then rename it.
+ The temp_file_length is used to calculate new data file length.
+ */
if (chain_append())
DBUG_RETURN(-1);
@@ -937,6 +947,7 @@ int ha_tina::update_row(const uchar * old_data, uchar * new_data)
if (my_write(update_temp_file, (uchar*)buffer.ptr(), size,
MYF(MY_WME | MY_NABP)))
DBUG_RETURN(-1);
+ temp_file_length+= size;
/* UPDATE should never happen on the log tables */
DBUG_ASSERT(!share->is_log_table);
@@ -963,6 +974,11 @@ int ha_tina::delete_row(const uchar * buf)
DBUG_RETURN(-1);
stats.records--;
+ /* Update shared info */
+ DBUG_ASSERT(share->rows_recorded);
+ pthread_mutex_lock(&share->mutex);
+ share->rows_recorded--;
+ pthread_mutex_unlock(&share->mutex);
/* DELETE should never happen on the log table */
DBUG_ASSERT(!share->is_log_table);
@@ -971,6 +987,33 @@ int ha_tina::delete_row(const uchar * buf)
}
+/**
+ @brief Initialize the data file.
+
+ @details Compare the local version of the data file with the shared one.
+ If they differ, there are some changes behind and we have to reopen
+ the data file to make the changes visible.
+ Call @c file_buff->init_buff() at the end to read the beginning of the
+ data file into buffer.
+
+ @retval 0 OK.
+ @retval 1 There was an error.
+*/
+
+int ha_tina::init_data_file()
+{
+ if (local_data_file_version != share->data_file_version)
+ {
+ local_data_file_version= share->data_file_version;
+ if (my_close(data_file, MYF(0)) ||
+ (data_file= my_open(share->data_file_name, O_RDONLY, MYF(0))) == -1)
+ return 1;
+ }
+ file_buff->init_buff(data_file);
+ return 0;
+}
+
+
/*
All table scans call this first.
The order of a table scan is:
@@ -1007,9 +1050,8 @@ int ha_tina::rnd_init(bool scan)
DBUG_ENTER("ha_tina::rnd_init");
/* set buffer to the beginning of the file */
- file_buff->init_buff(data_file);
- if (share->crashed)
- DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
+ if (share->crashed || init_data_file())
+ DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
current_position= next_position= 0;
stats.records= 0;
@@ -1174,15 +1216,18 @@ int ha_tina::rnd_end()
while ((file_buffer_start != -1)) // while not end of file
{
bool in_hole= get_write_pos(&write_end, ptr);
+ off_t write_length= write_end - write_begin;
/* if there is something to write, write it */
- if ((write_end - write_begin) &&
- (my_write(update_temp_file,
- (uchar*)(file_buff->ptr() +
- (write_begin - file_buff->start())),
- write_end - write_begin, MYF_RW)))
- goto error;
-
+ if (write_length)
+ {
+ if (my_write(update_temp_file,
+ (uchar*) (file_buff->ptr() +
+ (write_begin - file_buff->start())),
+ write_length, MYF_RW))
+ goto error;
+ temp_file_length+= write_length;
+ }
if (in_hole)
{
/* skip hole */
@@ -1230,11 +1275,26 @@ int ha_tina::rnd_end()
if (((data_file= my_open(share->data_file_name, O_RDONLY, MYF(0))) == -1))
DBUG_RETURN(-1);
/*
+ As we reopened the data file, increase share->data_file_version
+ in order to force other threads waiting on a table lock and
+ have already opened the table to reopen the data file.
+ That makes the latest changes become visible to them.
+ Update local_data_file_version as no need to reopen it in the
+ current thread.
+ */
+ share->data_file_version++;
+ local_data_file_version= share->data_file_version;
+ /*
The datafile is consistent at this point and the write filedes is
closed, so nothing worrying will happen to it in case of a crash.
Here we record this fact to the meta-file.
*/
(void)write_meta_file(share->meta_file, share->rows_recorded, FALSE);
+ /*
+ Update local_saved_data_file_length with the real length of the
+ data file.
+ */
+ local_saved_data_file_length= temp_file_length;
}
DBUG_RETURN(0);
@@ -1286,7 +1346,8 @@ int ha_tina::repair(THD* thd, HA_CHECK_OPT* check_opt)
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
/* position buffer to the start of the file */
- file_buff->init_buff(data_file);
+ if (init_data_file())
+ DBUG_RETURN(HA_ERR_CRASHED_ON_REPAIR);
/*
Local_saved_data_file_length is initialized during the lock phase.
@@ -1300,6 +1361,7 @@ int ha_tina::repair(THD* thd, HA_CHECK_OPT* check_opt)
/* Read the file row-by-row. If everything is ok, repair is not needed. */
while (!(rc= find_current_row(buf)))
{
+ thd_inc_row_count(thd);
rows_repaired++;
current_position= next_position;
}
@@ -1392,6 +1454,11 @@ int ha_tina::delete_all_rows()
rc= my_chsize(share->tina_write_filedes, 0, 0, MYF(MY_WME));
stats.records=0;
+ /* Update shared info */
+ pthread_mutex_lock(&share->mutex);
+ share->rows_recorded= 0;
+ pthread_mutex_unlock(&share->mutex);
+ local_saved_data_file_length= 0;
DBUG_RETURN(rc);
}
@@ -1452,7 +1519,8 @@ int ha_tina::check(THD* thd, HA_CHECK_OPT* check_opt)
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
/* position buffer to the start of the file */
- file_buff->init_buff(data_file);
+ if (init_data_file())
+ DBUG_RETURN(HA_ERR_CRASHED);
/*
Local_saved_data_file_length is initialized during the lock phase.
@@ -1465,6 +1533,7 @@ int ha_tina::check(THD* thd, HA_CHECK_OPT* check_opt)
/* Read the file row-by-row. If everything is ok, repair is not needed. */
while (!(rc= find_current_row(buf)))
{
+ thd_inc_row_count(thd);
count--;
current_position= next_position;
}
diff --git a/storage/csv/ha_tina.h b/storage/csv/ha_tina.h
index 8d2c6855b84..5bb3e9a79a0 100644
--- a/storage/csv/ha_tina.h
+++ b/storage/csv/ha_tina.h
@@ -49,6 +49,7 @@ typedef struct st_tina_share {
File tina_write_filedes; /* File handler for readers */
bool crashed; /* Meta file is crashed */
ha_rows rows_recorded; /* Number of rows in tables */
+ uint data_file_version; /* Version of the data file used */
} TINA_SHARE;
struct tina_set {
@@ -63,6 +64,7 @@ class ha_tina: public handler
off_t current_position; /* Current position in the file during a file scan */
off_t next_position; /* Next position in the file scan */
off_t local_saved_data_file_length; /* save position for reads */
+ off_t temp_file_length;
uchar byte_buffer[IO_SIZE];
Transparent_file *file_buff;
File data_file; /* File handler for readers */
@@ -78,12 +80,14 @@ class ha_tina: public handler
tina_set *chain_ptr;
uchar chain_alloced;
uint32 chain_size;
+ uint local_data_file_version; /* Saved version of the data file used */
bool records_is_known;
private:
bool get_write_pos(off_t *end_pos, tina_set *closest_hole);
int open_update_temp_file_if_needed();
int init_tina_writer();
+ int init_data_file();
public:
ha_tina(handlerton *hton, TABLE_SHARE *table_arg);
diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc
index 96ce0013587..635a6fa79e0 100644
--- a/storage/federated/ha_federated.cc
+++ b/storage/federated/ha_federated.cc
@@ -388,6 +388,11 @@
/* Variables for federated share methods */
static HASH federated_open_tables; // To track open tables
pthread_mutex_t federated_mutex; // To init the hash
+static char ident_quote_char= '`'; // Character for quoting
+ // identifiers
+static char value_quote_char= '\''; // Character for quoting
+ // literals
+static const int bulk_padding= 64; // bytes "overhead" in packet
/* Variables used when chopping off trailing characters */
static const uint sizeof_trailing_comma= sizeof(", ") - 1;
@@ -415,7 +420,7 @@ static handler *federated_create_handler(handlerton *hton,
/* Function we use in the creation of our hash to get key */
static uchar *federated_get_key(FEDERATED_SHARE *share, size_t *length,
- my_bool not_used __attribute__ ((unused)))
+ my_bool not_used __attribute__ ((unused)))
{
*length= share->share_key_length;
return (uchar*) share->share_key;
@@ -477,6 +482,57 @@ int federated_done(void *p)
}
+/**
+ @brief Append identifiers to the string.
+
+ @param[in,out] string The target string.
+ @param[in] name Identifier name
+ @param[in] length Length of identifier name in bytes
+ @param[in] quote_char Quote char to use for quoting identifier.
+
+ @return Operation Status
+ @retval FALSE OK
+ @retval TRUE There was an error appending to the string.
+
+ @note This function is based upon the append_identifier() function
+ in sql_show.cc except that quoting always occurs.
+*/
+
+static bool append_ident(String *string, const char *name, uint length,
+ const char quote_char)
+{
+ bool result;
+ uint clen;
+ const char *name_end;
+ DBUG_ENTER("append_ident");
+
+ if (quote_char)
+ {
+ string->reserve(length * 2 + 2);
+ if ((result= string->append(&quote_char, 1, system_charset_info)))
+ goto err;
+
+ for (name_end= name+length; name < name_end; name+= clen)
+ {
+ uchar c= *(uchar *) name;
+ if (!(clen= my_mbcharlen(system_charset_info, c)))
+ clen= 1;
+ if (clen == 1 && c == (uchar) quote_char &&
+ (result= string->append(&quote_char, 1, system_charset_info)))
+ goto err;
+ if ((result= string->append(name, clen, string->charset())))
+ goto err;
+ }
+ result= string->append(&quote_char, 1, system_charset_info);
+ }
+ else
+ result= string->append(name, length, system_charset_info);
+
+err:
+ DBUG_RETURN(result);
+}
+
+
/*
Check (in create) whether the tables exists, and that it can be connected to
@@ -495,7 +551,6 @@ int federated_done(void *p)
static int check_foreign_data_source(FEDERATED_SHARE *share,
bool table_create_flag)
{
- char escaped_table_name[NAME_LEN*2];
char query_buffer[FEDERATED_QUERY_BUFFER_SIZE];
char error_buffer[FEDERATED_QUERY_BUFFER_SIZE];
uint error_code;
@@ -536,7 +591,6 @@ static int check_foreign_data_source(FEDERATED_SHARE *share,
}
else
{
- int escaped_table_name_length= 0;
/*
Since we do not support transactions at this version, we can let the
client API silently reconnect. For future versions, we will need more
@@ -551,14 +605,10 @@ static int check_foreign_data_source(FEDERATED_SHARE *share,
the query will be: SELECT * FROM `tablename` WHERE 1=0
*/
- query.append(STRING_WITH_LEN("SELECT * FROM `"));
- escaped_table_name_length=
- escape_string_for_mysql(&my_charset_bin, (char*)escaped_table_name,
- sizeof(escaped_table_name),
- share->table_name,
- share->table_name_length);
- query.append(escaped_table_name, escaped_table_name_length);
- query.append(STRING_WITH_LEN("` WHERE 1=0"));
+ query.append(STRING_WITH_LEN("SELECT * FROM "));
+ append_ident(&query, share->table_name, share->table_name_length,
+ ident_quote_char);
+ query.append(STRING_WITH_LEN(" WHERE 1=0"));
if (mysql_real_query(mysql, query.ptr(), query.length()))
{
@@ -907,6 +957,7 @@ ha_federated::ha_federated(handlerton *hton,
mysql(0), stored_result(0)
{
trx_next= 0;
+ bzero(&bulk_insert, sizeof(bulk_insert));
}
@@ -969,9 +1020,8 @@ uint ha_federated::convert_row_to_internal_format(uchar *record,
static bool emit_key_part_name(String *to, KEY_PART_INFO *part)
{
DBUG_ENTER("emit_key_part_name");
- if (to->append(STRING_WITH_LEN("`")) ||
- to->append(part->field->field_name) ||
- to->append(STRING_WITH_LEN("`")))
+ if (append_ident(to, part->field->field_name,
+ strlen(part->field->field_name), ident_quote_char))
DBUG_RETURN(1); // Out of memory
DBUG_RETURN(0);
}
@@ -1515,20 +1565,20 @@ static FEDERATED_SHARE *get_share(const char *table_name, TABLE *table)
query.append(STRING_WITH_LEN("SELECT "));
for (field= table->field; *field; field++)
{
- query.append(STRING_WITH_LEN("`"));
- query.append((*field)->field_name);
- query.append(STRING_WITH_LEN("`, "));
+ append_ident(&query, (*field)->field_name,
+ strlen((*field)->field_name), ident_quote_char);
+ query.append(STRING_WITH_LEN(", "));
}
/* chops off trailing comma */
query.length(query.length() - sizeof_trailing_comma);
- query.append(STRING_WITH_LEN(" FROM `"));
- query.append(tmp_share.table_name, tmp_share.table_name_length);
- query.append(STRING_WITH_LEN("`"));
- DBUG_PRINT("info", ("calling alloc_root"));
+ query.append(STRING_WITH_LEN(" FROM "));
+
+ append_ident(&query, tmp_share.table_name,
+ tmp_share.table_name_length, ident_quote_char);
if (!(share= (FEDERATED_SHARE *) memdup_root(&mem_root, (char*)&tmp_share, sizeof(*share))) ||
- !(share->select_query= (char*) strmake_root(&mem_root, query.ptr(), query.length())))
+ !(share->select_query= (char*) strmake_root(&mem_root, query.ptr(), query.length() + 1)))
goto error;
share->use_count= 0;
@@ -1669,6 +1719,8 @@ int ha_federated::open(const char *name, int mode, uint test_if_locked)
table->s->reclength);
DBUG_PRINT("info", ("ref_length: %u", ref_length));
+ reset();
+
DBUG_RETURN(0);
}
@@ -1741,6 +1793,82 @@ static inline uint field_in_record_is_null(TABLE *table,
}
+/**
+ @brief Construct the INSERT statement.
+
+ @details This method will construct the INSERT statement and appends it to
+ the supplied query string buffer.
+
+ @return
+ @retval FALSE No error
+ @retval TRUE Failure
+*/
+
+bool ha_federated::append_stmt_insert(String *query)
+{
+ char insert_buffer[FEDERATED_QUERY_BUFFER_SIZE];
+ Field **field;
+ uint tmp_length;
+ bool added_field= FALSE;
+
+ /* The main insert query string */
+ String insert_string(insert_buffer, sizeof(insert_buffer), &my_charset_bin);
+ DBUG_ENTER("ha_federated::append_stmt_insert");
+
+ insert_string.length(0);
+
+ if (replace_duplicates)
+ insert_string.append(STRING_WITH_LEN("REPLACE INTO "));
+ else if (ignore_duplicates && !insert_dup_update)
+ insert_string.append(STRING_WITH_LEN("INSERT IGNORE INTO "));
+ else
+ insert_string.append(STRING_WITH_LEN("INSERT INTO "));
+ append_ident(&insert_string, share->table_name, share->table_name_length,
+ ident_quote_char);
+ tmp_length= insert_string.length();
+ insert_string.append(STRING_WITH_LEN(" ("));
+
+ /*
+ loop through the field pointer array, add any fields to both the values
+ list and the fields list that match the current query id
+ */
+ for (field= table->field; *field; field++)
+ {
+ if (bitmap_is_set(table->write_set, (*field)->field_index))
+ {
+ /* append the field name */
+ append_ident(&insert_string, (*field)->field_name,
+ strlen((*field)->field_name), ident_quote_char);
+
+ /* append commas between both fields and fieldnames */
+ /*
+ unfortunately, we can't use the logic if *(fields + 1) to
+ make the following appends conditional as we don't know if the
+ next field is in the write set
+ */
+ insert_string.append(STRING_WITH_LEN(", "));
+ added_field= TRUE;
+ }
+ }
+
+ if (added_field)
+ {
+ /* Remove trailing comma. */
+ insert_string.length(insert_string.length() - sizeof_trailing_comma);
+ insert_string.append(STRING_WITH_LEN(") "));
+ }
+ else
+ {
+ /* If there were no fields, we don't want to add a closing paren. */
+ insert_string.length(tmp_length);
+ }
+
+ insert_string.append(STRING_WITH_LEN(" VALUES "));
+
+ DBUG_RETURN(query->append(insert_string));
+}
+
+
/*
write_row() inserts a row. No extra() hint is given currently if a bulk load
is happeneding. buf() is a byte array of data. You can use the field
@@ -1757,69 +1885,14 @@ static inline uint field_in_record_is_null(TABLE *table,
int ha_federated::write_row(uchar *buf)
{
- /*
- I need a bool again, in 5.0, I used table->s->fields to accomplish this.
- This worked as a flag that says there are fields with values or not.
- In 5.1, this value doesn't work the same, and I end up with the code
- truncating open parenthesis:
-
- the statement "INSERT INTO t1 VALUES ()" ends up being first built
- in two strings
- "INSERT INTO t1 ("
- and
- " VALUES ("
-
- If there are fields with values, they get appended, with commas, and
- the last loop, a trailing comma is there
-
- "INSERT INTO t1 ( col1, col2, colN, "
-
- " VALUES ( 'val1', 'val2', 'valN', "
-
- Then, if there are fields, it should decrement the string by ", " length.
-
- "INSERT INTO t1 ( col1, col2, colN"
- " VALUES ( 'val1', 'val2', 'valN'"
-
- Then it adds a close paren to both - if there are fields
-
- "INSERT INTO t1 ( col1, col2, colN)"
- " VALUES ( 'val1', 'val2', 'valN')"
-
- Then appends both together
- "INSERT INTO t1 ( col1, col2, colN) VALUES ( 'val1', 'val2', 'valN')"
-
- So... the problem, is if you have the original statement:
-
- "INSERT INTO t1 VALUES ()"
-
- Which is legitimate, but if the code thinks there are fields
-
- "INSERT INTO t1 ("
- " VALUES ( "
-
- If the field flag is set, but there are no commas, reduces the
- string by strlen(", ")
-
- "INSERT INTO t1 "
- " VALUES "
-
- Then adds the close parenthesis
-
- "INSERT INTO t1 )"
- " VALUES )"
-
- So, I have to use a bool as before, set in the loop where fields and commas
- are appended to the string
- */
- my_bool commas_added= FALSE;
- char insert_buffer[FEDERATED_QUERY_BUFFER_SIZE];
char values_buffer[FEDERATED_QUERY_BUFFER_SIZE];
char insert_field_value_buffer[STRING_BUFFER_USUAL_SIZE];
Field **field;
+ uint tmp_length;
+ int error= 0;
+ bool use_bulk_insert;
+ bool auto_increment_update_required= (table->next_number_field != NULL);
- /* The main insert query string */
- String insert_string(insert_buffer, sizeof(insert_buffer), &my_charset_bin);
/* The string containing the values to be added to the insert */
String values_string(values_buffer, sizeof(values_buffer), &my_charset_bin);
/* The actual value of the field, to be added to the values_string */
@@ -1830,7 +1903,6 @@ int ha_federated::write_row(uchar *buf)
DBUG_ENTER("ha_federated::write_row");
values_string.length(0);
- insert_string.length(0);
insert_field_value_string.length(0);
ha_statistic_increment(&SSV::ha_write_count);
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT)
@@ -1838,14 +1910,19 @@ int ha_federated::write_row(uchar *buf)
/*
start both our field and field values strings
+ We must disable multi-row insert for "INSERT...ON DUPLICATE KEY UPDATE"
+ Ignore duplicates is always true when insert_dup_update is true.
+ When replace_duplicates == TRUE, we can safely enable multi-row insert.
+ When performing multi-row insert, we only collect the columns values for
+ the row. The start of the statement is only created when the first
+ row is copied in to the bulk_insert string.
*/
- insert_string.append(STRING_WITH_LEN("INSERT INTO `"));
- insert_string.append(share->table_name, share->table_name_length);
- insert_string.append('`');
- insert_string.append(STRING_WITH_LEN(" ("));
+ if (!(use_bulk_insert= bulk_insert.str &&
+ (!insert_dup_update || replace_duplicates)))
+ append_stmt_insert(&values_string);
- values_string.append(STRING_WITH_LEN(" VALUES "));
values_string.append(STRING_WITH_LEN(" ("));
+ tmp_length= values_string.length();
/*
loop through the field pointer array, add any fields to both the values
@@ -1855,7 +1932,6 @@ int ha_federated::write_row(uchar *buf)
{
if (bitmap_is_set(table->write_set, (*field)->field_index))
{
- commas_added= TRUE;
if ((*field)->is_null())
values_string.append(STRING_WITH_LEN(" NULL "));
else
@@ -1863,15 +1939,13 @@ int ha_federated::write_row(uchar *buf)
bool needs_quote= (*field)->str_needs_quotes();
(*field)->val_str(&insert_field_value_string);
if (needs_quote)
- values_string.append('\'');
+ values_string.append(value_quote_char);
insert_field_value_string.print(&values_string);
if (needs_quote)
- values_string.append('\'');
+ values_string.append(value_quote_char);
insert_field_value_string.length(0);
}
- /* append the field name */
- insert_string.append((*field)->field_name);
/* append commas between both fields and fieldnames */
/*
@@ -1879,7 +1953,6 @@ int ha_federated::write_row(uchar *buf)
make the following appends conditional as we don't know if the
next field is in the write set
*/
- insert_string.append(STRING_WITH_LEN(", "));
values_string.append(STRING_WITH_LEN(", "));
}
}
@@ -1890,26 +1963,53 @@ int ha_federated::write_row(uchar *buf)
AND, we don't want to chop off the last char '('
insert will be "INSERT INTO t1 VALUES ();"
*/
- if (commas_added)
+ if (values_string.length() > tmp_length)
{
- insert_string.length(insert_string.length() - sizeof_trailing_comma);
- /* chops off leading commas */
+ /* chops off trailing comma */
values_string.length(values_string.length() - sizeof_trailing_comma);
- insert_string.append(STRING_WITH_LEN(") "));
}
- else
- {
- /* chops off trailing ) */
- insert_string.length(insert_string.length() - sizeof_trailing_closeparen);
- }
-
/* we always want to append this, even if there aren't any fields */
values_string.append(STRING_WITH_LEN(") "));
- /* add the values */
- insert_string.append(values_string);
+ if (use_bulk_insert)
+ {
+ /*
+ Send the current bulk insert out if appending the current row would
+ cause the statement to overflow the packet size, otherwise set
+ auto_increment_update_required to FALSE as no query was executed.
+ */
+ if (bulk_insert.length + values_string.length() + bulk_padding >
+ mysql->net.max_packet_size && bulk_insert.length)
+ {
+ error= mysql_real_query(mysql, bulk_insert.str, bulk_insert.length);
+ bulk_insert.length= 0;
+ }
+ else
+ auto_increment_update_required= FALSE;
+
+ if (bulk_insert.length == 0)
+ {
+ char insert_buffer[FEDERATED_QUERY_BUFFER_SIZE];
+ String insert_string(insert_buffer, sizeof(insert_buffer),
+ &my_charset_bin);
+ insert_string.length(0);
+ append_stmt_insert(&insert_string);
+ dynstr_append_mem(&bulk_insert, insert_string.ptr(),
+ insert_string.length());
+ }
+ else
+ dynstr_append_mem(&bulk_insert, ",", 1);
- if (mysql_real_query(mysql, insert_string.ptr(), insert_string.length()))
+ dynstr_append_mem(&bulk_insert, values_string.ptr(),
+ values_string.length());
+ }
+ else
+ {
+ error= mysql_real_query(mysql, values_string.ptr(),
+ values_string.length());
+ }
+
+ if (error)
{
DBUG_RETURN(stash_remote_error());
}
@@ -1917,12 +2017,79 @@ int ha_federated::write_row(uchar *buf)
If the table we've just written a record to contains an auto_increment
field, then store the last_insert_id() value from the foreign server
*/
- if (table->next_number_field)
+ if (auto_increment_update_required)
update_auto_increment();
DBUG_RETURN(0);
}
+
+/**
+ @brief Prepares the storage engine for bulk inserts.
+
+ @param[in] rows estimated number of rows in bulk insert
+ or 0 if unknown.
+
+ @details Initializes memory structures required for bulk insert.
+*/
+
+void ha_federated::start_bulk_insert(ha_rows rows)
+{
+ uint page_size;
+ DBUG_ENTER("ha_federated::start_bulk_insert");
+
+ dynstr_free(&bulk_insert);
+
+ /**
+ We don't bother with bulk-insert semantics when the estimated rows == 1
+ The rows value will be 0 if the server does not know how many rows
+ would be inserted. This can occur when performing INSERT...SELECT
+ */
+
+ if (rows == 1)
+ DBUG_VOID_RETURN;
+
+ page_size= (uint) my_getpagesize();
+
+ if (init_dynamic_string(&bulk_insert, NULL, page_size, page_size))
+ DBUG_VOID_RETURN;
+
+ bulk_insert.length= 0;
+ DBUG_VOID_RETURN;
+}
+
+
+/**
+ @brief End bulk insert.
+
+ @details This method will send any remaining rows to the remote server.
+ Finally, it will deinitialize the bulk insert data structure.
+
+ @return Operation status
+ @retval 0 No error
+ @retval != 0 Error occured at remote server. Also sets my_errno.
+*/
+
+int ha_federated::end_bulk_insert()
+{
+ int error= 0;
+ DBUG_ENTER("ha_federated::end_bulk_insert");
+
+ if (bulk_insert.str && bulk_insert.length)
+ {
+ if (mysql_real_query(mysql, bulk_insert.str, bulk_insert.length))
+ error= stash_remote_error();
+ else
+ if (table->next_number_field)
+ update_auto_increment();
+ }
+
+ dynstr_free(&bulk_insert);
+
+ DBUG_RETURN(my_errno= error);
+}
+
+
/*
ha_federated::update_auto_increment
@@ -1952,9 +2119,9 @@ int ha_federated::optimize(THD* thd, HA_CHECK_OPT* check_opt)
query.length(0);
query.set_charset(system_charset_info);
- query.append(STRING_WITH_LEN("OPTIMIZE TABLE `"));
- query.append(share->table_name, share->table_name_length);
- query.append(STRING_WITH_LEN("`"));
+ query.append(STRING_WITH_LEN("OPTIMIZE TABLE "));
+ append_ident(&query, share->table_name, share->table_name_length,
+ ident_quote_char);
if (mysql_real_query(mysql, query.ptr(), query.length()))
{
@@ -1974,9 +2141,9 @@ int ha_federated::repair(THD* thd, HA_CHECK_OPT* check_opt)
query.length(0);
query.set_charset(system_charset_info);
- query.append(STRING_WITH_LEN("REPAIR TABLE `"));
- query.append(share->table_name, share->table_name_length);
- query.append(STRING_WITH_LEN("`"));
+ query.append(STRING_WITH_LEN("REPAIR TABLE "));
+ append_ident(&query, share->table_name, share->table_name_length,
+ ident_quote_char);
if (check_opt->flags & T_QUICK)
query.append(STRING_WITH_LEN(" QUICK"));
if (check_opt->flags & T_EXTEND)
@@ -2053,9 +2220,13 @@ int ha_federated::update_row(const uchar *old_data, uchar *new_data)
update_string.length(0);
where_string.length(0);
- update_string.append(STRING_WITH_LEN("UPDATE `"));
- update_string.append(share->table_name);
- update_string.append(STRING_WITH_LEN("` SET "));
+ if (ignore_duplicates)
+ update_string.append(STRING_WITH_LEN("UPDATE IGNORE "));
+ else
+ update_string.append(STRING_WITH_LEN("UPDATE "));
+ append_ident(&update_string, share->table_name,
+ share->table_name_length, ident_quote_char);
+ update_string.append(STRING_WITH_LEN(" SET "));
/*
In this loop, we want to match column names to values being inserted
@@ -2071,7 +2242,9 @@ int ha_federated::update_row(const uchar *old_data, uchar *new_data)
{
if (bitmap_is_set(table->write_set, (*field)->field_index))
{
- update_string.append((*field)->field_name);
+ uint field_name_length= strlen((*field)->field_name);
+ append_ident(&update_string, (*field)->field_name, field_name_length,
+ ident_quote_char);
update_string.append(STRING_WITH_LEN(" = "));
if ((*field)->is_null())
@@ -2083,10 +2256,10 @@ int ha_federated::update_row(const uchar *old_data, uchar *new_data)
bool needs_quote= (*field)->str_needs_quotes();
(*field)->val_str(&field_value);
if (needs_quote)
- update_string.append('\'');
+ update_string.append(value_quote_char);
field_value.print(&update_string);
if (needs_quote)
- update_string.append('\'');
+ update_string.append(value_quote_char);
field_value.length(0);
tmp_restore_column_map(table->read_set, old_map);
}
@@ -2095,7 +2268,9 @@ int ha_federated::update_row(const uchar *old_data, uchar *new_data)
if (bitmap_is_set(table->read_set, (*field)->field_index))
{
- where_string.append((*field)->field_name);
+ uint field_name_length= strlen((*field)->field_name);
+ append_ident(&where_string, (*field)->field_name, field_name_length,
+ ident_quote_char);
if (field_in_record_is_null(table, *field, (char*) old_data))
where_string.append(STRING_WITH_LEN(" IS NULL "));
else
@@ -2105,10 +2280,10 @@ int ha_federated::update_row(const uchar *old_data, uchar *new_data)
(*field)->val_str(&field_value,
(old_data + (*field)->offset(record)));
if (needs_quote)
- where_string.append('\'');
+ where_string.append(value_quote_char);
field_value.print(&where_string);
if (needs_quote)
- where_string.append('\'');
+ where_string.append(value_quote_char);
field_value.length(0);
}
where_string.append(STRING_WITH_LEN(" AND "));
@@ -2165,9 +2340,10 @@ int ha_federated::delete_row(const uchar *buf)
DBUG_ENTER("ha_federated::delete_row");
delete_string.length(0);
- delete_string.append(STRING_WITH_LEN("DELETE FROM `"));
- delete_string.append(share->table_name);
- delete_string.append(STRING_WITH_LEN("` WHERE "));
+ delete_string.append(STRING_WITH_LEN("DELETE FROM "));
+ append_ident(&delete_string, share->table_name,
+ share->table_name_length, ident_quote_char);
+ delete_string.append(STRING_WITH_LEN(" WHERE "));
for (Field **field= table->field; *field; field++)
{
@@ -2175,8 +2351,9 @@ int ha_federated::delete_row(const uchar *buf)
found++;
if (bitmap_is_set(table->read_set, cur_field->field_index))
{
+ append_ident(&delete_string, (*field)->field_name,
+ strlen((*field)->field_name), ident_quote_char);
data_string.length(0);
- delete_string.append(cur_field->field_name);
if (cur_field->is_null())
{
delete_string.append(STRING_WITH_LEN(" IS NULL "));
@@ -2187,10 +2364,10 @@ int ha_federated::delete_row(const uchar *buf)
delete_string.append(STRING_WITH_LEN(" = "));
cur_field->val_str(&data_string);
if (needs_quote)
- delete_string.append('\'');
+ delete_string.append(value_quote_char);
data_string.print(&delete_string);
if (needs_quote)
- delete_string.append('\'');
+ delete_string.append(value_quote_char);
}
delete_string.append(STRING_WITH_LEN(" AND "));
}
@@ -2680,7 +2857,6 @@ int ha_federated::info(uint flag)
{
char error_buffer[FEDERATED_QUERY_BUFFER_SIZE];
char status_buf[FEDERATED_QUERY_BUFFER_SIZE];
- char escaped_table_name[FEDERATED_QUERY_BUFFER_SIZE];
int error;
uint error_code;
MYSQL_RES *result= 0;
@@ -2693,13 +2869,9 @@ int ha_federated::info(uint flag)
if (flag & (HA_STATUS_VARIABLE | HA_STATUS_CONST))
{
status_query_string.length(0);
- status_query_string.append(STRING_WITH_LEN("SHOW TABLE STATUS LIKE '"));
- escape_string_for_mysql(&my_charset_bin, (char *)escaped_table_name,
- sizeof(escaped_table_name),
- share->table_name,
- share->table_name_length);
- status_query_string.append(escaped_table_name);
- status_query_string.append(STRING_WITH_LEN("'"));
+ status_query_string.append(STRING_WITH_LEN("SHOW TABLE STATUS LIKE "));
+ append_ident(&status_query_string, share->table_name,
+ share->table_name_length, value_quote_char);
if (mysql_real_query(mysql, status_query_string.ptr(),
status_query_string.length()))
@@ -2770,6 +2942,65 @@ error:
}
+/**
+ @brief Handles extra signals from MySQL server
+
+ @param[in] operation Hint for storage engine
+
+ @return Operation Status
+ @retval 0 OK
+ */
+int ha_federated::extra(ha_extra_function operation)
+{
+ DBUG_ENTER("ha_federated::extra");
+ switch (operation) {
+ case HA_EXTRA_IGNORE_DUP_KEY:
+ ignore_duplicates= TRUE;
+ break;
+ case HA_EXTRA_NO_IGNORE_DUP_KEY:
+ insert_dup_update= FALSE;
+ ignore_duplicates= FALSE;
+ break;
+ case HA_EXTRA_WRITE_CAN_REPLACE:
+ replace_duplicates= TRUE;
+ break;
+ case HA_EXTRA_WRITE_CANNOT_REPLACE:
+ /*
+ We use this flag to ensure that we do not create an "INSERT IGNORE"
+ statement when inserting new rows into the remote table.
+ */
+ replace_duplicates= FALSE;
+ break;
+ case HA_EXTRA_INSERT_WITH_UPDATE:
+ insert_dup_update= TRUE;
+ break;
+ default:
+ /* do nothing */
+ DBUG_PRINT("info",("unhandled operation: %d", (uint) operation));
+ }
+ DBUG_RETURN(0);
+}
+
+
+/**
+ @brief Reset state of file to after 'open'.
+
+ @detail This function is called after every statement for all tables
+ used by that statement.
+
+ @return Operation status
+ @retval 0 OK
+*/
+
+int ha_federated::reset(void)
+{
+ insert_dup_update= FALSE;
+ ignore_duplicates= FALSE;
+ replace_duplicates= FALSE;
+ return 0;
+}
+
+
/*
Used to delete all rows in a table. Both for cases of truncate and
for cases where the optimizer realizes that all rows will be
@@ -2791,9 +3022,9 @@ int ha_federated::delete_all_rows()
query.length(0);
query.set_charset(system_charset_info);
- query.append(STRING_WITH_LEN("TRUNCATE `"));
- query.append(share->table_name);
- query.append(STRING_WITH_LEN("`"));
+ query.append(STRING_WITH_LEN("TRUNCATE "));
+ append_ident(&query, share->table_name, share->table_name_length,
+ ident_quote_char);
/*
TRUNCATE won't return anything in mysql_affected_rows
@@ -2901,6 +3132,9 @@ int ha_federated::stash_remote_error()
DBUG_ENTER("ha_federated::stash_remote_error()");
remote_error_number= mysql_errno(mysql);
strmake(remote_error_buf, mysql_error(mysql), sizeof(remote_error_buf)-1);
+ if (remote_error_number == ER_DUP_ENTRY ||
+ remote_error_number == ER_DUP_KEY)
+ DBUG_RETURN(HA_ERR_FOUND_DUPP_KEY);
DBUG_RETURN(HA_FEDERATED_ERROR_WITH_REMOTE_SYSTEM);
}
diff --git a/storage/federated/ha_federated.h b/storage/federated/ha_federated.h
index 861f50fad06..3443194817b 100644
--- a/storage/federated/ha_federated.h
+++ b/storage/federated/ha_federated.h
@@ -88,6 +88,9 @@ class ha_federated: public handler
MYSQL_ROW_OFFSET current_position; // Current position used by ::position()
int remote_error_number;
char remote_error_buf[FEDERATED_QUERY_BUFFER_SIZE];
+ bool ignore_duplicates, replace_duplicates;
+ bool insert_dup_update;
+ DYNAMIC_STRING bulk_insert;
private:
/*
@@ -102,6 +105,14 @@ private:
bool records_in_range, bool eq_range);
int stash_remote_error();
+ bool append_stmt_insert(String *query);
+
+ int read_next(uchar *buf, MYSQL_RES *result);
+ int index_read_idx_with_result_set(uchar *buf, uint index,
+ const uchar *key,
+ uint key_len,
+ ha_rkey_function find_flag,
+ MYSQL_RES **result);
public:
ha_federated(handlerton *hton, TABLE_SHARE *table_arg);
~ha_federated() {}
@@ -189,6 +200,8 @@ public:
int open(const char *name, int mode, uint test_if_locked); // required
int close(void); // required
+ void start_bulk_insert(ha_rows rows);
+ int end_bulk_insert();
int write_row(uchar *buf);
int update_row(const uchar *old_data, uchar *new_data);
int delete_row(const uchar *buf);
@@ -217,6 +230,7 @@ public:
int rnd_pos(uchar *buf, uchar *pos); //required
void position(const uchar *record); //required
int info(uint); //required
+ int extra(ha_extra_function operation);
void update_auto_increment(void);
int repair(THD* thd, HA_CHECK_OPT* check_opt);
@@ -231,18 +245,12 @@ public:
THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to,
enum thr_lock_type lock_type); //required
- virtual bool get_error_message(int error, String *buf);
+ bool get_error_message(int error, String *buf);
int external_lock(THD *thd, int lock_type);
int connection_commit();
int connection_rollback();
int connection_autocommit(bool state);
int execute_simple_query(const char *query, int len);
-
- int read_next(uchar *buf, MYSQL_RES *result);
- int index_read_idx_with_result_set(uchar *buf, uint index,
- const uchar *key,
- uint key_len,
- ha_rkey_function find_flag,
- MYSQL_RES **result);
+ int reset(void);
};
diff --git a/storage/heap/ha_heap.cc b/storage/heap/ha_heap.cc
index 86bc2cc516e..f2b67f20c57 100644
--- a/storage/heap/ha_heap.cc
+++ b/storage/heap/ha_heap.cc
@@ -125,6 +125,26 @@ int ha_heap::close(void)
/*
+ Create a copy of this table
+
+ DESCRIPTION
+ Do same as default implementation but use file->s->name instead of
+ table->s->path. This is needed by Windows where the clone() call sees
+ '/'-delimited path in table->s->path, while ha_peap::open() was called
+ with '\'-delimited path.
+*/
+
+handler *ha_heap::clone(MEM_ROOT *mem_root)
+{
+ handler *new_handler= get_new_handler(table->s, mem_root, table->s->db_type());
+ if (new_handler && !new_handler->ha_open(table, file->s->name, table->db_stat,
+ HA_OPEN_IGNORE_IF_LOCKED))
+ return new_handler;
+ return NULL; /* purecov: inspected */
+}
+
+
+/*
Compute which keys to use for scanning
SYNOPSIS
diff --git a/storage/heap/ha_heap.h b/storage/heap/ha_heap.h
index f41c710716d..c414383a4aa 100644
--- a/storage/heap/ha_heap.h
+++ b/storage/heap/ha_heap.h
@@ -32,6 +32,7 @@ class ha_heap: public handler
public:
ha_heap(handlerton *hton, TABLE_SHARE *table);
~ha_heap() {}
+ handler *clone(MEM_ROOT *mem_root);
const char *table_type() const
{
return (table->in_use->variables.sql_mode & MODE_MYSQL323) ?
@@ -55,8 +56,8 @@ public:
ulong index_flags(uint inx, uint part, bool all_parts) const
{
return ((table_share->key_info[inx].algorithm == HA_KEY_ALG_BTREE) ?
- HA_READ_NEXT | HA_READ_PREV | HA_READ_ORDER | HA_READ_RANGE :
- HA_ONLY_WHOLE_INDEX);
+ HA_READ_NEXT | HA_READ_PREV | HA_READ_ORDER | HA_READ_RANGE :
+ HA_ONLY_WHOLE_INDEX | HA_KEY_SCAN_NOT_ROR);
}
const key_map *keys_to_use_for_scanning() { return &btree_keys; }
uint max_supported_keys() const { return MAX_KEY; }
@@ -108,9 +109,7 @@ public:
enum thr_lock_type lock_type);
int cmp_ref(const uchar *ref1, const uchar *ref2)
{
- HEAP_PTR ptr1=*(HEAP_PTR*)ref1;
- HEAP_PTR ptr2=*(HEAP_PTR*)ref2;
- return ptr1 < ptr2? -1 : (ptr1 > ptr2? 1 : 0);
+ return memcmp(ref1, ref2, sizeof(HEAP_PTR));
}
bool check_if_incompatible_data(HA_CREATE_INFO *info, uint table_changes);
private:
diff --git a/storage/innobase/Makefile.am b/storage/innobase/Makefile.am
index 62c0f8e817c..0b23ae74f9e 100644
--- a/storage/innobase/Makefile.am
+++ b/storage/innobase/Makefile.am
@@ -25,102 +25,146 @@ INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include \
-I$(top_srcdir)/sql \
-I$(srcdir)
-AUTOMAKE_OPTIONS = foreign
-TAR = gtar
+DEFS = @DEFS@
-noinst_HEADERS =
-SUBDIRS = os ut btr buf data dict dyn eval fil fsp fut \
- ha ibuf lock log mach mem mtr page \
- handler \
- pars que read rem row srv sync thr trx usr
+noinst_HEADERS = include/btr0btr.h include/btr0btr.ic \
+ include/btr0cur.h include/btr0cur.ic \
+ include/btr0pcur.h include/btr0pcur.ic \
+ include/btr0sea.h include/btr0sea.ic \
+ include/btr0types.h include/buf0buf.h \
+ include/buf0buf.ic include/buf0flu.h \
+ include/buf0flu.ic include/buf0lru.h \
+ include/buf0lru.ic include/buf0rea.h \
+ include/buf0types.h include/data0data.h \
+ include/data0data.ic include/data0type.h \
+ include/data0type.ic include/data0types.h \
+ include/db0err.h include/dict0boot.h \
+ include/dict0boot.ic include/dict0crea.h \
+ include/dict0crea.ic include/dict0dict.h \
+ include/dict0dict.ic include/dict0load.h \
+ include/dict0load.ic include/dict0mem.h \
+ include/dict0mem.ic include/dict0types.h \
+ include/dyn0dyn.h include/dyn0dyn.ic \
+ include/eval0eval.h include/eval0eval.ic \
+ include/eval0proc.h include/eval0proc.ic \
+ include/fil0fil.h include/fsp0fsp.h \
+ include/fsp0fsp.ic include/fut0fut.h \
+ include/fut0fut.ic include/fut0lst.h \
+ include/fut0lst.ic include/ha0ha.h \
+ include/ha0ha.ic include/hash0hash.h \
+ include/hash0hash.ic include/ibuf0ibuf.h \
+ include/ibuf0ibuf.ic include/ibuf0types.h \
+ include/lock0lock.h include/lock0lock.ic \
+ include/lock0types.h include/log0log.h \
+ include/log0log.ic include/log0recv.h \
+ include/log0recv.ic include/mach0data.h \
+ include/mach0data.ic include/mem0dbg.h \
+ include/mem0dbg.ic mem/mem0dbg.c \
+ include/mem0mem.h include/mem0mem.ic \
+ include/mem0pool.h include/mem0pool.ic \
+ include/mtr0log.h include/mtr0log.ic \
+ include/mtr0mtr.h include/mtr0mtr.ic \
+ include/mtr0types.h include/os0file.h \
+ include/os0proc.h include/os0proc.ic \
+ include/os0sync.h include/os0sync.ic \
+ include/os0thread.h include/os0thread.ic \
+ include/page0cur.h include/page0cur.ic \
+ include/page0page.h include/page0page.ic \
+ include/page0types.h include/pars0grm.h \
+ include/pars0opt.h include/pars0opt.ic \
+ include/pars0pars.h include/pars0pars.ic \
+ include/pars0sym.h include/pars0sym.ic \
+ include/pars0types.h include/que0que.h \
+ include/que0que.ic include/que0types.h \
+ include/read0read.h include/read0read.ic \
+ include/read0types.h include/rem0cmp.h \
+ include/rem0cmp.ic include/rem0rec.h \
+ include/rem0rec.ic include/rem0types.h \
+ include/row0ins.h include/row0ins.ic \
+ include/row0mysql.h include/row0mysql.ic \
+ include/row0purge.h include/row0purge.ic \
+ include/row0row.h include/row0row.ic \
+ include/row0sel.h include/row0sel.ic \
+ include/row0types.h include/row0uins.h \
+ include/row0uins.ic include/row0umod.h \
+ include/row0umod.ic include/row0undo.h \
+ include/row0undo.ic include/row0upd.h \
+ include/row0upd.ic include/row0vers.h \
+ include/row0vers.ic include/srv0que.h \
+ include/srv0srv.h include/srv0srv.ic \
+ include/srv0start.h include/sync0arr.h \
+ include/sync0arr.ic include/sync0rw.h \
+ include/sync0rw.ic include/sync0sync.h \
+ include/sync0sync.ic include/sync0types.h \
+ include/thr0loc.h include/thr0loc.ic \
+ include/trx0purge.h include/trx0purge.ic \
+ include/trx0rec.h include/trx0rec.ic \
+ include/trx0roll.h include/trx0roll.ic \
+ include/trx0rseg.h include/trx0rseg.ic \
+ include/trx0sys.h include/trx0sys.ic \
+ include/trx0trx.h include/trx0trx.ic \
+ include/trx0types.h include/trx0undo.h \
+ include/trx0undo.ic include/trx0xa.h \
+ include/univ.i include/usr0sess.h \
+ include/usr0sess.ic include/usr0types.h \
+ include/ut0byte.h include/ut0byte.ic \
+ include/ut0dbg.h include/ut0lst.h \
+ include/ut0mem.h include/ut0mem.ic \
+ include/ut0rnd.h include/ut0rnd.ic \
+ include/ut0sort.h include/ut0ut.h \
+ include/ut0ut.ic include/ut0vec.h \
+ include/ut0vec.ic include/ut0list.h \
+ include/ut0list.ic include/ut0wqueue.h \
+ include/ha_prototypes.h handler/ha_innodb.h
-EXTRA_DIST = include/btr0btr.h include/btr0btr.ic include/btr0cur.h include/btr0cur.ic \
- include/btr0pcur.h include/btr0pcur.ic include/btr0sea.h include/btr0sea.ic \
- include/btr0types.h \
- include/buf0buf.h include/buf0buf.ic include/buf0flu.h include/buf0flu.ic \
- include/buf0lru.h include/buf0lru.ic include/buf0rea.h include/buf0types.h \
- include/data0data.h include/data0data.ic include/data0type.h include/data0type.ic \
- include/data0types.h include/db0err.h \
- include/dict0boot.h include/dict0boot.ic include/dict0crea.h include/dict0crea.ic \
- include/dict0dict.h include/dict0dict.ic include/dict0load.h include/dict0load.ic \
- include/dict0mem.h include/dict0mem.ic include/dict0types.h \
- include/dyn0dyn.h include/dyn0dyn.ic \
- include/eval0eval.h include/eval0eval.ic include/eval0proc.h include/eval0proc.ic \
- include/fil0fil.h include/fsp0fsp.h include/fsp0fsp.ic \
- include/fut0fut.h include/fut0fut.ic include/fut0lst.h include/fut0lst.ic \
- include/ha0ha.h include/ha0ha.ic include/hash0hash.h include/hash0hash.ic \
- include/ibuf0ibuf.h include/ibuf0ibuf.ic include/ibuf0types.h \
- include/lock0lock.h include/lock0lock.ic include/lock0types.h \
- include/log0log.h include/log0log.ic include/log0recv.h include/log0recv.ic \
- include/mach0data.h include/mach0data.ic include/mem0dbg.h include/mem0dbg.ic \
- include/mem0mem.h include/mem0mem.ic include/mem0pool.h include/mem0pool.ic \
- include/mtr0log.h include/mtr0log.ic include/mtr0mtr.h include/mtr0mtr.ic \
- include/mtr0types.h include/os0file.h \
- include/os0proc.h include/os0proc.ic include/os0sync.h include/os0sync.ic \
- include/os0thread.h include/os0thread.ic \
- include/page0cur.h include/page0cur.ic include/page0page.h include/page0page.ic \
- include/page0types.h \
- include/pars0grm.h include/pars0opt.h include/pars0opt.ic \
- include/pars0pars.h include/pars0pars.ic include/pars0sym.h include/pars0sym.ic \
- include/pars0types.h \
- include/que0que.h include/que0que.ic include/que0types.h \
- include/read0read.h include/read0read.ic include/read0types.h \
- include/rem0cmp.h include/rem0cmp.ic include/rem0rec.h include/rem0rec.ic \
- include/rem0types.h \
- include/row0ins.h include/row0ins.ic include/row0mysql.h include/row0mysql.ic \
- include/row0purge.h include/row0purge.ic include/row0row.h include/row0row.ic \
- include/row0sel.h include/row0sel.ic include/row0types.h \
- include/row0uins.h include/row0uins.ic include/row0umod.h include/row0umod.ic \
- include/row0undo.h include/row0undo.ic include/row0upd.h include/row0upd.ic \
- include/row0vers.h include/row0vers.ic \
- include/srv0que.h include/srv0srv.h include/srv0srv.ic include/srv0start.h \
- include/sync0arr.h include/sync0arr.ic include/sync0rw.h include/sync0rw.ic \
- include/sync0sync.h include/sync0sync.ic include/sync0types.h \
- include/thr0loc.h include/thr0loc.ic \
- include/trx0purge.h include/trx0purge.ic include/trx0rec.h include/trx0rec.ic \
- include/trx0roll.h include/trx0roll.ic include/trx0rseg.h include/trx0rseg.ic \
- include/trx0sys.h include/trx0sys.ic include/trx0trx.h include/trx0trx.ic \
- include/trx0types.h include/trx0undo.h include/trx0undo.ic include/trx0xa.h \
- include/univ.i include/usr0sess.h include/usr0sess.ic include/usr0types.h \
- include/ut0byte.h include/ut0byte.ic include/ut0dbg.h include/ut0lst.h \
- include/ut0mem.h include/ut0mem.ic include/ut0rnd.h include/ut0rnd.ic \
- handler/ha_innodb.h \
- include/ut0sort.h include/ut0ut.h include/ut0ut.ic include/ut0vec.h include/ut0vec.ic include/ha_prototypes.h \
- include/ut0list.h include/ut0list.ic \
- include/ut0wqueue.h \
- pars/make_bison.sh pars/make_flex.sh \
- pars/pars0grm.y pars/pars0lex.l \
- CMakeLists.txt plug.in
+EXTRA_LIBRARIES = libinnobase.a
+noinst_LIBRARIES = @plugin_innobase_static_target@
+libinnobase_a_SOURCES = btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c \
+ btr/btr0sea.c buf/buf0buf.c buf/buf0flu.c \
+ buf/buf0lru.c buf/buf0rea.c data/data0data.c \
+ data/data0type.c dict/dict0boot.c \
+ dict/dict0crea.c dict/dict0dict.c \
+ dict/dict0load.c dict/dict0mem.c dyn/dyn0dyn.c \
+ eval/eval0eval.c eval/eval0proc.c \
+ fil/fil0fil.c fsp/fsp0fsp.c fut/fut0fut.c \
+ fut/fut0lst.c ha/ha0ha.c ha/hash0hash.c \
+ ibuf/ibuf0ibuf.c lock/lock0lock.c \
+ log/log0log.c log/log0recv.c mach/mach0data.c \
+ mem/mem0mem.c mem/mem0pool.c mtr/mtr0log.c \
+ mtr/mtr0mtr.c os/os0file.c os/os0proc.c \
+ os/os0sync.c os/os0thread.c page/page0cur.c \
+ page/page0page.c pars/lexyy.c pars/pars0grm.c \
+ pars/pars0opt.c pars/pars0pars.c \
+ pars/pars0sym.c que/que0que.c read/read0read.c \
+ rem/rem0cmp.c rem/rem0rec.c row/row0ins.c \
+ row/row0mysql.c row/row0purge.c row/row0row.c \
+ row/row0sel.c row/row0uins.c row/row0umod.c \
+ row/row0undo.c row/row0upd.c row/row0vers.c \
+ srv/srv0que.c srv/srv0srv.c srv/srv0start.c \
+ sync/sync0arr.c sync/sync0rw.c \
+ sync/sync0sync.c thr/thr0loc.c trx/trx0purge.c \
+ trx/trx0rec.c trx/trx0roll.c trx/trx0rseg.c \
+ trx/trx0sys.c trx/trx0trx.c trx/trx0undo.c \
+ usr/usr0sess.c ut/ut0byte.c ut/ut0dbg.c \
+ ut/ut0list.c ut/ut0mem.c ut/ut0rnd.c \
+ ut/ut0ut.c ut/ut0vec.c ut/ut0wqueue.c \
+ handler/ha_innodb.cc
-noinst_LIBRARIES = libinnobase.a
-libinnobase_a_LIBADD = usr/libusr.a srv/libsrv.a dict/libdict.a \
- que/libque.a srv/libsrv.a ibuf/libibuf.a \
- row/librow.a pars/libpars.a btr/libbtr.a \
- trx/libtrx.a read/libread.a usr/libusr.a \
- buf/libbuf.a ibuf/libibuf.a eval/libeval.a \
- log/liblog.a fsp/libfsp.a fut/libfut.a \
- fil/libfil.a lock/liblock.a mtr/libmtr.a \
- page/libpage.a rem/librem.a thr/libthr.a \
- sync/libsync.a data/libdata.a mach/libmach.a \
- ha/libha.a dyn/libdyn.a mem/libmem.a \
- handler/libhandler.a \
- ut/libut.a os/libos.a ut/libut.a
-libinnobase_a_SOURCES =
+libinnobase_a_CXXFLAGS= $(AM_CFLAGS)
+libinnobase_a_CFLAGS = $(AM_CFLAGS)
+EXTRA_LTLIBRARIES = ha_innodb.la
+pkglib_LTLIBRARIES = @plugin_innobase_shared_target@
-libinnobase.a: $(libinnobase_a_LIBADD)
- -rm -f $@
- if test "$(host_os)" = "netware" ; \
- then \
- $(libinnobase_a_AR) $@ $(libinnobase_a_LIBADD) ; \
- else \
- for arc in $(libinnobase_a_LIBADD); do \
- arpath=`echo $$arc|sed 's|[^/]*$$||'`; \
- $(AR) t $$arc|sed "s|^|$$arpath|"; \
- done | sort -u | xargs $(AR) cq $@ ; \
- $(RANLIB) $@ ; \
- fi
+ha_innodb_la_LDFLAGS = -module -rpath $(MYSQLLIBdir)
+ha_innodb_la_CXXFLAGS= $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
+ha_innodb_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
+ha_innodb_la_SOURCES = $(libinnobase_a_SOURCES)
+
+EXTRA_DIST = CMakeLists.txt plug.in \
+ pars/make_bison.sh pars/make_flex.sh \
+ pars/pars0grm.y pars/pars0lex.l
# Don't update the files from bitkeeper
%::SCCS/s.%
diff --git a/storage/innobase/btr/Makefile.am b/storage/innobase/btr/Makefile.am
deleted file mode 100644
index 6b09b289cdc..00000000000
--- a/storage/innobase/btr/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-include ../include/Makefile.i
-
-noinst_LIBRARIES = libbtr.a
-
-libbtr_a_SOURCES = btr0btr.c btr0cur.c btr0pcur.c btr0sea.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/btr/btr0btr.c b/storage/innobase/btr/btr0btr.c
index 50a349e78d6..6e8b43aeb8d 100644
--- a/storage/innobase/btr/btr0btr.c
+++ b/storage/innobase/btr/btr0btr.c
@@ -2606,8 +2606,11 @@ btr_index_rec_validate(
rec_get_nth_field(rec, offsets, i, &len);
- /* Note that prefix indexes are not fixed size even when
- their type is CHAR. */
+ /* Note that if fixed_size != 0, it equals the
+ length of a fixed-size column in the clustered index.
+ A prefix index of the column is of fixed, but different
+ length. When fixed_size == 0, prefix_len is the maximum
+ length of the prefix index column. */
if ((dict_index_get_nth_field(index, i)->prefix_len == 0
&& len != UNIV_SQL_NULL && fixed_size
diff --git a/storage/innobase/buf/Makefile.am b/storage/innobase/buf/Makefile.am
deleted file mode 100644
index 946d5a2e5c2..00000000000
--- a/storage/innobase/buf/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-include ../include/Makefile.i
-
-noinst_LIBRARIES = libbuf.a
-
-libbuf_a_SOURCES = buf0buf.c buf0flu.c buf0lru.c buf0rea.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/data/Makefile.am b/storage/innobase/data/Makefile.am
deleted file mode 100644
index 6f9407d40e5..00000000000
--- a/storage/innobase/data/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-include ../include/Makefile.i
-
-noinst_LIBRARIES = libdata.a
-
-libdata_a_SOURCES = data0data.c data0type.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/data/data0data.c b/storage/innobase/data/data0data.c
index fc4494d991a..0f03de4ca9d 100644
--- a/storage/innobase/data/data0data.c
+++ b/storage/innobase/data/data0data.c
@@ -18,6 +18,8 @@ Created 5/30/1994 Heikki Tuuri
#include "dict0dict.h"
#include "btr0cur.h"
+#include <ctype.h>
+
#ifdef UNIV_DEBUG
byte data_error; /* data pointers of tuple fields are initialized
to point here for error checking */
diff --git a/storage/innobase/data/data0type.c b/storage/innobase/data/data0type.c
index 77779d185cf..305000d7c0a 100644
--- a/storage/innobase/data/data0type.c
+++ b/storage/innobase/data/data0type.c
@@ -190,7 +190,8 @@ dtype_validate(
dtype_t* type) /* in: type struct to validate */
{
ut_a(type);
- ut_a((type->mtype >= DATA_VARCHAR) && (type->mtype <= DATA_MYSQL));
+ ut_a(type->mtype >= DATA_VARCHAR);
+ ut_a(type->mtype <= DATA_MYSQL);
if (type->mtype == DATA_SYS) {
ut_a((type->prtype & DATA_MYSQL_TYPE_MASK) < DATA_N_SYS_COLS);
diff --git a/storage/innobase/dict/Makefile.am b/storage/innobase/dict/Makefile.am
deleted file mode 100644
index 15cacca6f58..00000000000
--- a/storage/innobase/dict/Makefile.am
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-include ../include/Makefile.i
-
-noinst_LIBRARIES = libdict.a
-
-libdict_a_SOURCES = dict0boot.c dict0crea.c dict0dict.c dict0load.c\
- dict0mem.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/dict/dict0crea.c b/storage/innobase/dict/dict0crea.c
index e060d45768e..51146c3c24c 100644
--- a/storage/innobase/dict/dict0crea.c
+++ b/storage/innobase/dict/dict0crea.c
@@ -1195,7 +1195,8 @@ dict_create_or_check_foreign_constraint_tables(void)
fprintf(stderr, "InnoDB: error %lu in creation\n",
(ulong) error);
- ut_a(error == DB_OUT_OF_FILE_SPACE);
+ ut_a(error == DB_OUT_OF_FILE_SPACE
+ || error == DB_TOO_MANY_CONCURRENT_TRXS);
fprintf(stderr,
"InnoDB: creation failed\n"
diff --git a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c
index f450d3553eb..e2a9535dc8b 100644
--- a/storage/innobase/dict/dict0dict.c
+++ b/storage/innobase/dict/dict0dict.c
@@ -30,6 +30,8 @@ Created 1/8/1996 Heikki Tuuri
# include "m_ctype.h" /* my_isspace() */
#endif /* !UNIV_HOTBACKUP */
+#include <ctype.h>
+
dict_sys_t* dict_sys = NULL; /* the dictionary system */
rw_lock_t dict_operation_lock; /* table create, drop, etc. reserve
@@ -1529,6 +1531,12 @@ dict_index_add_col(
if (field->fixed_len > DICT_MAX_INDEX_COL_LEN) {
field->fixed_len = 0;
}
+#if DICT_MAX_INDEX_COL_LEN != 768
+ /* The comparison limit above must be constant. If it were
+ changed, the disk format of some fixed-length columns would
+ change, which would be a disaster. */
+# error "DICT_MAX_INDEX_COL_LEN != 768"
+#endif
if (!(col->prtype & DATA_NOT_NULL)) {
index->n_nullable++;
@@ -1585,9 +1593,6 @@ dict_index_copy_types(
ifield = dict_index_get_nth_field(index, i);
dfield_type = dfield_get_type(dtuple_get_nth_field(tuple, i));
dict_col_copy_type(dict_field_get_col(ifield), dfield_type);
- if (UNIV_UNLIKELY(ifield->prefix_len)) {
- dfield_type->len = ifield->prefix_len;
- }
}
}
@@ -3361,7 +3366,8 @@ dict_create_foreign_constraints(
ulint err;
mem_heap_t* heap;
- ut_a(trx && trx->mysql_thd);
+ ut_a(trx);
+ ut_a(trx->mysql_thd);
str = dict_strip_comments(sql_string);
heap = mem_heap_create(10000);
@@ -3403,7 +3409,8 @@ dict_foreign_parse_drop_constraints(
FILE* ef = dict_foreign_err_file;
struct charset_info_st* cs;
- ut_a(trx && trx->mysql_thd);
+ ut_a(trx);
+ ut_a(trx->mysql_thd);
cs = innobase_get_charset(trx->mysql_thd);
@@ -3712,7 +3719,7 @@ dict_index_calc_min_rec_len(
}
/* round the NULL flags up to full bytes */
- sum += (nullable + 7) / 8;
+ sum += UT_BITS_IN_BYTES(nullable);
return(sum);
}
diff --git a/storage/innobase/dyn/Makefile.am b/storage/innobase/dyn/Makefile.am
deleted file mode 100644
index 57d9a25e481..00000000000
--- a/storage/innobase/dyn/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-include ../include/Makefile.i
-
-noinst_LIBRARIES = libdyn.a
-
-libdyn_a_SOURCES = dyn0dyn.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/eval/Makefile.am b/storage/innobase/eval/Makefile.am
deleted file mode 100644
index 6c2b05d8b7a..00000000000
--- a/storage/innobase/eval/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-include ../include/Makefile.i
-
-noinst_LIBRARIES = libeval.a
-
-libeval_a_SOURCES = eval0eval.c eval0proc.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/fil/Makefile.am b/storage/innobase/fil/Makefile.am
deleted file mode 100644
index 0a85ceb5b86..00000000000
--- a/storage/innobase/fil/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-include ../include/Makefile.i
-
-noinst_LIBRARIES = libfil.a
-
-libfil_a_SOURCES = fil0fil.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/fsp/Makefile.am b/storage/innobase/fsp/Makefile.am
deleted file mode 100644
index 7818cdafc1b..00000000000
--- a/storage/innobase/fsp/Makefile.am
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-
-include ../include/Makefile.i
-
-noinst_LIBRARIES = libfsp.a
-
-libfsp_a_SOURCES = fsp0fsp.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/fsp/fsp0fsp.c b/storage/innobase/fsp/fsp0fsp.c
index b5662fd24a4..78fb55e4ef3 100644
--- a/storage/innobase/fsp/fsp0fsp.c
+++ b/storage/innobase/fsp/fsp0fsp.c
@@ -205,10 +205,9 @@ the extent are free and which contain old tuple version to clean. */
space */
#define XDES_FSEG 4 /* extent belongs to a segment */
-/* File extent data structure size in bytes. The "+ 7 ) / 8" part in the
-definition rounds the number of bytes upward. */
+/* File extent data structure size in bytes. */
#define XDES_SIZE \
- (XDES_BITMAP + (FSP_EXTENT_SIZE * XDES_BITS_PER_PAGE + 7) / 8)
+ (XDES_BITMAP + UT_BITS_IN_BYTES(FSP_EXTENT_SIZE * XDES_BITS_PER_PAGE))
/* Offset of the descriptor array on a descriptor page */
#define XDES_ARR_OFFSET (FSP_HEADER_OFFSET + FSP_HEADER_SIZE)
@@ -3649,7 +3648,11 @@ fsp_validate(
n_full_frag_pages = FSP_EXTENT_SIZE
* flst_get_len(header + FSP_FULL_FRAG, &mtr);
- ut_a(free_limit <= size || (space != 0 && size < FSP_EXTENT_SIZE));
+ if (UNIV_UNLIKELY(free_limit > size)) {
+
+ ut_a(space != 0);
+ ut_a(size < FSP_EXTENT_SIZE);
+ }
flst_validate(header + FSP_FREE, &mtr);
flst_validate(header + FSP_FREE_FRAG, &mtr);
diff --git a/storage/innobase/fut/Makefile.am b/storage/innobase/fut/Makefile.am
deleted file mode 100644
index ffe9835a023..00000000000
--- a/storage/innobase/fut/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-include ../include/Makefile.i
-
-noinst_LIBRARIES = libfut.a
-
-libfut_a_SOURCES = fut0fut.c fut0lst.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/ha/Makefile.am b/storage/innobase/ha/Makefile.am
deleted file mode 100644
index 696cad0b203..00000000000
--- a/storage/innobase/ha/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-include ../include/Makefile.i
-
-noinst_LIBRARIES = libha.a
-
-libha_a_SOURCES = ha0ha.c hash0hash.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/handler/Makefile.am b/storage/innobase/handler/Makefile.am
deleted file mode 100644
index 0d34212bdd4..00000000000
--- a/storage/innobase/handler/Makefile.am
+++ /dev/null
@@ -1,28 +0,0 @@
-# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
-# & Innobase Oy
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-include ../include/Makefile.i
-
-DEFS = -DMYSQL_SERVER @DEFS@
-
-noinst_LIBRARIES = libhandler.a
-
-libhandler_a_SOURCES = ha_innodb.cc
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 65c3086a086..b7d0c4417c3 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -15,11 +15,10 @@
/* This file defines the InnoDB handler: the interface between MySQL and InnoDB
NOTE: You can only use noninlined InnoDB functions in this file, because we
-have disables the InnoDB inlining in this file. */
+have disabled the InnoDB inlining in this file. */
/* TODO list for the InnoDB handler in 5.0:
- - Remove the flag trx->active_trans and look at the InnoDB
- trx struct state field
+ - Remove the flag trx->active_trans and look at trx->conc_state
- fix savepoint functions to use savepoint storage area
- Find out what kind of problems the OS X case-insensitivity causes to
table and database names; should we 'normalize' the names like we do
@@ -31,8 +30,7 @@ have disables the InnoDB inlining in this file. */
#endif
#include <mysql_priv.h>
-
-#ifdef WITH_INNOBASE_STORAGE_ENGINE
+#include <mysqld_error.h>
#include <m_ctype.h>
#include <hash.h>
@@ -40,15 +38,23 @@ have disables the InnoDB inlining in this file. */
#include <mysys_err.h>
#include <my_sys.h>
#include "ha_innodb.h"
-
-pthread_mutex_t innobase_share_mutex, /* to protect innobase_open_files */
- prepare_commit_mutex; /* to force correct commit order in
- binlog */
-ulong commit_threads= 0;
-pthread_mutex_t commit_threads_m;
-pthread_cond_t commit_cond;
-pthread_mutex_t commit_cond_m;
-bool innodb_inited= 0;
+#include <mysql/plugin.h>
+
+#ifndef MYSQL_SERVER
+/* This is needed because of Bug #3596. Let us hope that pthread_mutex_t
+is defined the same in both builds: the MySQL server and the InnoDB plugin. */
+extern pthread_mutex_t LOCK_thread_count;
+#endif /* MYSQL_SERVER */
+
+/** to protect innobase_open_files */
+static pthread_mutex_t innobase_share_mutex;
+/** to force correct commit order in binlog */
+static pthread_mutex_t prepare_commit_mutex;
+static ulong commit_threads = 0;
+static pthread_mutex_t commit_threads_m;
+static pthread_cond_t commit_cond;
+static pthread_mutex_t commit_cond_m;
+static bool innodb_inited = 0;
/*
This needs to exist until the query cache callback is removed
@@ -92,55 +98,41 @@ extern "C" {
#include "../storage/innobase/include/ha_prototypes.h"
}
-
-/* The default values for the following, type long or longlong, start-up
-parameters are declared in mysqld.cc: */
-
-long innobase_mirrored_log_groups, innobase_log_files_in_group,
+static long innobase_mirrored_log_groups, innobase_log_files_in_group,
innobase_log_buffer_size, innobase_buffer_pool_awe_mem_mb,
innobase_additional_mem_pool_size, innobase_file_io_threads,
innobase_lock_wait_timeout, innobase_force_recovery,
innobase_open_files;
-long long innobase_buffer_pool_size, innobase_log_file_size;
+static long long innobase_buffer_pool_size, innobase_log_file_size;
/* The default values for the following char* start-up parameters
are determined in innobase_init below: */
-char* innobase_data_home_dir = NULL;
-char* innobase_data_file_path = NULL;
-char* innobase_log_group_home_dir = NULL;
-char* innobase_log_arch_dir = NULL;/* unused */
+static char* innobase_data_home_dir = NULL;
+static char* innobase_data_file_path = NULL;
+static char* innobase_log_group_home_dir = NULL;
/* The following has a misleading name: starting from 4.0.5, this also
affects Windows: */
-char* innobase_unix_file_flush_method = NULL;
+static char* innobase_unix_file_flush_method = NULL;
/* Below we have boolean-valued start-up parameters, and their default
values */
-static
-ulong innobase_fast_shutdown = 1;
+static ulong innobase_fast_shutdown = 1;
#ifdef UNIV_LOG_ARCHIVE
-static
-my_bool innobase_log_archive = FALSE;/* unused */
-#endif /* UNIG_LOG_ARCHIVE */
-static
-my_bool innobase_use_doublewrite = TRUE;
-static
-my_bool innobase_use_checksums = TRUE;
-static
-my_bool innobase_file_per_table = FALSE;
-static
-my_bool innobase_locks_unsafe_for_binlog = FALSE;
-static
-my_bool innobase_rollback_on_timeout = FALSE;
-static
-my_bool innobase_create_status_file = FALSE;
-static
-my_bool innobase_stats_on_metadata = TRUE;
+static my_bool innobase_log_archive = FALSE;
+static char* innobase_log_arch_dir = NULL;
+#endif /* UNIV_LOG_ARCHIVE */
+static my_bool innobase_use_doublewrite = TRUE;
+static my_bool innobase_use_checksums = TRUE;
+static my_bool innobase_file_per_table = FALSE;
+static my_bool innobase_locks_unsafe_for_binlog = FALSE;
+static my_bool innobase_rollback_on_timeout = FALSE;
+static my_bool innobase_create_status_file = FALSE;
+static my_bool innobase_stats_on_metadata = TRUE;
-static
-char* internal_innobase_data_file_path = NULL;
+static char* internal_innobase_data_file_path = NULL;
/* The following counter is used to convey information to InnoDB
about server activity: in selects it is not sensible to call
@@ -427,6 +419,22 @@ static SHOW_VAR innodb_status_variables[]= {
/* General functions */
/**********************************************************************
+Returns true if the thread is the replication thread on the slave
+server. Used in srv_conc_enter_innodb() to determine if the thread
+should be allowed to enter InnoDB - the replication thread is treated
+differently than other threads. Also used in
+srv_conc_force_exit_innodb(). */
+extern "C"
+ibool
+thd_is_replication_slave_thread(
+/*============================*/
+ /* out: true if thd is the replication thread */
+ void* thd) /* in: thread handle (THD*) */
+{
+ return((ibool) thd_slave_thread((THD*) thd));
+}
+
+/**********************************************************************
Save some CPU by testing the value of srv_thread_concurrency in inline
functions. */
inline
@@ -482,14 +490,30 @@ innobase_release_stat_resources(
}
}
+/**********************************************************************
+Returns true if the transaction this thread is processing has edited
+non-transactional tables. Used by the deadlock detector when deciding
+which transaction to rollback in case of a deadlock - we try to avoid
+rolling back transactions that have edited non-transactional tables. */
+extern "C"
+ibool
+thd_has_edited_nontrans_tables(
+/*===========================*/
+ /* out: true if non-transactional tables have
+ been edited */
+ void* thd) /* in: thread handle (THD*) */
+{
+ return((ibool) thd_non_transactional_update((THD*) thd));
+}
+
/************************************************************************
Obtain the InnoDB transaction of a MySQL thread. */
inline
trx_t*&
thd_to_trx(
/*=======*/
- /* out: reference to transaction pointer */
- THD* thd) /* in: MySQL thread */
+ /* out: reference to transaction pointer */
+ THD* thd) /* in: MySQL thread */
{
return(*(trx_t**) thd_ha_data(thd, innodb_hton_ptr));
}
@@ -502,11 +526,14 @@ static
int
innobase_release_temporary_latches(
/*===============================*/
- handlerton *hton,
- THD *thd)
+ /* out: 0 */
+ handlerton* hton, /* in: handlerton */
+ THD* thd) /* in: MySQL thread */
{
trx_t* trx;
+ DBUG_ASSERT(hton == innodb_hton_ptr);
+
if (!innodb_inited) {
return 0;
@@ -623,7 +650,7 @@ convert_error_code_to_mysql(
} else if (error == (int) DB_TABLE_NOT_FOUND) {
- return(HA_ERR_KEY_NOT_FOUND);
+ return(HA_ERR_NO_SUCH_TABLE);
} else if (error == (int) DB_TOO_BIG_RECORD) {
@@ -645,6 +672,20 @@ convert_error_code_to_mysql(
}
return(HA_ERR_LOCK_TABLE_FULL);
+ } else if (error == DB_TOO_MANY_CONCURRENT_TRXS) {
+
+ /* Once MySQL add the appropriate code to errmsg.txt then
+ we can get rid of this #ifdef. NOTE: The code checked by
+ the #ifdef is the suggested name for the error condition
+ and the actual error code name could very well be different.
+ This will require some monitoring, ie. the status
+ of this request on our part.*/
+#ifdef ER_TOO_MANY_CONCURRENT_TRXS
+ return(ER_TOO_MANY_CONCURRENT_TRXS);
+#else
+ return(HA_ERR_RECORD_FILE_FULL);
+#endif
+
} else {
return(-1); // Unknown error
}
@@ -693,19 +734,19 @@ innobase_mysql_print_thd(
use the default max length */
{
THD* thd;
- char buffer[1024];
+ char buffer[1024];
- thd = (THD*) input_thd;
- fputs(thd_security_context(thd, buffer, sizeof(buffer),
+ thd = (THD*) input_thd;
+ fputs(thd_security_context(thd, buffer, sizeof(buffer),
max_query_len), f);
- putc('\n', f);
+ putc('\n', f);
}
/**********************************************************************
Get the variable length bounds of the given character set.
NOTE that the exact prototype of this function has to be in
-/innobase/data/data0type.ic! */
+/innobase/include/data0type.ic! */
extern "C"
void
innobase_get_cset_width(
@@ -744,7 +785,7 @@ innobase_convert_from_table_id(
{
uint errors;
- strconvert(current_thd->charset(), from,
+ strconvert(thd_charset(current_thd), from,
&my_charset_filename, to, (uint) len, &errors);
}
@@ -763,7 +804,7 @@ innobase_convert_from_id(
{
uint errors;
- strconvert(current_thd->charset(), from,
+ strconvert(thd_charset(current_thd), from,
system_charset_info, to, (uint) len, &errors);
}
@@ -826,7 +867,7 @@ innobase_get_charset(
/* out: connection character set */
void* mysql_thd) /* in: MySQL thread handle */
{
- return(((THD*) mysql_thd)->charset());
+ return(thd_charset((THD*) mysql_thd));
}
/*************************************************************************
@@ -837,22 +878,9 @@ innobase_mysql_tmpfile(void)
/*========================*/
/* out: temporary file descriptor, or < 0 on error */
{
- char filename[FN_REFLEN];
int fd2 = -1;
- File fd = create_temp_file(filename, mysql_tmpdir, "ib",
-#ifdef __WIN__
- O_BINARY | O_TRUNC | O_SEQUENTIAL |
- O_TEMPORARY | O_SHORT_LIVED |
-#endif /* __WIN__ */
- O_CREAT | O_EXCL | O_RDWR,
- MYF(MY_WME));
+ File fd = mysql_tmpfile("ib");
if (fd >= 0) {
-#ifndef __WIN__
- /* On Windows, open files cannot be removed, but files can be
- created with the O_TEMPORARY flag to the same effect
- ("delete on close"). */
- unlink(filename);
-#endif /* !__WIN__ */
/* Copy the file descriptor, so that the additional resources
allocated by create_temp_file() can be freed by invoking
my_close().
@@ -867,7 +895,7 @@ innobase_mysql_tmpfile(void)
my_errno=errno;
my_error(EE_OUT_OF_FILERESOURCES,
MYF(ME_BELL+ME_WAITTANG),
- filename, my_errno);
+ "ib*", my_errno);
}
my_close(fd, MYF(MY_WME));
}
@@ -903,7 +931,6 @@ trx_t*
check_trx_exists(
/*=============*/
/* out: InnoDB transaction handle */
- handlerton* hton, /* in: handlerton for innodb */
THD* thd) /* in: user thread handle */
{
trx_t*& trx = thd_to_trx(thd);
@@ -915,8 +942,7 @@ check_trx_exists(
trx = trx_allocate_for_mysql();
trx->mysql_thd = thd;
- trx->mysql_query_str = &(thd->query);
- trx->active_trans = 0;
+ trx->mysql_query_str = thd_query(thd);
/* Update the info whether we should skip XA steps that eat
CPU time */
@@ -927,7 +953,7 @@ check_trx_exists(
if (trx->magic_n != TRX_MAGIC_N) {
mem_analyze_corruption(trx);
- ut_a(0);
+ ut_error;
}
}
@@ -958,7 +984,7 @@ ha_innobase::ha_innobase(handlerton *hton, TABLE_SHARE *table_arg)
HA_CAN_SQL_HANDLER |
HA_PRIMARY_KEY_REQUIRED_FOR_POSITION |
HA_PRIMARY_KEY_IN_READ_INDEX |
- HA_BINLOG_ROW_CAPABLE |
+ HA_BINLOG_ROW_CAPABLE |
HA_CAN_GEOMETRY | HA_PARTIAL_COLUMN_READ |
HA_TABLE_SCAN_ON_INDEX),
start_of_scan(0),
@@ -978,7 +1004,7 @@ ha_innobase::update_thd(
{
trx_t* trx;
- trx = check_trx_exists(ht, thd);
+ trx = check_trx_exists(thd);
if (prebuilt->trx != trx) {
@@ -1117,7 +1143,7 @@ innobase_query_caching_of_table_permitted(
ut_a(full_name_len < 999);
- trx = check_trx_exists(innodb_hton_ptr, thd);
+ trx = check_trx_exists(thd);
if (trx->isolation_level == TRX_ISO_SERIALIZABLE) {
/* In the SERIALIZABLE mode we add LOCK IN SHARE MODE to every
@@ -1222,10 +1248,10 @@ innobase_invalidate_query_cache(
/* Argument TRUE below means we are using transactions */
#ifdef HAVE_QUERY_CACHE
- query_cache.invalidate((THD*)(trx->mysql_thd),
- (const char*)full_name,
- (uint32)full_name_len,
- TRUE);
+ mysql_query_cache_invalidate4((THD*) trx->mysql_thd,
+ (const char*) full_name,
+ (uint32) full_name_len,
+ TRUE);
#endif
}
@@ -1305,7 +1331,20 @@ trx_is_interrupted(
/* out: TRUE if interrupted */
trx_t* trx) /* in: transaction */
{
- return(trx && trx->mysql_thd && ((THD*) trx->mysql_thd)->killed);
+ return(trx && trx->mysql_thd && thd_killed((THD*) trx->mysql_thd));
+}
+
+/******************************************************************
+Resets some fields of a prebuilt struct. The template is used in fast
+retrieval of just those column values MySQL needs in its processing. */
+static
+void
+reset_template(
+/*===========*/
+ row_prebuilt_t* prebuilt) /* in/out: prebuilt struct */
+{
+ prebuilt->keep_other_fields_on_keyread = 0;
+ prebuilt->read_just_key = 0;
}
/*********************************************************************
@@ -1343,7 +1382,7 @@ ha_innobase::init_table_handle_for_HANDLER(void)
if (prebuilt->trx->active_trans == 0) {
- innobase_register_trx_and_stmt(ht, ha_thd());
+ innobase_register_trx_and_stmt(ht, user_thd);
prebuilt->trx->active_trans = 1;
}
@@ -1366,19 +1405,18 @@ ha_innobase::init_table_handle_for_HANDLER(void)
/* We want always to fetch all columns in the whole row? Or do
we???? */
- prebuilt->read_just_key = FALSE;
-
prebuilt->used_in_HANDLER = TRUE;
-
- prebuilt->keep_other_fields_on_keyread = FALSE;
+ reset_template(prebuilt);
}
/*************************************************************************
Opens an InnoDB database. */
static
int
-innobase_init(void *p)
-/*===============*/
+innobase_init(
+/*==========*/
+ /* out: 0 on success, error code on failure */
+ void *p) /* in: InnoDB handlerton */
{
static char current_dir[3]; /* Set if using current lib */
int err;
@@ -1387,9 +1425,9 @@ innobase_init(void *p)
DBUG_ENTER("innobase_init");
handlerton *innobase_hton= (handlerton *)p;
- innodb_hton_ptr= innobase_hton;
+ innodb_hton_ptr = innobase_hton;
- innobase_hton->state= SHOW_OPTION_YES;
+ innobase_hton->state = SHOW_OPTION_YES;
innobase_hton->db_type= DB_TYPE_INNODB;
innobase_hton->savepoint_offset=sizeof(trx_named_savept_t);
innobase_hton->close_connection=innobase_close_connection;
@@ -1569,10 +1607,7 @@ innobase_init(void *p)
changes the value so that it becomes the number of database pages. */
if (innobase_buffer_pool_awe_mem_mb == 0) {
- /* Careful here: we first convert the signed long int to ulint
- and only after that divide */
-
- srv_pool_size = ((ulint) innobase_buffer_pool_size) / 1024;
+ srv_pool_size = (ulint)(innobase_buffer_pool_size / 1024);
} else {
srv_use_awe = TRUE;
srv_pool_size = (ulint)
@@ -1751,7 +1786,7 @@ innobase_start_trx_and_assign_read_view(
/* Create a new trx struct for thd, if it does not yet have one */
- trx = check_trx_exists(hton, thd);
+ trx = check_trx_exists(thd);
/* This is just to play safe: release a possible FIFO ticket and
search latch. Since we will reserve the kernel mutex, we have to
@@ -1796,7 +1831,7 @@ innobase_commit(
DBUG_ENTER("innobase_commit");
DBUG_PRINT("trans", ("ending transaction"));
- trx = check_trx_exists(hton, thd);
+ trx = check_trx_exists(thd);
/* Update the info whether we should skip XA steps that eat CPU time */
trx->support_xa = THDVAR(thd, support_xa);
@@ -1855,9 +1890,8 @@ retry:
}
}
- trx->mysql_log_file_name = mysql_bin_log.get_log_fname();
- trx->mysql_log_offset =
- (ib_longlong)mysql_bin_log.get_log_file()->pos_in_file;
+ trx->mysql_log_file_name = mysql_bin_log_file_name();
+ trx->mysql_log_offset = (ib_longlong) mysql_bin_log_file_pos();
innobase_commit_low(trx);
@@ -1987,7 +2021,6 @@ int
innobase_commit_complete(
/*=====================*/
/* out: 0 */
- handlerton *hton, /* in: Innodb handlerton */
THD* thd) /* in: user thread */
{
trx_t* trx;
@@ -2012,8 +2045,8 @@ innobase_commit_complete(
/*********************************************************************
Rolls back a transaction or the latest SQL statement. */
-
-static int
+static
+int
innobase_rollback(
/*==============*/
/* out: 0 or error number */
@@ -2029,7 +2062,7 @@ innobase_rollback(
DBUG_ENTER("innobase_rollback");
DBUG_PRINT("trans", ("aborting transaction"));
- trx = check_trx_exists(hton, thd);
+ trx = check_trx_exists(thd);
/* Update the info whether we should skip XA steps that eat CPU time */
trx->support_xa = THDVAR(thd, support_xa);
@@ -2095,8 +2128,8 @@ innobase_rollback_trx(
/*********************************************************************
Rolls back a transaction to a savepoint. */
-
-static int
+static
+int
innobase_rollback_to_savepoint(
/*===========================*/
/* out: 0 if success, HA_ERR_NO_SAVEPOINT if
@@ -2113,7 +2146,7 @@ innobase_rollback_to_savepoint(
DBUG_ENTER("innobase_rollback_to_savepoint");
- trx = check_trx_exists(hton, thd);
+ trx = check_trx_exists(thd);
/* Release a possible FIFO ticket and search latch. Since we will
reserve the kernel mutex, we have to release the search system latch
@@ -2149,7 +2182,7 @@ innobase_release_savepoint(
DBUG_ENTER("innobase_release_savepoint");
- trx = check_trx_exists(hton, thd);
+ trx = check_trx_exists(thd);
/* TODO: use provided savepoint data area to store savepoint data */
@@ -2181,10 +2214,12 @@ innobase_savepoint(
(unless we are in sub-statement), so SQL layer ensures that
this method is never called in such situation.
*/
+#ifdef MYSQL_SERVER /* plugins cannot access thd->in_sub_stmt */
DBUG_ASSERT(thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN) ||
thd->in_sub_stmt);
+#endif /* MYSQL_SERVER */
- trx = check_trx_exists(hton, thd);
+ trx = check_trx_exists(thd);
/* Release a possible FIFO ticket and search latch. Since we will
reserve the kernel mutex, we have to release the search system latch
@@ -2217,6 +2252,8 @@ innobase_close_connection(
{
trx_t* trx;
+ DBUG_ENTER("innobase_close_connection");
+ DBUG_ASSERT(hton == innodb_hton_ptr);
trx = thd_to_trx(thd);
ut_a(trx);
@@ -2243,7 +2280,7 @@ innobase_close_connection(
thr_local_free(trx->mysql_thread_id);
trx_free_for_mysql(trx);
- return(0);
+ DBUG_RETURN(0);
}
@@ -2523,8 +2560,15 @@ ha_innobase::close(void)
/*====================*/
/* out: 0 */
{
+ THD* thd;
+
DBUG_ENTER("ha_innobase::close");
+ thd = current_thd; // avoid calling current_thd twice, it may be slow
+ if (thd != NULL) {
+ innobase_release_temporary_latches(ht, thd);
+ }
+
row_prebuilt_free(prebuilt);
my_free(upd_buff, MYF(0));
@@ -3099,7 +3143,7 @@ static
void
build_template(
/*===========*/
- row_prebuilt_t* prebuilt, /* in: prebuilt struct */
+ row_prebuilt_t* prebuilt, /* in/out: prebuilt struct */
THD* thd, /* in: current user thread, used
only if templ_type is
ROW_MYSQL_REC_FIELDS */
@@ -3319,8 +3363,8 @@ ha_innobase::write_row(
longlong auto_inc;
longlong dummy;
ibool auto_inc_used= FALSE;
- THD *thd= ha_thd();
- trx_t* trx = thd_to_trx(thd);
+ ulint sql_command;
+ trx_t* trx = thd_to_trx(user_thd);
DBUG_ENTER("ha_innobase::write_row");
@@ -3344,11 +3388,13 @@ ha_innobase::write_row(
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT)
table->timestamp_field->set_time();
- if ((thd_sql_command(thd) == SQLCOM_ALTER_TABLE
- || thd_sql_command(thd) == SQLCOM_OPTIMIZE
- || thd_sql_command(thd) == SQLCOM_CREATE_INDEX
- || thd_sql_command(thd) == SQLCOM_DROP_INDEX)
- && num_write_row >= 10000) {
+ sql_command = thd_sql_command(user_thd);
+
+ if ((sql_command == SQLCOM_ALTER_TABLE
+ || sql_command == SQLCOM_OPTIMIZE
+ || sql_command == SQLCOM_CREATE_INDEX
+ || sql_command == SQLCOM_DROP_INDEX)
+ && num_write_row >= 10000) {
/* ALTER TABLE is COMMITted at every 10000 copied rows.
The IX table lock for the original table has to be re-issued.
As this method will be called on a temporary table where the
@@ -3490,30 +3536,32 @@ no_commit:
/* This call will update the counter according to the
value that was inserted in the table */
- dict_table_autoinc_update(prebuilt->table, auto_inc);
- }
- }
+ dict_table_autoinc_update(prebuilt->table, auto_inc);
+ }
+ }
- /* A REPLACE command and LOAD DATA INFILE REPLACE handle a duplicate
- key error themselves, and we must update the autoinc counter if we are
- performing those statements. */
+ /* A REPLACE command and LOAD DATA INFILE REPLACE handle a duplicate
+ key error themselves, and we must update the autoinc counter if we are
+ performing those statements. */
- if (error == DB_DUPLICATE_KEY && auto_inc_used
- && (thd_sql_command(user_thd) == SQLCOM_REPLACE
- || thd_sql_command(user_thd) == SQLCOM_REPLACE_SELECT
- || (thd_sql_command(user_thd) == SQLCOM_INSERT
- && prebuilt->trx->allow_duplicates
- && !prebuilt->trx->replace_duplicates)
- || (thd_sql_command(user_thd) == SQLCOM_LOAD
- && prebuilt->trx->allow_duplicates
- && prebuilt->trx->replace_duplicates))) {
+ if (error == DB_DUPLICATE_KEY && auto_inc_used
+ && (sql_command == SQLCOM_REPLACE
+ || sql_command == SQLCOM_REPLACE_SELECT
+ || (sql_command == SQLCOM_INSERT
+ && ((trx->duplicates
+ & (TRX_DUP_IGNORE | TRX_DUP_REPLACE))
+ == TRX_DUP_IGNORE))
+ || (sql_command == SQLCOM_LOAD
+ && ((trx->duplicates
+ & (TRX_DUP_IGNORE | TRX_DUP_REPLACE))
+ == (TRX_DUP_IGNORE | TRX_DUP_REPLACE))))) {
- auto_inc = table->next_number_field->val_int();
+ auto_inc = table->next_number_field->val_int();
- if (auto_inc != 0) {
- dict_table_autoinc_update(prebuilt->table, auto_inc);
- }
- }
+ if (auto_inc != 0) {
+ dict_table_autoinc_update(prebuilt->table, auto_inc);
+ }
+ }
innodb_srv_conc_exit_innodb(prebuilt->trx);
@@ -3694,7 +3742,7 @@ ha_innobase::update_row(
{
upd_t* uvect;
int error = 0;
- trx_t* trx = thd_to_trx(ha_thd());
+ trx_t* trx = thd_to_trx(user_thd);
DBUG_ENTER("ha_innobase::update_row");
@@ -3747,7 +3795,7 @@ ha_innobase::delete_row(
const mysql_byte* record) /* in: a row in MySQL format */
{
int error = 0;
- trx_t* trx = thd_to_trx(ha_thd());
+ trx_t* trx = thd_to_trx(user_thd);
DBUG_ENTER("ha_innobase::delete_row");
@@ -3833,7 +3881,8 @@ ha_innobase::try_semi_consistent_read(bool yes)
option is used or this session is using READ COMMITTED isolation
level. */
- if (yes && (srv_locks_unsafe_for_binlog
+ if (yes
+ && (srv_locks_unsafe_for_binlog
|| prebuilt->trx->isolation_level == TRX_ISO_READ_COMMITTED)) {
prebuilt->row_read_type = ROW_READ_TRY_SEMI_CONSISTENT;
} else {
@@ -3991,7 +4040,7 @@ ha_innobase::index_read(
DBUG_ENTER("index_read");
- ut_a(prebuilt->trx == thd_to_trx(ha_thd()));
+ ut_a(prebuilt->trx == thd_to_trx(user_thd));
ha_statistic_increment(&SSV::ha_read_key_count);
@@ -4183,7 +4232,7 @@ ha_innobase::general_fetch(
DBUG_ENTER("general_fetch");
- ut_a(prebuilt->trx == thd_to_trx(ha_thd()));
+ ut_a(prebuilt->trx == thd_to_trx(user_thd));
innodb_srv_conc_enter_innodb(prebuilt->trx);
@@ -4482,6 +4531,25 @@ ha_innobase::position(
}
/*********************************************************************
+If it's a DB_TOO_BIG_RECORD error then set a suitable message to
+return to the client.*/
+static
+void
+innodb_check_for_record_too_big_error(
+/*==================================*/
+ dict_table_t* table, /* in: table to check */
+ int error) /* in: error code to check */
+{
+ if (error == (int)DB_TOO_BIG_RECORD) {
+ ulint max_row_size;
+
+ max_row_size = page_get_free_space_of_empty_noninline(table);
+
+ my_error(ER_TOO_BIG_ROWSIZE, MYF(0), max_row_size);
+ }
+}
+
+/*********************************************************************
Creates a table definition to an InnoDB database. */
static
int
@@ -4589,6 +4657,10 @@ create_table_def(
error = row_create_table_for_mysql(table, trx);
+ /* We need access to the table and so we do the error checking
+ and set the error message here, before the error translation.*/
+ innodb_check_for_record_too_big_error(table, error);
+
error = convert_error_code_to_mysql(error, NULL);
DBUG_RETURN(error);
@@ -4711,6 +4783,10 @@ create_index(
sure we don't create too long indexes. */
error = row_create_index_for_mysql(index, trx, field_lengths);
+ /* We need access to the table and so we do the error checking
+ and set the error message here, before the error translation.*/
+ innodb_check_for_record_too_big_error(index->table, error);
+
error = convert_error_code_to_mysql(error, NULL);
my_free(field_lengths, MYF(0));
@@ -4738,6 +4814,10 @@ create_clustered_index_when_no_primary(
(char*) "GEN_CLUST_INDEX", 0, DICT_CLUSTERED, 0);
error = row_create_index_for_mysql(index, trx, NULL);
+ /* We need access to the table and so we do the error checking
+ and set the error message here, before the error translation.*/
+ innodb_check_for_record_too_big_error(index->table, error);
+
error = convert_error_code_to_mysql(error, NULL);
return(error);
@@ -4779,7 +4859,7 @@ ha_innobase::create(
uint i;
char name2[FN_REFLEN];
char norm_name[FN_REFLEN];
- THD *thd= ha_thd();
+ THD* thd = ha_thd();
ib_longlong auto_inc_value;
ulint flags;
@@ -4797,7 +4877,7 @@ ha_innobase::create(
/* Get the transaction associated with the current thd, or create one
if not yet created */
- parent_trx = check_trx_exists(ht, thd);
+ parent_trx = check_trx_exists(thd);
/* In case MySQL calls this in the middle of a SELECT query, release
possible adaptive hash latch to avoid deadlocks of threads */
@@ -4807,7 +4887,7 @@ ha_innobase::create(
trx = trx_allocate_for_mysql();
trx->mysql_thd = thd;
- trx->mysql_query_str = &((*thd).query);
+ trx->mysql_query_str = thd_query(thd);
if (thd_test_options(thd, OPTION_NO_FOREIGN_KEY_CHECKS)) {
trx->check_foreigns = FALSE;
@@ -4893,9 +4973,9 @@ ha_innobase::create(
}
}
- if (thd->query != NULL) {
+ if (*trx->mysql_query_str) {
error = row_table_add_foreign_constraints(trx,
- thd->query, norm_name,
+ *trx->mysql_query_str, norm_name,
create_info->options & HA_LEX_CREATE_TMP_TABLE);
error = convert_error_code_to_mysql(error, NULL);
@@ -4994,33 +5074,32 @@ ha_innobase::delete_all_rows(void)
/* out: error number */
{
int error;
- THD* thd = ha_thd();
DBUG_ENTER("ha_innobase::delete_all_rows");
/* Get the transaction associated with the current thd, or create one
if not yet created, and update prebuilt->trx */
- update_thd(thd);
-
- if (thd_sql_command(thd) == SQLCOM_TRUNCATE) {
- /* Truncate the table in InnoDB */
+ update_thd(ha_thd());
- error = row_truncate_table_for_mysql(prebuilt->table, prebuilt->trx);
- if (error == DB_ERROR) {
- /* Cannot truncate; resort to ha_innobase::delete_row() */
- goto fallback;
- }
+ if (thd_sql_command(user_thd) != SQLCOM_TRUNCATE) {
+ fallback:
+ /* We only handle TRUNCATE TABLE t as a special case.
+ DELETE FROM t will have to use ha_innobase::delete_row(). */
+ DBUG_RETURN(my_errno=HA_ERR_WRONG_COMMAND);
+ }
- error = convert_error_code_to_mysql(error, NULL);
+ /* Truncate the table in InnoDB */
- DBUG_RETURN(error);
+ error = row_truncate_table_for_mysql(prebuilt->table, prebuilt->trx);
+ if (error == DB_ERROR) {
+ /* Cannot truncate; resort to ha_innobase::delete_row() */
+ goto fallback;
}
-fallback:
- /* We only handle TRUNCATE TABLE t as a special case.
- DELETE FROM t will have to use ha_innobase::delete_row(). */
- DBUG_RETURN(my_errno=HA_ERR_WRONG_COMMAND);
+ error = convert_error_code_to_mysql(error, NULL);
+
+ DBUG_RETURN(error);
}
/*********************************************************************
@@ -5040,7 +5119,7 @@ ha_innobase::delete_table(
int error;
trx_t* parent_trx;
trx_t* trx;
- THD *thd= ha_thd();
+ THD *thd = ha_thd();
char norm_name[1000];
DBUG_ENTER("ha_innobase::delete_table");
@@ -5048,7 +5127,7 @@ ha_innobase::delete_table(
/* Get the transaction associated with the current thd, or create one
if not yet created */
- parent_trx = check_trx_exists(ht, thd);
+ parent_trx = check_trx_exists(thd);
/* In case MySQL calls this in the middle of a SELECT query, release
possible adaptive hash latch to avoid deadlocks of threads */
@@ -5063,75 +5142,77 @@ ha_innobase::delete_table(
trx = trx_allocate_for_mysql();
- trx->mysql_thd = ha_thd();
- trx->mysql_query_str = &(ha_thd()->query);
+ trx->mysql_thd = thd;
+ trx->mysql_query_str = thd_query(thd);
- if (thd_test_options(thd, OPTION_NO_FOREIGN_KEY_CHECKS)) {
- trx->check_foreigns = FALSE;
- }
+ if (thd_test_options(thd, OPTION_NO_FOREIGN_KEY_CHECKS)) {
+ trx->check_foreigns = FALSE;
+ }
- if (thd_test_options(thd, OPTION_RELAXED_UNIQUE_CHECKS)) {
- trx->check_unique_secondary = FALSE;
- }
+ if (thd_test_options(thd, OPTION_RELAXED_UNIQUE_CHECKS)) {
+ trx->check_unique_secondary = FALSE;
+ }
- name_len = strlen(name);
+ name_len = strlen(name);
- assert(name_len < 1000);
+ assert(name_len < 1000);
- /* Strangely, MySQL passes the table name without the '.frm'
- extension, in contrast to ::create */
+ /* Strangely, MySQL passes the table name without the '.frm'
+ extension, in contrast to ::create */
- normalize_table_name(norm_name, name);
+ normalize_table_name(norm_name, name);
- /* Drop the table in InnoDB */
+ /* Drop the table in InnoDB */
- error = row_drop_table_for_mysql(norm_name, trx,
- thd_sql_command(thd) == SQLCOM_DROP_DB);
+ error = row_drop_table_for_mysql(norm_name, trx,
+ thd_sql_command(thd)
+ == SQLCOM_DROP_DB);
- /* Flush the log to reduce probability that the .frm files and
- the InnoDB data dictionary get out-of-sync if the user runs
- with innodb_flush_log_at_trx_commit = 0 */
+ /* Flush the log to reduce probability that the .frm files and
+ the InnoDB data dictionary get out-of-sync if the user runs
+ with innodb_flush_log_at_trx_commit = 0 */
- log_buffer_flush_to_disk();
+ log_buffer_flush_to_disk();
- /* Tell the InnoDB server that there might be work for
- utility threads: */
+ /* Tell the InnoDB server that there might be work for
+ utility threads: */
- srv_active_wake_master_thread();
+ srv_active_wake_master_thread();
- innobase_commit_low(trx);
+ innobase_commit_low(trx);
- trx_free_for_mysql(trx);
+ trx_free_for_mysql(trx);
- error = convert_error_code_to_mysql(error, NULL);
+ error = convert_error_code_to_mysql(error, NULL);
- DBUG_RETURN(error);
+ DBUG_RETURN(error);
}
/*********************************************************************
- Removes all tables in the named database inside InnoDB. */
+Removes all tables in the named database inside InnoDB. */
static
void
innobase_drop_database(
- /*===================*/
- /* out: error number */
- handlerton *hton, /* in: handlerton of Innodb */
- char* path) /* in: database path; inside InnoDB the name
- of the last directory in the path is used as
- the database name: for example, in 'mysql/data/test'
- the database name is 'test' */
-{
- ulint len = 0;
- trx_t* parent_trx;
- trx_t* trx;
- char* ptr;
- int error;
- char* namebuf;
-
- /* Get the transaction associated with the current thd, or create one
- if not yet created */
-
- parent_trx = check_trx_exists(hton, current_thd);
+/*===================*/
+ /* out: error number */
+ handlerton *hton, /* in: handlerton of Innodb */
+ char* path) /* in: database path; inside InnoDB the name
+ of the last directory in the path is used as
+ the database name: for example, in 'mysql/data/test'
+ the database name is 'test' */
+{
+ ulint len = 0;
+ trx_t* parent_trx;
+ trx_t* trx;
+ char* ptr;
+ int error;
+ char* namebuf;
+ THD* thd = current_thd;
+
+ /* Get the transaction associated with the current thd, or create one
+ if not yet created */
+
+ parent_trx = check_trx_exists(thd);
/* In case MySQL calls this in the middle of a SELECT query, release
possible adaptive hash latch to avoid deadlocks of threads */
@@ -5155,10 +5236,10 @@ innobase_drop_database(
innobase_casedn_str(namebuf);
#endif
trx = trx_allocate_for_mysql();
- trx->mysql_thd = current_thd;
- trx->mysql_query_str = &((*current_thd).query);
+ trx->mysql_thd = thd;
+ trx->mysql_query_str = thd_query(thd);
- if (thd_test_options(current_thd, OPTION_NO_FOREIGN_KEY_CHECKS)) {
+ if (thd_test_options(thd, OPTION_NO_FOREIGN_KEY_CHECKS)) {
trx->check_foreigns = FALSE;
}
@@ -5204,13 +5285,14 @@ ha_innobase::rename_table(
trx_t* trx;
char norm_from[1000];
char norm_to[1000];
+ THD* thd = ha_thd();
DBUG_ENTER("ha_innobase::rename_table");
/* Get the transaction associated with the current thd, or create one
if not yet created */
- parent_trx = check_trx_exists(ht, ha_thd());
+ parent_trx = check_trx_exists(thd);
/* In case MySQL calls this in the middle of a SELECT query, release
possible adaptive hash latch to avoid deadlocks of threads */
@@ -5224,10 +5306,10 @@ ha_innobase::rename_table(
}
trx = trx_allocate_for_mysql();
- trx->mysql_thd = ha_thd();
- trx->mysql_query_str = &((*ha_thd()).query);
+ trx->mysql_thd = thd;
+ trx->mysql_query_str = thd_query(thd);
- if (thd_test_options(ha_thd(), OPTION_NO_FOREIGN_KEY_CHECKS)) {
+ if (thd_test_options(thd, OPTION_NO_FOREIGN_KEY_CHECKS)) {
trx->check_foreigns = FALSE;
}
@@ -5489,7 +5571,12 @@ ha_innobase::info(
if (srv_force_recovery >= SRV_FORCE_NO_IBUF_MERGE) {
- DBUG_RETURN(HA_ERR_CRASHED);
+ /* We return success (0) instead of HA_ERR_CRASHED,
+ because we want MySQL to process this query and not
+ stop, like it would do if it received the error code
+ HA_ERR_CRASHED. */
+
+ DBUG_RETURN(0);
}
/* We do not know if MySQL can call this function before calling
@@ -5509,15 +5596,14 @@ ha_innobase::info(
if (flag & HA_STATUS_TIME) {
if (srv_stats_on_metadata) {
- /* In sql_show we call with this flag: update then statistics
- so that they are up-to-date */
+ /* In sql_show we call with this flag: update
+ then statistics so that they are up-to-date */
- prebuilt->trx->op_info = (char*)"updating table statistics";
+ prebuilt->trx->op_info = "updating table statistics";
dict_update_statistics(ib_table);
- prebuilt->trx->op_info = (char*)
- "returning various info to MySQL";
+ prebuilt->trx->op_info = "returning various info to MySQL";
}
my_snprintf(path, sizeof(path), "%s/%s%s",
@@ -5642,7 +5728,8 @@ ha_innobase::info(
}
if (flag & HA_STATUS_ERRKEY) {
- ut_a(prebuilt->trx && prebuilt->trx->magic_n == TRX_MAGIC_N);
+ ut_a(prebuilt->trx);
+ ut_a(prebuilt->trx->magic_n == TRX_MAGIC_N);
errkey = (unsigned int) row_get_mysql_key_number_for_index(
(dict_index_t*) trx_get_error_info(prebuilt->trx));
@@ -5726,8 +5813,10 @@ ha_innobase::check(
{
ulint ret;
- ut_a(prebuilt->trx && prebuilt->trx->magic_n == TRX_MAGIC_N);
- ut_a(prebuilt->trx == thd_to_trx(ha_thd()));
+ DBUG_ASSERT(thd == ha_thd());
+ ut_a(prebuilt->trx);
+ ut_a(prebuilt->trx->magic_n == TRX_MAGIC_N);
+ ut_a(prebuilt->trx == thd_to_trx(thd));
if (prebuilt->mysql_template == NULL) {
/* Build the template; we will use a dummy template
@@ -5909,8 +5998,8 @@ ha_innobase::get_foreign_key_list(THD *thd, List<FOREIGN_KEY_INFO> *f_key_list)
while (tmp_buff[i] != '/')
i++;
tmp_buff+= i + 1;
- f_key_info.forein_id= make_lex_string(thd, 0, tmp_buff,
- (uint) strlen(tmp_buff), 1);
+ f_key_info.forein_id = thd_make_lex_string(thd, 0,
+ tmp_buff, (uint) strlen(tmp_buff), 1);
tmp_buff= foreign->referenced_table_name;
/* Database name */
@@ -5922,22 +6011,23 @@ ha_innobase::get_foreign_key_list(THD *thd, List<FOREIGN_KEY_INFO> *f_key_list)
}
db_name[i]= 0;
ulen= filename_to_tablename(db_name, uname, sizeof(uname));
- f_key_info.referenced_db= make_lex_string(thd, 0, uname, ulen, 1);
+ f_key_info.referenced_db = thd_make_lex_string(thd, 0,
+ uname, ulen, 1);
/* Table name */
tmp_buff+= i + 1;
ulen= filename_to_tablename(tmp_buff, uname, sizeof(uname));
- f_key_info.referenced_table= make_lex_string(thd, 0, uname,
- ulen, 1);
+ f_key_info.referenced_table = thd_make_lex_string(thd, 0,
+ uname, ulen, 1);
for (i= 0;;) {
tmp_buff= foreign->foreign_col_names[i];
- name= make_lex_string(thd, name, tmp_buff,
- (uint) strlen(tmp_buff), 1);
+ name = thd_make_lex_string(thd, name,
+ tmp_buff, (uint) strlen(tmp_buff), 1);
f_key_info.foreign_fields.push_back(name);
tmp_buff= foreign->referenced_col_names[i];
- name= make_lex_string(thd, name, tmp_buff,
- (uint) strlen(tmp_buff), 1);
+ name = thd_make_lex_string(thd, name,
+ tmp_buff, (uint) strlen(tmp_buff), 1);
f_key_info.referenced_fields.push_back(name);
if (++i >= foreign->n_fields)
break;
@@ -5964,8 +6054,8 @@ ha_innobase::get_foreign_key_list(THD *thd, List<FOREIGN_KEY_INFO> *f_key_list)
length=8;
tmp_buff= "RESTRICT";
}
- f_key_info.delete_method= make_lex_string(thd, f_key_info.delete_method,
- tmp_buff, length, 1);
+ f_key_info.delete_method = thd_make_lex_string(
+ thd, f_key_info.delete_method, tmp_buff, length, 1);
if (foreign->type & DICT_FOREIGN_ON_UPDATE_CASCADE)
@@ -5988,20 +6078,19 @@ ha_innobase::get_foreign_key_list(THD *thd, List<FOREIGN_KEY_INFO> *f_key_list)
length=8;
tmp_buff= "RESTRICT";
}
- f_key_info.update_method= make_lex_string(thd, f_key_info.update_method,
- tmp_buff, length, 1);
+ f_key_info.update_method = thd_make_lex_string(
+ thd, f_key_info.update_method, tmp_buff, length, 1);
if (foreign->referenced_index &&
foreign->referenced_index->name)
{
- f_key_info.referenced_key_name=
- make_lex_string(thd, f_key_info.referenced_key_name,
- foreign->referenced_index->name,
- strlen(foreign->referenced_index->name), 1);
+ f_key_info.referenced_key_name = thd_make_lex_string(
+ thd, f_key_info.referenced_key_name,
+ foreign->referenced_index->name,
+ strlen(foreign->referenced_index->name), 1);
}
- FOREIGN_KEY_INFO *pf_key_info= ((FOREIGN_KEY_INFO *)
- thd->memdup(&f_key_info,
- sizeof(FOREIGN_KEY_INFO)));
+ FOREIGN_KEY_INFO *pf_key_info = (FOREIGN_KEY_INFO *)
+ thd_memdup(thd, &f_key_info, sizeof(FOREIGN_KEY_INFO));
f_key_list->push_back(pf_key_info);
foreign = UT_LIST_GET_NEXT(foreign_list, foreign);
}
@@ -6093,8 +6182,7 @@ ha_innobase::extra(
}
break;
case HA_EXTRA_RESET_STATE:
- prebuilt->keep_other_fields_on_keyread = 0;
- prebuilt->read_just_key = 0;
+ reset_template(prebuilt);
break;
case HA_EXTRA_NO_KEYREAD:
prebuilt->read_just_key = 0;
@@ -6105,18 +6193,25 @@ ha_innobase::extra(
case HA_EXTRA_KEYREAD_PRESERVE_FIELDS:
prebuilt->keep_other_fields_on_keyread = 1;
break;
+
+ /* IMPORTANT: prebuilt->trx can be obsolete in
+ this method, because it is not sure that MySQL
+ calls external_lock before this method with the
+ parameters below. We must not invoke update_thd()
+ either, because the calling threads may change.
+ CAREFUL HERE, OR MEMORY CORRUPTION MAY OCCUR! */
case HA_EXTRA_IGNORE_DUP_KEY:
- prebuilt->trx->allow_duplicates= TRUE;
+ thd_to_trx(ha_thd())->duplicates |= TRX_DUP_IGNORE;
break;
case HA_EXTRA_WRITE_CAN_REPLACE:
- prebuilt->trx->replace_duplicates= TRUE;
+ thd_to_trx(ha_thd())->duplicates |= TRX_DUP_REPLACE;
break;
case HA_EXTRA_WRITE_CANNOT_REPLACE:
- prebuilt->trx->replace_duplicates= FALSE;
+ thd_to_trx(ha_thd())->duplicates &= ~TRX_DUP_REPLACE;
break;
case HA_EXTRA_NO_IGNORE_DUP_KEY:
- prebuilt->trx->allow_duplicates= FALSE;
- prebuilt->trx->replace_duplicates= FALSE;
+ thd_to_trx(ha_thd())->duplicates &=
+ ~(TRX_DUP_IGNORE | TRX_DUP_REPLACE);
break;
default:/* Do nothing */
;
@@ -6130,8 +6225,7 @@ int ha_innobase::reset()
if (prebuilt->blob_heap) {
row_mysql_prebuilt_free_blob_heap(prebuilt);
}
- prebuilt->keep_other_fields_on_keyread = 0;
- prebuilt->read_just_key = 0;
+ reset_template(prebuilt);
return 0;
}
@@ -6172,8 +6266,7 @@ ha_innobase::start_stmt(
prebuilt->sql_stat_start = TRUE;
prebuilt->hint_need_to_fetch_extra_cols = 0;
- prebuilt->read_just_key = 0;
- prebuilt->keep_other_fields_on_keyread = FALSE;
+ reset_template(prebuilt);
if (!prebuilt->mysql_has_locked) {
/* This handle is for a temporary table created inside
@@ -6260,27 +6353,27 @@ ha_innobase::external_lock(
update_thd(thd);
- /* Statement based binlogging does not work in isolation level
- READ UNCOMMITTED and READ COMMITTED since the necessary
- locks cannot be taken. In this case, we print an
- informative error message and return with an error. */
- if (lock_type == F_WRLCK)
- {
- ulong const binlog_format= thd->variables.binlog_format;
- ulong const tx_isolation = thd_tx_isolation(current_thd);
- if (tx_isolation <= ISO_READ_COMMITTED &&
- binlog_format == BINLOG_FORMAT_STMT)
- {
- char buf[256];
- my_snprintf(buf, sizeof(buf),
- "Transaction level '%s' in"
- " InnoDB is not safe for binlog mode '%s'",
- tx_isolation_names[tx_isolation],
- binlog_format_names[binlog_format]);
- my_error(ER_BINLOG_LOGGING_IMPOSSIBLE, MYF(0), buf);
- DBUG_RETURN(HA_ERR_LOGGING_IMPOSSIBLE);
- }
- }
+ /* Statement based binlogging does not work in isolation level
+ READ UNCOMMITTED and READ COMMITTED since the necessary
+ locks cannot be taken. In this case, we print an
+ informative error message and return with an error. */
+ if (lock_type == F_WRLCK)
+ {
+ ulong const binlog_format= thd_binlog_format(thd);
+ ulong const tx_isolation = thd_tx_isolation(current_thd);
+ if (tx_isolation <= ISO_READ_COMMITTED &&
+ binlog_format == BINLOG_FORMAT_STMT)
+ {
+ char buf[256];
+ my_snprintf(buf, sizeof(buf),
+ "Transaction level '%s' in"
+ " InnoDB is not safe for binlog mode '%s'",
+ tx_isolation_names[tx_isolation],
+ binlog_format_names[binlog_format]);
+ my_error(ER_BINLOG_LOGGING_IMPOSSIBLE, MYF(0), buf);
+ DBUG_RETURN(HA_ERR_LOGGING_IMPOSSIBLE);
+ }
+ }
trx = prebuilt->trx;
@@ -6288,8 +6381,7 @@ ha_innobase::external_lock(
prebuilt->sql_stat_start = TRUE;
prebuilt->hint_need_to_fetch_extra_cols = 0;
- prebuilt->read_just_key = 0;
- prebuilt->keep_other_fields_on_keyread = FALSE;
+ reset_template(prebuilt);
if (lock_type == F_WRLCK) {
@@ -6347,17 +6439,17 @@ ha_innobase::external_lock(
if (prebuilt->select_lock_type != LOCK_NONE) {
- if (thd_in_lock_tables(thd) &&
- thd_sql_command(thd) == SQLCOM_LOCK_TABLES &&
- THDVAR(thd, table_locks) &&
- thd_test_options(thd, OPTION_NOT_AUTOCOMMIT)) {
+ if (thd_sql_command(thd) == SQLCOM_LOCK_TABLES
+ && THDVAR(thd, table_locks)
+ && thd_test_options(thd, OPTION_NOT_AUTOCOMMIT)
+ && thd_in_lock_tables(thd)) {
ulint error = row_lock_table_for_mysql(
prebuilt, NULL, 0);
if (error != DB_SUCCESS) {
error = convert_error_code_to_mysql(
- (int) error, user_thd);
+ (int) error, thd);
DBUG_RETURN((int) error);
}
}
@@ -6373,6 +6465,12 @@ ha_innobase::external_lock(
trx->n_mysql_tables_in_use--;
prebuilt->mysql_has_locked = FALSE;
+ /* Release a possible FIFO ticket and search latch. Since we
+ may reserve the kernel mutex, we have to release the search
+ system latch first to obey the latching order. */
+
+ innobase_release_stat_resources(trx);
+
/* If the MySQL lock count drops to zero we know that the current SQL
statement has ended */
@@ -6381,12 +6479,6 @@ ha_innobase::external_lock(
trx->mysql_n_tables_locked = 0;
prebuilt->used_in_HANDLER = FALSE;
- /* Release a possible FIFO ticket and search latch. Since we
- may reserve the kernel mutex, we have to release the search
- system latch first to obey the latching order. */
-
- innobase_release_stat_resources(trx);
-
if (!thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) {
if (trx->active_trans != 0) {
innobase_commit(ht, thd, TRUE);
@@ -6428,8 +6520,7 @@ ha_innobase::transactional_table_lock(
update_thd(thd);
- if (prebuilt->table->ibd_file_missing
- && !thd_tablespace_op(ha_thd())) {
+ if (prebuilt->table->ibd_file_missing && !thd_tablespace_op(thd)) {
ut_print_timestamp(stderr);
fprintf(stderr, " InnoDB error:\n"
"MySQL is trying to use a table handle but the .ibd file for\n"
@@ -6447,8 +6538,7 @@ ha_innobase::transactional_table_lock(
prebuilt->sql_stat_start = TRUE;
prebuilt->hint_need_to_fetch_extra_cols = 0;
- prebuilt->read_just_key = 0;
- prebuilt->keep_other_fields_on_keyread = FALSE;
+ reset_template(prebuilt);
if (lock_type == F_WRLCK) {
prebuilt->select_lock_type = LOCK_X;
@@ -6474,13 +6564,13 @@ ha_innobase::transactional_table_lock(
trx->active_trans = 1;
}
- if (thd_in_lock_tables(thd) && THDVAR(thd, table_locks)) {
+ if (THDVAR(thd, table_locks) && thd_in_lock_tables(thd)) {
ulint error = DB_SUCCESS;
error = row_lock_table_for_mysql(prebuilt, NULL, 0);
if (error != DB_SUCCESS) {
- error = convert_error_code_to_mysql((int) error, user_thd);
+ error = convert_error_code_to_mysql((int) error, thd);
DBUG_RETURN((int) error);
}
@@ -6530,7 +6620,7 @@ innodb_show_status(
DBUG_ENTER("innodb_show_status");
- trx = check_trx_exists(hton, thd);
+ trx = check_trx_exists(thd);
innobase_release_stat_resources(trx);
@@ -6808,7 +6898,7 @@ ha_innobase::store_lock(
because we call update_thd() later, in ::external_lock()! Failure to
understand this caused a serious memory corruption bug in 5.1.11. */
- trx = check_trx_exists(ht, thd);
+ trx = check_trx_exists(thd);
/* NOTE: MySQL can call this function with lock 'type' TL_IGNORE!
Be careful to ignore TL_IGNORE if we are going to do something with
@@ -6818,9 +6908,9 @@ ha_innobase::store_lock(
of the transaction. */
if (lock_type != TL_IGNORE
- && trx->n_mysql_tables_in_use == 0) {
+ && trx->n_mysql_tables_in_use == 0) {
trx->isolation_level = innobase_map_isolation_level(
- (enum_tx_isolation)thd_tx_isolation(thd));
+ (enum_tx_isolation) thd_tx_isolation(thd));
if (trx->isolation_level <= TRX_ISO_READ_COMMITTED
&& trx->global_read_view) {
@@ -6842,12 +6932,12 @@ ha_innobase::store_lock(
handle may belong to another thd that is running a query. Let
us in that case skip any changes to the prebuilt struct. */
- } else if ((lock_type == TL_READ && in_lock_tables) ||
- (lock_type == TL_READ_HIGH_PRIORITY && in_lock_tables) ||
- lock_type == TL_READ_WITH_SHARED_LOCKS ||
- lock_type == TL_READ_NO_INSERT ||
- (sql_command != SQLCOM_SELECT
- && lock_type != TL_IGNORE)) {
+ } else if ((lock_type == TL_READ && in_lock_tables)
+ || (lock_type == TL_READ_HIGH_PRIORITY && in_lock_tables)
+ || lock_type == TL_READ_WITH_SHARED_LOCKS
+ || lock_type == TL_READ_NO_INSERT
+ || (lock_type != TL_IGNORE
+ && sql_command != SQLCOM_SELECT)) {
/* The OR cases above are in this order:
1) MySQL is doing LOCK TABLES ... READ LOCAL, or we
@@ -6872,10 +6962,10 @@ ha_innobase::store_lock(
isolation_level = trx->isolation_level;
if ((srv_locks_unsafe_for_binlog
- || isolation_level == TRX_ISO_READ_COMMITTED)
- && isolation_level != TRX_ISO_SERIALIZABLE
- && (lock_type == TL_READ || lock_type == TL_READ_NO_INSERT)
- && (sql_command == SQLCOM_INSERT_SELECT
+ || isolation_level == TRX_ISO_READ_COMMITTED)
+ && isolation_level != TRX_ISO_SERIALIZABLE
+ && (lock_type == TL_READ || lock_type == TL_READ_NO_INSERT)
+ && (sql_command == SQLCOM_INSERT_SELECT
|| sql_command == SQLCOM_UPDATE
|| sql_command == SQLCOM_CREATE_TABLE)) {
@@ -6946,24 +7036,25 @@ ha_innobase::store_lock(
TRUE there). */
if ((lock_type >= TL_WRITE_CONCURRENT_INSERT
- && lock_type <= TL_WRITE)
- && !(in_lock_tables
- && sql_command == SQLCOM_LOCK_TABLES)
- && !thd_tablespace_op(thd)
- && sql_command != SQLCOM_TRUNCATE
- && sql_command != SQLCOM_OPTIMIZE
+ && lock_type <= TL_WRITE)
+ && !(in_lock_tables
+ && sql_command == SQLCOM_LOCK_TABLES)
+ && !thd_tablespace_op(thd)
+ && sql_command != SQLCOM_TRUNCATE
+ && sql_command != SQLCOM_OPTIMIZE
#ifdef __WIN__
- /* For alter table on win32 for succesful operation
- completion it is used TL_WRITE(=10) lock instead of
- TL_WRITE_ALLOW_READ(=6), however here in innodb handler
- TL_WRITE is lifted to TL_WRITE_ALLOW_WRITE, which causes
- race condition when several clients do alter table
- simultaneously (bug #17264). This fix avoids the problem. */
- && sql_command != SQLCOM_ALTER_TABLE
+ /* For alter table on win32 for successful
+ operation completion it is used TL_WRITE(=10) lock
+ instead of TL_WRITE_ALLOW_READ(=6), however here
+ in innodb handler TL_WRITE is lifted to
+ TL_WRITE_ALLOW_WRITE, which causes race condition
+ when several clients do alter table simultaneously
+ (bug #17264). This fix avoids the problem. */
+ && sql_command != SQLCOM_ALTER_TABLE
#endif
- && sql_command != SQLCOM_CREATE_TABLE) {
+ && sql_command != SQLCOM_CREATE_TABLE) {
lock_type = TL_WRITE_ALLOW_WRITE;
}
@@ -7008,11 +7099,16 @@ ha_innobase::innobase_read_and_init_auto_inc(
longlong auto_inc;
ulint old_select_lock_type;
ibool trx_was_not_started = FALSE;
+ ibool stmt_start;
int error;
ut_a(prebuilt);
ut_a(prebuilt->table);
+ /* Remember if we are in the beginning of an SQL statement.
+ This function must not change that flag. */
+ stmt_start = prebuilt->sql_stat_start;
+
/* Prepare prebuilt->trx in the table handle */
update_thd(ha_thd());
@@ -7134,6 +7230,8 @@ func_exit_early:
innobase_commit_low(prebuilt->trx);
}
+ prebuilt->sql_stat_start = stmt_start;
+
return(error);
}
@@ -7205,7 +7303,7 @@ ha_innobase::reset_auto_increment(ulonglong value)
bool
ha_innobase::get_error_message(int error, String *buf)
{
- trx_t* trx = check_trx_exists(ht, ha_thd());
+ trx_t* trx = check_trx_exists(ha_thd());
buf->copy(trx->detailed_error, strlen(trx->detailed_error),
system_charset_info);
@@ -7327,7 +7425,6 @@ ha_innobase::get_mysql_bin_log_pos()
return(trx_sys_mysql_bin_log_pos);
}
-extern "C" {
/**********************************************************************
This function is used to find the storage length in bytes of the first n
characters for prefix indexes using a multibyte character set. The function
@@ -7336,7 +7433,7 @@ index field in bytes.
NOTE: the prototype of this function is copied to data0type.c! If you change
this function, you MUST change also data0type.c! */
-
+extern "C"
ulint
innobase_get_at_most_n_mbchars(
/*===========================*/
@@ -7401,39 +7498,6 @@ innobase_get_at_most_n_mbchars(
return(char_length);
}
-}
-
-/**********************************************************************
-This function returns true if
-
-1) SQL-query in the current thread
-is either REPLACE or LOAD DATA INFILE REPLACE.
-
-2) SQL-query in the current thread
-is INSERT ON DUPLICATE KEY UPDATE.
-
-NOTE that storage/innobase/row/row0ins.c must contain the
-prototype for this function ! */
-extern "C"
-ibool
-innobase_query_is_update(void)
-/*==========================*/
-{
- THD* thd = current_thd;
- trx_t* trx;
-
- if (!thd) {
- /* InnoDB's internal threads may run InnoDB stored procedures
- that call this function. Then current_thd is not defined
- (it is probably NULL). */
-
- return(FALSE);
- }
-
- trx = check_trx_exists(innodb_hton_ptr, thd);
-
- return(trx->allow_duplicates);
-}
/***********************************************************************
This function is used to prepare X/Open XA distributed transaction */
@@ -7449,7 +7513,7 @@ innobase_xa_prepare(
FALSE - the current SQL statement ended */
{
int error = 0;
- trx_t* trx = check_trx_exists(hton, thd);
+ trx_t* trx = check_trx_exists(thd);
if (thd_sql_command(thd) != SQLCOM_XA_PREPARE &&
(all || !thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))
@@ -7483,7 +7547,7 @@ innobase_xa_prepare(
return(0);
}
- trx->xid=thd->transaction.xid_state.xid;
+ thd_get_xid(thd, (MYSQL_XID*) &trx->xid);
/* Release a possible FIFO ticket and search latch. Since we will
reserve the kernel mutex, we have to release the search system latch
@@ -7610,8 +7674,7 @@ innobase_create_cursor_view(
handlerton *hton, /* in: innobase hton */
THD* thd) /* in: user thread handle */
{
- return(read_cursor_view_create_for_mysql(
- check_trx_exists(hton, thd)));
+ return(read_cursor_view_create_for_mysql(check_trx_exists(thd)));
}
/***********************************************************************
@@ -7626,8 +7689,8 @@ innobase_close_cursor_view(
THD* thd, /* in: user thread handle */
void* curview)/* in: Consistent read view to be closed */
{
- read_cursor_view_close_for_mysql(check_trx_exists(hton, current_thd),
- (cursor_view_t*) curview);
+ read_cursor_view_close_for_mysql(check_trx_exists(thd),
+ (cursor_view_t*) curview);
}
/***********************************************************************
@@ -7643,8 +7706,8 @@ innobase_set_cursor_view(
THD* thd, /* in: user thread handle */
void* curview)/* in: Consistent cursor view to be set */
{
- read_cursor_set_for_mysql(check_trx_exists(hton, current_thd),
- (cursor_view_t*) curview);
+ read_cursor_set_for_mysql(check_trx_exists(thd),
+ (cursor_view_t*) curview);
}
@@ -7727,8 +7790,9 @@ static MYSQL_SYSVAR_BOOL(file_per_table, innobase_file_per_table,
static MYSQL_SYSVAR_ULONG(flush_log_at_trx_commit, srv_flush_log_at_trx_commit,
PLUGIN_VAR_OPCMDARG,
- "Set to 0 (write and flush once per second), 1 (write and flush at each commit)"
- " or 2 (write at commit, flush once per second).",
+ "Set to 0 (write and flush once per second),"
+ " 1 (write and flush at each commit)"
+ " or 2 (write at commit, flush once per second).",
NULL, NULL, 1, 0, 2, 0);
static MYSQL_SYSVAR_STR(flush_method, innobase_unix_file_flush_method,
@@ -7740,11 +7804,11 @@ static MYSQL_SYSVAR_BOOL(locks_unsafe_for_binlog, innobase_locks_unsafe_for_binl
"Force InnoDB to not use next-key locking, to use only row-level locking.",
NULL, NULL, FALSE);
+#ifdef UNIV_LOG_ARCHIVE
static MYSQL_SYSVAR_STR(log_arch_dir, innobase_log_arch_dir,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"Where full logs should be archived.", NULL, NULL, NULL);
-#ifdef UNIV_LOG_ARCHIVE
static MYSQL_SYSVAR_BOOL(log_archive, innobase_log_archive,
PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_READONLY,
"Set to 1 if you want to have logs archived.", NULL, NULL, FALSE);
@@ -7882,8 +7946,8 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
MYSQL_SYSVAR(force_recovery),
MYSQL_SYSVAR(locks_unsafe_for_binlog),
MYSQL_SYSVAR(lock_wait_timeout),
- MYSQL_SYSVAR(log_arch_dir),
#ifdef UNIV_LOG_ARCHIVE
+ MYSQL_SYSVAR(log_arch_dir),
MYSQL_SYSVAR(log_archive),
#endif /* UNIV_LOG_ARCHIVE */
MYSQL_SYSVAR(log_buffer_size),
@@ -7921,5 +7985,3 @@ mysql_declare_plugin(innobase)
NULL /* reserved */
}
mysql_declare_plugin_end;
-
-#endif
diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h
index c727243bfd3..b10cccded18 100644
--- a/storage/innobase/handler/ha_innodb.h
+++ b/storage/innobase/handler/ha_innodb.h
@@ -190,27 +190,50 @@ class ha_innobase: public handler
uint table_changes);
};
-extern long innobase_mirrored_log_groups, innobase_log_files_in_group;
-extern long long innobase_buffer_pool_size, innobase_log_file_size;
-extern long innobase_log_buffer_size;
-extern long innobase_additional_mem_pool_size;
-extern long innobase_buffer_pool_awe_mem_mb;
-extern long innobase_file_io_threads, innobase_lock_wait_timeout;
-extern long innobase_force_recovery;
-extern long innobase_open_files;
-extern char *innobase_data_home_dir, *innobase_data_file_path;
-extern char *innobase_log_group_home_dir, *innobase_log_arch_dir;
-extern char *innobase_unix_file_flush_method;
+/* Some accessor functions which the InnoDB plugin needs, but which
+can not be added to mysql/plugin.h as part of the public interface;
+the definitions are bracketed with #ifdef INNODB_COMPATIBILITY_HOOKS */
+
+#ifndef INNODB_COMPATIBILITY_HOOKS
+#error InnoDB needs MySQL to be built with #define INNODB_COMPATIBILITY_HOOKS
+#endif
+
extern "C" {
-extern ulong srv_max_buf_pool_modified_pct;
-extern ulong srv_max_purge_lag;
-extern ulong srv_auto_extend_increment;
-extern ulong srv_n_spin_wait_rounds;
-extern ulong srv_n_free_tickets_to_enter;
-extern ulong srv_thread_sleep_delay;
-extern ulong srv_thread_concurrency;
-extern ulong srv_commit_concurrency;
-extern ulong srv_flush_log_at_trx_commit;
+struct charset_info_st *thd_charset(MYSQL_THD thd);
+char **thd_query(MYSQL_THD thd);
+
+/** Get the file name of the MySQL binlog.
+ * @return the name of the binlog file
+ */
+const char* mysql_bin_log_file_name(void);
+
+/** Get the current position of the MySQL binlog.
+ * @return byte offset from the beginning of the binlog
+ */
+ulonglong mysql_bin_log_file_pos(void);
+
+/**
+ Check if a user thread is a replication slave thread
+ @param thd user thread
+ @retval 0 the user thread is not a replication slave thread
+ @retval 1 the user thread is a replication slave thread
+*/
+int thd_slave_thread(const MYSQL_THD thd);
+
+/**
+ Check if a user thread is running a non-transactional update
+ @param thd user thread
+ @retval 0 the user thread is not running a non-transactional update
+ @retval 1 the user thread is running a non-transactional update
+*/
+int thd_non_transactional_update(const MYSQL_THD thd);
+
+/**
+ Get the user thread's binary logging format
+ @param thd user thread
+ @return Value to be used as index into the binlog_format_names array
+*/
+int thd_binlog_format(const MYSQL_THD thd);
}
/*
diff --git a/storage/innobase/ibuf/Makefile.am b/storage/innobase/ibuf/Makefile.am
deleted file mode 100644
index 42adda9a4ef..00000000000
--- a/storage/innobase/ibuf/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-include ../include/Makefile.i
-
-noinst_LIBRARIES = libibuf.a
-
-libibuf_a_SOURCES = ibuf0ibuf.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/ibuf/ibuf0ibuf.c b/storage/innobase/ibuf/ibuf0ibuf.c
index 1cbb6003cfc..4e291924e0e 100644
--- a/storage/innobase/ibuf/ibuf0ibuf.c
+++ b/storage/innobase/ibuf/ibuf0ibuf.c
@@ -150,9 +150,30 @@ ulint ibuf_flush_count = 0;
#define IBUF_COUNT_N_PAGES 2000
/* Buffered entry counts for file pages, used in debugging */
-static ulint* ibuf_counts[IBUF_COUNT_N_SPACES];
+static ulint ibuf_counts[IBUF_COUNT_N_SPACES][IBUF_COUNT_N_PAGES];
-static ibool ibuf_counts_inited = FALSE;
+/**********************************************************************
+Checks that the indexes to ibuf_counts[][] are within limits. */
+UNIV_INLINE
+void
+ibuf_count_check(
+/*=============*/
+ ulint space_id, /* in: space identifier */
+ ulint page_no) /* in: page number */
+{
+ if (space_id < IBUF_COUNT_N_SPACES && page_no < IBUF_COUNT_N_PAGES) {
+ return;
+ }
+
+ fprintf(stderr,
+ "InnoDB: UNIV_IBUF_DEBUG limits space_id and page_no\n"
+ "InnoDB: and breaks crash recovery.\n"
+ "InnoDB: space_id=%lu, should be 0<=space_id<%lu\n"
+ "InnoDB: page_no=%lu, should be 0<=page_no<%lu\n",
+ (ulint) space_id, (ulint) IBUF_COUNT_N_SPACES,
+ (ulint) page_no, (ulint) IBUF_COUNT_N_PAGES);
+ ut_error;
+}
#endif
/* The start address for an insert buffer bitmap page bitmap */
@@ -328,15 +349,9 @@ ibuf_count_get(
ulint space, /* in: space id */
ulint page_no)/* in: page number */
{
- ut_ad(space < IBUF_COUNT_N_SPACES);
- ut_ad(page_no < IBUF_COUNT_N_PAGES);
-
- if (!ibuf_counts_inited) {
-
- return(0);
- }
+ ibuf_count_check(space, page_no);
- return(*(ibuf_counts[space] + page_no));
+ return(ibuf_counts[space][page_no]);
}
/**********************************************************************
@@ -349,11 +364,10 @@ ibuf_count_set(
ulint page_no,/* in: page number */
ulint val) /* in: value to set */
{
- ut_a(space < IBUF_COUNT_N_SPACES);
- ut_a(page_no < IBUF_COUNT_N_PAGES);
+ ibuf_count_check(space, page_no);
ut_a(val < UNIV_PAGE_SIZE);
- *(ibuf_counts[space] + page_no) = val;
+ ibuf_counts[space][page_no] = val;
}
#endif
@@ -378,22 +392,6 @@ ibuf_init_at_db_start(void)
ibuf->size = 0;
-#ifdef UNIV_IBUF_DEBUG
- {
- ulint i, j;
-
- for (i = 0; i < IBUF_COUNT_N_SPACES; i++) {
-
- ibuf_counts[i] = mem_alloc(sizeof(ulint)
- * IBUF_COUNT_N_PAGES);
- for (j = 0; j < IBUF_COUNT_N_PAGES; j++) {
- ibuf_count_set(i, j, 0);
- }
- }
-
- ibuf_counts_inited = TRUE;
- }
-#endif
mutex_create(&ibuf_pessimistic_insert_mutex,
SYNC_IBUF_PESS_INSERT_MUTEX);
@@ -567,7 +565,8 @@ ibuf_bitmap_page_init(
bit_offset = XDES_DESCRIBED_PER_PAGE * IBUF_BITS_PER_PAGE;
- byte_offset = bit_offset / 8 + 1; /* better: (bit_offset + 7) / 8 */
+ byte_offset = bit_offset / 8 + 1;
+ /* better: byte_offset = UT_BITS_IN_BYTES(bit_offset); */
fil_page_set_type(page, FIL_PAGE_IBUF_BITMAP);
@@ -1441,6 +1440,9 @@ ibuf_entry_build(
*buf2++ = 0; /* write the compact format indicator */
}
for (i = 0; i < n_fields; i++) {
+ ulint fixed_len;
+ const dict_field_t* ifield;
+
/* We add 4 below because we have the 4 extra fields at the
start of an ibuf record */
@@ -1448,10 +1450,30 @@ ibuf_entry_build(
entry_field = dtuple_get_nth_field(entry, i);
dfield_copy(field, entry_field);
+ ifield = dict_index_get_nth_field(index, i);
+ /* Prefix index columns of fixed-length columns are of
+ fixed length. However, in the function call below,
+ dfield_get_type(entry_field) contains the fixed length
+ of the column in the clustered index. Replace it with
+ the fixed length of the secondary index column. */
+ fixed_len = ifield->fixed_len;
+
+#ifdef UNIV_DEBUG
+ if (fixed_len) {
+ /* dict_index_add_col() should guarantee these */
+ ut_ad(fixed_len <= (ulint) entry_field->type.len);
+ if (ifield->prefix_len) {
+ ut_ad(ifield->prefix_len == fixed_len);
+ } else {
+ ut_ad(fixed_len
+ == (ulint) entry_field->type.len);
+ }
+ }
+#endif /* UNIV_DEBUG */
+
dtype_new_store_for_order_and_null_size(
buf2 + i * DATA_NEW_ORDER_NULL_TYPE_BUF_SIZE,
- dfield_get_type(entry_field),
- dict_index_get_nth_field(index, i)->prefix_len);
+ dfield_get_type(entry_field), fixed_len);
}
/* Store the type info in buf2 to field 3 of tuple */
diff --git a/storage/innobase/include/Makefile.i b/storage/innobase/include/Makefile.i
deleted file mode 100644
index db436c702ff..00000000000
--- a/storage/innobase/include/Makefile.i
+++ /dev/null
@@ -1,10 +0,0 @@
-# Makefile included in Makefile.am in every subdirectory
-
-INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include \
- -I$(top_srcdir)/regex \
- -I$(top_srcdir)/storage/innobase/include \
- -I$(top_srcdir)/sql \
- -I$(srcdir)
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/include/db0err.h b/storage/innobase/include/db0err.h
index 843c70af577..0aa1b87e470 100644
--- a/storage/innobase/include/db0err.h
+++ b/storage/innobase/include/db0err.h
@@ -62,6 +62,11 @@ Created 5/24/1996 Heikki Tuuri
lead to a duplicate key in some
table */
+#define DB_TOO_MANY_CONCURRENT_TRXS 47 /* when InnoDB runs out of the
+ preconfigured undo slots, this can
+ only happen when there are too many
+ concurrent transactions */
+
/* The following are partial failure codes */
#define DB_FAIL 1000
#define DB_OVERFLOW 1001
diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h
index 836a6290498..eb31043ecc3 100644
--- a/storage/innobase/include/dict0dict.h
+++ b/storage/innobase/include/dict0dict.h
@@ -92,6 +92,17 @@ dict_col_copy_type_noninline(
/*=========================*/
const dict_col_t* col, /* in: column */
dtype_t* type); /* out: data type */
+#ifdef UNIV_DEBUG
+/*************************************************************************
+Assert that a column and a data type match. */
+UNIV_INLINE
+ibool
+dict_col_type_assert_equal(
+/*=======================*/
+ /* out: TRUE */
+ const dict_col_t* col, /* in: column */
+ const dtype_t* type); /* in: data type */
+#endif /* UNIV_DEBUG */
/***************************************************************************
Returns the minimum size of the column. */
UNIV_INLINE
diff --git a/storage/innobase/include/dict0dict.ic b/storage/innobase/include/dict0dict.ic
index 4a9afd2f3f5..7d38cbcd1fa 100644
--- a/storage/innobase/include/dict0dict.ic
+++ b/storage/innobase/include/dict0dict.ic
@@ -30,6 +30,30 @@ dict_col_copy_type(
type->mbmaxlen = col->mbmaxlen;
}
+#ifdef UNIV_DEBUG
+/*************************************************************************
+Assert that a column and a data type match. */
+UNIV_INLINE
+ibool
+dict_col_type_assert_equal(
+/*=======================*/
+ /* out: TRUE */
+ const dict_col_t* col, /* in: column */
+ const dtype_t* type) /* in: data type */
+{
+ ut_ad(col);
+ ut_ad(type);
+
+ ut_ad(col->mtype == type->mtype);
+ ut_ad(col->prtype == type->prtype);
+ ut_ad(col->len == type->len);
+ ut_ad(col->mbminlen == type->mbminlen);
+ ut_ad(col->mbmaxlen == type->mbmaxlen);
+
+ return(TRUE);
+}
+#endif /* UNIV_DEBUG */
+
/***************************************************************************
Returns the minimum size of the column. */
UNIV_INLINE
diff --git a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h
index a23f89954a4..647035c2fff 100644
--- a/storage/innobase/include/dict0mem.h
+++ b/storage/innobase/include/dict0mem.h
@@ -158,10 +158,13 @@ struct dict_col_struct{
of an index */
};
-/* DICT_MAX_INDEX_COL_LEN is measured in bytes and is the max index column
-length + 1. Starting from 4.1.6, we set it to < 3 * 256, so that one can
-create a column prefix index on 255 characters of a TEXT field also in the
-UTF-8 charset. In that charset, a character may take at most 3 bytes. */
+/* DICT_MAX_INDEX_COL_LEN is measured in bytes and is the maximum
+indexed column length (or indexed prefix length). It is set to 3*256,
+so that one can create a column prefix index on 256 characters of a
+TEXT or VARCHAR column also in the UTF-8 charset. In that charset,
+a character may take at most 3 bytes.
+This constant MUST NOT BE CHANGED, or the compatibility of InnoDB data
+files would be at risk! */
#define DICT_MAX_INDEX_COL_LEN 768
diff --git a/storage/innobase/include/ha_prototypes.h b/storage/innobase/include/ha_prototypes.h
index 2d27034fdfe..7fb50988941 100644
--- a/storage/innobase/include/ha_prototypes.h
+++ b/storage/innobase/include/ha_prototypes.h
@@ -1,6 +1,9 @@
#ifndef HA_INNODB_PROTOTYPES_H
#define HA_INNODB_PROTOTYPES_H
+#include "univ.i" /* ulint, uint */
+#include "m_ctype.h" /* CHARSET_INFO */
+
/* Prototypes for global functions in ha_innodb.cc that are called by
InnoDB's C-code. */
@@ -19,4 +22,30 @@ innobase_convert_string(
CHARSET_INFO* from_cs,
uint* errors);
+/**********************************************************************
+Returns true if the thread is the replication thread on the slave
+server. Used in srv_conc_enter_innodb() to determine if the thread
+should be allowed to enter InnoDB - the replication thread is treated
+differently than other threads. Also used in
+srv_conc_force_exit_innodb(). */
+
+ibool
+thd_is_replication_slave_thread(
+/*============================*/
+ /* out: true if thd is the replication thread */
+ void* thd); /* in: thread handle (THD*) */
+
+/**********************************************************************
+Returns true if the transaction this thread is processing has edited
+non-transactional tables. Used by the deadlock detector when deciding
+which transaction to rollback in case of a deadlock - we try to avoid
+rolling back transactions that have edited non-transactional tables. */
+
+ibool
+thd_has_edited_nontrans_tables(
+/*===========================*/
+ /* out: true if non-transactional tables have
+ been edited */
+ void* thd); /* in: thread handle (THD*) */
+
#endif
diff --git a/storage/innobase/include/os0file.h b/storage/innobase/include/os0file.h
index 5ffcdf7e58c..9eb44d3f4a8 100644
--- a/storage/innobase/include/os0file.h
+++ b/storage/innobase/include/os0file.h
@@ -94,7 +94,8 @@ log. */
#define OS_FILE_PATH_ERROR 74
#define OS_FILE_AIO_RESOURCES_RESERVED 75 /* wait for OS aio resources
to become available again */
-#define OS_FILE_ERROR_NOT_SPECIFIED 76
+#define OS_FILE_SHARING_VIOLATION 76
+#define OS_FILE_ERROR_NOT_SPECIFIED 77
/* Types for aio operations */
#define OS_FILE_READ 10
diff --git a/storage/innobase/include/rem0rec.ic b/storage/innobase/include/rem0rec.ic
index 90a35af74dc..95aa65fabba 100644
--- a/storage/innobase/include/rem0rec.ic
+++ b/storage/innobase/include/rem0rec.ic
@@ -795,7 +795,8 @@ UNIV_INLINE
void
rec_offs_set_n_alloc(
/*=================*/
- ulint* offsets, /* in: array for rec_get_offsets() */
+ ulint* offsets, /* out: array for rec_get_offsets(),
+ must be allocated */
ulint n_alloc) /* in: number of elements */
{
ut_ad(offsets);
@@ -1282,7 +1283,8 @@ UNIV_INLINE
void
rec_offs_set_n_fields(
/*==================*/
- ulint* offsets, /* in: array returned by rec_get_offsets() */
+ ulint* offsets, /* in/out: array returned by
+ rec_get_offsets() */
ulint n_fields) /* in: number of fields */
{
ut_ad(offsets);
diff --git a/storage/innobase/include/row0mysql.h b/storage/innobase/include/row0mysql.h
index 1448efe94fe..bda3494073f 100644
--- a/storage/innobase/include/row0mysql.h
+++ b/storage/innobase/include/row0mysql.h
@@ -460,6 +460,19 @@ row_check_table_for_mysql(
/* out: DB_ERROR or DB_SUCCESS */
row_prebuilt_t* prebuilt); /* in: prebuilt struct in MySQL
handle */
+/*************************************************************************
+Get the min of the maximum possible row sizes. */
+
+ulint
+page_get_free_space_of_empty_noninline(
+/*===================================*/
+ /* out: The (approx) maximum size
+ of a row, this is a conservative
+ estimate, since the size can be
+ slightly larger depending upon
+ the ROW_FORMAT setting.*/
+ dict_table_t* table); /* in: table for which max record
+ size required.*/
/* A struct describing a place for an individual column in the MySQL
row format which is presented to the table handler in ha_innobase.
diff --git a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h
index e75c200cc3a..eeda2a7a52c 100644
--- a/storage/innobase/include/trx0trx.h
+++ b/storage/innobase/include/trx0trx.h
@@ -371,6 +371,18 @@ trx_is_interrupted(
#define trx_is_interrupted(trx) FALSE
#endif /* !UNIV_HOTBACKUP */
+/***********************************************************************
+Compares the "weight" (or size) of two transactions. The weight of one
+transaction is estimated as the number of altered rows + the number of
+locked rows. Transactions that have edited non-transactional tables are
+considered heavier than ones that have not. */
+
+int
+trx_weight_cmp(
+/*===========*/
+ /* out: <0, 0 or >0; similar to strcmp(3) */
+ trx_t* a, /* in: the first transaction to be compared */
+ trx_t* b); /* in: the second transaction to be compared */
/* Signal to a transaction */
struct trx_sig_struct{
@@ -453,7 +465,8 @@ struct trx_struct{
dulint table_id; /* table id if the preceding field is
TRUE */
/*------------------------------*/
- int active_trans; /* 1 - if a transaction in MySQL
+ unsigned duplicates:2; /* TRX_DUP_IGNORE | TRX_DUP_REPLACE */
+ unsigned active_trans:2; /* 1 - if a transaction in MySQL
is active. 2 - if prepare_commit_mutex
was taken */
void* mysql_thd; /* MySQL thread handle corresponding
@@ -610,7 +623,7 @@ struct trx_struct{
NULL */
ibool was_chosen_as_deadlock_victim;
/* when the transaction decides to wait
- for a lock, this it sets this to FALSE;
+ for a lock, it sets this to FALSE;
if another transaction chooses this
transaction as a victim in deadlock
resolution, it sets this to TRUE */
@@ -651,7 +664,12 @@ struct trx_struct{
cannot be any activity in the undo
logs! */
dulint undo_no; /* next undo log record number to
- assign */
+ assign; since the undo log is
+ private for a transaction, this
+ is a simple ascending sequence
+ with no gaps; thus it represents
+ the number of modified/inserted
+ rows in a transaction */
trx_savept_t last_sql_stat_start;
/* undo_no when the last sql statement
was started: in case of an error, trx
@@ -681,19 +699,19 @@ struct trx_struct{
single operation of a
transaction, e.g., a parallel
query */
-/* Transaction concurrency states */
+/* Transaction concurrency states (trx->conc_state) */
#define TRX_NOT_STARTED 1
#define TRX_ACTIVE 2
#define TRX_COMMITTED_IN_MEMORY 3
#define TRX_PREPARED 4 /* Support for 2PC/XA */
-/* Transaction execution states when trx state is TRX_ACTIVE */
+/* Transaction execution states when trx->conc_state == TRX_ACTIVE */
#define TRX_QUE_RUNNING 1 /* transaction is running */
#define TRX_QUE_LOCK_WAIT 2 /* transaction is waiting for a lock */
#define TRX_QUE_ROLLING_BACK 3 /* transaction is rolling back */
#define TRX_QUE_COMMITTING 4 /* transaction is committing */
-/* Transaction isolation levels */
+/* Transaction isolation levels (trx->isolation_level) */
#define TRX_ISO_READ_UNCOMMITTED 1 /* dirty read: non-locking
SELECTs are performed so that
we do not look at a possible
@@ -728,6 +746,12 @@ struct trx_struct{
converted to LOCK IN SHARE
MODE reads */
+/* Treatment of duplicate values (trx->duplicates; for example, in inserts).
+Multiple flags can be combined with bitwise OR. */
+#define TRX_DUP_IGNORE 1 /* duplicate rows are to be updated */
+#define TRX_DUP_REPLACE 2 /* duplicate rows are to be replaced */
+
+
/* Types of a trx signal */
#define TRX_SIG_NO_SIGNAL 100
#define TRX_SIG_TOTAL_ROLLBACK 1
diff --git a/storage/innobase/include/trx0undo.h b/storage/innobase/include/trx0undo.h
index 87849ab42c3..f53c6b01be4 100644
--- a/storage/innobase/include/trx0undo.h
+++ b/storage/innobase/include/trx0undo.h
@@ -222,13 +222,16 @@ trx_undo_lists_init(
Assigns an undo log for a transaction. A new undo log is created or a cached
undo log reused. */
-trx_undo_t*
+ulint
trx_undo_assign_undo(
/*=================*/
- /* out: the undo log, NULL if did not succeed: out of
- space */
- trx_t* trx, /* in: transaction */
- ulint type); /* in: TRX_UNDO_INSERT or TRX_UNDO_UPDATE */
+ /* out: DB_SUCCESS if undo log assign
+ * successful, possible error codes are:
+ * ER_TOO_MANY_CONCURRENT_TRXS
+ * DB_OUT_OF_FILE_SPAC
+ * DB_OUT_OF_MEMORY */
+ trx_t* trx, /* in: transaction */
+ ulint type); /* in: TRX_UNDO_INSERT or TRX_UNDO_UPDATE */
/**********************************************************************
Sets the state of the undo log segment at a transaction finish. */
diff --git a/storage/innobase/include/ut0ut.h b/storage/innobase/include/ut0ut.h
index 8bfc1edd323..825c10d5f11 100644
--- a/storage/innobase/include/ut0ut.h
+++ b/storage/innobase/include/ut0ut.h
@@ -121,6 +121,11 @@ ut_2_power_up(
/* out: first power of 2 which is >= n */
ulint n) /* in: number != 0 */
__attribute__((const));
+
+/* Determine how many bytes (groups of 8 bits) are needed to
+store the given number of bits. */
+#define UT_BITS_IN_BYTES(b) (((b) + 7) / 8)
+
/****************************************************************
Sort function for ulint arrays. */
diff --git a/storage/innobase/lock/Makefile.am b/storage/innobase/lock/Makefile.am
deleted file mode 100644
index 4c6caa49853..00000000000
--- a/storage/innobase/lock/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-include ../include/Makefile.i
-
-noinst_LIBRARIES = liblock.a
-
-liblock_a_SOURCES = lock0lock.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/lock/lock0lock.c b/storage/innobase/lock/lock0lock.c
index 93a43d9a30f..6f5390145b5 100644
--- a/storage/innobase/lock/lock0lock.c
+++ b/storage/innobase/lock/lock0lock.c
@@ -3174,7 +3174,8 @@ lock_deadlock_occurs(
ulint ret;
ulint cost = 0;
- ut_ad(trx && lock);
+ ut_ad(trx);
+ ut_ad(lock);
ut_ad(mutex_own(&kernel_mutex));
retry:
/* We check that adding this trx to the waits-for graph
@@ -3246,7 +3247,9 @@ lock_deadlock_recursive(
trx_t* lock_trx;
ulint ret;
- ut_a(trx && start && wait_lock);
+ ut_a(trx);
+ ut_a(start);
+ ut_a(wait_lock);
ut_ad(mutex_own(&kernel_mutex));
if (trx->deadlock_mark == 1) {
@@ -3357,8 +3360,8 @@ lock_deadlock_recursive(
return(LOCK_VICTIM_IS_START);
}
- if (ut_dulint_cmp(wait_lock->trx->undo_no,
- start->undo_no) >= 0) {
+ if (trx_weight_cmp(wait_lock->trx,
+ start) >= 0) {
/* Our recursion starting point
transaction is 'smaller', let us
choose 'start' as the victim and roll
@@ -4423,12 +4426,9 @@ lock_table_queue_validate(
dict_table_t* table) /* in: table */
{
lock_t* lock;
- ibool is_waiting;
ut_ad(mutex_own(&kernel_mutex));
- is_waiting = FALSE;
-
lock = UT_LIST_GET_FIRST(table->locks);
while (lock) {
@@ -4438,13 +4438,10 @@ lock_table_queue_validate(
if (!lock_get_wait(lock)) {
- ut_a(!is_waiting);
-
ut_a(!lock_table_other_has_incompatible(
lock->trx, 0, table,
lock_get_mode(lock)));
} else {
- is_waiting = TRUE;
ut_a(lock_table_has_to_wait_in_queue(lock));
}
diff --git a/storage/innobase/log/Makefile.am b/storage/innobase/log/Makefile.am
deleted file mode 100644
index a40572a64da..00000000000
--- a/storage/innobase/log/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-include ../include/Makefile.i
-
-noinst_LIBRARIES = liblog.a
-
-liblog_a_SOURCES = log0log.c log0recv.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/log/log0log.c b/storage/innobase/log/log0log.c
index e9dedf6aac4..b10c348b24d 100644
--- a/storage/innobase/log/log0log.c
+++ b/storage/innobase/log/log0log.c
@@ -3039,10 +3039,22 @@ loop:
mutex_enter(&kernel_mutex);
- /* Check that there are no longer transactions. We need this wait
- even for the 'very fast' shutdown, because the InnoDB layer may have
- committed or prepared transactions and we don't want to lose
- them. */
+ /* We need the monitor threads to stop before we proceed with a
+ normal shutdown. In case of very fast shutdown, however, we can
+ proceed without waiting for monitor threads. */
+
+ if (srv_fast_shutdown < 2
+ && (srv_error_monitor_active
+ || srv_lock_timeout_and_monitor_active)) {
+
+ mutex_exit(&kernel_mutex);
+
+ goto loop;
+ }
+
+ /* Check that there are no longer transactions. We need this wait even
+ for the 'very fast' shutdown, because the InnoDB layer may have
+ committed or prepared transactions and we don't want to lose them. */
if (trx_n_mysql_transactions > 0
|| UT_LIST_GET_LEN(trx_sys->trx_list) > 0) {
@@ -3163,22 +3175,8 @@ loop:
goto loop;
}
- /* The lock timeout thread should now have exited */
-
- if (srv_lock_timeout_and_monitor_active) {
-
- goto loop;
- }
-
- /* We now let also the InnoDB error monitor thread to exit */
-
srv_shutdown_state = SRV_SHUTDOWN_LAST_PHASE;
- if (srv_error_monitor_active) {
-
- goto loop;
- }
-
/* Make some checks that the server really is quiet */
ut_a(srv_n_threads_active[SRV_MASTER] == 0);
ut_a(buf_all_freed());
diff --git a/storage/innobase/mach/Makefile.am b/storage/innobase/mach/Makefile.am
deleted file mode 100644
index 1a59cb3e4d7..00000000000
--- a/storage/innobase/mach/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-include ../include/Makefile.i
-
-noinst_LIBRARIES = libmach.a
-
-libmach_a_SOURCES = mach0data.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/mem/Makefile.am b/storage/innobase/mem/Makefile.am
deleted file mode 100644
index 598dbb96124..00000000000
--- a/storage/innobase/mem/Makefile.am
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-include ../include/Makefile.i
-
-noinst_LIBRARIES = libmem.a
-
-libmem_a_SOURCES = mem0mem.c mem0pool.c
-
-EXTRA_DIST = mem0dbg.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/mtr/Makefile.am b/storage/innobase/mtr/Makefile.am
deleted file mode 100644
index 80eb7c907be..00000000000
--- a/storage/innobase/mtr/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-include ../include/Makefile.i
-
-noinst_LIBRARIES = libmtr.a
-
-libmtr_a_SOURCES = mtr0mtr.c mtr0log.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/os/Makefile.am b/storage/innobase/os/Makefile.am
deleted file mode 100644
index d5c45eba54e..00000000000
--- a/storage/innobase/os/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003-2004 MySQL AB & Innobase Oy
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-include ../include/Makefile.i
-
-noinst_LIBRARIES = libos.a
-
-libos_a_SOURCES = os0proc.c os0sync.c os0thread.c os0file.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c
index c18ba047d4e..f496e1127ce 100644
--- a/storage/innobase/os/os0file.c
+++ b/storage/innobase/os/os0file.c
@@ -250,6 +250,15 @@ os_file_get_last_error(
"InnoDB: the directory. It may also be"
" you have created a subdirectory\n"
"InnoDB: of the same name as a data file.\n");
+ } else if (err == ERROR_SHARING_VIOLATION
+ || err == ERROR_LOCK_VIOLATION) {
+ fprintf(stderr,
+ "InnoDB: The error means that another program"
+ " is using InnoDB's files.\n"
+ "InnoDB: This might be a backup or antivirus"
+ " software or another instance\n"
+ "InnoDB: of MySQL."
+ " Please close it to get rid of this error.\n");
} else {
fprintf(stderr,
"InnoDB: Some operating system error numbers"
@@ -268,6 +277,9 @@ os_file_get_last_error(
return(OS_FILE_DISK_FULL);
} else if (err == ERROR_FILE_EXISTS) {
return(OS_FILE_ALREADY_EXISTS);
+ } else if (err == ERROR_SHARING_VIOLATION
+ || err == ERROR_LOCK_VIOLATION) {
+ return(OS_FILE_SHARING_VIOLATION);
} else {
return(100 + err);
}
@@ -388,6 +400,10 @@ os_file_handle_error_cond_exit(
|| err == OS_FILE_PATH_ERROR) {
return(FALSE);
+ } else if (err == OS_FILE_SHARING_VIOLATION) {
+
+ os_thread_sleep(10000000); /* 10 sec */
+ return(TRUE);
} else {
if (name) {
fprintf(stderr, "InnoDB: File name %s\n", name);
diff --git a/storage/innobase/page/Makefile.am b/storage/innobase/page/Makefile.am
deleted file mode 100644
index 1a5b202a2c9..00000000000
--- a/storage/innobase/page/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-include ../include/Makefile.i
-
-noinst_LIBRARIES = libpage.a
-
-libpage_a_SOURCES = page0page.c page0cur.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/pars/Makefile.am b/storage/innobase/pars/Makefile.am
deleted file mode 100644
index b10796c3d5e..00000000000
--- a/storage/innobase/pars/Makefile.am
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-include ../include/Makefile.i
-
-noinst_LIBRARIES = libpars.a
-
-noinst_HEADERS = pars0grm.h
-
-libpars_a_SOURCES = pars0grm.c lexyy.c pars0opt.c pars0pars.c pars0sym.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/plug.in b/storage/innobase/plug.in
index 59634523399..6e26a7d3376 100644
--- a/storage/innobase/plug.in
+++ b/storage/innobase/plug.in
@@ -2,6 +2,7 @@ MYSQL_STORAGE_ENGINE(innobase, innodb, [InnoDB Storage Engine],
[Transactional Tables using InnoDB], [max,max-no-ndb])
MYSQL_PLUGIN_DIRECTORY(innobase, [storage/innobase])
MYSQL_PLUGIN_STATIC(innobase, [libinnobase.a])
+MYSQL_PLUGIN_DYNAMIC(innobase, [ha_innodb.la])
MYSQL_PLUGIN_ACTIONS(innobase, [
AC_CHECK_LIB(rt, aio_read, [innodb_system_libs="-lrt"])
AC_SUBST(innodb_system_libs)
@@ -38,37 +39,5 @@ MYSQL_PLUGIN_ACTIONS(innobase, [
openbsd*)
CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";;
esac
- AC_CONFIG_FILES(
- storage/innobase/ut/Makefile
- storage/innobase/btr/Makefile
- storage/innobase/buf/Makefile
- storage/innobase/data/Makefile
- storage/innobase/dict/Makefile
- storage/innobase/dyn/Makefile
- storage/innobase/eval/Makefile
- storage/innobase/fil/Makefile
- storage/innobase/fsp/Makefile
- storage/innobase/fut/Makefile
- storage/innobase/ha/Makefile
- storage/innobase/ibuf/Makefile
- storage/innobase/lock/Makefile
- storage/innobase/log/Makefile
- storage/innobase/mach/Makefile
- storage/innobase/mem/Makefile
- storage/innobase/mtr/Makefile
- storage/innobase/os/Makefile
- storage/innobase/page/Makefile
- storage/innobase/pars/Makefile
- storage/innobase/que/Makefile
- storage/innobase/read/Makefile
- storage/innobase/rem/Makefile
- storage/innobase/row/Makefile
- storage/innobase/srv/Makefile
- storage/innobase/sync/Makefile
- storage/innobase/thr/Makefile
- storage/innobase/trx/Makefile
- storage/innobase/handler/Makefile
- storage/innobase/usr/Makefile)
])
-MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS(innobase, [handler/ha_innodb.cc])
diff --git a/storage/innobase/que/Makefile.am b/storage/innobase/que/Makefile.am
deleted file mode 100644
index 73f3fb07af4..00000000000
--- a/storage/innobase/que/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-include ../include/Makefile.i
-
-noinst_LIBRARIES = libque.a
-
-libque_a_SOURCES = que0que.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/read/Makefile.am b/storage/innobase/read/Makefile.am
deleted file mode 100644
index 1e56a9716c3..00000000000
--- a/storage/innobase/read/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-include ../include/Makefile.i
-
-noinst_LIBRARIES = libread.a
-
-libread_a_SOURCES = read0read.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/rem/Makefile.am b/storage/innobase/rem/Makefile.am
deleted file mode 100644
index 1026172b815..00000000000
--- a/storage/innobase/rem/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-include ../include/Makefile.i
-
-noinst_LIBRARIES = librem.a
-
-librem_a_SOURCES = rem0rec.c rem0cmp.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/rem/rem0rec.c b/storage/innobase/rem/rem0rec.c
index 549b5ee8b28..3bc73eca9ea 100644
--- a/storage/innobase/rem/rem0rec.c
+++ b/storage/innobase/rem/rem0rec.c
@@ -153,7 +153,6 @@ static
void
rec_init_offsets(
/*=============*/
- /* out: the offsets */
rec_t* rec, /* in: physical record */
dict_index_t* index, /* in: record descriptor */
ulint* offsets)/* in/out: array of offsets;
@@ -189,7 +188,7 @@ rec_init_offsets(
}
nulls = rec - (REC_N_NEW_EXTRA_BYTES + 1);
- lens = nulls - (index->n_nullable + 7) / 8;
+ lens = nulls - UT_BITS_IN_BYTES(index->n_nullable);
offs = 0;
null_mask = 1;
@@ -304,7 +303,7 @@ rec_get_offsets_func(
/* out: the new offsets */
rec_t* rec, /* in: physical record */
dict_index_t* index, /* in: record descriptor */
- ulint* offsets,/* in: array consisting of offsets[0]
+ ulint* offsets,/* in/out: array consisting of offsets[0]
allocated elements, or an array from
rec_get_offsets(), or NULL */
ulint n_fields,/* in: maximum number of initialized fields
@@ -440,7 +439,7 @@ rec_get_converted_size_new(
dtuple_t* dtuple) /* in: data tuple */
{
ulint size = REC_N_NEW_EXTRA_BYTES
- + (index->n_nullable + 7) / 8;
+ + UT_BITS_IN_BYTES(index->n_nullable);
ulint i;
ulint n_fields;
ut_ad(index && dtuple);
@@ -459,10 +458,10 @@ rec_get_converted_size_new(
break;
case REC_STATUS_INFIMUM:
case REC_STATUS_SUPREMUM:
- /* infimum or supremum record, 8 bytes */
- return(size + 8); /* no extra data needed */
+ /* infimum or supremum record, 8 data bytes */
+ return(REC_N_NEW_EXTRA_BYTES + 8);
default:
- ut_a(0);
+ ut_error;
return(ULINT_UNDEFINED);
}
@@ -476,21 +475,31 @@ rec_get_converted_size_new(
len = dtuple_get_nth_field(dtuple, i)->len;
col = dict_field_get_col(field);
- ut_ad(len != UNIV_SQL_NULL || !(col->prtype & DATA_NOT_NULL));
+ ut_ad(dict_col_type_assert_equal(
+ col, dfield_get_type(dtuple_get_nth_field(
+ dtuple, i))));
if (len == UNIV_SQL_NULL) {
/* No length is stored for NULL fields. */
+ ut_ad(!(col->prtype & DATA_NOT_NULL));
continue;
}
ut_ad(len <= col->len || col->mtype == DATA_BLOB);
- ut_ad(!field->fixed_len || len == field->fixed_len);
if (field->fixed_len) {
+ ut_ad(len == field->fixed_len);
+ /* dict_index_add_col() should guarantee this */
+ ut_ad(!field->prefix_len
+ || field->fixed_len == field->prefix_len);
} else if (len < 128
|| (col->len < 256 && col->mtype != DATA_BLOB)) {
size++;
} else {
+ /* For variable-length columns, we look up the
+ maximum length from the column itself. If this
+ is a prefix index column shorter than 256 bytes,
+ this will waste one byte. */
size += 2;
}
size += len;
@@ -586,7 +595,7 @@ rec_set_nth_field_extern_bit_new(
we do not write to log about the change */
{
byte* nulls = rec - (REC_N_NEW_EXTRA_BYTES + 1);
- byte* lens = nulls - (index->n_nullable + 7) / 8;
+ byte* lens = nulls - UT_BITS_IN_BYTES(index->n_nullable);
ulint i;
ulint n_fields;
ulint null_mask = 1;
@@ -875,7 +884,7 @@ rec_convert_dtuple_to_rec_new(
/* Calculate the offset of the origin in the physical record.
We must loop over all fields to do this. */
- rec += (index->n_nullable + 7) / 8;
+ rec += UT_BITS_IN_BYTES(index->n_nullable);
for (i = 0; i < n_fields; i++) {
if (UNIV_UNLIKELY(i == n_node_ptr_field)) {
@@ -892,6 +901,11 @@ rec_convert_dtuple_to_rec_new(
len = dfield_get_len(field);
fixed_len = dict_index_get_nth_field(index, i)->fixed_len;
+ ut_ad(dict_col_type_assert_equal(
+ dict_field_get_col(dict_index_get_nth_field(
+ index, i)),
+ dfield_get_type(field)));
+
if (!(dtype_get_prtype(type) & DATA_NOT_NULL)) {
if (len == UNIV_SQL_NULL)
continue;
@@ -915,7 +929,7 @@ rec_convert_dtuple_to_rec_new(
init:
end = rec;
nulls = rec - (REC_N_NEW_EXTRA_BYTES + 1);
- lens = nulls - (index->n_nullable + 7) / 8;
+ lens = nulls - UT_BITS_IN_BYTES(index->n_nullable);
/* clear the SQL-null flags */
memset (lens + 1, 0, nulls - lens);
@@ -1172,7 +1186,7 @@ rec_copy_prefix_to_buf(
}
nulls = rec - (REC_N_NEW_EXTRA_BYTES + 1);
- lens = nulls - (index->n_nullable + 7) / 8;
+ lens = nulls - UT_BITS_IN_BYTES(index->n_nullable);
UNIV_PREFETCH_R(lens);
prefix_len = 0;
null_mask = 1;
diff --git a/storage/innobase/row/Makefile.am b/storage/innobase/row/Makefile.am
deleted file mode 100644
index 6c1f960055d..00000000000
--- a/storage/innobase/row/Makefile.am
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-include ../include/Makefile.i
-
-noinst_LIBRARIES = librow.a
-
-librow_a_SOURCES = row0ins.c row0mysql.c row0purge.c row0row.c row0sel.c\
- row0uins.c row0umod.c row0undo.c row0upd.c row0vers.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/row/row0ins.c b/storage/innobase/row/row0ins.c
index 1fba0abcdaf..ad14b927170 100644
--- a/storage/innobase/row/row0ins.c
+++ b/storage/innobase/row/row0ins.c
@@ -51,21 +51,6 @@ innobase_invalidate_query_cache(
ulint full_name_len); /* in: full name length where also the null
chars count */
-/**********************************************************************
-This function returns true if
-
-1) SQL-query in the current thread
-is either REPLACE or LOAD DATA INFILE REPLACE.
-
-2) SQL-query in the current thread
-is INSERT ON DUPLICATE KEY UPDATE.
-
-NOTE that /mysql/innobase/row/row0ins.c must contain the
-prototype for this function ! */
-
-ibool
-innobase_query_is_update(void);
-
/*************************************************************************
Creates an insert node struct. */
@@ -448,7 +433,11 @@ row_ins_cascade_calc_update_vec(
ulint i;
ulint j;
- ut_a(node && foreign && cascade && table && index);
+ ut_a(node);
+ ut_a(foreign);
+ ut_a(cascade);
+ ut_a(table);
+ ut_a(index);
/* Calculate the appropriate update vector which will set the fields
in the child index record to the same value (possibly padded with
@@ -791,7 +780,10 @@ row_ins_foreign_check_on_constraint(
trx_t* trx;
mem_heap_t* tmp_heap = NULL;
- ut_a(thr && foreign && pcur && mtr);
+ ut_a(thr);
+ ut_a(foreign);
+ ut_a(pcur);
+ ut_a(mtr);
trx = thr_get_trx(thr);
@@ -1308,7 +1300,8 @@ run_again:
goto exit_func;
}
- ut_a(check_table && check_index);
+ ut_a(check_table);
+ ut_a(check_index);
if (check_table != table) {
/* We already have a LOCK_IX on table, but not necessarily
@@ -1336,11 +1329,9 @@ run_again:
/* Scan index records and check if there is a matching record */
for (;;) {
- page_t* page;
rec = btr_pcur_get_rec(&pcur);
- page = buf_frame_align(rec);
- if (rec == page_get_infimum_rec(page)) {
+ if (page_rec_is_infimum(rec)) {
goto next_rec;
}
@@ -1348,7 +1339,7 @@ run_again:
offsets = rec_get_offsets(rec, check_index,
offsets, ULINT_UNDEFINED, &heap);
- if (rec == page_get_supremum_rec(page)) {
+ if (page_rec_is_supremum(rec)) {
err = row_ins_set_shared_rec_lock(
LOCK_ORDINARY, rec, check_index, offsets, thr);
@@ -1654,6 +1645,7 @@ row_ins_scan_sec_index_for_duplicate(
btr_pcur_t pcur;
ulint err = DB_SUCCESS;
ibool moved;
+ unsigned allow_duplicates;
mtr_t mtr;
mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE];
@@ -1684,12 +1676,14 @@ row_ins_scan_sec_index_for_duplicate(
btr_pcur_open(index, entry, PAGE_CUR_GE, BTR_SEARCH_LEAF, &pcur, &mtr);
+ allow_duplicates = thr_get_trx(thr)->duplicates & TRX_DUP_IGNORE;
+
/* Scan index records and check if there is a duplicate */
for (;;) {
rec = btr_pcur_get_rec(&pcur);
- if (rec == page_get_infimum_rec(buf_frame_align(rec))) {
+ if (page_rec_is_infimum(rec)) {
goto next_rec;
}
@@ -1697,7 +1691,7 @@ row_ins_scan_sec_index_for_duplicate(
offsets = rec_get_offsets(rec, index, offsets,
ULINT_UNDEFINED, &heap);
- if (innobase_query_is_update()) {
+ if (allow_duplicates) {
/* If the SQL-query will update or replace
duplicate key we will take X-lock for
@@ -1826,7 +1820,7 @@ row_ins_duplicate_error_in_clust(
sure that in roll-forward we get the same duplicate
errors as in original execution */
- if (innobase_query_is_update()) {
+ if (trx->duplicates & TRX_DUP_IGNORE) {
/* If the SQL-query will update or replace
duplicate key we will take X-lock for
@@ -1864,7 +1858,7 @@ row_ins_duplicate_error_in_clust(
offsets = rec_get_offsets(rec, cursor->index, offsets,
ULINT_UNDEFINED, &heap);
- if (innobase_query_is_update()) {
+ if (trx->duplicates & TRX_DUP_IGNORE) {
/* If the SQL-query will update or replace
duplicate key we will take X-lock for
diff --git a/storage/innobase/row/row0mysql.c b/storage/innobase/row/row0mysql.c
index 7c9427db0d2..9f88fd8040b 100644
--- a/storage/innobase/row/row0mysql.c
+++ b/storage/innobase/row/row0mysql.c
@@ -476,7 +476,8 @@ handle_new_error:
/* MySQL will roll back the latest SQL statement */
} else if (err == DB_ROW_IS_REFERENCED
|| err == DB_NO_REFERENCED_ROW
- || err == DB_CANNOT_ADD_CONSTRAINT) {
+ || err == DB_CANNOT_ADD_CONSTRAINT
+ || err == DB_TOO_MANY_CONCURRENT_TRXS) {
if (savept) {
/* Roll back the latest, possibly incomplete
insertion or update */
@@ -4058,3 +4059,25 @@ row_check_table_for_mysql(
return(ret);
}
+
+/*************************************************************************
+Get the maximum row size. */
+
+ulint
+page_get_free_space_of_empty_noninline(
+/*===================================*/
+ /* out: The (approx) maximum size
+ of a row, this is a conservative
+ estimate, since the size can be
+ slightly larger depending upon
+ the ROW_FORMAT setting.*/
+ dict_table_t* table) /* in: table for which max record
+ size is required.*/
+{
+ ibool compact;
+
+ compact = dict_table_is_comp(table);
+
+ return(page_get_free_space_of_empty(compact) / 2);
+}
+
diff --git a/storage/innobase/row/row0row.c b/storage/innobase/row/row0row.c
index efa129d6211..08e50817db9 100644
--- a/storage/innobase/row/row0row.c
+++ b/storage/innobase/row/row0row.c
@@ -142,20 +142,15 @@ row_build_index_entry(
dfield_copy(dfield, dfield2);
/* If a column prefix index, take only the prefix */
- if (ind_field->prefix_len) {
- if (dfield_get_len(dfield2) != UNIV_SQL_NULL) {
+ if (ind_field->prefix_len > 0
+ && dfield_get_len(dfield2) != UNIV_SQL_NULL) {
- storage_len = dtype_get_at_most_n_mbchars(
- col->prtype,
- col->mbminlen, col->mbmaxlen,
- ind_field->prefix_len,
- dfield_get_len(dfield2),
- dfield2->data);
-
- dfield_set_len(dfield, storage_len);
- }
+ storage_len = dtype_get_at_most_n_mbchars(
+ col->prtype, col->mbminlen, col->mbmaxlen,
+ ind_field->prefix_len,
+ dfield_get_len(dfield2), dfield2->data);
- dfield_get_type(dfield)->len = ind_field->prefix_len;
+ dfield_set_len(dfield, storage_len);
}
}
@@ -478,7 +473,9 @@ row_build_row_ref_in_tuple(
ulint* offsets = offsets_;
*offsets_ = (sizeof offsets_) / sizeof *offsets_;
- ut_a(ref && index && rec);
+ ut_a(ref);
+ ut_a(index);
+ ut_a(rec);
if (UNIV_UNLIKELY(!index->table)) {
fputs("InnoDB: table ", stderr);
diff --git a/storage/innobase/row/row0sel.c b/storage/innobase/row/row0sel.c
index a3199055b54..e70b3b8671f 100644
--- a/storage/innobase/row/row0sel.c
+++ b/storage/innobase/row/row0sel.c
@@ -3619,6 +3619,32 @@ shortcut_fails_too_big_rec:
pcur, 0, &mtr);
pcur->trx_if_known = trx;
+
+ rec = btr_pcur_get_rec(pcur);
+
+ if (!moves_up
+ && !page_rec_is_supremum(rec)
+ && set_also_gap_locks
+ && !(srv_locks_unsafe_for_binlog
+ || trx->isolation_level == TRX_ISO_READ_COMMITTED)
+ && prebuilt->select_lock_type != LOCK_NONE) {
+
+ /* Try to place a gap lock on the next index record
+ to prevent phantoms in ORDER BY ... DESC queries */
+
+ offsets = rec_get_offsets(page_rec_get_next(rec),
+ index, offsets,
+ ULINT_UNDEFINED, &heap);
+ err = sel_set_rec_lock(page_rec_get_next(rec),
+ index, offsets,
+ prebuilt->select_lock_type,
+ LOCK_GAP, thr);
+
+ if (err != DB_SUCCESS) {
+
+ goto lock_wait_or_error;
+ }
+ }
} else {
if (mode == PAGE_CUR_G) {
btr_pcur_open_at_index_side(
diff --git a/storage/innobase/srv/Makefile.am b/storage/innobase/srv/Makefile.am
deleted file mode 100644
index e0b5b911b04..00000000000
--- a/storage/innobase/srv/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003-2004 MySQL AB & Innobase Oy
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-include ../include/Makefile.i
-
-noinst_LIBRARIES = libsrv.a
-
-libsrv_a_SOURCES = srv0srv.c srv0que.c srv0start.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
index 72e8fe751d0..8f8c9386f41 100644
--- a/storage/innobase/srv/srv0srv.c
+++ b/storage/innobase/srv/srv0srv.c
@@ -47,6 +47,7 @@ Created 10/8/1995 Heikki Tuuri
#include "dict0boot.h"
#include "srv0start.h"
#include "row0mysql.h"
+#include "ha_prototypes.h"
/* This is set to TRUE if the MySQL user has set it in MySQL; currently
affects only FOREIGN KEY definition parsing */
@@ -180,6 +181,16 @@ dulint srv_archive_recovery_limit_lsn;
ulint srv_lock_wait_timeout = 1024 * 1024 * 1024;
+/* This parameter is used to throttle the number of insert buffers that are
+merged in a batch. By increasing this parameter on a faster disk you can
+possibly reduce the number of I/O operations performed to complete the
+merge operation. The value of this parameter is used as is by the
+background loop when the system is idle (low load), on a busy system
+the parameter is scaled down by a factor of 4, this is to avoid putting
+a heavier load on the I/O sub system. */
+
+ulong srv_insert_buffer_batch_size = 20;
+
char* srv_file_flush_method_str = NULL;
ulint srv_unix_file_flush_method = SRV_UNIX_FDATASYNC;
ulint srv_win_file_flush_method = SRV_WIN_IO_UNBUFFERED;
@@ -977,6 +988,17 @@ srv_conc_enter_innodb(
srv_conc_slot_t* slot = NULL;
ulint i;
+ if (trx->mysql_thd != NULL
+ && thd_is_replication_slave_thread(trx->mysql_thd)) {
+
+ /* TODO Do something more interesting (based on a config
+ parameter). Some users what to give the replication
+ thread very low priority, see http://bugs.mysql.com/25078
+ This can be done by introducing
+ innodb_replication_delay(ms) config parameter */
+ return;
+ }
+
/* If trx has 'free tickets' to enter the engine left, then use one
such ticket */
@@ -1017,7 +1039,7 @@ retry:
if (!has_slept && !trx->has_search_latch
&& NULL == UT_LIST_GET_FIRST(trx->trx_locks)) {
- has_slept = TRUE; /* We let is sleep only once to avoid
+ has_slept = TRUE; /* We let it sleep only once to avoid
starvation */
srv_conc_n_waiting_threads++;
@@ -1130,7 +1152,7 @@ srv_conc_force_enter_innodb(
srv_conc_n_threads++;
trx->declared_to_be_inside_innodb = TRUE;
- trx->n_tickets_to_enter_innodb = 0;
+ trx->n_tickets_to_enter_innodb = 1;
os_fast_mutex_unlock(&srv_conc_mutex);
}
@@ -1152,6 +1174,12 @@ srv_conc_force_exit_innodb(
return;
}
+ if (trx->mysql_thd != NULL
+ && thd_is_replication_slave_thread(trx->mysql_thd)) {
+
+ return;
+ }
+
if (trx->declared_to_be_inside_innodb == FALSE) {
return;
@@ -1853,6 +1881,7 @@ srv_lock_timeout_and_monitor_thread(
double time_elapsed;
time_t current_time;
time_t last_table_monitor_time;
+ time_t last_tablespace_monitor_time;
time_t last_monitor_time;
ibool some_waits;
double wait_time;
@@ -1865,6 +1894,7 @@ srv_lock_timeout_and_monitor_thread(
UT_NOT_USED(arg);
srv_last_monitor_time = time(NULL);
last_table_monitor_time = time(NULL);
+ last_tablespace_monitor_time = time(NULL);
last_monitor_time = time(NULL);
loop:
srv_lock_timeout_and_monitor_active = TRUE;
@@ -1901,9 +1931,9 @@ loop:
}
if (srv_print_innodb_tablespace_monitor
- && difftime(current_time, last_table_monitor_time) > 60) {
-
- last_table_monitor_time = time(NULL);
+ && difftime(current_time,
+ last_tablespace_monitor_time) > 60) {
+ last_tablespace_monitor_time = time(NULL);
fputs("========================"
"========================\n",
@@ -2100,7 +2130,7 @@ loop:
os_thread_sleep(2000000);
- if (srv_shutdown_state < SRV_SHUTDOWN_LAST_PHASE) {
+ if (srv_shutdown_state < SRV_SHUTDOWN_CLEANUP) {
goto loop;
}
@@ -2270,7 +2300,8 @@ loop:
+ buf_pool->n_pages_written;
if (n_pend_ios < 3 && (n_ios - n_ios_old < 5)) {
srv_main_thread_op_info = "doing insert buffer merge";
- ibuf_contract_for_n_pages(TRUE, 5);
+ ibuf_contract_for_n_pages(
+ TRUE, srv_insert_buffer_batch_size / 4);
srv_main_thread_op_info = "flushing log";
@@ -2331,7 +2362,7 @@ loop:
even if the server were active */
srv_main_thread_op_info = "doing insert buffer merge";
- ibuf_contract_for_n_pages(TRUE, 5);
+ ibuf_contract_for_n_pages(TRUE, srv_insert_buffer_batch_size / 4);
srv_main_thread_op_info = "flushing log";
log_buffer_flush_to_disk();
@@ -2469,7 +2500,8 @@ background_loop:
if (srv_fast_shutdown && srv_shutdown_state > 0) {
n_bytes_merged = 0;
} else {
- n_bytes_merged = ibuf_contract_for_n_pages(TRUE, 20);
+ n_bytes_merged = ibuf_contract_for_n_pages(
+ TRUE, srv_insert_buffer_batch_size);
}
srv_main_thread_op_info = "reserving kernel mutex";
diff --git a/storage/innobase/srv/srv0start.c b/storage/innobase/srv/srv0start.c
index 25f6f05e878..dac84e1410d 100644
--- a/storage/innobase/srv/srv0start.c
+++ b/storage/innobase/srv/srv0start.c
@@ -1025,6 +1025,12 @@ innobase_start_or_create_for_mysql(void)
"InnoDB: !!!!!!!! UNIV_DEBUG switched on !!!!!!!!!\n");
#endif
+#ifdef UNIV_IBUF_DEBUG
+ fprintf(stderr,
+ "InnoDB: !!!!!!!! UNIV_IBUF_DEBUG switched on !!!!!!!!!\n"
+ "InnoDB: Crash recovery will fail with UNIV_IBUF_DEBUG\n");
+#endif
+
#ifdef UNIV_SYNC_DEBUG
fprintf(stderr,
"InnoDB: !!!!!!!! UNIV_SYNC_DEBUG switched on !!!!!!!!!\n");
diff --git a/storage/innobase/sync/Makefile.am b/storage/innobase/sync/Makefile.am
deleted file mode 100644
index 7cf274b64e8..00000000000
--- a/storage/innobase/sync/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003-2004 MySQL AB & Innobase Oy
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-include ../include/Makefile.i
-
-noinst_LIBRARIES = libsync.a
-
-libsync_a_SOURCES = sync0arr.c sync0rw.c sync0sync.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/sync/sync0arr.c b/storage/innobase/sync/sync0arr.c
index e45cd48a6b4..82b08a890e0 100644
--- a/storage/innobase/sync/sync0arr.c
+++ b/storage/innobase/sync/sync0arr.c
@@ -670,7 +670,9 @@ sync_array_detect_deadlock(
ibool ret;
rw_lock_debug_t*debug;
- ut_a(arr && start && cell);
+ ut_a(arr);
+ ut_a(start);
+ ut_a(cell);
ut_ad(cell->wait_object);
ut_ad(os_thread_get_curr_id() == start->thread);
ut_ad(depth < 100);
diff --git a/storage/innobase/thr/Makefile.am b/storage/innobase/thr/Makefile.am
deleted file mode 100644
index febcdf3e1a3..00000000000
--- a/storage/innobase/thr/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-include ../include/Makefile.i
-
-noinst_LIBRARIES = libthr.a
-
-libthr_a_SOURCES = thr0loc.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/trx/Makefile.am b/storage/innobase/trx/Makefile.am
deleted file mode 100644
index f9722454ef5..00000000000
--- a/storage/innobase/trx/Makefile.am
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-include ../include/Makefile.i
-
-noinst_LIBRARIES = libtrx.a
-
-libtrx_a_SOURCES = trx0purge.c trx0rec.c trx0roll.c trx0rseg.c\
- trx0sys.c trx0trx.c trx0undo.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/trx/trx0rec.c b/storage/innobase/trx/trx0rec.c
index 69e858fe71d..50f8b011463 100644
--- a/storage/innobase/trx/trx0rec.c
+++ b/storage/innobase/trx/trx0rec.c
@@ -1024,6 +1024,7 @@ trx_undo_report_row_operation(
ibool is_insert;
trx_rseg_t* rseg;
mtr_t mtr;
+ ulint err = DB_SUCCESS;
mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_;
@@ -1035,7 +1036,7 @@ trx_undo_report_row_operation(
*roll_ptr = ut_dulint_zero;
- return(DB_SUCCESS);
+ return(err);
}
ut_ad(thr);
@@ -1053,7 +1054,7 @@ trx_undo_report_row_operation(
if (trx->insert_undo == NULL) {
- trx_undo_assign_undo(trx, TRX_UNDO_INSERT);
+ err = trx_undo_assign_undo(trx, TRX_UNDO_INSERT);
}
undo = trx->insert_undo;
@@ -1063,7 +1064,7 @@ trx_undo_report_row_operation(
if (trx->update_undo == NULL) {
- trx_undo_assign_undo(trx, TRX_UNDO_UPDATE);
+ err = trx_undo_assign_undo(trx, TRX_UNDO_UPDATE);
}
@@ -1071,11 +1072,11 @@ trx_undo_report_row_operation(
is_insert = FALSE;
}
- if (undo == NULL) {
- /* Did not succeed: out of space */
+ if (err != DB_SUCCESS) {
+ /* Did not succeed: return the error encountered */
mutex_exit(&(trx->undo_mutex));
- return(DB_OUT_OF_FILE_SPACE);
+ return(err);
}
page_no = undo->last_page_no;
@@ -1107,7 +1108,9 @@ trx_undo_report_row_operation(
if (offset == 0) {
/* The record did not fit on the page. We erase the
end segment of the undo log page and write a log
- record of it to to ensure deterministic contents. */
+ record of it: this is to ensure that in the debug
+ version the replicate page constructed using the log
+ records stays identical to the original page */
trx_undo_erase_page_end(undo_page, &mtr);
}
@@ -1163,7 +1166,7 @@ trx_undo_report_row_operation(
if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
- return(DB_SUCCESS);
+ return(err);
}
/*============== BUILDING PREVIOUS VERSION OF A RECORD ===============*/
diff --git a/storage/innobase/trx/trx0trx.c b/storage/innobase/trx/trx0trx.c
index cdea3e9c477..2d5ce0e1c61 100644
--- a/storage/innobase/trx/trx0trx.c
+++ b/storage/innobase/trx/trx0trx.c
@@ -25,6 +25,7 @@ Created 3/26/1996 Heikki Tuuri
#include "btr0sea.h"
#include "os0proc.h"
#include "trx0xa.h"
+#include "ha_prototypes.h"
/* Copy of the prototype for innobase_mysql_print_thd: this
copy MUST be equal to the one in mysql/sql/ha_innodb.cc ! */
@@ -130,6 +131,8 @@ trx_create(
trx->mysql_thd = NULL;
trx->mysql_query_str = NULL;
+ trx->active_trans = 0;
+ trx->duplicates = 0;
trx->n_mysql_tables_in_use = 0;
trx->mysql_n_tables_locked = 0;
@@ -1771,6 +1774,61 @@ trx_print(
}
}
+/***********************************************************************
+Compares the "weight" (or size) of two transactions. The weight of one
+transaction is estimated as the number of altered rows + the number of
+locked rows. Transactions that have edited non-transactional tables are
+considered heavier than ones that have not. */
+
+int
+trx_weight_cmp(
+/*===========*/
+ /* out: <0, 0 or >0; similar to strcmp(3) */
+ trx_t* a, /* in: the first transaction to be compared */
+ trx_t* b) /* in: the second transaction to be compared */
+{
+ ibool a_notrans_edit;
+ ibool b_notrans_edit;
+
+ /* If mysql_thd is NULL for a transaction we assume that it has
+ not edited non-transactional tables. */
+
+ a_notrans_edit = a->mysql_thd != NULL
+ && thd_has_edited_nontrans_tables(a->mysql_thd);
+
+ b_notrans_edit = b->mysql_thd != NULL
+ && thd_has_edited_nontrans_tables(b->mysql_thd);
+
+ if (a_notrans_edit && !b_notrans_edit) {
+
+ return(1);
+ }
+
+ if (!a_notrans_edit && b_notrans_edit) {
+
+ return(-1);
+ }
+
+ /* Either both had edited non-transactional tables or both had
+ not, we fall back to comparing the number of altered/locked
+ rows. */
+
+#if 0
+ fprintf(stderr,
+ "%s TRX_WEIGHT(a): %lld+%lu, TRX_WEIGHT(b): %lld+%lu\n",
+ __func__,
+ ut_conv_dulint_to_longlong(a->undo_no),
+ UT_LIST_GET_LEN(a->trx_locks),
+ ut_conv_dulint_to_longlong(b->undo_no),
+ UT_LIST_GET_LEN(b->trx_locks));
+#endif
+
+#define TRX_WEIGHT(t) \
+ ut_dulint_add((t)->undo_no, UT_LIST_GET_LEN((t)->trx_locks))
+
+ return(ut_dulint_cmp(TRX_WEIGHT(a), TRX_WEIGHT(b)));
+}
+
/********************************************************************
Prepares a transaction. */
@@ -1889,7 +1947,7 @@ Does the transaction prepare for MySQL. */
ulint
trx_prepare_for_mysql(
-/*====-=============*/
+/*==================*/
/* out: 0 or error number */
trx_t* trx) /* in: trx handle */
{
diff --git a/storage/innobase/trx/trx0undo.c b/storage/innobase/trx/trx0undo.c
index 831e337f513..64e5ad3c9a8 100644
--- a/storage/innobase/trx/trx0undo.c
+++ b/storage/innobase/trx/trx0undo.c
@@ -373,26 +373,31 @@ trx_undo_page_init(
/*******************************************************************
Creates a new undo log segment in file. */
static
-page_t*
+ulint
trx_undo_seg_create(
/*================*/
- /* out: segment header page x-latched, NULL
- if no space left */
+ /* out: DB_SUCCESS if page creation OK
+ possible error codes are:
+ DB_TOO_MANY_CONCURRENT_TRXS
+ DB_OUT_OF_FILE_SPACE */
trx_rseg_t* rseg __attribute__((unused)),/* in: rollback segment */
trx_rsegf_t* rseg_hdr,/* in: rollback segment header, page
x-latched */
ulint type, /* in: type of the segment: TRX_UNDO_INSERT or
TRX_UNDO_UPDATE */
ulint* id, /* out: slot index within rseg header */
+ page_t** undo_page,
+ /* out: segment header page x-latched, NULL
+ if there was an error */
mtr_t* mtr) /* in: mtr */
{
ulint slot_no;
ulint space;
- page_t* undo_page;
trx_upagef_t* page_hdr;
trx_usegf_t* seg_hdr;
ulint n_reserved;
ibool success;
+ ulint err = DB_SUCCESS;
ut_ad(mtr && id && rseg_hdr);
ut_ad(mutex_own(&(rseg->mutex)));
@@ -410,7 +415,7 @@ trx_undo_seg_create(
"InnoDB: many active transactions"
" running concurrently?\n");
- return(NULL);
+ return(DB_TOO_MANY_CONCURRENT_TRXS);
}
space = buf_frame_get_space_id(rseg_hdr);
@@ -419,30 +424,30 @@ trx_undo_seg_create(
mtr);
if (!success) {
- return(NULL);
+ return(DB_OUT_OF_FILE_SPACE);
}
/* Allocate a new file segment for the undo log */
- undo_page = fseg_create_general(space, 0,
+ *undo_page = fseg_create_general(space, 0,
TRX_UNDO_SEG_HDR
+ TRX_UNDO_FSEG_HEADER, TRUE, mtr);
fil_space_release_free_extents(space, n_reserved);
- if (undo_page == NULL) {
+ if (*undo_page == NULL) {
/* No space left */
- return(NULL);
+ return(DB_OUT_OF_FILE_SPACE);
}
#ifdef UNIV_SYNC_DEBUG
- buf_page_dbg_add_level(undo_page, SYNC_TRX_UNDO_PAGE);
+ buf_page_dbg_add_level(*undo_page, SYNC_TRX_UNDO_PAGE);
#endif /* UNIV_SYNC_DEBUG */
- page_hdr = undo_page + TRX_UNDO_PAGE_HDR;
- seg_hdr = undo_page + TRX_UNDO_SEG_HDR;
+ page_hdr = *undo_page + TRX_UNDO_PAGE_HDR;
+ seg_hdr = *undo_page + TRX_UNDO_SEG_HDR;
- trx_undo_page_init(undo_page, type, mtr);
+ trx_undo_page_init(*undo_page, type, mtr);
mlog_write_ulint(page_hdr + TRX_UNDO_PAGE_FREE,
TRX_UNDO_SEG_HDR + TRX_UNDO_SEG_HDR_SIZE,
@@ -456,10 +461,11 @@ trx_undo_seg_create(
page_hdr + TRX_UNDO_PAGE_NODE, mtr);
trx_rsegf_set_nth_undo(rseg_hdr, slot_no,
- buf_frame_get_page_no(undo_page), mtr);
+ buf_frame_get_page_no(*undo_page), mtr);
+
*id = slot_no;
- return(undo_page);
+ return(err);
}
/**************************************************************************
@@ -1387,6 +1393,11 @@ trx_undo_mem_create(
undo = mem_alloc(sizeof(trx_undo_t));
+ if (undo == NULL) {
+
+ return NULL;
+ }
+
undo->id = id;
undo->type = type;
undo->state = TRX_UNDO_ACTIVE;
@@ -1464,11 +1475,15 @@ trx_undo_mem_free(
/**************************************************************************
Creates a new undo log. */
static
-trx_undo_t*
+ulint
trx_undo_create(
/*============*/
- /* out: undo log object, NULL if did not
- succeed: out of space */
+ /* out: DB_SUCCESS if successful in creating
+ the new undo lob object, possible error
+ codes are:
+ DB_TOO_MANY_CONCURRENT_TRXS
+ DB_OUT_OF_FILE_SPACE
+ DB_OUT_OF_MEMORY*/
trx_t* trx, /* in: transaction */
trx_rseg_t* rseg, /* in: rollback segment memory copy */
ulint type, /* in: type of the log: TRX_UNDO_INSERT or
@@ -1476,34 +1491,37 @@ trx_undo_create(
dulint trx_id, /* in: id of the trx for which the undo log
is created */
XID* xid, /* in: X/Open transaction identification*/
+ trx_undo_t** undo, /* out: the new undo log object, undefined
+ * if did not succeed */
mtr_t* mtr) /* in: mtr */
{
trx_rsegf_t* rseg_header;
ulint page_no;
ulint offset;
ulint id;
- trx_undo_t* undo;
page_t* undo_page;
+ ulint err;
ut_ad(mutex_own(&(rseg->mutex)));
if (rseg->curr_size == rseg->max_size) {
- return(NULL);
+ return(DB_OUT_OF_FILE_SPACE);
}
rseg->curr_size++;
rseg_header = trx_rsegf_get(rseg->space, rseg->page_no, mtr);
- undo_page = trx_undo_seg_create(rseg, rseg_header, type, &id, mtr);
+ err = trx_undo_seg_create(rseg, rseg_header, type, &id,
+ &undo_page, mtr);
- if (undo_page == NULL) {
+ if (err != DB_SUCCESS) {
/* Did not succeed */
rseg->curr_size--;
- return(NULL);
+ return(err);
}
page_no = buf_frame_get_page_no(undo_page);
@@ -1515,9 +1533,14 @@ trx_undo_create(
undo_page + offset, mtr);
}
- undo = trx_undo_mem_create(rseg, id, type, trx_id, xid,
+ *undo = trx_undo_mem_create(rseg, id, type, trx_id, xid,
page_no, offset);
- return(undo);
+ if (*undo == NULL) {
+
+ err = DB_OUT_OF_MEMORY;
+ }
+
+ return(err);
}
/*================ UNDO LOG ASSIGNMENT AND CLEANUP =====================*/
@@ -1634,17 +1657,20 @@ trx_undo_mark_as_dict_operation(
Assigns an undo log for a transaction. A new undo log is created or a cached
undo log reused. */
-trx_undo_t*
+ulint
trx_undo_assign_undo(
/*=================*/
- /* out: the undo log, NULL if did not succeed: out of
- space */
- trx_t* trx, /* in: transaction */
- ulint type) /* in: TRX_UNDO_INSERT or TRX_UNDO_UPDATE */
+ /* out: DB_SUCCESS if undo log assign
+ successful, possible error codes are:
+ DD_TOO_MANY_CONCURRENT_TRXS
+ DB_OUT_OF_FILE_SPACE DB_OUT_OF_MEMORY*/
+ trx_t* trx, /* in: transaction */
+ ulint type) /* in: TRX_UNDO_INSERT or TRX_UNDO_UPDATE */
{
trx_rseg_t* rseg;
trx_undo_t* undo;
mtr_t mtr;
+ ulint err = DB_SUCCESS;
ut_ad(trx);
ut_ad(trx->rseg);
@@ -1662,15 +1688,11 @@ trx_undo_assign_undo(
undo = trx_undo_reuse_cached(trx, rseg, type, trx->id, &trx->xid,
&mtr);
if (undo == NULL) {
- undo = trx_undo_create(trx, rseg, type, trx->id, &trx->xid,
- &mtr);
- if (undo == NULL) {
- /* Did not succeed */
+ err = trx_undo_create(trx, rseg, type, trx->id, &trx->xid,
+ &undo, &mtr);
+ if (err != DB_SUCCESS) {
- mutex_exit(&(rseg->mutex));
- mtr_commit(&mtr);
-
- return(NULL);
+ goto func_exit;
}
}
@@ -1688,10 +1710,11 @@ trx_undo_assign_undo(
trx_undo_mark_as_dict_operation(trx, undo, &mtr);
}
+func_exit:
mutex_exit(&(rseg->mutex));
mtr_commit(&mtr);
- return(undo);
+ return err;
}
/**********************************************************************
diff --git a/storage/innobase/usr/Makefile.am b/storage/innobase/usr/Makefile.am
deleted file mode 100644
index ea485022f71..00000000000
--- a/storage/innobase/usr/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-include ../include/Makefile.i
-
-noinst_LIBRARIES = libusr.a
-
-libusr_a_SOURCES = usr0sess.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/ut/Makefile.am b/storage/innobase/ut/Makefile.am
deleted file mode 100644
index d79184759c1..00000000000
--- a/storage/innobase/ut/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-include ../include/Makefile.i
-
-noinst_LIBRARIES = libut.a
-
-libut_a_SOURCES = ut0byte.c ut0dbg.c ut0mem.c ut0rnd.c ut0ut.c ut0vec.c ut0list.c ut0wqueue.c
-
-EXTRA_PROGRAMS =
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/innobase/ut/ut0ut.c b/storage/innobase/ut/ut0ut.c
index bc6778f4c2f..389063ad821 100644
--- a/storage/innobase/ut/ut0ut.c
+++ b/storage/innobase/ut/ut0ut.c
@@ -14,6 +14,7 @@ Created 5/11/1994 Heikki Tuuri
#include <stdarg.h>
#include <string.h>
+#include <ctype.h>
#include "ut0sort.h"
#include "trx0trx.h"
diff --git a/storage/myisam/ft_boolean_search.c b/storage/myisam/ft_boolean_search.c
index f38561a76dd..c881f7a7480 100644
--- a/storage/myisam/ft_boolean_search.c
+++ b/storage/myisam/ft_boolean_search.c
@@ -23,8 +23,14 @@
inside plus subtree. max_docid could be used by any word in plus
subtree, but it could be updated by plus-word only.
+ Fulltext "smarter index merge" optimization assumes that rows
+ it gets are ordered by doc_id. That is not the case when we
+ search for a word with truncation operator. It may return
+ rows in random order. Thus we may not use "smarter index merge"
+ optimization with "trunc-words".
+
The idea is: there is no need to search for docid smaller than
- biggest docid inside current plus subtree.
+ biggest docid inside current plus subtree or any upper plus subtree.
Examples:
+word1 word2
@@ -36,6 +42,13 @@
+(word1 -word2) +(+word3 word4)
share same max_docid
max_docid updated by word3
+ +word1 word2 (+word3 word4 (+word5 word6))
+ three subexpressions (including the top-level one),
+ every one has its own max_docid, updated by its plus word.
+ but for the search word6 uses
+ max(word1.max_docid, word3.max_docid, word5.max_docid),
+ while word4 uses, accordingly,
+ max(word1.max_docid, word3.max_docid).
*/
#define FT_CORE
@@ -104,7 +117,7 @@ typedef struct st_ftb_word
/* ^^^^^^^^^^^^^^^^^^ FTB_{EXPR,WORD} common section */
my_off_t docid[2]; /* for index search and for scan */
my_off_t key_root;
- my_off_t *max_docid;
+ FTB_EXPR *max_docid_expr;
MI_KEYDEF *keyinfo;
struct st_ftb_word *prev;
float weight;
@@ -208,7 +221,7 @@ static int ftb_query_add_word(MYSQL_FTPARSER_PARAM *param,
for (tmp_expr= ftb_param->ftbe; tmp_expr->up; tmp_expr= tmp_expr->up)
if (! (tmp_expr->flags & FTB_FLAG_YES))
break;
- ftbw->max_docid= &tmp_expr->max_docid;
+ ftbw->max_docid_expr= tmp_expr;
/* fall through */
case FT_TOKEN_STOPWORD:
if (! ftb_param->up_quot) break;
@@ -347,11 +360,17 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
else
{
uint sflag= SEARCH_BIGGER;
- if (ftbw->docid[0] < *ftbw->max_docid)
+ my_off_t max_docid=0;
+ FTB_EXPR *tmp;
+
+ for (tmp= ftbw->max_docid_expr; tmp; tmp= tmp->up)
+ set_if_bigger(max_docid, tmp->max_docid);
+
+ if (ftbw->docid[0] < max_docid)
{
sflag|= SEARCH_SAME;
_mi_dpointer(info, (uchar *)(ftbw->word + ftbw->len + HA_FT_WLEN),
- *ftbw->max_docid);
+ max_docid);
}
r=_mi_search(info, ftbw->keyinfo, (uchar*) lastkey_buf,
USE_WHOLE_KEY, sflag, ftbw->key_root);
@@ -430,8 +449,8 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
memcpy(lastkey_buf+off, info->lastkey, info->lastkey_length);
}
ftbw->docid[0]=info->lastpos;
- if (ftbw->flags & FTB_FLAG_YES)
- *ftbw->max_docid= info->lastpos;
+ if (ftbw->flags & FTB_FLAG_YES && !(ftbw->flags & FTB_FLAG_TRUNC))
+ ftbw->max_docid_expr->max_docid= info->lastpos;
return 0;
}
@@ -474,7 +493,8 @@ static void _ftb_init_index_search(FT_INFO *ftb)
ftbe->up->flags|= FTB_FLAG_TRUNC, ftbe=ftbe->up)
{
if (ftbe->flags & FTB_FLAG_NO || /* 2 */
- ftbe->up->ythresh - ftbe->up->yweaks >1) /* 1 */
+ ftbe->up->ythresh - ftbe->up->yweaks >
+ (uint) test(ftbe->flags & FTB_FLAG_YES)) /* 1 */
{
FTB_EXPR *top_ftbe=ftbe->up;
ftbw->docid[0]=HA_OFFSET_ERROR;
diff --git a/storage/myisam/ft_parser.c b/storage/myisam/ft_parser.c
index ba858c37aee..befe2bab066 100644
--- a/storage/myisam/ft_parser.c
+++ b/storage/myisam/ft_parser.c
@@ -111,7 +111,8 @@ uchar ft_get_word(CHARSET_INFO *cs, uchar **start, uchar *end,
{
uchar *doc=*start;
int ctype;
- uint mwc, length, mbl;
+ uint mwc, length;
+ int mbl;
param->yesno=(FTB_YES==' ') ? 1 : (param->quot != 0);
param->weight_adjust= param->wasign= 0;
@@ -119,7 +120,7 @@ uchar ft_get_word(CHARSET_INFO *cs, uchar **start, uchar *end,
while (doc<end)
{
- for (; doc < end; doc+= (mbl > 0 ? mbl : 1))
+ for (; doc < end; doc+= (mbl > 0 ? mbl : (mbl < 0 ? -mbl : 1)))
{
mbl= cs->cset->ctype(cs, &ctype, (uchar*)doc, (uchar*)end);
if (true_word_char(ctype, *doc))
@@ -157,7 +158,8 @@ uchar ft_get_word(CHARSET_INFO *cs, uchar **start, uchar *end,
}
mwc=length=0;
- for (word->pos= doc; doc < end; length++, doc+= (mbl > 0 ? mbl : 1))
+ for (word->pos= doc; doc < end; length++,
+ doc+= (mbl > 0 ? mbl : (mbl < 0 ? -mbl : 1)))
{
mbl= cs->cset->ctype(cs, &ctype, (uchar*)doc, (uchar*)end);
if (true_word_char(ctype, *doc))
@@ -200,13 +202,14 @@ uchar ft_simple_get_word(CHARSET_INFO *cs, uchar **start, const uchar *end,
FT_WORD *word, my_bool skip_stopwords)
{
uchar *doc= *start;
- uint mwc, length, mbl;
+ uint mwc, length;
+ int mbl;
int ctype;
DBUG_ENTER("ft_simple_get_word");
do
{
- for (;; doc+= (mbl > 0 ? mbl : 1))
+ for (;; doc+= (mbl > 0 ? mbl : (mbl < 0 ? -mbl : 1)))
{
if (doc >= end)
DBUG_RETURN(0);
@@ -216,7 +219,8 @@ uchar ft_simple_get_word(CHARSET_INFO *cs, uchar **start, const uchar *end,
}
mwc= length= 0;
- for (word->pos= doc; doc < end; length++, doc+= (mbl > 0 ? mbl : 1))
+ for (word->pos= doc; doc < end; length++,
+ doc+= (mbl > 0 ? mbl : (mbl < 0 ? -mbl : 1)))
{
mbl= cs->cset->ctype(cs, &ctype, (uchar*)doc, (uchar*)end);
if (true_word_char(ctype, *doc))
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index 98f74247707..c86459ae0a7 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -1889,6 +1889,8 @@ int ha_myisam::create(const char *name, register TABLE *table_arg,
if (ha_create_info->options & HA_LEX_CREATE_TMP_TABLE)
create_flags|= HA_CREATE_TMP_TABLE;
+ if (ha_create_info->options & HA_CREATE_KEEP_FILES)
+ create_flags|= HA_CREATE_KEEP_FILES;
if (options & HA_OPTION_PACK_RECORD)
create_flags|= HA_PACK_RECORD;
if (options & HA_OPTION_CHECKSUM)
@@ -2075,3 +2077,78 @@ mysql_declare_plugin(myisam)
}
mysql_declare_plugin_end;
+
+#ifdef HAVE_QUERY_CACHE
+/**
+ @brief Register a named table with a call back function to the query cache.
+
+ @param thd The thread handle
+ @param table_key A pointer to the table name in the table cache
+ @param key_length The length of the table name
+ @param[out] engine_callback The pointer to the storage engine call back
+ function, currently 0
+ @param[out] engine_data Engine data will be set to 0.
+
+ @note Despite the name of this function, it is used to check each statement
+ before it is cached and not to register a table or callback function.
+
+ @see handler::register_query_cache_table
+
+ @return The error code. The engine_data and engine_callback will be set to 0.
+ @retval TRUE Success
+ @retval FALSE An error occured
+*/
+
+my_bool ha_myisam::register_query_cache_table(THD *thd, char *table_name,
+ uint table_name_len,
+ qc_engine_callback
+ *engine_callback,
+ ulonglong *engine_data)
+{
+ /*
+ No call back function is needed to determine if a cached statement
+ is valid or not.
+ */
+ *engine_callback= 0;
+
+ /*
+ No engine data is needed.
+ */
+ *engine_data= 0;
+
+ /*
+ If a concurrent INSERT has happened just before the currently processed
+ SELECT statement, the total size of the table is unknown.
+
+ To determine if the table size is known, the current thread's snap shot of
+ the table size with the actual table size are compared.
+
+ If the table size is unknown the SELECT statement can't be cached.
+ */
+ ulonglong actual_data_file_length;
+ ulonglong current_data_file_length;
+
+ /*
+ POSIX visibility rules specify that "2. Whatever memory values a
+ thread can see when it unlocks a mutex <...> can also be seen by any
+ thread that later locks the same mutex". In this particular case,
+ concurrent insert thread had modified the data_file_length in
+ MYISAM_SHARE before it has unlocked (or even locked)
+ structure_guard_mutex. So, here we're guaranteed to see at least that
+ value after we've locked the same mutex. We can see a later value
+ (modified by some other thread) though, but it's ok, as we only want
+ to know if the variable was changed, the actual new value doesn't matter
+ */
+ actual_data_file_length= file->s->state.state.data_file_length;
+ current_data_file_length= file->save_state.data_file_length;
+
+ if (current_data_file_length != actual_data_file_length)
+ {
+ /* Don't cache current statement. */
+ return FALSE;
+ }
+
+ /* It is ok to try to cache current statement. */
+ return TRUE;
+}
+#endif
diff --git a/storage/myisam/ha_myisam.h b/storage/myisam/ha_myisam.h
index 6cc9f4811b0..024675075c2 100644
--- a/storage/myisam/ha_myisam.h
+++ b/storage/myisam/ha_myisam.h
@@ -137,4 +137,11 @@ class ha_myisam: public handler
int dump(THD* thd, int fd);
int net_read_dump(NET* net);
#endif
+#ifdef HAVE_QUERY_CACHE
+ my_bool register_query_cache_table(THD *thd, char *table_key,
+ uint key_length,
+ qc_engine_callback
+ *engine_callback,
+ ulonglong *engine_data);
+#endif
};
diff --git a/storage/myisam/mi_create.c b/storage/myisam/mi_create.c
index c177aa8d987..0cac5f08b3b 100644
--- a/storage/myisam/mi_create.c
+++ b/storage/myisam/mi_create.c
@@ -615,7 +615,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
(have_iext ? MY_REPLACE_EXT : MY_APPEND_EXT));
linkname_ptr=0;
/* Replace the current file */
- create_flag=MY_DELETE_OLD;
+ create_flag=(flags & HA_CREATE_KEEP_FILES) ? 0 : MY_DELETE_OLD;
}
/*
@@ -689,7 +689,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
fn_format(filename,name,"", MI_NAME_DEXT,
MY_UNPACK_FILENAME | MY_APPEND_EXT);
linkname_ptr=0;
- create_flag=MY_DELETE_OLD;
+ create_flag=(flags & HA_CREATE_KEEP_FILES) ? 0 : MY_DELETE_OLD;
}
if ((dfile=
my_create_with_symlink(linkname_ptr, filename, 0, create_mode,
diff --git a/storage/myisam/sp_key.c b/storage/myisam/sp_key.c
index be4021935c4..3748a38ff81 100644
--- a/storage/myisam/sp_key.c
+++ b/storage/myisam/sp_key.c
@@ -31,11 +31,6 @@ static int sp_get_geometry_mbr(uchar *(*wkb), uchar *end, uint n_dims,
double *mbr, int top);
static int sp_mbr_from_wkb(uchar (*wkb), uint size, uint n_dims, double *mbr);
-static void get_double(double *d, const uchar *pos)
-{
- float8get(*d, pos);
-}
-
uint sp_make_key(register MI_INFO *info, uint keynr, uchar *key,
const uchar *record, my_off_t filepos)
{
@@ -62,48 +57,40 @@ uint sp_make_key(register MI_INFO *info, uint keynr, uchar *key,
for (i = 0, keyseg = keyinfo->seg; keyseg->type; keyseg++, i++)
{
- uint length = keyseg->length;
+ uint length = keyseg->length, start= keyseg->start;
+ double val;
+
+ DBUG_ASSERT(length == sizeof(double));
+ DBUG_ASSERT(!(start % sizeof(double)));
+ DBUG_ASSERT(start < sizeof(mbr));
+ DBUG_ASSERT(keyseg->type == HA_KEYTYPE_DOUBLE);
- pos = ((uchar*)mbr) + keyseg->start;
- if (keyseg->flag & HA_SWAP_KEY)
- {
+ val= mbr[start / sizeof (double)];
#ifdef HAVE_ISNAN
- if (keyseg->type == HA_KEYTYPE_FLOAT)
- {
- float nr;
- float4get(nr, pos);
- if (isnan(nr))
- {
- /* Replace NAN with zero */
- bzero(key, length);
- key+= length;
- continue;
- }
- }
- else if (keyseg->type == HA_KEYTYPE_DOUBLE)
- {
- double nr;
- get_double(&nr, pos);
- if (isnan(nr))
- {
- bzero(key, length);
- key+= length;
- continue;
- }
- }
+ if (isnan(val))
+ {
+ bzero(key, length);
+ key+= length;
+ len+= length;
+ continue;
+ }
#endif
- pos += length;
- while (length--)
- {
+
+ if (keyseg->flag & HA_SWAP_KEY)
+ {
+ uchar buf[sizeof(double)];
+
+ float8store(buf, val);
+ pos= &buf[length];
+ while (pos > buf)
*key++ = *--pos;
- }
}
else
{
- memcpy((uchar*)key, pos, length);
- key += keyseg->length;
+ float8store((uchar *)key, val);
+ key += length;
}
- len += keyseg->length;
+ len+= length;
}
_mi_dpointer(info, key, filepos);
return len;
@@ -141,13 +128,13 @@ static int sp_add_point_to_mbr(uchar *(*wkb), uchar *end, uint n_dims,
{
if ((*wkb) > end - 8)
return -1;
- get_double(&ord, (const uchar*) *wkb);
+ float8get(ord, (const uchar*) *wkb);
(*wkb)+= 8;
if (ord < *mbr)
- float8store((char*) mbr, ord);
+ *mbr= ord;
mbr++;
if (ord > *mbr)
- float8store((char*) mbr, ord);
+ *mbr= ord;
mbr++;
}
return 0;
diff --git a/storage/ndb/include/ndb_version.h.in b/storage/ndb/include/ndb_version.h.in
index 9e1edeecd1e..5405ad4d7aa 100644
--- a/storage/ndb/include/ndb_version.h.in
+++ b/storage/ndb/include/ndb_version.h.in
@@ -16,8 +16,7 @@
#ifndef NDB_VERSION_H
#define NDB_VERSION_H
-#include <ndb_global.h>
-#include <version.h>
+#include <ndb_types.h>
/* NDB build version */
#define NDB_VERSION_BUILD @NDB_VERSION_BUILD@
@@ -32,19 +31,35 @@
#define NDB_VERSION_STATUS "@NDB_VERSION_STATUS@"
-#define MAKE_VERSION(A,B,C) (((A) << 16) | ((B) << 8) | ((C) << 0))
+#define NDB_MAKE_VERSION(A,B,C) (((A) << 16) | ((B) << 8) | ((C) << 0))
-#define NDB_VERSION_D MAKE_VERSION(NDB_VERSION_MAJOR, NDB_VERSION_MINOR, NDB_VERSION_BUILD)
+#define NDB_VERSION_D NDB_MAKE_VERSION(NDB_VERSION_MAJOR, NDB_VERSION_MINOR, NDB_VERSION_BUILD)
#define NDB_VERSION_STRING_BUF_SZ 100
#ifdef __cplusplus
-extern "C"
-#else
-extern
+extern "C" {
#endif
-char ndb_version_string_buf[NDB_VERSION_STRING_BUF_SZ];
-#define NDB_VERSION_STRING (getVersionString(NDB_VERSION, NDB_VERSION_STATUS, \
- ndb_version_string_buf, \
- sizeof(ndb_version_string_buf)))
+
+void ndbPrintVersion();
+
+Uint32 ndbMakeVersion(Uint32 major, Uint32 minor, Uint32 build);
+
+Uint32 ndbGetMajor(Uint32 version);
+
+Uint32 ndbGetMinor(Uint32 version);
+
+Uint32 ndbGetBuild(Uint32 version);
+
+const char* ndbGetVersionString(Uint32 version, const char * status,
+ char *buf, unsigned sz);
+const char* ndbGetOwnVersionString();
+
+Uint32 ndbGetOwnVersion();
+
+#ifdef __cplusplus
+}
+#endif
+
+#define NDB_VERSION_STRING ndbGetOwnVersionString()
#define NDB_VERSION ndbGetOwnVersion()
@@ -59,19 +74,19 @@ char ndb_version_string_buf[NDB_VERSION_STRING_BUF_SZ];
/**
* From which version do we support rowid
*/
-#define NDBD_ROWID_VERSION (MAKE_VERSION(5,1,6))
-#define NDBD_INCL_NODECONF_VERSION_4 MAKE_VERSION(4,1,17)
-#define NDBD_INCL_NODECONF_VERSION_5 MAKE_VERSION(5,0,18)
-#define NDBD_FRAGID_VERSION (MAKE_VERSION(5,1,6))
-#define NDBD_DICT_LOCK_VERSION_5 MAKE_VERSION(5,0,23)
-#define NDBD_DICT_LOCK_VERSION_5_1 MAKE_VERSION(5,1,12)
+#define NDBD_ROWID_VERSION (NDB_MAKE_VERSION(5,1,6))
+#define NDBD_INCL_NODECONF_VERSION_4 NDB_MAKE_VERSION(4,1,17)
+#define NDBD_INCL_NODECONF_VERSION_5 NDB_MAKE_VERSION(5,0,18)
+#define NDBD_FRAGID_VERSION (NDB_MAKE_VERSION(5,1,6))
+#define NDBD_DICT_LOCK_VERSION_5 NDB_MAKE_VERSION(5,0,23)
+#define NDBD_DICT_LOCK_VERSION_5_1 NDB_MAKE_VERSION(5,1,12)
-#define NDBD_UPDATE_FRAG_DIST_KEY_50 MAKE_VERSION(5,0,26)
-#define NDBD_UPDATE_FRAG_DIST_KEY_51 MAKE_VERSION(5,1,12)
+#define NDBD_UPDATE_FRAG_DIST_KEY_50 NDB_MAKE_VERSION(5,0,26)
+#define NDBD_UPDATE_FRAG_DIST_KEY_51 NDB_MAKE_VERSION(5,1,12)
-#define NDBD_QMGR_SINGLEUSER_VERSION_5 MAKE_VERSION(5,0,25)
+#define NDBD_QMGR_SINGLEUSER_VERSION_5 NDB_MAKE_VERSION(5,0,25)
-#define NDBD_NODE_VERSION_REP MAKE_VERSION(6,1,1)
+#define NDBD_NODE_VERSION_REP NDB_MAKE_VERSION(6,1,1)
#endif
diff --git a/storage/ndb/include/ndbapi/Ndb.hpp b/storage/ndb/include/ndbapi/Ndb.hpp
index a6a3df92ddb..4d0219d1a3c 100644
--- a/storage/ndb/include/ndbapi/Ndb.hpp
+++ b/storage/ndb/include/ndbapi/Ndb.hpp
@@ -1281,6 +1281,16 @@ public:
*/
/**
+ * Structure for passing in pointers to startTransaction
+ *
+ */
+ struct Key_part_ptr
+ {
+ const void * ptr;
+ unsigned len;
+ };
+
+ /**
* Start a transaction
*
* @note When the transaction is completed it must be closed using
@@ -1301,6 +1311,30 @@ public:
Uint32 keyLen = 0);
/**
+ * Compute hash value given table/keys
+ *
+ * @param hashvalueptr - OUT, is set to hashvalue if return value is 0
+ * @param table Pointer to table object
+ * @param keyData Null-terminated array of pointers to keyParts that is
+ * part of distribution key.
+ * Length of resp. keyPart will be read from
+ * metadata and checked against passed value
+ * @param xfrmbuf Pointer to temporary buffer that will be used
+ * to calculate hashvalue
+ * @param xfrmbuflen Lengh of buffer
+ *
+ * @note if xfrmbuf is null (default) malloc/free will be made
+ * if xfrmbuf is not null but length is too short, method will fail
+ *
+ * @return 0 - ok - hashvalueptr is set
+ * else - fail, return error code
+ */
+ static int computeHash(Uint32* hashvalueptr,
+ const NdbDictionary::Table*,
+ const struct Key_part_ptr * keyData,
+ void* xfrmbuf = 0, Uint32 xfrmbuflen = 0);
+
+ /**
* Close a transaction.
*
* @note should be called after the transaction has completed, irrespective
diff --git a/storage/ndb/include/util/version.h b/storage/ndb/include/util/version.h
index 42513d00442..9ea18ecd9d9 100644
--- a/storage/ndb/include/util/version.h
+++ b/storage/ndb/include/util/version.h
@@ -16,25 +16,18 @@
#ifndef VERSION_H
#define VERSION_H
-#include <ndb_types.h>
+#include <ndb_version.h>
+
+/* some backwards compatible macros */
+#define MAKE_VERSION(A,B,C) NDB_MAKE_VERSION(A,B,C)
+#define getMajor(a) ndbGetMajor(a)
+#define getMinor(a) ndbGetMinor(a)
+#define getBuild(a) ndbGetBuild(a)
+
#ifdef __cplusplus
extern "C" {
#endif
- Uint32 getMajor(Uint32 version);
-
- Uint32 getMinor(Uint32 version);
-
- Uint32 getBuild(Uint32 version);
-
- Uint32 makeVersion(Uint32 major, Uint32 minor, Uint32 build);
-
- const char* getVersionString(Uint32 version, const char * status,
- char *buf, unsigned sz);
-
- void ndbPrintVersion();
- Uint32 ndbGetOwnVersion();
-
int ndbCompatible_mgmt_ndb(Uint32 ownVersion, Uint32 otherVersion);
int ndbCompatible_ndb_mgmt(Uint32 ownVersion, Uint32 otherVersion);
int ndbCompatible_mgmt_api(Uint32 ownVersion, Uint32 otherVersion);
diff --git a/storage/ndb/ndbapi-examples/ndbapi_simple/ndbapi_simple.cpp b/storage/ndb/ndbapi-examples/ndbapi_simple/ndbapi_simple.cpp
index 0a4f6d92f2c..4e82fc3e42b 100644
--- a/storage/ndb/ndbapi-examples/ndbapi_simple/ndbapi_simple.cpp
+++ b/storage/ndb/ndbapi-examples/ndbapi_simple/ndbapi_simple.cpp
@@ -281,12 +281,14 @@ static void do_read(Ndb &myNdb)
if (myRecAttr == NULL) APIERROR(myTransaction->getNdbError());
if(myTransaction->execute( NdbTransaction::Commit ) == -1)
- if (i == 3) {
- std::cout << "Detected that deleted tuple doesn't exist!" << std::endl;
- } else {
- APIERROR(myTransaction->getNdbError());
- }
+ APIERROR(myTransaction->getNdbError());
+ if (myTransaction->getNdbError().classification == NdbError::NoDataFound)
+ if (i == 3)
+ std::cout << "Detected that deleted tuple doesn't exist!" << std::endl;
+ else
+ APIERROR(myTransaction->getNdbError());
+
if (i != 3) {
printf(" %2d %2d\n", i, myRecAttr->u_32_value());
}
diff --git a/storage/ndb/src/common/util/version.c b/storage/ndb/src/common/util/version.c
index f309a3d4ad5..56a92489131 100644
--- a/storage/ndb/src/common/util/version.c
+++ b/storage/ndb/src/common/util/version.c
@@ -20,26 +20,33 @@
#include <NdbEnv.h>
#include <NdbOut.hpp>
-Uint32 getMajor(Uint32 version) {
+Uint32 ndbGetMajor(Uint32 version) {
return (version >> 16) & 0xFF;
}
-Uint32 getMinor(Uint32 version) {
+Uint32 ndbGetMinor(Uint32 version) {
return (version >> 8) & 0xFF;
}
-Uint32 getBuild(Uint32 version) {
+Uint32 ndbGetBuild(Uint32 version) {
return (version >> 0) & 0xFF;
}
-Uint32 makeVersion(Uint32 major, Uint32 minor, Uint32 build) {
- return MAKE_VERSION(major, minor, build);
+Uint32 ndbMakeVersion(Uint32 major, Uint32 minor, Uint32 build) {
+ return NDB_MAKE_VERSION(major, minor, build);
}
-char ndb_version_string_buf[NDB_VERSION_STRING_BUF_SZ];
-const char * getVersionString(Uint32 version, const char * status,
- char *buf, unsigned sz)
+const char * ndbGetOwnVersionString()
+{
+ static char ndb_version_string_buf[NDB_VERSION_STRING_BUF_SZ];
+ return ndbGetVersionString(NDB_VERSION, NDB_VERSION_STATUS,
+ ndb_version_string_buf,
+ sizeof(ndb_version_string_buf));
+}
+
+const char * ndbGetVersionString(Uint32 version, const char * status,
+ char *buf, unsigned sz)
{
if (status && status[0] != 0)
basestring_snprintf(buf, sz,
diff --git a/storage/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp b/storage/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp
index 602881095c3..44326e213d0 100644
--- a/storage/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp
+++ b/storage/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp
@@ -15,7 +15,7 @@
#include <ndb_global.h>
-#include <ndb_version.h>
+#include <util/version.h>
#include <NdbMain.h>
#include <NdbOut.hpp>
diff --git a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
index e47fcf34471..efb88bfccd2 100644
--- a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
+++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
@@ -11795,7 +11795,7 @@ void Dblqh::sendLCP_COMPLETE_REP(Signal* signal, Uint32 lcpId)
sendEMPTY_LCP_CONF(signal, true);
}
- if (getNodeState().getNodeRestartInProgress())
+ if (getNodeState().getNodeRestartInProgress() && cstartRecReq != 3)
{
jam();
ndbrequire(cstartRecReq == 2);
@@ -14215,15 +14215,6 @@ void Dblqh::execSTART_RECREQ(Signal* signal)
* WE ALSO NEED TO SET CNEWEST_GCI TO ENSURE THAT LOG RECORDS ARE EXECUTED
* WITH A PROPER GCI.
*------------------------------------------------------------------------ */
- if(cstartType == NodeState::ST_INITIAL_NODE_RESTART){
- jam();
- cstartRecReq = 2;
- StartRecConf * conf = (StartRecConf*)signal->getDataPtrSend();
- conf->startingNodeId = getOwnNodeId();
- sendSignal(cmasterDihBlockref, GSN_START_RECCONF, signal,
- StartRecConf::SignalLength, JBB);
- return;
- }//if
if (c_lcp_restoring_fragments.isEmpty())
{
@@ -14276,6 +14267,19 @@ void Dblqh::execSTART_RECCONF(Signal* signal)
jam();
csrExecUndoLogState = EULS_COMPLETED;
+
+ if(cstartType == NodeState::ST_INITIAL_NODE_RESTART)
+ {
+ jam();
+ cstartRecReq = 2;
+
+ StartRecConf * conf = (StartRecConf*)signal->getDataPtrSend();
+ conf->startingNodeId = getOwnNodeId();
+ sendSignal(cmasterDihBlockref, GSN_START_RECCONF, signal,
+ StartRecConf::SignalLength, JBB);
+ return;
+ }
+
c_lcp_complete_fragments.first(fragptr);
build_acc(signal, fragptr.i);
return;
diff --git a/storage/ndb/src/kernel/blocks/diskpage.cpp b/storage/ndb/src/kernel/blocks/diskpage.cpp
index 3f98e078746..50e9b6e53cb 100644
--- a/storage/ndb/src/kernel/blocks/diskpage.cpp
+++ b/storage/ndb/src/kernel/blocks/diskpage.cpp
@@ -49,7 +49,7 @@ operator<<(NdbOut& out, const File_formats::Zero_page_header& obj)
char buf[256];
out << "page size: " << obj.m_page_size << endl;
out << "ndb version: " << obj.m_ndb_version << ", " <<
- getVersionString(obj.m_ndb_version, 0, buf, sizeof(buf)) << endl;
+ ndbGetVersionString(obj.m_ndb_version, 0, buf, sizeof(buf)) << endl;
out << "ndb node id: " << obj.m_node_id << endl;
out << "file type: " << obj.m_file_type << endl;
out << "time: " << obj.m_time << ", "
diff --git a/storage/ndb/src/kernel/blocks/lgman.cpp b/storage/ndb/src/kernel/blocks/lgman.cpp
index 25cdac89737..23738717580 100644
--- a/storage/ndb/src/kernel/blocks/lgman.cpp
+++ b/storage/ndb/src/kernel/blocks/lgman.cpp
@@ -346,6 +346,12 @@ Lgman::execCREATE_FILEGROUP_REQ(Signal* signal){
m_logfile_group_hash.add(ptr);
m_logfile_group_list.add(ptr);
+
+ if (getNodeState().getNodeRestartInProgress() ||
+ getNodeState().getSystemRestartInProgress())
+ {
+ ptr.p->m_state = Logfile_group::LG_STARTING;
+ }
CreateFilegroupImplConf* conf=
(CreateFilegroupImplConf*)signal->getDataPtr();
@@ -370,8 +376,6 @@ Lgman::execDROP_FILEGROUP_REQ(Signal* signal)
{
jamEntry();
- jamEntry();
-
Uint32 errorCode = 0;
DropFilegroupImplReq req = *(DropFilegroupImplReq*)signal->getDataPtr();
do
@@ -717,7 +721,8 @@ Lgman::create_file_commit(Signal* signal,
Uint32 senderData = ptr.p->m_create.m_senderData;
bool first= false;
- if(ptr.p->m_state == Undofile::FS_CREATING)
+ if(ptr.p->m_state == Undofile::FS_CREATING &&
+ (lg_ptr.p->m_state & Logfile_group::LG_ONLINE))
{
jam();
Local_undofile_list free(m_file_pool, lg_ptr.p->m_files);
@@ -2082,13 +2087,17 @@ Lgman::execSTART_RECREQ(Signal* signal)
void
Lgman::find_log_head(Signal* signal, Ptr<Logfile_group> ptr)
{
+ ndbrequire(ptr.p->m_state &
+ (Logfile_group::LG_STARTING | Logfile_group::LG_SORTING));
+
if(ptr.p->m_meta_files.isEmpty() && ptr.p->m_files.isEmpty())
{
jam();
/**
* Logfile_group wo/ any files
*/
-
+ ptr.p->m_state &= ~(Uint32)Logfile_group::LG_STARTING;
+ ptr.p->m_state |= Logfile_group::LG_ONLINE;
m_logfile_group_list.next(ptr);
signal->theData[0] = LgmanContinueB::FIND_LOG_HEAD;
signal->theData[1] = ptr.i;
diff --git a/storage/ndb/src/kernel/blocks/lgman.hpp b/storage/ndb/src/kernel/blocks/lgman.hpp
index b26c3219088..d2706818144 100644
--- a/storage/ndb/src/kernel/blocks/lgman.hpp
+++ b/storage/ndb/src/kernel/blocks/lgman.hpp
@@ -175,13 +175,14 @@ public:
,LG_SORTING = 0x002 // Sorting files
,LG_SEARCHING = 0x004 // Searching in last file
,LG_EXEC_THREAD = 0x008 // Execute thread is running
- ,LG_READ_THREAD = 0x010 // Read thread is running
+ ,LG_READ_THREAD = 0x010 // Read thread is running
,LG_FORCE_SYNC_THREAD = 0x020
,LG_SYNC_WAITERS_THREAD = 0x040
,LG_CUT_LOG_THREAD = 0x080
,LG_WAITERS_THREAD = 0x100
,LG_FLUSH_THREAD = 0x200
,LG_DROPPING = 0x400
+ ,LG_STARTING = 0x800
};
static const Uint32 LG_THREAD_MASK = Logfile_group::LG_FORCE_SYNC_THREAD |
diff --git a/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp b/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
index 52045fd63cd..1fba4d62e17 100644
--- a/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
+++ b/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
@@ -2793,7 +2793,7 @@ void Qmgr::execAPI_REGREQ(Signal* signal)
"incompatible with %s",
type == NodeInfo::API ? "api or mysqld" : "management server",
apiNodePtr.i,
- getVersionString(version,"",buf,sizeof(buf)),
+ ndbGetVersionString(version,"",buf,sizeof(buf)),
NDB_VERSION_STRING);
apiNodePtr.p->phase = ZAPI_INACTIVE;
sendApiRegRef(signal, ref, ApiRegRef::UnsupportedVersion);
diff --git a/storage/ndb/src/kernel/blocks/restore.cpp b/storage/ndb/src/kernel/blocks/restore.cpp
index 2d40cd79daa..efc4bc1948a 100644
--- a/storage/ndb/src/kernel/blocks/restore.cpp
+++ b/storage/ndb/src/kernel/blocks/restore.cpp
@@ -1271,7 +1271,7 @@ Restore::check_file_version(Signal* signal, Uint32 file_version)
{
char buf[255];
char verbuf[255];
- getVersionString(file_version, 0, verbuf, sizeof(verbuf));
+ ndbGetVersionString(file_version, 0, verbuf, sizeof(verbuf));
BaseString::snprintf(buf, sizeof(buf),
"Unsupported version of LCP files found on disk, "
" found: %s", verbuf);
diff --git a/storage/ndb/src/kernel/vm/SimulatedBlock.hpp b/storage/ndb/src/kernel/vm/SimulatedBlock.hpp
index a78ee21fb8f..31f219718e5 100644
--- a/storage/ndb/src/kernel/vm/SimulatedBlock.hpp
+++ b/storage/ndb/src/kernel/vm/SimulatedBlock.hpp
@@ -18,7 +18,7 @@
#include <NdbTick.h>
#include <kernel_types.h>
-#include <ndb_version.h>
+#include <util/version.h>
#include <ndb_limits.h>
#include "VMSignal.hpp"
diff --git a/storage/ndb/src/mgmsrv/ConfigInfo.cpp b/storage/ndb/src/mgmsrv/ConfigInfo.cpp
index 69907224b7f..9cbb7d93ceb 100644
--- a/storage/ndb/src/mgmsrv/ConfigInfo.cpp
+++ b/storage/ndb/src/mgmsrv/ConfigInfo.cpp
@@ -3806,16 +3806,16 @@ check_node_vs_replicas(Vector<ConfigInfo::ConfigRuleSection>&sections,
}
}
if (db_host_count > 1 && node_group_warning.length() > 0)
- ndbout_c("Cluster configuration warning:\n%s",node_group_warning.c_str());
+ ctx.reportWarning("Cluster configuration warning:\n%s",node_group_warning.c_str());
if (!with_arbitration_rank)
{
- ndbout_c("Cluster configuration warning:"
+ ctx.reportWarning("Cluster configuration warning:"
"\n Neither %s nor %s nodes are configured with arbitrator,"
"\n may cause complete cluster shutdown in case of host failure.",
MGM_TOKEN, API_TOKEN);
}
if (db_host_count > 1 && arbitration_warning.length() > 0)
- ndbout_c("Cluster configuration warning:%s%s",arbitration_warning.c_str(),
+ ctx.reportWarning("Cluster configuration warning:%s%s",arbitration_warning.c_str(),
"\n Running arbitrator on the same host as a database node may"
"\n cause complete cluster shutdown in case of host failure.");
}
diff --git a/storage/ndb/src/mgmsrv/Services.cpp b/storage/ndb/src/mgmsrv/Services.cpp
index f260ff7e3ec..9272b5ab532 100644
--- a/storage/ndb/src/mgmsrv/Services.cpp
+++ b/storage/ndb/src/mgmsrv/Services.cpp
@@ -18,7 +18,7 @@
#include <uucode.h>
#include <socket_io.h>
-#include <ndb_version.h>
+#include <util/version.h>
#include <mgmapi.h>
#include <EventLogger.hpp>
#include <signaldata/SetLogLevelOrd.hpp>
diff --git a/storage/ndb/src/ndbapi/ClusterMgr.cpp b/storage/ndb/src/ndbapi/ClusterMgr.cpp
index f51a5098c53..448bc1025e8 100644
--- a/storage/ndb/src/ndbapi/ClusterMgr.cpp
+++ b/storage/ndb/src/ndbapi/ClusterMgr.cpp
@@ -16,7 +16,7 @@
#include <ndb_global.h>
#include <my_pthread.h>
#include <ndb_limits.h>
-#include <ndb_version.h>
+#include <util/version.h>
#include "TransporterFacade.hpp"
#include "ClusterMgr.hpp"
diff --git a/storage/ndb/src/ndbapi/Ndb.cpp b/storage/ndb/src/ndbapi/Ndb.cpp
index 9b8e4e86d30..bbeeed3ae70 100644
--- a/storage/ndb/src/ndbapi/Ndb.cpp
+++ b/storage/ndb/src/ndbapi/Ndb.cpp
@@ -37,6 +37,7 @@ Name: Ndb.cpp
#include "API.hpp"
#include <NdbEnv.h>
#include <BaseString.hpp>
+#include <NdbSqlUtil.hpp>
/****************************************************************************
void connect();
@@ -304,6 +305,181 @@ Return Value: Returns a pointer to a connection object.
Return NULL otherwise.
Remark: Start transaction. Synchronous.
*****************************************************************************/
+int
+Ndb::computeHash(Uint32 *retval,
+ const NdbDictionary::Table *table,
+ const struct Key_part_ptr * keyData,
+ void* buf, Uint32 bufLen)
+{
+ Uint32 j = 0;
+ Uint32 sumlen = 0; // Needed len
+ const NdbTableImpl* impl = &NdbTableImpl::getImpl(*table);
+ const NdbColumnImpl* const * cols = impl->m_columns.getBase();
+ Uint32 len;
+ NdbTransaction* trans;
+ char* pos;
+
+ Uint32 colcnt = impl->m_columns.size();
+ Uint32 parts = impl->m_noOfDistributionKeys;
+ if (parts == 0)
+ {
+ parts = impl->m_noOfKeys;
+ }
+
+ for (Uint32 i = 0; i<parts; i++)
+ {
+ if (unlikely(keyData[i].ptr == 0))
+ goto enullptr;
+ }
+
+ if (unlikely(keyData[parts].ptr != 0))
+ goto emissingnullptr;
+
+ const NdbColumnImpl* partcols[NDB_MAX_NO_OF_ATTRIBUTES_IN_KEY];
+ for (Uint32 i = 0; i<colcnt && j < parts; i++)
+ {
+ if (cols[i]->m_distributionKey)
+ {
+ // wl3717_todo
+ // char allowed now as dist key so this case should be tested
+ partcols[j++] = cols[i];
+ }
+ }
+
+ for (Uint32 i = 0; i<parts; i++)
+ {
+ Uint32 lb, len;
+ if (unlikely(!NdbSqlUtil::get_var_length(partcols[i]->m_type,
+ keyData[i].ptr,
+ keyData[i].len,
+ lb, len)))
+ goto emalformedkey;
+
+ if (unlikely(keyData[i].len < (lb + len)))
+ goto elentosmall;
+
+ Uint32 maxlen = (partcols[i]->m_attrSize * partcols[i]->m_arraySize);
+
+ if (unlikely(lb == 0 && keyData[i].len != maxlen))
+ goto emalformedkey;
+
+ if (partcols[i]->m_cs)
+ {
+ Uint32 xmul = partcols[i]->m_cs->strxfrm_multiply;
+ xmul = xmul ? xmul : 1;
+ len = xmul * (maxlen - lb);
+ }
+
+ len = (lb + len + 3) & ~(Uint32)3;
+ sumlen += len;
+
+ }
+
+ if (buf)
+ {
+ UintPtr org = UintPtr(buf);
+ UintPtr use = (org + 7) & ~(UintPtr)7;
+
+ buf = (void*)use;
+ bufLen -= (use - org);
+
+ if (unlikely(sumlen > bufLen))
+ goto ebuftosmall;
+ }
+ else
+ {
+ buf = malloc(sumlen);
+ if (unlikely(buf == 0))
+ goto enomem;
+ bufLen = 0;
+ assert((UintPtr(buf) & 7) == 0);
+ }
+
+ pos = (char*)buf;
+ for (Uint32 i = 0; i<parts; i++)
+ {
+ Uint32 lb, len;
+ NdbSqlUtil::get_var_length(partcols[i]->m_type,
+ keyData[i].ptr, keyData[i].len, lb, len);
+ CHARSET_INFO* cs;
+ if ((cs = partcols[i]->m_cs))
+ {
+ Uint32 xmul = cs->strxfrm_multiply;
+ if (xmul == 0)
+ xmul = 1;
+ /*
+ * Varchar end-spaces are ignored in comparisons. To get same hash
+ * we blank-pad to maximum length via strnxfrm.
+ */
+ Uint32 maxlen = (partcols[i]->m_attrSize * partcols[i]->m_arraySize);
+ Uint32 dstLen = xmul * (maxlen - lb);
+ int n = NdbSqlUtil::strnxfrm_bug7284(cs,
+ (unsigned char*)pos,
+ dstLen,
+ ((unsigned char*)keyData[i].ptr)+lb,
+ len);
+
+ if (unlikely(n == -1))
+ goto emalformedstring;
+
+ while ((n & 3) != 0)
+ {
+ pos[n++] = 0;
+ }
+ pos += n;
+ }
+ else
+ {
+ len += lb;
+ memcpy(pos, keyData[i].ptr, len);
+ while (len & 3)
+ {
+ * (pos + len++) = 0;
+ }
+ pos += len;
+ }
+ }
+ len = UintPtr(pos) - UintPtr(buf);
+ assert((len & 3) == 0);
+
+ Uint32 values[4];
+ md5_hash(values, (const Uint64*)buf, len >> 2);
+
+ if (retval)
+ {
+ * retval = values[1];
+ }
+
+ if (bufLen == 0)
+ free(buf);
+
+ return 0;
+
+enullptr:
+ return 4316;
+
+emissingnullptr:
+ return 4276;
+
+elentosmall:
+ return 4277;
+
+ebuftosmall:
+ return 4278;
+
+emalformedstring:
+ if (bufLen == 0)
+ free(buf);
+
+ return 4279;
+
+emalformedkey:
+ return 4280;
+
+enomem:
+ return 4000;
+}
+
NdbTransaction*
Ndb::startTransaction(const NdbDictionary::Table *table,
const char * keyData, Uint32 keyLen)
diff --git a/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
index 63d36bf012f..ab6d90ad59e 100644
--- a/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
+++ b/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
@@ -42,7 +42,7 @@
#include <my_sys.h>
#include <NdbEnv.h>
#include <NdbMem.h>
-#include <ndb_version.h>
+#include <util/version.h>
#define DEBUG_PRINT 0
#define INCOMPATIBLE_VERSION -2
diff --git a/storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp b/storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp
index 673587b1ed7..aa9bd174471 100644
--- a/storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp
+++ b/storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp
@@ -391,7 +391,7 @@ struct NdbFileImpl : public NdbDictObjectImpl {
NdbFileImpl(NdbDictionary::Object::Type t);
Uint64 m_size;
- Uint32 m_free;
+ Uint64 m_free;
BaseString m_path;
BaseString m_filegroup_name;
Uint32 m_filegroup_id;
diff --git a/storage/ndb/tools/restore/restore_main.cpp b/storage/ndb/tools/restore/restore_main.cpp
index ec2550118d3..c12dc4dd0e8 100644
--- a/storage/ndb/tools/restore/restore_main.cpp
+++ b/storage/ndb/tools/restore/restore_main.cpp
@@ -684,7 +684,7 @@ main(int argc, char** argv)
char buf[NDB_VERSION_STRING_BUF_SZ];
info.setLevel(254);
info << "Ndb version in backup files: "
- << getVersionString(version, 0, buf, sizeof(buf)) << endl;
+ << ndbGetVersionString(version, 0, buf, sizeof(buf)) << endl;
/**
* check wheater we can restore the backup (right version).
@@ -694,9 +694,9 @@ main(int argc, char** argv)
if (version >= MAKE_VERSION(5,1,3) && version <= MAKE_VERSION(5,1,9))
{
err << "Restore program incompatible with backup versions between "
- << getVersionString(MAKE_VERSION(5,1,3), 0, buf, sizeof(buf))
+ << ndbGetVersionString(MAKE_VERSION(5,1,3), 0, buf, sizeof(buf))
<< " and "
- << getVersionString(MAKE_VERSION(5,1,9), 0, buf, sizeof(buf))
+ << ndbGetVersionString(MAKE_VERSION(5,1,9), 0, buf, sizeof(buf))
<< endl;
exitHandler(NDBT_FAILED);
}
diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c
index 9a80b932d20..6b71f29f0d2 100644
--- a/strings/ctype-simple.c
+++ b/strings/ctype-simple.c
@@ -185,7 +185,7 @@ int my_strnncollsp_simple(CHARSET_INFO * cs, const uchar *a, size_t a_length,
}
for (end= a + a_length-length; a < end ; a++)
{
- if (*a != ' ')
+ if (map[*a] != ' ')
return (map[*a] < ' ') ? -swap : swap;
}
}
diff --git a/support-files/Makefile.am b/support-files/Makefile.am
index b3581d65eb0..36dcd36e25b 100644
--- a/support-files/Makefile.am
+++ b/support-files/Makefile.am
@@ -25,6 +25,7 @@ EXTRA_DIST = mysql.spec.sh \
my-innodb-heavy-4G.cnf.sh \
mysql-log-rotate.sh \
mysql.server.sh \
+ mysqld_multi.server.sh \
binary-configure.sh \
magic mysql.m4 \
MySQL-shared-compat.spec.sh \
@@ -42,7 +43,8 @@ pkgdata_DATA = my-small.cnf \
binary-configure \
ndb-config-2-node.ini
-pkgdata_SCRIPTS = mysql.server
+pkgdata_SCRIPTS = mysql.server \
+ mysqld_multi.server
aclocaldir = $(datadir)/aclocal
aclocal_DATA = mysql.m4
@@ -59,6 +61,7 @@ CLEANFILES = my-small.cnf \
mysql-@VERSION@.spec \
mysql-log-rotate \
mysql.server \
+ mysqld_multi.server \
binary-configure \
MySQL-shared-compat.spec \
ndb-config-2-node.ini
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index cb1561ad6f5..eac1ad413ea 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -16271,6 +16271,70 @@ static void test_bug27592()
}
+
+/*
+ Bug#29687 mysql_stmt_store_result memory leak in libmysqld
+*/
+
+static void test_bug29687()
+{
+ const int NUM_ITERATIONS= 40;
+ int i;
+ int rc;
+ MYSQL_STMT *stmt= NULL;
+
+ DBUG_ENTER("test_bug29687");
+ myheader("test_bug29687");
+
+ stmt= mysql_simple_prepare(mysql, "SELECT 1 FROM dual WHERE 0=2");
+ DIE_UNLESS(stmt);
+
+ for (i= 0; i < NUM_ITERATIONS; i++)
+ {
+ rc= mysql_stmt_execute(stmt);
+ check_execute(stmt, rc);
+ mysql_stmt_store_result(stmt);
+ while (mysql_stmt_fetch(stmt)==0);
+ mysql_stmt_free_result(stmt);
+ }
+
+ mysql_stmt_close(stmt);
+ DBUG_VOID_RETURN;
+}
+
+
+/*
+ Bug #29692 Single row inserts can incorrectly report a huge number of
+ row insertions
+*/
+
+static void test_bug29692()
+{
+ MYSQL* conn;
+
+ if (!(conn= mysql_init(NULL)))
+ {
+ myerror("test_bug29692 init failed");
+ exit(1);
+ }
+
+ if (!(mysql_real_connect(conn, opt_host, opt_user,
+ opt_password, opt_db ? opt_db:"test", opt_port,
+ opt_unix_socket, CLIENT_FOUND_ROWS)))
+ {
+ myerror("test_bug29692 connection failed");
+ mysql_close(mysql);
+ exit(1);
+ }
+ myquery(mysql_query(conn, "drop table if exists t1"));
+ myquery(mysql_query(conn, "create table t1(f1 int)"));
+ myquery(mysql_query(conn, "insert into t1 values(1)"));
+ DIE_UNLESS(1 == mysql_affected_rows(conn));
+ myquery(mysql_query(conn, "drop table t1"));
+ mysql_close(conn);
+}
+
+
/*
Read and parse arguments and MySQL options from my.cnf
*/
@@ -16560,6 +16624,8 @@ static struct my_tests_st my_tests[]= {
{ "test_bug28505", test_bug28505 },
{ "test_bug28934", test_bug28934 },
{ "test_bug27592", test_bug27592 },
+ { "test_bug29687", test_bug29687 },
+ { "test_bug29692", test_bug29692 },
{ 0, 0 }
};
diff --git a/vio/viossl.c b/vio/viossl.c
index 32cfecdb9c8..2c74efb1bef 100644
--- a/vio/viossl.c
+++ b/vio/viossl.c
@@ -124,6 +124,16 @@ int vio_ssl_close(Vio *vio)
if (ssl)
{
+ /*
+ THE SSL standard says that SSL sockets must send and receive a close_notify
+ alert on socket shutdown to avoid truncation attacks. However, this can
+ cause problems since we often hold a lock during shutdown and this IO can
+ take an unbounded amount of time to complete. Since our packets are self
+ describing with length, we aren't vunerable to these attacks. Therefore,
+ we just shutdown by closing the socket (quiet shutdown).
+ */
+ SSL_set_quiet_shutdown(ssl, 1);
+
switch ((r= SSL_shutdown(ssl))) {
case 1:
/* Shutdown successful */
diff --git a/win/configure.js b/win/configure.js
index 06c2fe56a51..2b0e2bbcc37 100644
--- a/win/configure.js
+++ b/win/configure.js
@@ -51,6 +51,7 @@ try
configfile.WriteLine("SET (" + args.Item(i) + " TRUE)");
break;
case "MYSQL_SERVER_SUFFIX":
+ case "MYSQLD_EXE_SUFFIX":
configfile.WriteLine("SET (" + parts[0] + " \""
+ parts[1] + "\")");
break;
diff --git a/win/create_manifest.js b/win/create_manifest.js
index 520ecec21b8..8569bd508ff 100755
--- a/win/create_manifest.js
+++ b/win/create_manifest.js
@@ -1,11 +1,10 @@
/*
manifest.js - Writes a custom XML manifest for each executable/library
- 6 command line options must be supplied:
+ 5 command line options must be supplied:
name - Name of the executable/library into which the mainfest will be
embedded.
version - Version of the executable
arch - Architecture intended.
- type - Application type.
exe_level - Application execution level.
[asInvoker|highestAvailable|requireAdministrator]
outfile - Final destination where mainfest will be written.
@@ -37,9 +36,6 @@ try
case "arch":
var app_arch= parts[1];
break;
- case "type":
- var app_type= parts[1];
- break;
case "exe_level":
var app_exe_level= parts[1];
break;
@@ -50,7 +46,7 @@ try
WScript.echo("Invalid argument supplied.");
}
}
- if (i != 6)
+ if (i != 5)
throw new Error(1, "Incorrect number of arguments.");
var manifest_xml= "<?xml version=\'1.0\' encoding=\'UTF-8\' standalone=\'yes\'?>\r\n";
@@ -61,7 +57,7 @@ try
manifest_xml+= " version=\'" + app_version + "\'";
manifest_xml+= " processorArchitecture=\'" + app_arch + "\'";
// TOADD - Add publicKeyToken attribute once we have Authenticode key.
- manifest_xml+= " type=\'" + app_type + "\' />\r\n";
+ manifest_xml+= " type=\'win32\' />\r\n";
// Identify the application security requirements.
manifest_xml+= "\t<trustInfo xmlns=\'urn:schemas-microsoft-com:asm.v2\'>\r\n";
manifest_xml+= "\t\t<security>\r\n\t\t\t<requestedPrivileges>\r\n\t\t\t\t";
diff --git a/win/mysql_manifest.cmake b/win/mysql_manifest.cmake
index b5bb6fda8fb..4c88be1d800 100755
--- a/win/mysql_manifest.cmake
+++ b/win/mysql_manifest.cmake
@@ -9,7 +9,7 @@ MACRO(MYSQL_EMBED_MANIFEST _target_name _required_privs)
TARGET ${_target_name}
PRE_LINK
COMMAND cscript.exe
- ARGS "${PROJECT_SOURCE_DIR}/win/create_manifest.js" name=$(ProjectName) version=${VERSION} arch=${PROCESSOR_ARCH} type=$(PlatformName) exe_level=${_required_privs} outfile=$(IntDir)\\$(TargetFileName).intermediate.manifest
+ ARGS "${PROJECT_SOURCE_DIR}/win/create_manifest.js" name=$(ProjectName) version=${VERSION} arch=${PROCESSOR_ARCH} exe_level=${_required_privs} outfile=$(IntDir)\\$(TargetFileName).intermediate.manifest
COMMENT "Generates the contents of the manifest contents.")
ADD_CUSTOM_COMMAND(
TARGET ${_target_name}