summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xBUILD/SETUP.sh2
-rwxr-xr-xBUILD/build_mccge.sh623
-rwxr-xr-xBUILD/check-cpu58
-rwxr-xr-xBUILD/compile-pentium645
-rwxr-xr-xCMakeLists.txt11
-rwxr-xr-xclient/CMakeLists.txt2
-rw-r--r--client/Makefile.am10
-rw-r--r--client/mysql.cc15
-rw-r--r--client/mysqlbinlog.cc15
-rw-r--r--client/mysqltest.cc106
-rw-r--r--client/sql_string.h10
-rw-r--r--cmd-line-utils/libedit/common.c5
-rw-r--r--cmd-line-utils/libedit/readline.c23
-rw-r--r--cmd-line-utils/libedit/vi.c29
-rw-r--r--cmd-line-utils/readline/Makefile.am3
-rw-r--r--cmd-line-utils/readline/complete.c7
-rw-r--r--cmd-line-utils/readline/histfile.c1
-rw-r--r--cmd-line-utils/readline/isearch.c8
-rw-r--r--cmd-line-utils/readline/parens.c4
-rw-r--r--cmd-line-utils/readline/readline.c3
-rw-r--r--cmd-line-utils/readline/terminal.c8
-rw-r--r--cmd-line-utils/readline/text.c3
-rw-r--r--config/ac-macros/maintainer.m45
-rw-r--r--config/ac-macros/plugins.m4112
-rw-r--r--configure.in54
-rw-r--r--dbug/CMakeLists.txt1
-rw-r--r--dbug/Makefile.am9
-rw-r--r--dbug/dbug.c5
-rwxr-xr-xextra/CMakeLists.txt2
-rw-r--r--extra/Makefile.am6
-rw-r--r--extra/libevent/epoll.c4
-rw-r--r--extra/libevent/evbuffer.c6
-rw-r--r--extra/libevent/event.c2
-rw-r--r--extra/libevent/kqueue.c9
-rw-r--r--extra/libevent/signal.c5
-rw-r--r--extra/replace.c2
-rw-r--r--extra/yassl/Makefile.am3
-rw-r--r--extra/yassl/src/Makefile.am4
-rw-r--r--extra/yassl/taocrypt/Makefile.am3
-rw-r--r--extra/yassl/taocrypt/benchmark/Makefile.am3
-rw-r--r--extra/yassl/taocrypt/src/Makefile.am4
-rw-r--r--extra/yassl/taocrypt/test/Makefile.am3
-rw-r--r--extra/yassl/testsuite/Makefile.am4
-rw-r--r--include/maria.h3
-rw-r--r--include/my_attribute.h13
-rw-r--r--include/my_compiler.h13
-rw-r--r--include/my_dbug.h46
-rw-r--r--include/my_pthread.h7
-rw-r--r--include/my_sys.h10
-rw-r--r--include/myisam.h5
-rw-r--r--include/myisamchk.h3
-rw-r--r--include/mysql.h3
-rw-r--r--include/mysql.h.pp3
-rw-r--r--include/sha1.h37
-rwxr-xr-xlibmysql/CMakeLists.txt3
-rw-r--r--libmysql/Makefile.shared3
-rw-r--r--libmysql/libmysql.c6
-rw-r--r--libmysqld/CMakeLists.txt2
-rw-r--r--libmysqld/Makefile.am124
-rw-r--r--libmysqld/examples/Makefile.am10
-rw-r--r--mysql-test/Makefile.am1
-rw-r--r--mysql-test/README19
-rw-r--r--mysql-test/collections/default.daily2
-rw-r--r--mysql-test/collections/default.experimental2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_auto_increment.test57
-rw-r--r--mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_loaddata.test2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_stop_slave.test62
-rw-r--r--mysql-test/include/check_concurrent_insert.inc4
-rw-r--r--mysql-test/include/check_no_concurrent_insert.inc4
-rw-r--r--mysql-test/include/get_relay_log_pos.inc4
-rw-r--r--mysql-test/include/have_not_innodb_plugin.inc2
-rw-r--r--mysql-test/include/have_xtradb.inc9
-rw-r--r--mysql-test/include/have_xtradb.opt2
-rw-r--r--mysql-test/include/index_merge2.inc52
-rw-r--r--mysql-test/include/index_merge_ror_cpk.inc16
-rw-r--r--mysql-test/include/kill_query.inc4
-rw-r--r--mysql-test/include/kill_query_and_diff_master_slave.inc8
-rw-r--r--mysql-test/include/long_test.inc4
-rw-r--r--mysql-test/include/mix1.inc12
-rw-r--r--mysql-test/include/percona_query_response_time_flush.inc1
-rw-r--r--mysql-test/include/percona_query_response_time_show.inc8
-rw-r--r--mysql-test/include/percona_query_response_time_sleep.inc19
-rw-r--r--mysql-test/include/setup_fake_relay_log.inc4
-rw-r--r--mysql-test/include/show_binlog_events.inc4
-rw-r--r--mysql-test/include/show_rpl_debug_info.inc6
-rw-r--r--mysql-test/include/wait_for_slave_io_error.inc2
-rw-r--r--mysql-test/include/wait_for_slave_param.inc4
-rw-r--r--mysql-test/include/wait_for_slave_sql_error.inc2
-rw-r--r--mysql-test/include/wait_for_status_var.inc2
-rw-r--r--mysql-test/lib/My/SafeProcess/Makefile.am4
-rw-r--r--mysql-test/lib/mtr_cases.pm29
-rwxr-xr-xmysql-test/mysql-test-run.pl112
-rw-r--r--mysql-test/r/archive.result1
-rw-r--r--mysql-test/r/connect.result4
-rw-r--r--mysql-test/r/ctype_utf8.result31
-rw-r--r--mysql-test/r/explain.result46
-rw-r--r--mysql-test/r/fulltext.result36
-rw-r--r--mysql-test/r/func_gconcat.result8
-rw-r--r--mysql-test/r/func_math.result16
-rw-r--r--mysql-test/r/func_misc.result6
-rw-r--r--mysql-test/r/grant.result11
-rw-r--r--mysql-test/r/grant3.result25
-rw-r--r--mysql-test/r/group_by.result10
-rw-r--r--mysql-test/r/index_merge_innodb.result77
-rw-r--r--mysql-test/r/index_merge_myisam.result73
-rw-r--r--mysql-test/r/join_outer.result29
-rw-r--r--mysql-test/r/lock_multi.result7
-rw-r--r--mysql-test/r/log_tables.result8
-rwxr-xr-xmysql-test/r/lowercase_table4.result7
-rw-r--r--mysql-test/r/merge.result41
-rw-r--r--mysql-test/r/multi_update.result20
-rw-r--r--mysql-test/r/mysqlbinlog-innodb.result85
-rw-r--r--mysql-test/r/mysqltest.result14
-rw-r--r--mysql-test/r/order_by.result21
-rw-r--r--mysql-test/r/partition.result42
-rw-r--r--mysql-test/r/partition_binlog_stmt.result13
-rw-r--r--mysql-test/r/partition_error.result10
-rw-r--r--mysql-test/r/partition_hash.result12
-rw-r--r--mysql-test/r/partition_innodb.result50
-rw-r--r--mysql-test/r/partition_innodb_semi_consistent.result10
-rw-r--r--mysql-test/r/partition_pruning.result508
-rw-r--r--mysql-test/r/partition_range.result12
-rw-r--r--mysql-test/r/plugin.result6
-rw-r--r--mysql-test/r/ps.result38
-rw-r--r--mysql-test/r/ps_2myisam.result272
-rw-r--r--mysql-test/r/ps_3innodb.result272
-rw-r--r--mysql-test/r/ps_4heap.result272
-rw-r--r--mysql-test/r/ps_5merge.result544
-rw-r--r--mysql-test/r/row.result23
-rw-r--r--mysql-test/r/subselect.result34
-rw-r--r--mysql-test/r/subselect4.result86
-rw-r--r--mysql-test/r/table_elim.result31
-rw-r--r--mysql-test/r/table_options.result46
-rw-r--r--mysql-test/r/trigger_notembedded.result21
-rw-r--r--mysql-test/r/type_timestamp.result21
-rw-r--r--mysql-test/r/variables_debug.result13
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result8
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result2
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result8
-rw-r--r--mysql-test/suite/binlog/t/disabled.def3
-rw-r--r--mysql-test/suite/federated/federated_debug.test1
-rw-r--r--mysql-test/suite/handler/aria.result671
-rw-r--r--mysql-test/suite/handler/aria.test82
-rw-r--r--mysql-test/suite/handler/handler.inc (renamed from mysql-test/include/handler.inc)382
-rw-r--r--mysql-test/suite/handler/init.inc33
-rw-r--r--mysql-test/suite/handler/innodb.result (renamed from mysql-test/r/handler_innodb.result)381
-rw-r--r--mysql-test/suite/handler/innodb.test28
-rw-r--r--mysql-test/suite/handler/interface.result259
-rw-r--r--mysql-test/suite/handler/interface.test307
-rw-r--r--mysql-test/suite/handler/myisam.result (renamed from mysql-test/r/handler_myisam.result)390
-rw-r--r--mysql-test/suite/handler/myisam.test (renamed from mysql-test/t/handler_myisam.test)24
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug56143.result560
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug56680.result102
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug56716.result4
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug57252.result6
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug57255.result10
-rw-r--r--mysql-test/suite/innodb/r/innodb_mysql.result37
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug38231.test5
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug53756.test4
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug56143.test580
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug56680.test130
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug56716.test10
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug57252.test46
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug57255.test38
-rw-r--r--mysql-test/suite/innodb/t/innodb_mysql.test27
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb_bug53756.result118
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb_bug56143.result556
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb_bug56632.result294
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb_bug56680.result109
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb_bug56716.result4
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb_bug56947.result6
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb_bug57252.result6
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb_bug57255.result10
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb_mysql.result20
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_bug38231.test5
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_bug53756-master.opt1
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_bug53756.test184
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_bug56143.test581
-rwxr-xr-xmysql-test/suite/innodb_plugin/t/innodb_bug56632.test216
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_bug56680.test143
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_bug56716.test10
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_bug56947.test11
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_bug57252.test46
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_bug57255.test38
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_mysql.test14
-rw-r--r--mysql-test/suite/maria/r/maria.result18
-rw-r--r--mysql-test/suite/maria/r/maria3.result2
-rw-r--r--mysql-test/suite/maria/r/ps_maria.result272
-rw-r--r--mysql-test/suite/maria/t/maria-recovery-rtree-ft.test1
-rw-r--r--mysql-test/suite/maria/t/maria.test18
-rw-r--r--mysql-test/suite/ndb/r/ps_7ndb.result272
-rw-r--r--mysql-test/suite/parts/r/partition_alter3_innodb.result36
-rw-r--r--mysql-test/suite/parts/r/partition_alter3_myisam.result36
-rw-r--r--mysql-test/suite/parts/t/partition_alter2_1_myisam.test2
-rw-r--r--mysql-test/suite/parts/t/partition_alter2_2_myisam.test2
-rw-r--r--mysql-test/suite/parts/t/partition_basic_innodb.test2
-rw-r--r--mysql-test/suite/parts/t/partition_decimal_myisam.test2
-rw-r--r--mysql-test/suite/parts/t/partition_float_myisam.test2
-rw-r--r--mysql-test/suite/parts/t/partition_int_myisam.test2
-rw-r--r--mysql-test/suite/pbxt/r/partition_hash.result12
-rw-r--r--mysql-test/suite/pbxt/r/partition_pruning.result166
-rw-r--r--mysql-test/suite/pbxt/r/partition_range.result20
-rw-r--r--mysql-test/suite/pbxt/r/select.result4
-rw-r--r--mysql-test/suite/pbxt/r/subselect.result4
-rw-r--r--mysql-test/suite/pbxt/t/select.test3
-rw-r--r--mysql-test/suite/percona/percona_innodb_buffer_pool_shm-master.opt1
-rw-r--r--mysql-test/suite/percona/percona_innodb_buffer_pool_shm.result6
-rw-r--r--mysql-test/suite/percona/percona_innodb_buffer_pool_shm.test18
-rw-r--r--mysql-test/suite/percona/percona_log_connection_error.result15
-rw-r--r--mysql-test/suite/percona/percona_log_connection_error.test52
-rw-r--r--mysql-test/suite/percona/percona_query_response_time-replication.result60
-rw-r--r--mysql-test/suite/percona/percona_query_response_time-replication.test52
-rw-r--r--mysql-test/suite/percona/percona_query_response_time-stored.result316
-rw-r--r--mysql-test/suite/percona/percona_query_response_time-stored.test87
-rw-r--r--mysql-test/suite/percona/percona_query_response_time.result570
-rw-r--r--mysql-test/suite/percona/percona_query_response_time.test65
-rw-r--r--mysql-test/suite/percona/percona_server_variables.result5
-rw-r--r--mysql-test/suite/percona/percona_slow_query_log-log_slow_verbosity.result9
-rw-r--r--mysql-test/suite/percona/percona_slow_query_log-log_slow_verbosity.test15
-rw-r--r--mysql-test/suite/percona/percona_slow_query_log-long_query_time.result21
-rw-r--r--mysql-test/suite/percona/percona_slow_query_log-long_query_time.test18
-rw-r--r--mysql-test/suite/percona/percona_slow_query_log-microseconds_in_slow_query_log.result12
-rw-r--r--mysql-test/suite/percona/percona_slow_query_log-microseconds_in_slow_query_log.test21
-rw-r--r--mysql-test/suite/percona/percona_slow_query_log-use_global_long_query_time-master.opt1
-rw-r--r--mysql-test/suite/percona/percona_sql_no_fcache.result12
-rw-r--r--mysql-test/suite/percona/percona_sql_no_fcache.test11
-rw-r--r--mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments.inc (renamed from mysql-test/include/percona_query_cache_with_comments.inc)0
-rw-r--r--mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments.inc.backup (renamed from mysql-test/suite/percona/percona_query_cache_with_comments.inc.backup)0
-rw-r--r--mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments.result (renamed from mysql-test/suite/percona/percona_query_cache_with_comments.result)0
-rw-r--r--mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments.test (renamed from mysql-test/suite/percona/percona_query_cache_with_comments.test)1
-rw-r--r--mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_begin.inc (renamed from mysql-test/include/percona_query_cache_with_comments_begin.inc)0
-rw-r--r--mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_clear.inc (renamed from mysql-test/include/percona_query_cache_with_comments_clear.inc)0
-rw-r--r--mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_crash.result (renamed from mysql-test/suite/percona/percona_query_cache_with_comments_crash.result)0
-rw-r--r--mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_crash.test (renamed from mysql-test/suite/percona/percona_query_cache_with_comments_crash.test)0
-rw-r--r--mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_disable.result (renamed from mysql-test/suite/percona/percona_query_cache_with_comments_disable.result)0
-rw-r--r--mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_disable.test (renamed from mysql-test/suite/percona/percona_query_cache_with_comments_disable.test)0
-rw-r--r--mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_end.inc (renamed from mysql-test/include/percona_query_cache_with_comments_end.inc)0
-rw-r--r--mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_eval.inc (renamed from mysql-test/include/percona_query_cache_with_comments_eval.inc)0
-rw-r--r--mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_prepared_statements.result (renamed from mysql-test/suite/percona/percona_query_cache_with_comments_prepared_statements.result)0
-rw-r--r--mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_prepared_statements.test (renamed from mysql-test/suite/percona/percona_query_cache_with_comments_prepared_statements.test)0
-rw-r--r--mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_show.inc (renamed from mysql-test/include/percona_query_cache_with_comments_show.inc)0
-rw-r--r--mysql-test/suite/percona/query_cache_enhance.patch/percona_status_wait_query_cache_mutex.result (renamed from mysql-test/suite/percona/percona_status_wait_query_cache_mutex.result)0
-rw-r--r--mysql-test/suite/percona/query_cache_enhance.patch/percona_status_wait_query_cache_mutex.test (renamed from mysql-test/suite/percona/percona_status_wait_query_cache_mutex.test)0
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-control_global_slow-master.opt (renamed from mysql-test/suite/percona/percona_slow_query_log-control_global_slow-master.opt)0
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-control_global_slow.result (renamed from mysql-test/suite/percona/percona_slow_query_log-control_global_slow.result)2
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-control_global_slow.test (renamed from mysql-test/suite/percona/percona_slow_query_log-control_global_slow.test)8
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_filter-master.opt (renamed from mysql-test/suite/percona/percona_slow_query_log-log_slow_filter-master.opt)0
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_filter.result (renamed from mysql-test/suite/percona/percona_slow_query_log-log_slow_filter.result)2
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_filter.test (renamed from mysql-test/suite/percona/percona_slow_query_log-log_slow_filter.test)8
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_verbosity-master.opt (renamed from mysql-test/suite/percona/percona_slow_query_log-log_slow_verbosity-master.opt)0
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_verbosity.result9
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_verbosity.test11
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-long_query_time-master.opt (renamed from mysql-test/suite/percona/percona_slow_query_log-long_query_time-master.opt)2
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-long_query_time.result22
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-long_query_time.test17
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-microseconds_in_slow_extended-master.opt (renamed from mysql-test/suite/percona/percona_slow_query_log-microseconds_in_slow_query_log-master.opt)0
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-microseconds_in_slow_extended.result12
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-microseconds_in_slow_extended.test17
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-min_examined_row_limit-master.opt (renamed from mysql-test/suite/percona/percona_slow_query_log-min_examined_row_limit-master.opt)0
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-min_examined_row_limit.result (renamed from mysql-test/suite/percona/percona_slow_query_log-min_examined_row_limit.result)2
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-min_examined_row_limit.test (renamed from mysql-test/suite/percona/percona_slow_query_log-min_examined_row_limit.test)7
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_innodb_stats-master.opt (renamed from mysql-test/suite/percona/percona_slave_innodb_stats-master.opt)0
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_innodb_stats-slave.opt (renamed from mysql-test/suite/percona/percona_slave_innodb_stats-slave.opt)0
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_innodb_stats.result (renamed from mysql-test/suite/percona/percona_slave_innodb_stats.result)0
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_innodb_stats.test (renamed from mysql-test/suite/percona/percona_slave_innodb_stats.test)5
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements-and-use_global_long_query_time-master.opt (renamed from mysql-test/suite/percona/percona_log_slow_slave_statements-and-use_global_long_query_time-master.opt)0
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements-and-use_global_long_query_time-slave.opt (renamed from mysql-test/suite/percona/percona_log_slow_slave_statements-and-use_global_long_query_time-slave.opt)0
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements-and-use_global_long_query_time.result (renamed from mysql-test/suite/percona/percona_log_slow_slave_statements-and-use_global_long_query_time.result)12
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements-and-use_global_long_query_time.test (renamed from mysql-test/suite/percona/percona_log_slow_slave_statements-and-use_global_long_query_time.test)52
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements-master.opt (renamed from mysql-test/suite/percona/percona_log_slow_slave_statements-master.opt)0
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements-slave.opt (renamed from mysql-test/suite/percona/percona_log_slow_slave_statements-slave.opt)0
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements.result (renamed from mysql-test/suite/percona/percona_log_slow_slave_statements.result)0
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements.test (renamed from mysql-test/suite/percona/percona_log_slow_slave_statements.test)13
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-use_global_long_query_time-master.opt1
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-use_global_long_query_time.result (renamed from mysql-test/suite/percona/percona_slow_query_log-use_global_long_query_time.result)4
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-use_global_long_query_time.test (renamed from mysql-test/suite/percona/percona_slow_query_log-use_global_long_query_time.test)9
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/show_slave_status_nolock.patch/percona_show_slave_status_nolock.result23
-rw-r--r--mysql-test/suite/percona/slow_extended.patch/show_slave_status_nolock.patch/percona_show_slave_status_nolock.test28
-rw-r--r--mysql-test/suite/rpl/r/rpl_alter.result20
-rw-r--r--mysql-test/suite/rpl/r/rpl_auto_increment.result29
-rw-r--r--mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_binlog_max_cache_size.result47
-rw-r--r--mysql-test/suite/rpl/r/rpl_do_grant.result23
-rw-r--r--mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_stop_slave.result131
-rw-r--r--mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result44
-rw-r--r--mysql-test/suite/rpl/t/disabled.def1
-rw-r--r--mysql-test/suite/rpl/t/rpl_alter.test59
-rw-r--r--mysql-test/suite/rpl/t/rpl_auto_increment-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_binlog_max_cache_size-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_binlog_max_cache_size.test105
-rw-r--r--mysql-test/suite/rpl/t/rpl_deadlock_innodb.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_do_grant.test21
-rw-r--r--mysql-test/suite/rpl/t/rpl_killed_ddl.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp003.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_tbl_metadata.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_stop_slave.test60
-rw-r--r--mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test53
-rw-r--r--mysql-test/suite/sys_vars/t/secure_file_priv.test2
-rw-r--r--mysql-test/suite/vcol/inc/vcol_unsupported_storage_engines.inc6
-rw-r--r--mysql-test/suite/vcol/r/vcol_archive.result6
-rw-r--r--mysql-test/suite/vcol/r/vcol_blackhole.result6
-rw-r--r--mysql-test/suite/vcol/r/vcol_csv.result4
-rw-r--r--mysql-test/suite/vcol/r/vcol_memory.result6
-rw-r--r--mysql-test/suite/vcol/r/vcol_merge.result2
-rw-r--r--mysql-test/suite/vcol/r/vcol_non_stored_columns_innodb.result4
-rw-r--r--mysql-test/suite/vcol/r/vcol_non_stored_columns_myisam.result4
-rw-r--r--mysql-test/suite/vcol/t/rpl_vcol.test2
-rw-r--r--mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_innodb.test2
-rw-r--r--mysql-test/suite/vcol/t/vcol_column_def_options_innodb.test2
-rw-r--r--mysql-test/suite/vcol/t/vcol_csv.test8
-rw-r--r--mysql-test/suite/vcol/t/vcol_handler_innodb.test2
-rw-r--r--mysql-test/suite/vcol/t/vcol_ins_upd_innodb.test2
-rw-r--r--mysql-test/suite/vcol/t/vcol_keys_innodb.test2
-rw-r--r--mysql-test/suite/vcol/t/vcol_merge.test2
-rw-r--r--mysql-test/suite/vcol/t/vcol_non_stored_columns_innodb.test2
-rw-r--r--mysql-test/suite/vcol/t/vcol_partition_innodb.test2
-rw-r--r--mysql-test/suite/vcol/t/vcol_select_innodb.test2
-rw-r--r--mysql-test/suite/vcol/t/vcol_supported_sql_funcs_innodb.test2
-rw-r--r--mysql-test/suite/vcol/t/vcol_trigger_sp_innodb.test2
-rw-r--r--mysql-test/suite/vcol/t/vcol_view_innodb.test2
-rw-r--r--mysql-test/t/archive.test5
-rw-r--r--mysql-test/t/connect.test13
-rw-r--r--mysql-test/t/ctype_utf8.test20
-rw-r--r--mysql-test/t/disabled.def2
-rw-r--r--mysql-test/t/explain.test36
-rw-r--r--mysql-test/t/fulltext.test36
-rw-r--r--mysql-test/t/func_gconcat.test12
-rw-r--r--mysql-test/t/func_math.test6
-rw-r--r--mysql-test/t/func_misc.test8
-rw-r--r--mysql-test/t/grant.test10
-rw-r--r--mysql-test/t/grant3.test5
-rw-r--r--mysql-test/t/group_by.test11
-rw-r--r--mysql-test/t/handler_innodb.test20
-rw-r--r--mysql-test/t/index_merge_innodb.test6
-rw-r--r--mysql-test/t/information_schema_all_engines-master.opt2
-rw-r--r--mysql-test/t/join_outer.test30
-rw-r--r--mysql-test/t/lock_multi.test16
-rwxr-xr-xmysql-test/t/lowercase_table4-master.opt1
-rwxr-xr-xmysql-test/t/lowercase_table4.test56
-rw-r--r--mysql-test/t/merge.test78
-rw-r--r--mysql-test/t/multi_update.test21
-rw-r--r--mysql-test/t/multi_update2.test2
-rw-r--r--mysql-test/t/mysqlbinlog-innodb.test31
-rw-r--r--mysql-test/t/mysqltest.test70
-rw-r--r--mysql-test/t/openssl_1.test4
-rw-r--r--mysql-test/t/order_by.test25
-rw-r--r--mysql-test/t/partition.test49
-rw-r--r--mysql-test/t/partition_binlog_stmt.test27
-rw-r--r--mysql-test/t/partition_error.test14
-rw-r--r--mysql-test/t/partition_innodb.test37
-rw-r--r--mysql-test/t/partition_innodb_semi_consistent.test12
-rw-r--r--mysql-test/t/partition_pruning.test24
-rw-r--r--mysql-test/t/pool_of_threads.test1
-rw-r--r--mysql-test/t/ps.test22
-rw-r--r--mysql-test/t/query_cache.test1
-rw-r--r--mysql-test/t/row.test19
-rw-r--r--mysql-test/t/subselect.test39
-rw-r--r--mysql-test/t/subselect4.test62
-rw-r--r--mysql-test/t/table_elim.test32
-rw-r--r--mysql-test/t/trigger_notembedded.test48
-rw-r--r--mysql-test/t/type_timestamp.test17
-rw-r--r--mysql-test/t/variables_debug.test13
-rw-r--r--mysql-test/t/wait_timeout.test4
-rw-r--r--mysql-test/valgrind.supp13
-rw-r--r--mysys/CMakeLists.txt1
-rw-r--r--mysys/Makefile.am16
-rw-r--r--mysys/charset.c2
-rw-r--r--mysys/my_gethostbyname.c11
-rw-r--r--mysys/my_gethwaddr.c32
-rw-r--r--mysys/my_getopt.c3
-rw-r--r--mysys/my_redel.c33
-rw-r--r--mysys/my_symlink.c15
-rw-r--r--mysys/my_sync.c7
-rw-r--r--mysys/my_uuid.c2
-rw-r--r--mysys/sha1.c55
-rw-r--r--mysys/thr_lock.c10
-rw-r--r--mysys/thr_mutex.c4
-rw-r--r--mysys/tree.c4
-rw-r--r--plugin/auth/dialog.c5
-rw-r--r--plugin/daemon_example/Makefile.am3
-rw-r--r--plugin/fulltext/Makefile.am3
-rw-r--r--pstack/aout/Makefile.am3
-rwxr-xr-xregex/CMakeLists.txt2
-rw-r--r--regex/Makefile.am6
-rwxr-xr-xscripts/make_win_bin_dist2
-rw-r--r--scripts/mysql_convert_table_format.sh2
-rw-r--r--server-tools/CMakeLists.txt2
-rwxr-xr-xserver-tools/instance-manager/CMakeLists.txt4
-rw-r--r--server-tools/instance-manager/Makefile.am3
-rw-r--r--sql-bench/compare-results.sh2
-rw-r--r--sql-common/client.c2
-rw-r--r--sql-common/client_plugin.c18
-rwxr-xr-xsql/CMakeLists.txt6
-rw-r--r--sql/Makefile.am2
-rw-r--r--sql/create_options.cc3
-rw-r--r--sql/debug_sync.cc1
-rwxr-xr-xsql/examples/CMakeLists.txt3
-rw-r--r--sql/ha_ndbcluster.cc9
-rw-r--r--sql/ha_partition.cc150
-rw-r--r--sql/ha_partition.h12
-rw-r--r--sql/handler.cc20
-rw-r--r--sql/handler.h33
-rw-r--r--sql/item.cc13
-rw-r--r--sql/item.h21
-rw-r--r--sql/item_cmpfunc.cc86
-rw-r--r--sql/item_func.cc47
-rw-r--r--sql/item_func.h3
-rw-r--r--sql/item_strfunc.cc43
-rw-r--r--sql/item_subselect.cc86
-rw-r--r--sql/item_sum.cc6
-rw-r--r--sql/item_timefunc.cc4
-rw-r--r--sql/item_timefunc.h1
-rw-r--r--sql/lock.cc8
-rw-r--r--sql/log.cc74
-rw-r--r--sql/log_event.cc72
-rw-r--r--sql/log_event.h8
-rw-r--r--sql/my_decimal.h2
-rw-r--r--sql/mysql_priv.h5
-rw-r--r--sql/mysqld.cc24
-rw-r--r--sql/net_serv.cc12
-rw-r--r--sql/opt_range.cc116
-rw-r--r--sql/opt_range.h12
-rw-r--r--sql/rpl_record.cc2
-rw-r--r--sql/rpl_rli.h10
-rw-r--r--sql/set_var.cc4
-rw-r--r--sql/share/Makefile.am3
-rw-r--r--sql/share/errmsg.txt6
-rw-r--r--sql/slave.cc78
-rw-r--r--sql/sql_acl.cc34
-rw-r--r--sql/sql_base.cc34
-rw-r--r--sql/sql_cache.cc61
-rw-r--r--sql/sql_class.cc44
-rw-r--r--sql/sql_class.h39
-rw-r--r--sql/sql_db.cc6
-rw-r--r--sql/sql_handler.cc19
-rw-r--r--sql/sql_help.cc2
-rw-r--r--sql/sql_insert.cc4
-rw-r--r--sql/sql_lex.cc6
-rw-r--r--sql/sql_load.cc2
-rw-r--r--sql/sql_parse.cc22
-rw-r--r--sql/sql_partition.cc4
-rw-r--r--sql/sql_plugin_services.h2
-rw-r--r--sql/sql_prepare.cc4
-rw-r--r--sql/sql_select.cc71
-rw-r--r--sql/sql_string.h10
-rw-r--r--sql/sql_table.cc36
-rw-r--r--sql/sql_trigger.cc9
-rw-r--r--sql/sql_union.cc9
-rw-r--r--sql/sql_update.cc46
-rw-r--r--sql/sql_yacc.yy19
-rw-r--r--sql/table.cc23
-rw-r--r--sql/table.h3
-rwxr-xr-xstorage/archive/CMakeLists.txt2
-rw-r--r--storage/archive/Makefile.am13
-rw-r--r--storage/archive/plug.in2
-rw-r--r--storage/blackhole/CMakeLists.txt3
-rw-r--r--storage/blackhole/Makefile.am11
-rw-r--r--storage/blackhole/plug.in2
-rw-r--r--storage/csv/CMakeLists.txt3
-rw-r--r--storage/csv/Makefile.am11
-rw-r--r--storage/csv/plug.in2
-rw-r--r--storage/example/CMakeLists.txt2
-rw-r--r--storage/example/Makefile.am13
-rwxr-xr-xstorage/federated/CMakeLists.txt3
-rw-r--r--storage/federated/Makefile.am15
-rw-r--r--storage/federated/ha_federated.cc2
-rw-r--r--storage/federated/plug.in3
-rw-r--r--storage/federatedx/Makefile.am24
-rw-r--r--storage/federatedx/plug.in3
-rwxr-xr-xstorage/heap/CMakeLists.txt3
-rw-r--r--storage/heap/Makefile.am23
-rw-r--r--storage/heap/plug.in3
-rw-r--r--storage/ibmdb2i/CMakeLists.txt3
-rw-r--r--storage/ibmdb2i/Makefile.am2
-rw-r--r--storage/ibmdb2i/db2i_ioBuffers.h2
-rw-r--r--storage/innobase/Makefile.am14
-rw-r--r--storage/innobase/btr/btr0btr.c2
-rw-r--r--storage/innobase/btr/btr0cur.c25
-rw-r--r--storage/innobase/btr/btr0pcur.c2
-rw-r--r--storage/innobase/btr/btr0sea.c3
-rw-r--r--storage/innobase/buf/buf0buf.c24
-rw-r--r--storage/innobase/buf/buf0flu.c83
-rw-r--r--storage/innobase/buf/buf0lru.c101
-rw-r--r--storage/innobase/dict/dict0load.c4
-rw-r--r--storage/innobase/eval/eval0eval.c7
-rw-r--r--storage/innobase/handler/ha_innodb.cc72
-rw-r--r--storage/innobase/handler/ha_innodb.h1
-rw-r--r--storage/innobase/ibuf/ibuf0ibuf.c183
-rw-r--r--storage/innobase/include/buf0flu.h14
-rw-r--r--storage/innobase/include/buf0lru.h8
-rw-r--r--storage/innobase/include/ibuf0ibuf.h5
-rw-r--r--storage/innobase/include/rem0rec.h3
-rw-r--r--storage/innobase/include/rem0rec.ic3
-rw-r--r--storage/innobase/include/row0mysql.h4
-rw-r--r--storage/innobase/include/row0upd.h8
-rw-r--r--storage/innobase/include/ut0dbg.h4
-rw-r--r--storage/innobase/include/ut0rnd.ic3
-rw-r--r--storage/innobase/lock/lock0lock.c4
-rw-r--r--storage/innobase/log/log0recv.c6
-rw-r--r--storage/innobase/os/os0file.c56
-rw-r--r--storage/innobase/plug.in.disabled2
-rw-r--r--storage/innobase/que/que0que.c7
-rw-r--r--storage/innobase/row/row0mysql.c19
-rw-r--r--storage/innobase/row/row0purge.c2
-rw-r--r--storage/innobase/row/row0sel.c174
-rw-r--r--storage/innobase/row/row0umod.c7
-rw-r--r--storage/innobase/row/row0upd.c19
-rw-r--r--storage/innobase/row/row0vers.c11
-rw-r--r--storage/innobase/trx/trx0purge.c12
-rw-r--r--storage/innobase/trx/trx0roll.c5
-rw-r--r--storage/innobase/trx/trx0sys.c9
-rw-r--r--storage/innobase/trx/trx0trx.c3
-rw-r--r--storage/innobase/trx/trx0undo.c23
-rw-r--r--storage/innodb_plugin/CMakeLists.txt22
-rw-r--r--storage/innodb_plugin/ChangeLog79
-rw-r--r--storage/innodb_plugin/Makefile.am16
-rw-r--r--storage/innodb_plugin/btr/btr0btr.c9
-rw-r--r--storage/innodb_plugin/btr/btr0cur.c12
-rw-r--r--storage/innodb_plugin/btr/btr0pcur.c2
-rw-r--r--storage/innodb_plugin/btr/btr0sea.c3
-rw-r--r--storage/innodb_plugin/buf/buf0buf.c24
-rw-r--r--storage/innodb_plugin/buf/buf0flu.c90
-rw-r--r--storage/innodb_plugin/dict/dict0crea.c2
-rw-r--r--storage/innodb_plugin/dict/dict0dict.c9
-rw-r--r--storage/innodb_plugin/dict/dict0load.c31
-rw-r--r--storage/innodb_plugin/eval/eval0eval.c7
-rw-r--r--storage/innodb_plugin/handler/ha_innodb.cc88
-rw-r--r--storage/innodb_plugin/handler/ha_innodb.h1
-rw-r--r--storage/innodb_plugin/handler/i_s.cc1
-rw-r--r--storage/innodb_plugin/ibuf/ibuf0ibuf.c197
-rw-r--r--storage/innodb_plugin/include/btr0cur.h16
-rw-r--r--storage/innodb_plugin/include/buf0flu.h14
-rw-r--r--storage/innodb_plugin/include/ibuf0ibuf.h5
-rw-r--r--storage/innodb_plugin/include/os0sync.h2
-rw-r--r--storage/innodb_plugin/include/row0mysql.h4
-rw-r--r--storage/innodb_plugin/include/row0upd.h7
-rw-r--r--storage/innodb_plugin/include/univ.i2
-rw-r--r--storage/innodb_plugin/include/ut0rnd.ic3
-rw-r--r--storage/innodb_plugin/log/log0recv.c6
-rw-r--r--storage/innodb_plugin/os/os0file.c61
-rw-r--r--storage/innodb_plugin/plug.in5
-rw-r--r--storage/innodb_plugin/que/que0que.c5
-rw-r--r--storage/innodb_plugin/row/row0mysql.c55
-rw-r--r--storage/innodb_plugin/row/row0purge.c7
-rw-r--r--storage/innodb_plugin/row/row0sel.c189
-rw-r--r--storage/innodb_plugin/row/row0umod.c7
-rw-r--r--storage/innodb_plugin/row/row0upd.c7
-rw-r--r--storage/innodb_plugin/row/row0vers.c11
-rw-r--r--storage/innodb_plugin/srv/srv0start.c7
-rw-r--r--storage/innodb_plugin/trx/trx0i_s.c33
-rw-r--r--storage/innodb_plugin/trx/trx0purge.c12
-rw-r--r--storage/innodb_plugin/trx/trx0roll.c5
-rw-r--r--storage/innodb_plugin/trx/trx0sys.c11
-rw-r--r--storage/innodb_plugin/trx/trx0trx.c3
-rw-r--r--storage/innodb_plugin/trx/trx0undo.c23
-rw-r--r--storage/maria/CMakeLists.txt6
-rw-r--r--storage/maria/Makefile.am26
-rw-r--r--storage/maria/ha_maria.cc24
-rw-r--r--storage/maria/ha_maria.h1
-rw-r--r--storage/maria/ma_bitmap.c8
-rw-r--r--storage/maria/ma_blockrec.c84
-rw-r--r--storage/maria/ma_blockrec.h2
-rw-r--r--storage/maria/ma_check.c110
-rw-r--r--storage/maria/ma_extra.c4
-rw-r--r--storage/maria/ma_ft_boolean_search.c6
-rw-r--r--storage/maria/ma_loghandler.c244
-rw-r--r--storage/maria/ma_loghandler.h24
-rw-r--r--storage/maria/ma_open.c2
-rw-r--r--storage/maria/ma_pagecache.c156
-rw-r--r--storage/maria/ma_pagecache.h1
-rw-r--r--storage/maria/ma_recovery.c40
-rw-r--r--storage/maria/ma_recovery.h2
-rw-r--r--storage/maria/ma_recovery_util.c8
-rw-r--r--storage/maria/ma_rkey.c2
-rw-r--r--storage/maria/ma_rnext.c17
-rw-r--r--storage/maria/ma_rsame.c10
-rw-r--r--storage/maria/ma_rt_index.c1
-rw-r--r--storage/maria/ma_rt_split.c3
-rw-r--r--storage/maria/ma_search.c17
-rw-r--r--storage/maria/ma_sort.c14
-rw-r--r--storage/maria/ma_unique.c17
-rw-r--r--storage/maria/ma_write.c6
-rw-r--r--storage/maria/maria_chk.c11
-rw-r--r--storage/maria/maria_def.h5
-rw-r--r--storage/maria/maria_dump_log.c190
-rw-r--r--storage/maria/maria_pack.c6
-rw-r--r--storage/maria/maria_read_log.c67
-rw-r--r--storage/maria/plug.in3
-rw-r--r--storage/maria/unittest/CMakeLists.txt2
-rw-r--r--storage/maria/unittest/Makefile.am3
-rw-r--r--storage/maria/unittest/ma_pagecache_consist.c1
-rw-r--r--storage/maria/unittest/ma_pagecache_rwconsist.c1
-rw-r--r--storage/maria/unittest/ma_test_loghandler_multithread-t.c5
-rw-r--r--storage/maria/unittest/ma_test_loghandler_pagecache-t.c2
-rw-r--r--storage/myisam/CMakeLists.txt3
-rw-r--r--storage/myisam/Makefile.am23
-rw-r--r--storage/myisam/ha_myisam.cc16
-rw-r--r--storage/myisam/ha_myisam.h2
-rw-r--r--storage/myisam/mi_check.c24
-rw-r--r--storage/myisam/mi_close.c2
-rw-r--r--storage/myisam/mi_open.c2
-rw-r--r--storage/myisam/mi_range.c3
-rw-r--r--storage/myisam/mi_search.c10
-rw-r--r--storage/myisam/myisamchk.c10
-rw-r--r--storage/myisam/myisampack.c2
-rw-r--r--storage/myisam/plug.in3
-rw-r--r--storage/myisam/rt_index.c8
-rw-r--r--storage/myisam/rt_split.c11
-rwxr-xr-xstorage/myisammrg/CMakeLists.txt2
-rw-r--r--storage/myisammrg/Makefile.am19
-rw-r--r--storage/myisammrg/ha_myisammrg.cc4
-rw-r--r--storage/myisammrg/plug.in3
-rw-r--r--storage/ndb/Makefile.am3
-rw-r--r--storage/ndb/docs/Makefile.am3
-rw-r--r--storage/ndb/include/Makefile.am3
-rw-r--r--storage/ndb/include/kernel/signaldata/FsOpenReq.hpp8
-rw-r--r--storage/ndb/include/ndbapi/NdbDictionary.hpp2
-rw-r--r--storage/ndb/include/ndbapi/NdbError.hpp2
-rw-r--r--storage/ndb/include/util/File.hpp2
-rw-r--r--storage/ndb/include/util/NdbSqlUtil.hpp1
-rw-r--r--storage/ndb/src/Makefile.am3
-rw-r--r--storage/ndb/src/common/Makefile.am3
-rw-r--r--storage/ndb/src/common/debugger/Makefile.am3
-rw-r--r--storage/ndb/src/common/debugger/signaldata/Makefile.am3
-rw-r--r--storage/ndb/src/common/logger/Makefile.am2
-rw-r--r--storage/ndb/src/common/mgmcommon/Makefile.am3
-rw-r--r--storage/ndb/src/common/portlib/Makefile.am3
-rw-r--r--storage/ndb/src/common/transporter/Makefile.am3
-rw-r--r--storage/ndb/src/common/util/Makefile.am3
-rw-r--r--storage/ndb/src/cw/Makefile.am3
-rw-r--r--storage/ndb/src/cw/cpcd/Makefile.am3
-rw-r--r--storage/ndb/src/kernel/Makefile.am3
-rw-r--r--storage/ndb/src/kernel/blocks/Makefile.am6
-rw-r--r--storage/ndb/src/kernel/blocks/backup/Makefile.am3
-rw-r--r--storage/ndb/src/kernel/blocks/dbdict/Makefile.am3
-rw-r--r--storage/ndb/src/kernel/blocks/dbdih/Makefile.am3
-rw-r--r--storage/ndb/src/kernel/blocks/dblqh/Makefile.am3
-rw-r--r--storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp2
-rw-r--r--storage/ndb/src/kernel/blocks/dbtup/Makefile.am3
-rw-r--r--storage/ndb/src/kernel/error/Makefile.am3
-rw-r--r--storage/ndb/src/kernel/vm/Makefile.am3
-rw-r--r--storage/ndb/src/mgmapi/Makefile.am3
-rw-r--r--storage/ndb/src/mgmclient/Makefile.am3
-rw-r--r--storage/ndb/src/mgmsrv/Makefile.am3
-rw-r--r--storage/ndb/src/ndbapi/Makefile.am3
-rw-r--r--storage/ndb/test/Makefile.am3
-rw-r--r--storage/ndb/test/ndbapi/Makefile.am4
-rw-r--r--storage/ndb/test/ndbapi/bank/Makefile.am3
-rw-r--r--storage/ndb/test/run-test/Makefile.am3
-rw-r--r--storage/ndb/test/src/Makefile.am3
-rw-r--r--storage/ndb/test/tools/Makefile.am3
-rw-r--r--storage/ndb/tools/Makefile.am3
-rw-r--r--storage/oqgraph/ha_oqgraph.cc10
-rw-r--r--storage/oqgraph/plug.in1
-rw-r--r--storage/pbxt/CMakeLists.txt3
-rw-r--r--storage/pbxt/plug.in3
-rw-r--r--storage/pbxt/src/Makefile.am28
-rw-r--r--storage/pbxt/src/ha_pbxt.cc2
-rw-r--r--storage/pbxt/src/table_xt.cc15
-rw-r--r--storage/sphinx/Makefile.am17
-rw-r--r--storage/sphinx/ha_sphinx.cc2
-rw-r--r--storage/sphinx/plug.in2
-rw-r--r--storage/xtradb/CMakeLists.txt22
-rw-r--r--storage/xtradb/ChangeLog79
-rw-r--r--storage/xtradb/Makefile.am16
-rw-r--r--storage/xtradb/btr/btr0btr.c9
-rw-r--r--storage/xtradb/btr/btr0cur.c12
-rw-r--r--storage/xtradb/btr/btr0pcur.c2
-rw-r--r--storage/xtradb/btr/btr0sea.c3
-rw-r--r--storage/xtradb/buf/buf0buf.c481
-rw-r--r--storage/xtradb/buf/buf0flu.c90
-rw-r--r--storage/xtradb/dict/dict0crea.c2
-rw-r--r--storage/xtradb/dict/dict0dict.c9
-rw-r--r--storage/xtradb/dict/dict0load.c4
-rw-r--r--storage/xtradb/eval/eval0eval.c7
-rw-r--r--storage/xtradb/ha/hash0hash.c64
-rw-r--r--storage/xtradb/handler/ha_innodb.cc109
-rw-r--r--storage/xtradb/handler/ha_innodb.h2
-rw-r--r--storage/xtradb/handler/i_s.cc3
-rw-r--r--storage/xtradb/handler/innodb_patch_info.h1
-rw-r--r--storage/xtradb/ibuf/ibuf0ibuf.c197
-rw-r--r--storage/xtradb/include/btr0cur.h16
-rw-r--r--storage/xtradb/include/buf0buf.h6
-rw-r--r--storage/xtradb/include/buf0flu.h14
-rw-r--r--storage/xtradb/include/fsp0types.h2
-rw-r--r--storage/xtradb/include/hash0hash.h49
-rw-r--r--storage/xtradb/include/ibuf0ibuf.h5
-rw-r--r--storage/xtradb/include/os0proc.h28
-rw-r--r--storage/xtradb/include/os0sync.h2
-rw-r--r--storage/xtradb/include/row0mysql.h4
-rw-r--r--storage/xtradb/include/row0upd.h7
-rw-r--r--storage/xtradb/include/srv0srv.h8
-rw-r--r--storage/xtradb/include/univ.i4
-rw-r--r--storage/xtradb/include/ut0lst.h43
-rw-r--r--storage/xtradb/include/ut0rnd.ic3
-rw-r--r--storage/xtradb/log/log0log.c2
-rw-r--r--storage/xtradb/log/log0recv.c7
-rw-r--r--storage/xtradb/os/os0file.c66
-rw-r--r--storage/xtradb/os/os0proc.c170
-rw-r--r--storage/xtradb/plug.in7
-rw-r--r--storage/xtradb/que/que0que.c5
-rw-r--r--storage/xtradb/row/row0mysql.c55
-rw-r--r--storage/xtradb/row/row0purge.c7
-rw-r--r--storage/xtradb/row/row0sel.c229
-rw-r--r--storage/xtradb/row/row0umod.c7
-rw-r--r--storage/xtradb/row/row0upd.c7
-rw-r--r--storage/xtradb/row/row0vers.c11
-rw-r--r--storage/xtradb/srv/srv0srv.c29
-rw-r--r--storage/xtradb/srv/srv0start.c9
-rw-r--r--storage/xtradb/sync/sync0rw.c9
-rw-r--r--storage/xtradb/sync/sync0sync.c3
-rw-r--r--storage/xtradb/trx/trx0i_s.c33
-rw-r--r--storage/xtradb/trx/trx0purge.c12
-rw-r--r--storage/xtradb/trx/trx0roll.c5
-rw-r--r--storage/xtradb/trx/trx0sys.c16
-rw-r--r--storage/xtradb/trx/trx0trx.c3
-rw-r--r--storage/xtradb/trx/trx0undo.c23
-rwxr-xr-xstrings/CMakeLists.txt2
-rw-r--r--strings/Makefile.am12
-rw-r--r--strings/conf_to_src.c2
-rw-r--r--support-files/MacOSX/Makefile.am3
-rw-r--r--support-files/RHEL4-SElinux/Makefile.am3
-rwxr-xr-xtests/CMakeLists.txt1
-rw-r--r--tests/mysql_client_test.c102
-rw-r--r--unittest/examples/Makefile.am3
-rw-r--r--unittest/examples/skip-t.c8
-rw-r--r--unittest/examples/skip_all-t.c8
-rw-r--r--unittest/examples/todo-t.c8
-rw-r--r--unittest/mysys/CMakeLists.txt3
-rw-r--r--unittest/mysys/Makefile.am3
-rw-r--r--unittest/mytap/CMakeLists.txt2
-rw-r--r--unittest/mytap/Makefile.am3
-rw-r--r--unittest/mytap/t/Makefile.am3
-rw-r--r--unittest/mytap/t/basic-t.c2
-rw-r--r--unittest/mytap/tap.c17
-rw-r--r--unittest/mytap/tap.h15
-rw-r--r--unittest/strings/Makefile.am3
-rw-r--r--unittest/unit.pl2
-rwxr-xr-xvio/CMakeLists.txt2
-rw-r--r--vio/Makefile.am8
-rw-r--r--win/configure-mariadb.bat8
743 files changed, 15328 insertions, 7849 deletions
diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh
index 2028db94eed..3f1933ac4ef 100755
--- a/BUILD/SETUP.sh
+++ b/BUILD/SETUP.sh
@@ -108,7 +108,7 @@ if [ "x$warning_mode" != "xpedantic" ]; then
# C++ warnings
cxx_warnings="$warnings -Wno-unused-parameter"
# cxx_warnings="$cxx_warnings -Woverloaded-virtual -Wsign-promo"
- cxx_warnings="$cxx_warnings -Wctor-dtor-privacy -Wnon-virtual-dtor"
+ cxx_warnings="$cxx_warnings -Wnon-virtual-dtor"
# Added unless --with-debug=full
debug_extra_cflags="-O0 -g3 -gdwarf-2"
else
diff --git a/BUILD/build_mccge.sh b/BUILD/build_mccge.sh
index f04caef8df8..81dbebff32d 100755
--- a/BUILD/build_mccge.sh
+++ b/BUILD/build_mccge.sh
@@ -63,41 +63,50 @@ sysadmin_usage()
cat <<EOF
This script can be used to build MySQL Cluster Carrier Grade Edition
- based on a source code release you received from MySQL.
+ based on a source code release you received from MySQL. It can also
+ be used to build many variants other variants of MySQL, in particular
+ various performance-optimised versions of MySQL.
It is assumed that you are building on a computer which is of the
- same type as that on which you intend to run MySQL Cluster.
+ same type as that on which you intend to run MySQL/MySQL Cluster.
The simplest possible way to run this script is to allow it to use the
- built-in defaults everywhere, invoking it simply as:
+ built-in defaults everywhere, invoking it simply as (from top-level
+ MySQL directory):
- shell> ./build_mccge.sh
+ shell> BUILD/build_mccge.sh
This performs the following operations:
1) Detects the operating system. Currently, Linux, FreeBSD, Solaris
- 10/11, and Mac OS X are supported by this script.
+ 8/9/10/11, and Mac OS X are supported by this script.
2) Detect the type of CPU being used. Currently supported processors
are: x86 for all supported operating systems, Itanium for Linux
- with GCC, and SPARC for Solaris using the Forte compiler.
+ with GCC, and x86 + SPARC for Solaris using the Forte compiler and
+ finally x86 on Linux using the Intel compiler.
3) Invokes the GCC compiler.
- 4) Builds a set of MySQL Cluster Carrier Grade Edition binaries; for
+ 4) Builds a set of MySQL/MySQL Cluster binaries; for
more information about these, see --extended-help.
+ 5) Default compiler is always gcc.
The default version assumes that you have a source code tarball from
which you are building, and thus autoconf and automake do not need to
be run. If you have downloaded a BitKeeper tree then you should read
--developer-help.
- If you are building MySQL Cluster Carrier Grade Edition for commercial
+ If you are building MySQL/MySQL Cluster for commercial
use then you need to set the --commercial flag to ensure that the
commercial libraries are compiled in, rather than the GPL-only
libraries. The default is to build a GPL version of MySQL Cluster
Carrier Grade Edition.
- If your building on a Solaris SPARC machine you must set
+ If your building on a Solaris SPARC machine and you want to compile
+ using SunStudio you must set
--compiler=forte; if you want to build using the Intel compiler on
Linux, you need to set --compiler=icc.
+ A synonym for forte is SunStudio, so one can also use
+ --compiler=SunStudio.
+
If you want to make sure that a 64-bit version is built then you
should add the flag --64. This is always set on Solaris machines and
when check-cpu is able to discover that a 64-bit CPU is being used. If
@@ -120,7 +129,7 @@ cat <<EOF
information in the binary then use --debug.
If your aim is not to build MySQL Cluster Carrier Grade Edition, you
- can also use this script to build MySQL Classic and MySQL Pro
+ can also use this script to build MySQL Classic and MySQL Enterprise Pro
versions; see the --extended-help for descriptions of these packages.
EOF
}
@@ -133,13 +142,20 @@ Usage: $0 [options]
--help Show this help message.
--sysadmin-help Show help for system administrators wishing
to build MySQL Cluster Carrier Grade Edition
+ or other MySQL versions.
--developer-help Show help for developers trying to build MySQL
--with-help Show extended help on --with-xxx options to
configure
--extended-help Show extended help message
--without-debug Build non-debug version
+ --use-comment Set the comment in the build
+ --with-fast-mutexes Use try/retry method of acquiring mutex
--with-debug Build debug version
--with-debug=full Build with full debug.
+ --with-link-time-optimizer
+ Link time optimizations enabled (Requires GCC 4.5
+ if GCC used), available for icc as well. This flag
+ is only considered if also fast is set.
--configure-only Stop after running configure.
--use-autotools Start by running autoconf, automake,.. tools
--no-autotools Start from configure
@@ -155,10 +171,10 @@ Usage: $0 [options]
MySQL use
--commercial Use commercial libraries
--gpl Use gpl libraries
- --compiler=[gcc|icc|forte] Select compiler
- --cpu=[x86|x86_64|sparc] Select CPU type
- x86 => 32-bit binary
- x86_64 => 64 bit binary unless Mac OS X
+ --compiler=[gcc|icc|forte|SunStudio] Select compiler
+ --cpu=[x86|x86_64|sparc|itanium] Select CPU type
+ x86 => x86 and 32-bit binary
+ x86_64 => x86 and 64 bit binary
--warning-mode=[extra|pedantic|normal|no] Set warning mode level
--warnings Set warning mode to normal
--32 Build a 32-bit binary even if CPU is 64-bit
@@ -170,8 +186,9 @@ Usage: $0 [options]
--error-inject Enable error injection into MySQL Server and
data nodes
--valgrind Build with valgrind
- --fast Optimise for CPU architecture buildt on
+ --fast Optimise for CPU architecture built on
--static-linking Statically link system libraries into binaries
+ --use-tcmalloc Link with tcmalloc instead of standard malloc (Linux only)
--with-flags * Pass extra --with-xxx options to configure
EOF
if test "x$1" != "x" ; then
@@ -186,13 +203,14 @@ extended_usage()
Extended help text for this script:
-----------------------------------
This script is intended to make it easier for customers using MySQL
- Cluster Carrier Grade Edition to build the product from source on
- these platforms/compilers: Linux/x86 (32-bit and 64-bit),
- Solaris 10 and 11/x86/gcc, Solaris 9/Sparc/Forte, and MacOSX/x86/gcc.
- The script automatically detects CPU type and operating system; in
- most cases this also determines which compiler to use, the exception
- being Linux/x86 where you can choose between gcc and icc (gcc is the
- default).
+ Cluster Carrier Grade Edition, customers using performance-optimised
+ MySQL versions and developers to build the product from source on
+ these platforms/compilers: Linux/x86 (32-bit and 64-bit) (either using
+ gcc or icc), Linux Itanium, Solaris 8,9,10 and 11 x86 and SPARC using
+ gcc or SunStudio and MacOSX/x86/gcc.
+
+ The script automatically detects CPU type and operating system; The
+ default compiler is always gcc.
To build on other platforms you can use the --print-only option on a
supported platform and edit the output for a proper set of commands on
@@ -213,7 +231,7 @@ extended_usage()
--package=cge
storage engines:
- ARCHIVE, BLACKHOLE, CSV, EXAMPLE, FEDERATED, MYISAM, NDB
+ ARCHIVE, BLACKHOLE, CSV, FEDERATED, MYISAM, NDB
(All storage engines except InnoDB)
comment: MySQL Cluster Carrier Grade Edition GPL/Commercial version
built from source
@@ -221,7 +239,7 @@ extended_usage()
--package=extended
storage engines:
- ARCHIVE, BLACKHOLE, CSV, EXAMPLE, FEDERATED, MYISAM, INNODB, NDB
+ ARCHIVE, BLACKHOLE, CSV, FEDERATED, MYISAM, INNODB, NDB
(All storage engines)
comment: MySQL Cluster Carrier Grade Extended Edition GPL/Commercial
version built from source
@@ -229,7 +247,7 @@ extended_usage()
--package=pro
storage engines:
- ARCHIVE, BLACKHOLE, CSV, EXAMPLE, FEDERATED, INNODB, MYISAM
+ ARCHIVE, BLACKHOLE, CSV, FEDERATED, INNODB, MYISAM
(All storage engines except NDB)
comment: MySQL Pro GPL/Commercial version built from
source
@@ -291,11 +309,16 @@ extended_usage()
by MySQL (cannot be overridden).
--with-ssl: Enable use of yaSSL library included in the MySQL source
+ if possible (GCC and same CC and CXX).
(cannot be overridden).
--with-pic: Build all binaries using position independent assembler
to avoid problems with dynamic linkers (cannot be overridden).
+ --without-example-engine: Ensure that the example engine isn't built,
+ it cannot do any useful things, it's merely intended as documentation.
+ (cannot be overridden)
+
--with-csv-storage-engine: Ensure that the CSV storage engine is
included in all builds. Since CSV is required for log tables in
MySQL 5.1, this option cannot be overridden.
@@ -314,10 +337,6 @@ extended_usage()
In addition there are some configure options that are specific to
Linux operating systems:
- --with-fast-mutexes
- Include an alternative implementation of mutexes that is faster on
- Linux systems
-
--enable-assembler
Include assembler code optimisations for a number of mostly string
methods. Used for x86 processors only.
@@ -364,17 +383,24 @@ extended_usage()
--with-mysqld-libs=-lmtmalloc
Used on Solaris to ensure that the proper malloc library is used.
+ Investigations have shown mtmalloc to be the best choice on Solaris,
+ also umem has good performance on Solaris but better debugging
+ capabilities.
Compiler options:
-----------------
- This section describes the compiler options for each of the different
- platforms supported by thisscript.
+ This section describes the compiler options for each of the different
+ platforms supported by this script.
+
+ The --fast option adds -mtune=cpu_arg to the C/C++ flags (provides
+ support for Nocona, K8, and other processors).
- The --fast option adds -mtune=cpu_arg to the C/C++ flags (provides
- support for Nocona, K8, and other processors).
+ Use of the --debug option adds -g to the C/C++ flags.
- Use of the --debug option adds -g to the C/C++ flags.
+ In all cases it is possible to override the definition of CC and CXX
+ by calling the script as follows:
+ CC="/usr/local/bin/gcc" CXX="/usr/local/bin/gcc" BUILD/build_mccge.sh
FreeBSD/x86/gcc
---------------
@@ -383,8 +409,7 @@ extended_usage()
Linux/x86+Itanium/gcc
-------------
- No flags are used. Instead the configure script determines the
- proper flags to use for both normal and debug builds. Discovery of a
+ For debug builds -O is used and otherwise -O3 is used.Discovery of a
Nocona or Core 2 Duo CPU causes a 64-bit binary to be built;
otherwise, the binary is 32-bit. To build a 64-bit binary, -m64 is
added to the C/C++ flags. (To build a 32-bit binary on a 64-bit CPU,
@@ -393,48 +418,105 @@ extended_usage()
Linux/x86+Itanium/icc
-------------
Flags used:
- CC = icc -static-libgcc -static-libcxa -i-static
- C++ = icpc -static-libgcc -static-libcxa -i-static
+ CC = icc -static-libgcc -static-intel
+ C++ = icpc -static-libgcc -static-intel
C/C++ flags = -mp -restrict
- On Itanium we also add -no-ftz and -no-prefetch to CC and C++ flags.
+ On Itanium we also add -no-ftz and to CC and C++ flags.
- The non-debug versions also add the following:
- C/C++ flags += -O3 unroll2 -ip
+ Note that if the user of this script sets CC or CXX explicitly then
+ also -static-libgcc and -static-intel needs to be set in the CC and
+ CXX.
- The fast version adds:
- C/C++ flags += -ipo
+ The non-debug versions also add the following:
+ C/C++ flags += -O3 unroll2 -ip
- On discovery of a Core 2 Duo architecture while using icc, -xT is also
- added to the C/C++ flags; this provides optimisations specific to Core
- 2 Duo. This is added only when the --fast flag is set.
+ The fast version adds (if --with-link-time-optimizer is used):
+ C/C++ flags += -ipo
+
+ On discovery of a Core 2 Duo architecture while using icc, -xT is also
+ added to the C/C++ flags; this provides optimisations specific to Core
+ 2 Duo. This is added only when the --fast flag is set.
Solaris/x86/gcc
---------------
- All builds on Solaris are 64-bit, so -m64 is always used in the
- C/C++ flags. LDFLAGS is set to -m64 -static-libgcc -O/-O2.
+ All builds on Solaris are by default 64-bit, so -m64 is always used in
+ the C/C++ flags. LDFLAGS is set to -m64 -O/-O2/-O3. If for
+ some reason a 32-bit Solaris is used it is necessary to add the flag
+ --32 to the script invocation. Due to bugs in compiling with -O3 on
+ Solaris only -O2 is used by default, when --fast flag is used -O3 will
+ be used instead.
+
+ Sets -m64 (default) or -m32 (if specifically set) in LDFLAGS and
+ C/C++ flags.
Solaris/Sparc/Forte
-------------------
- Uses cc-5.0 as CC
- Sets ASFLAGS=LDFLAGS=xarch=v9, so that we compile Sparc v9 binaries
- C flags = -Xa -strconst -xc99=none
+ Uses cc as CC and CC as CXX
+ Note that SunStudio uses different binaries for C and C++ compilers.
+
+ Set -m64 (default) or -m32 (if specifically set) in ASFLAGS,
+ LDFLAGS and C/C++ flags.
+
+ Sets ASFLAGS=LDFLAGS=compiler flags=xarch=sparc, so that we compile
+ Sparc v9 binaries, also -mt is set in all those since we're always
+ building a multithreaded program.
+
+ C flags = -xstrconst This flag is set only on SPARC
C++ flags = -noex
- C/C++ flags = -mt -D_FORTEC -xarch=v9
- For non-debug builds, the following flags are also used:
+ Set the following C/C++ flags:
+ -fsimple=1
+ -ftrap=%none
+ -nofstore This flag is set only on x86
+ -xbuiltin=%all
+ -xlibmil
+ -xlibmopt
- C/C++ flags = -xO3
+ Set the C++ flag:
+ -noex
+ -features=no%except This flag is set only on x86
+
+ When compiling with fast we set (-ipo only used if we have
+ set --with-link-time-optimizer):
+ C/C++ flags: -xtarget=native -xunroll=3 -xipo
+ LDFLAGS: -xipo
+
+ When not compiling with fast we always set -xtarget=generic
+
+ When compiling with fast on SPARC we also set:
+ C/C++ flags: -xbinopt=prepare
+ LDFLAGS: -xbinopt=prepare
+
+ When compiling with fast on x86 we also set:
+ C/C++ flags: -xregs=frameptr
+ When not compiling with fast we set on x86
+ C/C++ flags: -xregs=no%frameptr
+
+ On SPARC we set
+ ASFLAGS = LDFLAGS = C/C++ flags = -xarch=sparc
+
+ The optimisation level is
+ -xO Debug builds
+ -xO2 Production build on SPARC
+ -xO3 Production build on x86
+ -xO4 Fast builds on SPARC/x86
MacOSX/x86/gcc
--------------
- C/C++ flags include -fno-common -arch i386.
+ C/C++ flags include -fno-common -arch i386.
+ When 64-bits builds then i386 is replaced by x86_64.
- Non-debug versions also add -Os -felide-constructors, where "-Os"
- means the build is space-optimised as long as the space optimisations
- do not negatively affect performance. Debug versions use -O.
+ Non-debug versions also add -Os -felide-constructors, where "-Os"
+ means the build is space-optimised as long as the space optimisations
+ do not negatively affect performance. Debug versions use -O.
+
+ Mac OS X builds will always be 32-bit by default, when --64 is added
+ the build will be 64 bit instead. Thus the flag --m64 is added only
+ when specifically given as an option.
EOF
}
+
with_usage()
{
cat <<EOF
@@ -495,7 +577,7 @@ parse_package()
package="pro"
;;
extended )
- package=""
+ package="extended"
;;
cge )
package="cge"
@@ -537,11 +619,15 @@ parse_cpu_type()
case "$cpu_type" in
x86 )
cpu_type="x86"
- m32="yes"
+ if test "x$m64" = "x" ; then
+ m64="no"
+ fi
;;
x86_64 )
cpu_type="x86"
- m64="yes"
+ if test "x$m64" = "x" ; then
+ m64="yes"
+ fi
;;
itanium )
cpu_type="itanium"
@@ -569,7 +655,7 @@ parse_compiler()
icc )
compiler="icc"
;;
- forte )
+ forte | SunStudio | sunstudio )
compiler="forte"
;;
*)
@@ -590,6 +676,9 @@ parse_options()
--datadir=*)
datadir=`get_key_value "$1"`
;;
+ --with-link-time-optimizer)
+ with_link_time_optimizer="yes"
+ ;;
--with-debug=full)
full_debug="=full"
with_debug_flag="yes"
@@ -601,6 +690,15 @@ parse_options()
fast_flag="generic"
fi
;;
+ --use-comment)
+ without_comment="no"
+ ;;
+ --with-fast-mutexes)
+ with_fast_mutexes="yes"
+ ;;
+ --use-tcmalloc)
+ use_tcmalloc="yes"
+ ;;
--with-debug)
with_debug_flag="yes"
fast_flag="no"
@@ -636,17 +734,19 @@ parse_options()
warning_mode="normal"
;;
--32)
- if test "x$m64" != "x" ; then
+ if test "x$explicit_size_set" != "x" ; then
echo "Cannot set both --32 and --64"
exit 1
fi
- m32="yes"
+ explicit_size_set="yes"
+ m64="no"
;;
--64)
- if test "x$m32" != "x" ; then
+ if test "x$explicit_size_set" != "x" ; then
echo "Cannot set both --32 and --64"
exit 1
fi
+ explicit_size_set="yes"
m64="yes"
;;
--package=*)
@@ -750,13 +850,15 @@ set_cpu_base()
if test "x$cpu_type" = "x" ; then
if test "x$cpu_arg" = "x" ; then
usage "CPU type not discovered, cannot proceed"
- return 1
+ exit 1
fi
case "$cpu_arg" in
core2 | nocona | prescott | pentium* | i*86 )
+ # Intel CPU
cpu_base_type="x86"
;;
- athlon* | opteron* )
+ athlon* | opteron* | k6 | k8 )
+ # AMD CPU
cpu_base_type="x86"
;;
sparc )
@@ -775,18 +877,20 @@ set_cpu_base()
check_cpu_cflags=""
fi
if test "x$os" = "xMacOSX" ; then
- m64="no"
+ if test "x$m64" = "x" ; then
+ m64="no"
+ fi
elif test "x$os" = "xSolaris" ; then
- m64="yes"
- elif test "x$m32" = "x" ; then
+ if test "x$m64" = "x" ; then
+ m64="yes"
+ fi
+ elif test "x$m64" = "x" ; then
if test "x$cpu_arg" = "xnocona" || test "x$cpu_arg" = "xcore2" || \
test "x$cpu_arg" = "xathlon64" || test "x$cpu_arg" = "xopteron" ; then
m64="yes"
- elif test "x$m64" != "xyes" ; then
+ else
m64="no"
fi
- else
- m64="no"
fi
echo "Discovered CPU of type $cpu_base_type ($cpu_arg) on $os"
if test "x$m64" = "xyes" ; then
@@ -806,18 +910,15 @@ init_configure_commands()
cxxflags="$cxx_warnings $base_cxxflags $compiler_flags"
configure="./configure $base_configs $with_flags"
- commands="$commands
- CC=\"$CC\" CFLAGS=\"$cflags\" CXX=\"$CXX\" CXXFLAGS=\"$cxxflags\""
+ env_flags="CC=\"$CC\" CFLAGS=\"$cflags\" CXX=\"$CXX\" CXXFLAGS=\"$cxxflags\""
if test "x$LDFLAGS" != "x" ; then
- commands="$commands
- LDFLAGS=\"$LDFLAGS\""
+ env_flags="$env_flags LDFLAGS=\"$LDFLAGS\""
fi
if test "x$ASFLAGS" != "x" ; then
- commands="$commands
- ASFLAGS=\"$ASFLAGS\""
+ env_flags="$env_flags ASFLAGS=\"$ASFLAGS\""
fi
commands="$commands
- $configure"
+ $env_flags $configure"
}
#
@@ -920,7 +1021,7 @@ set_libtoolize_version()
# We do not use ccache when gcov is used. Also only when
# gcc is used.
#
-set_up_ccache()
+set_ccache_usage()
{
if test "x$compiler" = "xgcc" ; then
if ccache -V > /dev/null 2>&1 && test "$USING_GCOV" != "1"
@@ -994,7 +1095,7 @@ set_with_debug_flags()
if test "x$with_debug_flag" = "xyes" ; then
if test "x$developer_flag" = "xyes" ; then
loc_debug_flags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG -DFORCE_INIT_OF_VARS "
- loc_debug_flags="$loc_debug_cflags -DSAFEMALLOC -DPEDANTIC_SAFEMALLOC"
+ loc_debug_flags="$loc_debug_flags -DSAFEMALLOC -DPEDANTIC_SAFEMALLOC"
compiler_flags="$compiler_flags $loc_debug_flags"
fi
fi
@@ -1024,6 +1125,18 @@ set_debug_flag()
}
#
+# We compile in SSL support if we can, this isn't possible if CXX
+# and CC aren't the same and we're not using GCC.
+#
+set_ssl()
+{
+ if test "x$compiler" = "xgcc" && \
+ test "x$CC" = "x$CXX" ; then
+ base_configs="$base_configs --with-ssl"
+ fi
+}
+
+#
# Base options used by all packages
#
# SSL library to use. --with-ssl selects the bundled yaSSL
@@ -1048,9 +1161,12 @@ set_base_configs()
base_configs="$base_configs --enable-thread-safe-client"
base_configs="$base_configs --with-big-tables"
base_configs="$base_configs --with-extra-charsets=all"
- base_configs="$base_configs --with-ssl"
+ if test "x$with_fast_mutexes" = "xyes" ; then
+ base_configs="$base_configs --with-fast-mutexes"
+ fi
base_configs="$base_configs --with-pic"
base_configs="$base_configs --with-csv-storage-engine"
+ base_configs="$base_configs --with-perfschema"
}
#
@@ -1060,18 +1176,30 @@ set_base_configs()
#
set_base_engines()
{
- engine_configs="$engine_configs --with-archive-storage-engine"
+ engine_configs="--with-archive-storage-engine"
engine_configs="$engine_configs --with-blackhole-storage-engine"
- engine_configs="$engine_configs --with-example-storage-engine"
+ engine_configs="$engine_configs --without-example-storage-engine"
engine_configs="$engine_configs --with-federated-storage-engine"
engine_configs="$engine_configs --with-partition"
+ base_configs="$base_configs $engine_configs"
}
-set_pro_package()
+set_innodb_engine()
{
- base_configs="$base_configs $engine_configs"
base_configs="$base_configs --with-innodb"
- base_configs="$base_configs --with-comment=\"MySQL Pro $version_text built from source\""
+}
+
+set_ndb_engine()
+{
+ base_configs="$base_configs --with-ndbcluster"
+ base_configs="$base_configs --without-ndb-debug"
+}
+
+set_pro_package()
+{
+ if test "x$without_comment" != "xyes" ; then
+ base_configs="$base_configs --with-comment=\"MySQL Enterprise Pro $version_text built from source\""
+ fi
if test "x$with_debug_flag" = "xyes" ; then
base_configs="$base_configs --with-server-suffix=\"-debug\""
fi
@@ -1079,40 +1207,37 @@ set_pro_package()
set_cge_extended_package()
{
- if test "x$gpl" = "xno" ; then
- echo "Cannot build Extended Carrier Grade Edition as Commercial version"
+ if test "x$without_comment" != "xyes" ; then
+ base_configs="$base_configs --with-comment=\"MySQL Cluster Carrier Grade Extended Edition $version_text built from source\""
fi
- base_configs="$base_configs --with-ndbcluster"
- base_configs="$base_configs --without-ndb-debug"
- base_configs="$base_configs $engine_configs"
- base_configs="$base_configs --with-innodb"
- base_configs="$base_configs --with-comment=\"MySQL Cluster Carrier Grade Extended Edition $version_text built from source\""
if test "x$with_debug_flag" = "xyes" ; then
base_configs="$base_configs --with-server-suffix=\"-cge-extended-debug\""
else
- base_configs="$base_configs --with-server-suffix=\"-cge-extended"\"
+ base_configs="$base_configs --with-server-suffix=\"-cge-extended\""
fi
}
set_cge_package()
{
- base_configs="$base_configs --with-ndbcluster"
- base_configs="$base_configs --without-ndb-debug"
- base_configs="$base_configs $engine_configs"
- base_configs="$base_configs --with-comment=\"MySQL Cluster Carrier Grade Edition $version_text built from source\""
+ if test "x$without_comment" != "xyes" ; then
+ base_configs="$base_configs --with-comment=\"MySQL Cluster Carrier Grade Edition $version_text built from source\""
+ fi
if test "x$with_debug_flag" = "xyes" ; then
base_configs="$base_configs --with-server-suffix=\"-cge-debug\""
else
- base_configs="$base_configs --with-server-suffix=\"-cge"\"
+ base_configs="$base_configs --with-server-suffix=\"-cge\""
fi
}
set_classic_package()
{
- base_configs="$base_configs --with-comment=\"MySQL Classic $version_text built from source\""
+ if test "x$without_comment" != "xyes" ; then
+ base_configs="$base_configs --with-comment=\"MySQL Classic $version_text built from source\""
+ fi
if test "x$with_debug_flag" = "xyes" ; then
base_configs="$base_configs --with-server-suffix=\"-debug\""
fi
+ base_configs="$base_configs --without-example-storage-engine"
}
#
@@ -1140,6 +1265,36 @@ set_gcc_special_options()
fi
}
+set_cc_and_cxx_for_gcc()
+{
+ if test "x$CC" = "x" ; then
+ CC="gcc -static-libgcc -fno-exceptions"
+ fi
+ if test "x$CXX" = "x" ; then
+ CXX="gcc -static-libgcc -fno-exceptions"
+ fi
+}
+
+set_cc_and_cxx_for_icc()
+{
+ if test "x$CC" = "x" ; then
+ CC="icc -static-intel -static-libgcc"
+ fi
+ if test "x$CXX" = "x" ; then
+ CXX="icpc -static-intel -static-libgcc"
+ fi
+}
+
+set_cc_and_cxx_for_forte()
+{
+ if test "x$CC" = "x" ; then
+ CC="cc"
+ fi
+ if test "x$CXX" = "x" ; then
+ CXX="CC"
+ fi
+}
+
#
# If we discover a Core 2 Duo architecture and we have enabled the fast
# flag, we enable a compile especially optimised for Core 2 Duo. This
@@ -1167,42 +1322,116 @@ set_bsd_configs()
exit 1
fi
base_configs="$base_configs --enable-assembler"
- CC="gcc"
- CXX="gcc"
+ if test "x$fast_flag" != "xno" ; then
+ compiler_flags="$compiler_flags -O3"
+ else
+ compiler_flags="$compiler_flags -O0"
+ fi
+ set_cc_and_cxx_for_gcc
+}
+
+check_64_bits()
+{
+ echo "Checking for 32/64-bits compilation"
+ echo "int main() { return 0; }" > temp_test.c
+ if test "x$m64" = "xyes" ; then
+ cmd="$CC $compile_flags -m64 temp_test.c"
+ if ! $cmd 2>1 ; then
+ m64="no"
+ echo "Changing to 32-bits since 64-bits didn't work"
+ else
+ echo "Will use 64-bits"
+ fi
+ else
+ cmd="$CC $compile_flags -m32 temp_test.c"
+ if ! $cmd 2>1 ; then
+ m64="yes"
+ echo "Changing to 64-bits since 32-bits didn't work"
+ else
+ echo "Will use 32-bits"
+ fi
+ fi
+ rm temp_test.c
}
#
+# Get GCC version
+#
+get_gcc_version()
+{
+ # check if compiler is gcc and dump its version
+ cc_verno=`$cc -dumpversion 2>/dev/null`
+ if test "x$?" = "x0" ; then
+ set -- `echo $cc_verno | tr '.' ' '`
+ cc_ver="GCC"
+ cc_major=$1
+ cc_minor=$2
+ cc_patch=$3
+ gcc_version=`expr $cc_major '*' 100 '+' $cc_minor`
+ fi
+}
+
+#
+# Link Time Optimizer in GCC (LTO) uses a parameter -flto
+# which was added to GCC 4.5, if --with-link-time-optimizer
+# is set then use this feature
+#
+check_for_link_time_optimizer()
+{
+ get_gcc_version
+ if test "$gcc_version" -ge 405 && \
+ test "x$with_link_time_optimizer" = "xyes" ; then
+ compiler_flags="$compiler_flags -flto"
+ LDFLAGS="$LDFLAGS -flto"
+ fi
+}
+#
# Linux Section
#
set_linux_configs()
{
if test "x$cpu_base_type" != "xx86" && \
test "x$cpu_base_type" != "xitanium" ; then
- usage "Only x86 and Itanium CPUs supported for 32-bit Linux"
+ usage "Only x86 and Itanium CPUs supported for Linux"
exit 1
fi
- base_configs="$base_configs --with-fast-mutexes"
+ if test "x$use_tcmalloc" = "xyes" ; then
+ base_configs="$base_configs --with-mysqld-libs=-ltcmalloc_minimal"
+ fi
if test "x$cpu_base_type" = "xx86" ; then
base_configs="$base_configs --enable-assembler"
fi
if test "x$compiler" = "xgcc" ; then
- CC="gcc"
- CXX="gcc"
+ set_cc_and_cxx_for_gcc
+ if test "x$fast_flag" != "xno" ; then
+ if test "x$fast_flag" = "xyes" ; then
+ compiler_flags="$compiler_flags -O3"
+ check_for_link_time_optimizer
+ else
+ compiler_flags="$compiler_flags -O2"
+ fi
+ else
+ compiler_flags="$compiler_flags -O0"
+ fi
+ check_64_bits
if test "x$m64" = "xyes" ; then
compiler_flags="$compiler_flags -m64"
+ else
+ compiler_flags="$compiler_flags -m32"
fi
# configure will set proper compiler flags for gcc on Linux
elif test "x$compiler" = "xicc" ; then
compiler_flags="$compiler_flags -mp -restrict"
- CC="icc -static-intel"
- CXX="icpc -static-intel"
+ set_cc_and_cxx_for_icc
if test "x$cpu_base_type" = "xitanium" ; then
compiler_flags="$compiler_flags -no-ftz"
fi
if test "x$fast_flag" != "xno" ; then
compiler_flags="$compiler_flags -O3 -unroll2 -ip"
- if test "x$fast_flag" = "xyes" ; then
+ if test "x$fast_flag" = "xyes" && \
+ test "x$with_link_time_optimizer" = "xyes" ; then
compiler_flags="$compiler_flags -ipo"
+ LDFLAGS="$LDFLAGS -ipo"
fi
fi
else
@@ -1216,53 +1445,111 @@ set_linux_configs()
#
set_solaris_configs()
{
- base_configs="$base_configs --with-mysqld-libs=-lmtmalloc"
+# Use mtmalloc as malloc, see Tim Cook blog
+# For information on optimal compiler settings, see article at
+# http://developers.sun.com/solaris/articles/mysql_perf_tune.html
+# by Luojia Chen at Sun.
+ base_configs="$base_configs --with-named-curses=-lcurses"
case "`uname -a`" in
- *5.10*|*5.11*)
+ *5.8* | *5.9* )
+ ;;
+
+ *5.10* | *5.11*)
+ base_configs="$base_configs --with-mysqld-libs=-lmtmalloc"
;;
*)
- die "Only versions 10 and 11 supported for Solaris"
+ usage "Only versions 8,9, 10 and 11 supported for Solaris"
+ exit 1
esac
if test "x$cpu_base_type" != "xx86" && \
test "x$cpu_base_type" != "xsparc" ; then
usage "Only x86 and Sparc CPUs supported for Solaris"
exit 1
fi
+ if test "x$compiler" != "xgcc" && \
+ test "x$compiler" != "xforte" ; then
+ usage "Only gcc and Forte compilers supported for Solaris"
+ exit 1
+ fi
+ if test "x$m64" = "xyes" ; then
+ compiler_flags="$compiler_flags -m64"
+ LDFLAGS="-m64"
+ ASFLAGS="$ASFLAGS -m64"
+ else
+ compiler_flags="$compiler_flags -m32"
+ LDFLAGS="-m32"
+ ASFLAGS="$ASFLAGS -m32"
+ fi
if test "x$compiler" = "xgcc" ; then
- CC="gcc"
- CXX="gcc"
+ set_cc_and_cxx_for_gcc
if test "x$cpu_base_type" != "xx86" ; then
- usage "Only gcc supported for Solaris 10/11 on SPARC"
+ usage "gcc currently not supported for Solaris on SPARC"
+ exit 1
fi
- compiler_flags="$compiler_flags -m64 -DMY_ATOMIC_MODE_RWLOCKS"
- LDFLAGS="-m64 -static-libgcc"
- if test "x$fast_flag" != "xno" ; then
- LDFLAGS="$LDFLAGS -O2"
- compiler_flags="$compiler_flags -O2"
+ if test "x$fast_flag" = "xyes" ; then
+ LDFLAGS="$LDFLAGS -O3"
+ compiler_flags="$compiler_flags -O3"
+ check_for_link_time_optimizer
else
- LDFLAGS="$LDFLAGS -O"
- compiler_flags="$compiler_flags -O"
- fi
- elif test "x$compiler" = "xforte" ; then
- if test "x$cpu_base_type" = "xx86" ; then
- usage "Only gcc supported for Solaris/x86"
+ if test "x$fast_flag" = "xgeneric" ; then
+ LDFLAGS="$LDFLAGS -O2"
+ compiler_flags="$compiler_flags -O2"
+ else
+ LDFLAGS="$LDFLAGS -O0"
+ compiler_flags="$compiler_flags -O0"
+ fi
fi
- if test "x$cpu_base_type" != "xsparc" ; then
- usage "Forte compiler supported for Solaris 9/SPARC only"
+ else
+#Using Forte compiler (SunStudio)
+ set_cc_and_cxx_for_forte
+ compiler_flags="$compiler_flags -mt"
+ LDFLAGS="$LDFLAGS -mt"
+ compiler_flags="$compiler_flags -fsimple=1"
+ compiler_flags="$compiler_flags -ftrap=%none"
+ compiler_flags="$compiler_flags -xbuiltin=%all"
+ compiler_flags="$compiler_flags -xlibmil"
+ compiler_flags="$compiler_flags -xlibmopt"
+ if test "x$fast_flag" = "xyes" ; then
+ compiler_flags="$compiler_flags -xtarget=native"
+ compiler_flags="$compiler_flags -xunroll=3"
+ if test "x$with_link_time_optimizer" = "xyes" ; then
+ compiler_flags="$compiler_flags -xipo"
+ LDFLAGS="$LDFLAGS -xipo"
+ fi
+ else
+ compiler_flags="$compiler_flags -xtarget=generic"
fi
- CC="cc-5.0"
- CXX=CC
- ASFLAGS="xarch=v9"
- LDFLAGS="xarch=v9"
- base_cflags="$base_cflags -Xa -xstrconst -xc99=none"
- base_cxxflags="$base_cxxflags -noex"
- compiler_flags="$compiler_flags -mt -D_FORTEC -xarch=v9"
- if test "x$fast_flag" != "xno" ; then
- compiler_flags="$compiler_flags -xO3"
+ if test "x$cpu_base_type" = "xx86" ; then
+ compiler_flags="$compiler_flags -nofstore"
+ base_cxx_flags="$base_cxx_flags -features=no%except"
+ if test "x$fast_flag" = "xyes" ; then
+ compiler_flags="$compiler_flags -xregs=frameptr"
+ compiler_flags="$compiler_flags -xO4"
+ else
+ compiler_flags="$compiler_flags -xregs=no%frameptr"
+ if test "x$fast_flag" = "xgeneric" ; then
+ compiler_flags="$compiler_flags -xO2"
+ else
+ compiler_flags="$compiler_flags -xO0"
+ fi
+ fi
+ else
+#Using SPARC cpu with SunStudio (Forte) compiler
+ ASFLAGS="$ASFLAGS -xarch=sparc"
+ LDFLAGS="$LDFLAGS -xarch=sparc"
+ base_cxxflags="$base_cxxflags -noex"
+ base_cflags="$base_cflags -xstrconst"
+ compiler_flags="$compiler_flags -xarch=sparc"
+ if test "x$fast_flag" = "xyes" ; then
+ compiler_flags="$compiler_flags -xbinopt=prepare"
+ LDFLAGS="$LDFLAGS -xbinopt=prepare"
+ compiler_flags="$compiler_flags -xO4"
+ elif test "x$fast_flag" = "xgeneric" ; then
+ compiler_flags="$compiler_flags -xO3"
+ else
+ compiler_flags="$compiler_flags -xO0"
+ fi
fi
- else
- usage "Only gcc and Forte compilers supported for Solaris"
- exit 1
fi
}
@@ -1271,10 +1558,7 @@ set_solaris_configs()
#
set_macosx_configs()
{
- base_cxxflags="$base_cxxflags -fno-common"
- if test "x$cpu_base_type" = "xx86" && test "x$compiler" = "xgcc" ; then
- compiler_flags="$compiler_flags -arch i386"
- else
+ if test "x$cpu_base_type" != "xx86" || test "x$compiler" != "xgcc" ; then
usage "Only gcc/x86 supported for Mac OS X"
exit 1
fi
@@ -1282,14 +1566,21 @@ set_macosx_configs()
# Optimize for space as long as it doesn't affect performance, use some
# optimisations also when not in fast mode.
#
+ base_cxxflags="$base_cxxflags -felide-constructors"
+ compiler_flags="$compiler_flags -fno-common"
+ if test "x$m64" = "xyes" ; then
+ compiler_flags="$compiler_flags -m64"
+ compiler_flags="$compiler_flags -arch x86_64"
+ else
+ compiler_flags="$compiler_flags -m32"
+ compiler_flags="$compiler_flags -arch i386"
+ fi
if test "x$fast_flag" != "xno" ; then
compiler_flags="$compiler_flags -Os"
- base_cxxflags="$base_cxxflags -felide-constructors"
else
- compiler_flags="$compiler_flags -O"
+ compiler_flags="$compiler_flags -O0"
fi
- CC="gcc"
- CXX="gcc"
+ set_cc_and_cxx_for_gcc
}
#
@@ -1370,7 +1661,7 @@ fi
cpu_type=
package=
prefix="/usr/local/mysql"
-parallelism="4"
+parallelism="8"
fast_flag="generic"
compiler="gcc"
gpl="yes"
@@ -1398,11 +1689,19 @@ base_cxxflags=
base_configs=
debug_flags=
cxxflags=
-m32=
m64=
+explicit_size_set=
datadir=
commands=
use_autotools=
+engine_configs=
+ASFLAGS=
+LDFLAGS=
+use_tcmalloc=
+without_comment="yes"
+with_fast_mutexes=
+with_link_time_optimizer=
+gcc_version="0"
set_defaults_based_on_environment
@@ -1419,7 +1718,14 @@ set -e
# This call sets the cpu_arg and check_cpu_args parameters
#
path=`dirname $0`
+if test "x$compiler" = "xgcc" ; then
+ compiler=
+fi
. "$path/check-cpu"
+if test "x$compiler" = "x" ; then
+ compiler="gcc"
+fi
+check_os
set_cpu_base
if test "x$?" = "x1" ; then
exit 1
@@ -1447,17 +1753,23 @@ set_icc_special_options
# including all storage engines except InnoDB, and to use GPL libraries.
#
set_base_configs
-set_base_engines
if test "x$gpl" = "xyes" ; then
version_text="GPL version"
else
version_text="Commercial version"
fi
if test "x$package" = "xpro" ; then
+ set_base_engines
+ set_innodb_engine
set_pro_package
elif test "x$package" = "xextended" ; then
+ set_base_engines
+ set_ndb_engine
+ set_innodb_engine
set_cge_extended_package
elif test "x$package" = "xcge" ; then
+ set_base_engines
+ set_ndb_engine
set_cge_package
elif test "x$package" = "xclassic" ; then
set_classic_package
@@ -1473,7 +1785,6 @@ set_error_inject_configs
# operating systems, and processors.
#
-check_os
if test "x$os" = "xlinux" ; then
set_linux_configs
elif test "x$os" = "xSolaris" ; then
@@ -1485,13 +1796,13 @@ elif test "x$os" = "xbsd" ; then
else
die "Operating system not supported by this script"
fi
-
+set_ssl
#
# Final step before setting up commands is to set up proper make and
# proper libtoolize versions, and to determine whether to use ccache.
#
set_make_version
-set_up_ccache
+set_ccache_usage
#
# Set up commands variable from variables prepared for base
diff --git a/BUILD/check-cpu b/BUILD/check-cpu
index 390ba545405..90f42ef67cc 100755
--- a/BUILD/check-cpu
+++ b/BUILD/check-cpu
@@ -16,12 +16,14 @@ check_cpu () {
# on Linux (and others?) we can get detailed CPU information out of /proc
cpuinfo="cat $CPUINFO"
+ # detect CPU architecture
+ cpu_arch=`$cpuinfo | grep 'arch' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1`
+
# detect CPU family
cpu_family=`$cpuinfo | grep 'family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1`
if test -z "$cpu_family" ; then
cpu_family=`$cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1`
fi
-
# detect CPU vendor and model
cpu_vendor=`$cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1`
model_name=`$cpuinfo | grep 'model name' | cut -d ':' -f 2 | head -1`
@@ -56,8 +58,8 @@ check_cpu () {
fi
;;
*)
- cpu_family=`uname -m`;
- model_name=`uname -p`;
+ cpu_family=`uname -p`;
+ model_name=`uname -m`;
;;
esac
fi
@@ -65,9 +67,10 @@ check_cpu () {
# detect CPU shortname as used by gcc options
# this list is not complete, feel free to add further entries
cpu_arg=""
- case "$cpu_family--$model_name" in
+ low_cpu_arg=""
+ case "$cpu_vendor--$cpu_family--$model_name--$cpu_arch" in
# DEC Alpha
- Alpha*EV6*)
+ *Alpha*EV6*)
cpu_arg="ev6";
;;
#Core 2 Duo
@@ -96,6 +99,13 @@ check_cpu () {
*Pentium*4*Mobile*)
cpu_arg="pentium4m"
;;
+ *Pentium\(R\)*\ M*)
+ cpu_arg="pentium-m"
+ low_cpu_arg="pentium3"
+ ;;
+ *Pentium\(R\)*\ D*)
+ cpu_arg="prescott"
+ ;;
*Pentium*4*)
cpu_arg="pentium4"
;;
@@ -120,6 +130,12 @@ check_cpu () {
*Celeron*)
cpu_arg="pentium2"
;;
+ *Atom*)
+ cpu_arg="prescott"
+ ;;
+ *GenuineIntel*)
+ cpu_arg="pentium"
+ ;;
*Turion*)
cpu_arg="athlon64"
;;
@@ -129,9 +145,30 @@ check_cpu () {
*Athlon*)
cpu_arg="athlon"
;;
+ *AMD-K7*)
+ cpu_arg="athlon"
+ ;;
+ *Athlon*XP\ *)
+ cpu_arg="athlon-xp"
+ ;;
+ *AMD*Sempron\(tm\)*)
+ cpu_arg="athlon-mp"
+ ;;
+ *AMD*Athlon\(tm\)\ 64*)
+ cpu_arg="k8"
+ ;;
*Opteron*)
cpu_arg="opteron"
;;
+ *Phenom*)
+ cpu_arg="k8"
+ ;;
+ *AuthenticAMD*)
+ cpu_arg="k6"
+ ;;
+ *VIA\ *)
+ cpu_arg="i686"
+ ;;
# MacOSX / Intel
*i386*i486*)
cpu_arg="pentium-m"
@@ -143,8 +180,11 @@ check_cpu () {
*Itanium*)
cpu_arg="itanium"
;;
+ *IA-64*)
+ cpu_arg="itanium"
+ ;;
# Solaris Sparc
- *sparc*sun4u*)
+ *sparc*sun4[uv]*)
cpu_arg="sparc"
;;
# Power PC
@@ -160,6 +200,10 @@ check_cpu () {
;;
esac
+ if test "x$low_cpu_arg" = "x" ; then
+ low_cpu_arg="$cpu_arg"
+ fi
+
if test -z "$cpu_arg" ; then
if test "$CPUINFO" != " " ; then
# fallback to uname if necessary
@@ -198,7 +242,7 @@ check_cpu () {
case `gcc -dumpmachine` in
i?86-* | x86_64-*)
if test "$cc_comp" -lt 304 ; then
- check_cpu_cflags="-mcpu=${cpu_arg}"
+ check_cpu_cflags="-mcpu=${low_cpu_arg}"
elif test "$cc_comp" -ge 402 ; then
check_cpu_cflags="-mtune=native"
else
diff --git a/BUILD/compile-pentium64 b/BUILD/compile-pentium64
index 3a8fad51fea..01eb2adf88b 100755
--- a/BUILD/compile-pentium64
+++ b/BUILD/compile-pentium64
@@ -4,7 +4,10 @@ path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$pentium64_cflags $fast_cflags"
-extra_configs="$pentium_configs $static_link"
+# On CentOS/Fedora Core 10 amd64, there is system libz.so but not
+# libz.a, so need to use bundled zlib when building static
+# binary. Hence we use --with-zlib-dir=bundled
+extra_configs="$pentium_configs $static_link --with-zlib-dir=bundled"
CC="$CC --pipe"
strip=yes
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5aa865d600f..8d918a4a71e 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -67,6 +67,15 @@ IF(EXTRA_DEBUG)
ADD_DEFINITIONS(-D EXTRA_DEBUG)
ENDIF(EXTRA_DEBUG)
+SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFE_MUTEX")
+SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFE_MUTEX")
+
+OPTION (WITH_DEBUG_FULL "Enable malloc debug library (only debug builds)" OFF)
+IF(WITH_DEBUG_FULL)
+ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC")
+ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC")
+ENDIF()
+
IF(ENABLED_DEBUG_SYNC)
ADD_DEFINITIONS(-D ENABLED_DEBUG_SYNC)
ENDIF(ENABLED_DEBUG_SYNC)
@@ -116,7 +125,7 @@ IF(MSVC)
STRING(REPLACE "/MDd" "/MTd" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
STRING(REPLACE "/MDd" "/MTd" CMAKE_CXX_FLAGS_DEBUG_INIT ${CMAKE_CXX_FLAGS_DEBUG_INIT})
- # set stack size (see bug#20815)
+ # generate map files, set stack size (see bug#20815)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:1048576")
# remove support for Exception handling
diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt
index b22a83faff9..8febb62481e 100755
--- a/client/CMakeLists.txt
+++ b/client/CMakeLists.txt
@@ -18,8 +18,6 @@ INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
# any of the clients here would go beyond the client API and access the
# Thread Local Storage directly.
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/zlib
diff --git a/client/Makefile.am b/client/Makefile.am
index f4855a03797..20d316c1b9b 100644
--- a/client/Makefile.am
+++ b/client/Makefile.am
@@ -74,8 +74,7 @@ mysqlimport_SOURCES= mysqlimport.c
mysqlimport_CFLAGS= -DTHREAD -UUNDEF_THREADS_HACK
mysqlimport_LDADD = $(CXXLDFLAGS) $(CLIENT_THREAD_LIBS) \
@CLIENT_EXTRA_LDFLAGS@ \
- $(LIBMYSQLCLIENT_LA) \
- $(top_builddir)/mysys/libmysys.a
+ $(LIBMYSQLCLIENT_LA)
mysqlshow_SOURCES= mysqlshow.c
@@ -83,16 +82,15 @@ mysqlslap_SOURCES= mysqlslap.c
mysqlslap_CFLAGS= -DTHREAD -UMYSQL_CLIENT_NO_THREADS
mysqlslap_LDADD = $(CXXLDFLAGS) $(CLIENT_THREAD_LIBS) \
@CLIENT_EXTRA_LDFLAGS@ \
- $(LIBMYSQLCLIENT_LA) \
- $(top_builddir)/mysys/libmysys.a
+ $(LIBMYSQLCLIENT_LA)
mysqltest_SOURCES= mysqltest.cc
mysqltest_CXXFLAGS= -DTHREAD -UMYSQL_CLIENT_NO_THREADS
mysqltest_LDADD = $(CXXLDFLAGS) $(CLIENT_THREAD_LIBS) \
@CLIENT_EXTRA_LDFLAGS@ \
- $(LIBMYSQLCLIENT_LA) \
$(top_builddir)/mysys/libmysys.a \
- $(top_builddir)/regex/libregex.a \
+ $(LIBMYSQLCLIENT_LA) \
+ $(top_builddir)/regex/libregex.la
$(CLIENT_THREAD_LIBS)
mysql_upgrade_SOURCES= mysql_upgrade.c \
diff --git a/client/mysql.cc b/client/mysql.cc
index 134f54757cb..4283cd99c4c 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -3750,7 +3750,8 @@ print_tab_data(MYSQL_RES *result)
}
static int
-com_tee(String *buffer, char *line __attribute__((unused)))
+com_tee(String *buffer __attribute__((unused)),
+ char *line __attribute__((unused)))
{
char file_name[FN_REFLEN], *end, *param;
@@ -3809,7 +3810,8 @@ com_notee(String *buffer __attribute__((unused)),
#ifdef USE_POPEN
static int
-com_pager(String *buffer, char *line __attribute__((unused)))
+com_pager(String *buffer __attribute__((unused)),
+ char *line __attribute__((unused)))
{
char pager_name[FN_REFLEN], *end, *param;
@@ -3941,7 +3943,8 @@ com_rehash(String *buffer __attribute__((unused)),
#ifdef USE_POPEN
static int
-com_shell(String *buffer, char *line __attribute__((unused)))
+com_shell(String *buffer __attribute__((unused)),
+ char *line __attribute__((unused)))
{
char *shell_cmd;
@@ -4033,7 +4036,8 @@ com_connect(String *buffer, char *line)
}
-static int com_source(String *buffer, char *line)
+static int com_source(String *buffer __attribute__((unused)),
+ char *line)
{
char source_name[FN_REFLEN], *end, *param;
LINE_BUFFER *line_buff;
@@ -5022,7 +5026,8 @@ static void init_username()
}
}
-static int com_prompt(String *buffer, char *line)
+static int com_prompt(String *buffer __attribute__((unused)),
+ char *line)
{
char *ptr=strchr(line, ' ');
prompt_counter = 0;
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index 420042e6055..266160890f6 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -636,11 +636,16 @@ static bool shall_skip_database(const char *log_dbname)
producing USE statements by corresponding log event print-functions.
*/
-void print_use_stmt(PRINT_EVENT_INFO* pinfo, const char* db, size_t db_len)
+static void
+print_use_stmt(PRINT_EVENT_INFO* pinfo, const Query_log_event *ev)
{
+ const char* db= ev->db;
+ const size_t db_len= ev->db_len;
+
// pinfo->db is the current db.
// If current db is the same as required db, do nothing.
- if (!db || !memcmp(pinfo->db, db, db_len + 1))
+ if ((ev->flags & LOG_EVENT_SUPPRESS_USE_F) || !db ||
+ !memcmp(pinfo->db, db, db_len + 1))
return;
// Current db and required db are different.
@@ -779,7 +784,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
Query_log_event *qe= (Query_log_event*)ev;
if (!qe->is_trans_keyword() && shall_skip_database(qe->db))
goto end;
- print_use_stmt(print_event_info, qe->db, qe->db_len);
+ print_use_stmt(print_event_info, qe);
if (opt_base64_output_mode == BASE64_OUTPUT_ALWAYS)
{
if ((retval= write_event_header_and_base64(ev, result_file,
@@ -912,7 +917,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
if (!shall_skip_database(exlq->db))
{
- print_use_stmt(print_event_info, exlq->db, exlq->db_len);
+ print_use_stmt(print_event_info, exlq);
if (fname)
{
convert_path_to_forward_slashes(fname);
@@ -1491,7 +1496,7 @@ static int parse_args(int *argc, char*** argv)
*/
static Exit_status safe_connect()
{
- /* Close and old connections to MySQL */
+ /* Close any old connections to MySQL */
if (mysql)
mysql_close(mysql);
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index be4a3e06fbb..2a63ab61590 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -110,6 +110,7 @@ static my_bool parsing_disabled= 0;
static my_bool display_result_vertically= FALSE, display_result_lower= FALSE,
display_metadata= FALSE, display_result_sorted= FALSE;
static my_bool disable_query_log= 0, disable_result_log= 0;
+static my_bool disable_connect_log= 1;
static my_bool disable_warnings= 0;
static my_bool prepare_warnings_enabled= 0;
static my_bool disable_info= 1;
@@ -256,7 +257,9 @@ struct st_connection
int cur_query_len;
pthread_mutex_t mutex;
pthread_cond_t cond;
+ pthread_t tid;
int query_done;
+ my_bool has_thread;
#endif /*EMBEDDED_LIBRARY*/
};
@@ -287,6 +290,7 @@ enum enum_commands {
Q_DISABLE_RPL_PARSE, Q_EVAL_RESULT,
Q_ENABLE_QUERY_LOG, Q_DISABLE_QUERY_LOG,
Q_ENABLE_RESULT_LOG, Q_DISABLE_RESULT_LOG,
+ Q_ENABLE_CONNECT_LOG, Q_DISABLE_CONNECT_LOG,
Q_WAIT_FOR_SLAVE_TO_STOP,
Q_ENABLE_WARNINGS, Q_DISABLE_WARNINGS,
Q_ENABLE_INFO, Q_DISABLE_INFO,
@@ -355,6 +359,8 @@ const char *command_names[]=
/* Enable/disable that the _result_ from a query is logged to result file */
"enable_result_log",
"disable_result_log",
+ "enable_connect_log",
+ "disable_connect_log",
"wait_for_slave_to_stop",
"enable_warnings",
"disable_warnings",
@@ -757,8 +763,6 @@ pthread_handler_t send_one_query(void *arg)
static int do_send_query(struct st_connection *cn, const char *q, int q_len,
int flags)
{
- pthread_t tid;
-
if (flags & QUERY_REAP_FLAG)
return mysql_send_query(&cn->mysql, q, q_len);
@@ -769,9 +773,10 @@ static int do_send_query(struct st_connection *cn, const char *q, int q_len,
cn->cur_query= q;
cn->cur_query_len= q_len;
cn->query_done= 0;
- if (pthread_create(&tid, &cn_thd_attrib, send_one_query, (void*)cn))
+ if (pthread_create(&cn->tid, &cn_thd_attrib, send_one_query, (void*)cn))
die("Cannot start new thread for query");
+ cn->has_thread= TRUE;
return 0;
}
@@ -784,6 +789,14 @@ static void wait_query_thread_end(struct st_connection *con)
pthread_cond_wait(&con->cond, &con->mutex);
pthread_mutex_unlock(&con->mutex);
}
+ if (con->has_thread)
+ {
+#ifndef __WIN__
+ /* May hang on Windows, but the problem it solves is not seen there */
+ pthread_join(con->tid, NULL);
+#endif
+ con->has_thread= FALSE;
+ }
}
#else /*EMBEDDED_LIBRARY*/
@@ -2223,8 +2236,14 @@ void var_query_set(VAR *var, const char *query, const char** query_end)
DBUG_ENTER("var_query_set");
LINT_INIT(res);
+ /* Only white space or ) allowed past ending ` */
while (end > query && *end != '`')
+ {
+ if (*end && (*end != ' ' && *end != '\t' && *end != '\n' && *end != ')'))
+ die("Spurious text after `query` expression");
--end;
+ }
+
if (query == end)
die("Syntax error in query, missing '`'");
++query;
@@ -3891,7 +3910,18 @@ void do_perl(struct st_command *command)
if (!error)
my_delete(temp_file_path, MYF(MY_WME));
- handle_command_error(command, WEXITSTATUS(error), my_errno);
+ /* Check for error code that indicates perl could not be started */
+ int exstat= WEXITSTATUS(error);
+#ifdef __WIN__
+ if (exstat == 1)
+ /* Text must begin 'perl not found' as mtr looks for it */
+ abort_not_supported_test("perl not found in path or did not start");
+#else
+ if (exstat == 127)
+ abort_not_supported_test("perl not found in path");
+#endif
+ else
+ handle_command_error(command, WEXITSTATUS(error), my_errno);
}
dynstr_free(&ds_delimiter);
DBUG_VOID_RETURN;
@@ -4835,6 +4865,16 @@ void select_connection_name(const char *name)
set_current_connection(con);
+ /* Connection logging if enabled */
+ if (!disable_connect_log && !disable_query_log)
+ {
+ DYNAMIC_STRING *ds= &ds_res;
+
+ dynstr_append_mem(ds, "connection ", 11);
+ replace_dynstr_append(ds, name);
+ dynstr_append_mem(ds, ";\n", 2);
+ }
+
DBUG_VOID_RETURN;
}
@@ -4921,6 +4961,17 @@ void do_close_connection(struct st_command *command)
var_set_int("$mysql_get_server_version", 0xFFFFFFFF);
var_set_string("$CURRENT_CONNECTION", con->name);
}
+
+ /* Connection logging if enabled */
+ if (!disable_connect_log && !disable_query_log)
+ {
+ DYNAMIC_STRING *ds= &ds_res;
+
+ dynstr_append_mem(ds, "disconnect ", 11);
+ replace_dynstr_append(ds, ds_connection.str);
+ dynstr_append_mem(ds, ";\n", 2);
+ }
+
dynstr_free(&ds_connection);
DBUG_VOID_RETURN;
}
@@ -5056,6 +5107,13 @@ int connect_n_handle_errors(struct st_command *command,
dynstr_append_mem(ds, delimiter, delimiter_length);
dynstr_append_mem(ds, "\n", 1);
}
+ /* Simlified logging if enabled */
+ if (!disable_connect_log && !disable_query_log)
+ {
+ replace_dynstr_append(ds, command->query);
+ dynstr_append_mem(ds, ";\n", 2);
+ }
+
while (!mysql_real_connect(con, host, user, pass, db, port, sock ? sock: 0,
CLIENT_MULTI_STATEMENTS))
{
@@ -5246,6 +5304,7 @@ void do_connect(struct st_command *command)
#ifdef EMBEDDED_LIBRARY
con_slot->query_done= 1;
+ con_slot->has_thread= FALSE;
#endif
if (!mysql_init(&con_slot->mysql))
die("Failed on mysql_init()");
@@ -5262,8 +5321,13 @@ void do_connect(struct st_command *command)
&opt_connect_timeout);
#ifdef HAVE_OPENSSL
- if (opt_use_ssl || con_ssl)
+ if (opt_use_ssl)
+ con_ssl= 1;
+#endif
+
+ if (con_ssl)
{
+#ifdef HAVE_OPENSSL
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
@@ -5272,15 +5336,15 @@ void do_connect(struct st_command *command)
mysql_options(&con_slot->mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
&opt_ssl_verify_server_cert);
#endif
- }
#endif
+ }
-#ifdef __WIN__
if (con_pipe)
{
+#ifdef __WIN__
opt_protocol= MYSQL_PROTOCOL_PIPE;
- }
#endif
+ }
if (opt_protocol)
mysql_options(&con_slot->mysql, MYSQL_OPT_PROTOCOL, (char*) &opt_protocol);
@@ -5568,6 +5632,8 @@ int read_line(char *buf, int size)
char c, UNINIT_VAR(last_quote);
char *p= buf, *buf_end= buf + size - 1;
int skip_char= 0;
+ my_bool have_slash= FALSE;
+
enum {R_NORMAL, R_Q, R_SLASH_IN_Q,
R_COMMENT, R_LINE_START} state= R_LINE_START;
DBUG_ENTER("read_line");
@@ -5639,9 +5705,13 @@ int read_line(char *buf, int size)
}
else if (c == '\'' || c == '"' || c == '`')
{
- last_quote= c;
- state= R_Q;
+ if (! have_slash)
+ {
+ last_quote= c;
+ state= R_Q;
+ }
}
+ have_slash= (c == '\\');
break;
case R_COMMENT:
@@ -5716,7 +5786,7 @@ int read_line(char *buf, int size)
/* Could be a multibyte character */
/* This code is based on the code in "sql_load.cc" */
#ifdef USE_MB
- int charlen = my_mbcharlen(charset_info, c);
+ int charlen = my_mbcharlen(charset_info, (unsigned char) c);
/* We give up if multibyte character is started but not */
/* completed before we pass buf_end */
if ((charlen > 1) && (p + charlen) <= buf_end)
@@ -5728,16 +5798,16 @@ int read_line(char *buf, int size)
for (i= 1; i < charlen; i++)
{
+ c= my_getc(cur_file->file);
if (feof(cur_file->file))
goto found_eof;
- c= my_getc(cur_file->file);
*p++ = c;
}
if (! my_ismbchar(charset_info, mb_start, p))
{
/* It was not a multiline char, push back the characters */
/* We leave first 'c', i.e. pretend it was a normal char */
- while (p > mb_start)
+ while (p-1 > mb_start)
my_ungetc(*--p);
}
}
@@ -7385,11 +7455,13 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
(flags & QUERY_REAP_FLAG));
DBUG_ENTER("run_query");
- init_dynamic_string(&ds_warnings, NULL, 0, 256);
-
if (cn->pending && (flags & QUERY_SEND_FLAG))
die ("Cannot run query on connection between send and reap");
+ if (!(flags & QUERY_SEND_FLAG) && !cn->pending)
+ die ("Cannot reap on a connection without pending send");
+
+ init_dynamic_string(&ds_warnings, NULL, 0, 256);
/*
Evaluate query if this is an eval command
*/
@@ -8130,6 +8202,8 @@ int main(int argc, char **argv)
case Q_DISABLE_ABORT_ON_ERROR: abort_on_error=0; break;
case Q_ENABLE_RESULT_LOG: disable_result_log=0; break;
case Q_DISABLE_RESULT_LOG: disable_result_log=1; break;
+ case Q_ENABLE_CONNECT_LOG: disable_connect_log=0; break;
+ case Q_DISABLE_CONNECT_LOG: disable_connect_log=1; break;
case Q_ENABLE_WARNINGS: disable_warnings=0; break;
case Q_DISABLE_WARNINGS: disable_warnings=1; break;
case Q_ENABLE_PREPARE_WARNINGS: prepare_warnings_enabled=1; break;
@@ -9796,6 +9870,7 @@ void free_pointer_array(POINTER_ARRAY *pa)
void replace_dynstr_append_mem(DYNAMIC_STRING *ds,
const char *val, int len)
{
+ char lower[512];
#ifdef __WIN__
fix_win_paths(val, len);
#endif
@@ -9803,7 +9878,6 @@ void replace_dynstr_append_mem(DYNAMIC_STRING *ds,
if (display_result_lower)
{
/* Convert to lower case, and do this first */
- char lower[512];
char *c= lower;
for (const char *v= val; *v; v++)
*c++= my_tolower(charset_info, *v);
diff --git a/client/sql_string.h b/client/sql_string.h
index 0a23f9ee92f..a0f1f5b3a6c 100644
--- a/client/sql_string.h
+++ b/client/sql_string.h
@@ -73,9 +73,13 @@ public:
}
static void *operator new(size_t size, MEM_ROOT *mem_root)
{ return (void*) alloc_root(mem_root, (uint) size); }
- static void operator delete(void *ptr_arg,size_t size)
- { TRASH(ptr_arg, size); }
- static void operator delete(void *ptr_arg, MEM_ROOT *mem_root)
+ static void operator delete(void *ptr_arg, size_t size)
+ {
+ (void) ptr_arg;
+ (void) size;
+ TRASH(ptr_arg, size);
+ }
+ static void operator delete(void *, MEM_ROOT *)
{ /* never called */ }
~String() { free(); }
diff --git a/cmd-line-utils/libedit/common.c b/cmd-line-utils/libedit/common.c
index d4d024eae10..ba5890fa606 100644
--- a/cmd-line-utils/libedit/common.c
+++ b/cmd-line-utils/libedit/common.c
@@ -136,7 +136,7 @@ ed_delete_prev_word(EditLine *el, int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-ed_delete_next_char(EditLine *el, int c)
+ed_delete_next_char(EditLine *el, int c __attribute__((__unused__)))
{
#ifdef notdef /* XXX */
#define EL el->el_line
@@ -431,7 +431,8 @@ ed_argument_digit(EditLine *el, int c)
*/
protected el_action_t
/*ARGSUSED*/
-ed_unassigned(EditLine *el, int c __attribute__((__unused__)))
+ed_unassigned(EditLine *el __attribute__((__unused__)),
+ int c __attribute__((__unused__)))
{
return (CC_ERROR);
diff --git a/cmd-line-utils/libedit/readline.c b/cmd-line-utils/libedit/readline.c
index 1f1b18c97d8..0318ab409b3 100644
--- a/cmd-line-utils/libedit/readline.c
+++ b/cmd-line-utils/libedit/readline.c
@@ -202,7 +202,7 @@ _move_history(int op)
*/
static int
/*ARGSUSED*/
-_getc_function(EditLine *el, char *c)
+_getc_function(EditLine *el __attribute__((__unused__)), char *c)
{
int i;
@@ -1613,7 +1613,8 @@ rl_insert(int count, int c)
/*ARGSUSED*/
int
-rl_newline(int count, int c)
+rl_newline(int count __attribute__((__unused__)),
+ int c __attribute__((__unused__)))
{
/*
* Readline-4.0 appears to ignore the args.
@@ -1623,7 +1624,7 @@ rl_newline(int count, int c)
/*ARGSUSED*/
static unsigned char
-rl_bind_wrapper(EditLine *el, unsigned char c)
+rl_bind_wrapper(EditLine *el __attribute__((__unused__)), unsigned char c)
{
if (map[c] == NULL)
return CC_ERROR;
@@ -1718,7 +1719,7 @@ rl_get_previous_history(int count, int key)
void
/*ARGSUSED*/
-rl_prep_terminal(int meta_flag)
+rl_prep_terminal(int meta_flag __attribute__((__unused__)))
{
el_set(e, EL_PREP_TERM, 1);
}
@@ -1922,7 +1923,8 @@ _rl_qsort_string_compare(char **s1, char **s2)
int
/*ARGSUSED*/
-rl_kill_text(int from, int to)
+rl_kill_text(int from __attribute__((__unused__)),
+ int to __attribute__((__unused__)))
{
return 0;
}
@@ -1941,20 +1943,25 @@ rl_get_keymap(void)
void
/*ARGSUSED*/
-rl_set_keymap(Keymap k)
+rl_set_keymap(Keymap k __attribute__((__unused__)))
{
}
int
/*ARGSUSED*/
-rl_generic_bind(int type, const char * keyseq, const char * data, Keymap k)
+rl_generic_bind(int type __attribute__((__unused__)),
+ const char * keyseq __attribute__((__unused__)),
+ const char * data __attribute__((__unused__)),
+ Keymap k __attribute__((__unused__)))
{
return 0;
}
int
/*ARGSUSED*/
-rl_bind_key_in_map(int key, Function *fun, Keymap k)
+rl_bind_key_in_map(int key __attribute__((__unused__)),
+ Function *fun __attribute__((__unused__)),
+ Keymap k __attribute__((__unused__)))
{
return 0;
}
diff --git a/cmd-line-utils/libedit/vi.c b/cmd-line-utils/libedit/vi.c
index 00a9f493a9b..d628f076a1d 100644
--- a/cmd-line-utils/libedit/vi.c
+++ b/cmd-line-utils/libedit/vi.c
@@ -145,7 +145,7 @@ vi_paste_prev(EditLine *el, int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_prev_big_word(EditLine *el, int c)
+vi_prev_big_word(EditLine *el, int c __attribute__((__unused__)))
{
if (el->el_line.cursor == el->el_line.buffer)
@@ -195,7 +195,7 @@ vi_prev_word(EditLine *el, int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_next_big_word(EditLine *el, int c)
+vi_next_big_word(EditLine *el, int c __attribute__((__unused__)))
{
if (el->el_line.cursor >= el->el_line.lastchar - 1)
@@ -462,7 +462,7 @@ vi_delete_meta(EditLine *el, int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_end_big_word(EditLine *el, int c)
+vi_end_big_word(EditLine *el, int c __attribute__((__unused__)))
{
if (el->el_line.cursor == el->el_line.lastchar)
@@ -797,7 +797,7 @@ vi_repeat_prev_char(EditLine *el, int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_match(EditLine *el, int c)
+vi_match(EditLine *el, int c __attribute__((__unused__)))
{
const char match_chars[] = "()[]{}";
char *cp;
@@ -844,7 +844,7 @@ vi_match(EditLine *el, int c)
*/
protected el_action_t
/*ARGSUSED*/
-vi_undo_line(EditLine *el, int c)
+vi_undo_line(EditLine *el, int c __attribute__((__unused__)))
{
cv_undo(el);
@@ -858,7 +858,7 @@ vi_undo_line(EditLine *el, int c)
*/
protected el_action_t
/*ARGSUSED*/
-vi_to_column(EditLine *el, int c)
+vi_to_column(EditLine *el, int c __attribute__((__unused__)))
{
el->el_line.cursor = el->el_line.buffer;
@@ -872,7 +872,7 @@ vi_to_column(EditLine *el, int c)
*/
protected el_action_t
/*ARGSUSED*/
-vi_yank_end(EditLine *el, int c)
+vi_yank_end(EditLine *el, int c __attribute__((__unused__)))
{
cv_yank(el, el->el_line.cursor,
@@ -886,7 +886,7 @@ vi_yank_end(EditLine *el, int c)
*/
protected el_action_t
/*ARGSUSED*/
-vi_yank(EditLine *el, int c)
+vi_yank(EditLine *el, int c __attribute__((__unused__)))
{
return cv_action(el, YANK);
@@ -898,7 +898,7 @@ vi_yank(EditLine *el, int c)
*/
protected el_action_t
/*ARGSUSED*/
-vi_comment_out(EditLine *el, int c)
+vi_comment_out(EditLine *el, int c __attribute__((__unused__)))
{
el->el_line.cursor = el->el_line.buffer;
@@ -919,7 +919,8 @@ extern char *get_alias_text(const char *) __weak_reference(get_alias_text);
#endif
protected el_action_t
/*ARGSUSED*/
-vi_alias(EditLine *el, int c)
+vi_alias(EditLine *el __attribute__((__unused__)),
+ int c __attribute__((__unused__)))
{
#if defined(__weak_reference) && !defined(__FreeBSD__)
char alias_name[3];
@@ -949,7 +950,7 @@ vi_alias(EditLine *el, int c)
*/
protected el_action_t
/*ARGSUSED*/
-vi_to_history_line(EditLine *el, int c)
+vi_to_history_line(EditLine *el, int c __attribute__((__unused__)))
{
int sv_event_no = el->el_history.eventno;
el_action_t rval;
@@ -994,7 +995,7 @@ vi_to_history_line(EditLine *el, int c)
*/
protected el_action_t
/*ARGSUSED*/
-vi_histedit(EditLine *el, int c)
+vi_histedit(EditLine *el, int c __attribute__((__unused__)))
{
int fd;
pid_t pid;
@@ -1050,7 +1051,7 @@ vi_histedit(EditLine *el, int c)
*/
protected el_action_t
/*ARGSUSED*/
-vi_history_word(EditLine *el, int c)
+vi_history_word(EditLine *el, int c __attribute__((__unused__)))
{
const char *wp = HIST_FIRST(el);
const char *wep, *wsp;
@@ -1099,7 +1100,7 @@ vi_history_word(EditLine *el, int c)
*/
protected el_action_t
/*ARGSUSED*/
-vi_redo(EditLine *el, int c)
+vi_redo(EditLine *el, int c __attribute__((__unused__)))
{
c_redo_t *r = &el->el_chared.c_redo;
diff --git a/cmd-line-utils/readline/Makefile.am b/cmd-line-utils/readline/Makefile.am
index e1e9645e238..39f37ad7453 100644
--- a/cmd-line-utils/readline/Makefile.am
+++ b/cmd-line-utils/readline/Makefile.am
@@ -32,6 +32,3 @@ noinst_HEADERS = readline.h chardefs.h keymaps.h \
EXTRA_DIST= emacs_keymap.c vi_keymap.c
DEFS = -DMYSQL_CLIENT_NO_THREADS -DHAVE_CONFIG_H -DNO_KILL_INTR -D_GNU_SOURCE=1
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/cmd-line-utils/readline/complete.c b/cmd-line-utils/readline/complete.c
index 2745e4e4801..d11ea2493a6 100644
--- a/cmd-line-utils/readline/complete.c
+++ b/cmd-line-utils/readline/complete.c
@@ -1839,8 +1839,11 @@ rl_username_completion_function (text, state)
#else /* !__WIN32__ && !__OPENNT) */
static char *username = (char *)NULL;
static struct passwd *entry;
- static int namelen, first_char, first_char_loc;
+ static int first_char, first_char_loc;
char *value;
+#if defined (HAVE_GETPWENT)
+ static int namelen;
+#endif
if (state == 0)
{
@@ -1850,7 +1853,9 @@ rl_username_completion_function (text, state)
first_char_loc = first_char == '~';
username = savestring (&text[first_char_loc]);
+#if defined (HAVE_GETPWENT)
namelen = strlen (username);
+#endif
setpwent ();
}
diff --git a/cmd-line-utils/readline/histfile.c b/cmd-line-utils/readline/histfile.c
index cbd367542ce..1a6d69b6684 100644
--- a/cmd-line-utils/readline/histfile.c
+++ b/cmd-line-utils/readline/histfile.c
@@ -402,6 +402,7 @@ history_truncate_file (fname, lines)
if (bp > buffer && ((file = open (filename, O_WRONLY|O_TRUNC|O_BINARY, 0600)) != -1))
{
bytes_written= write (file, bp, chars_read - (bp - buffer));
+ (void) bytes_written;
#if defined (__BEOS__)
/* BeOS ignores O_TRUNC. */
diff --git a/cmd-line-utils/readline/isearch.c b/cmd-line-utils/readline/isearch.c
index 305c847d8da..977e08eb9ba 100644
--- a/cmd-line-utils/readline/isearch.c
+++ b/cmd-line-utils/readline/isearch.c
@@ -617,7 +617,7 @@ rl_search_history (direction, invoking_key)
int direction, invoking_key __attribute__((unused));
{
_rl_search_cxt *cxt; /* local for now, but saved globally */
- int c, r;
+ int r;
RL_SETSTATE(RL_STATE_ISEARCH);
cxt = _rl_isearch_init (direction);
@@ -632,7 +632,7 @@ rl_search_history (direction, invoking_key)
r = -1;
for (;;)
{
- c = _rl_search_getchar (cxt);
+ _rl_search_getchar (cxt);
/* We might want to handle EOF here (c == 0) */
r = _rl_isearch_dispatch (cxt, cxt->lastc);
if (r <= 0)
@@ -655,9 +655,9 @@ int
_rl_isearch_callback (cxt)
_rl_search_cxt *cxt;
{
- int c, r;
+ int r;
- c = _rl_search_getchar (cxt);
+ _rl_search_getchar (cxt);
/* We might want to handle EOF here */
r = _rl_isearch_dispatch (cxt, cxt->lastc);
diff --git a/cmd-line-utils/readline/parens.c b/cmd-line-utils/readline/parens.c
index fe1578ed3e2..58f22291172 100644
--- a/cmd-line-utils/readline/parens.c
+++ b/cmd-line-utils/readline/parens.c
@@ -115,7 +115,7 @@ rl_insert_close (count, invoking_key)
else
{
#if defined (HAVE_SELECT)
- int orig_point, match_point, ready;
+ int orig_point, match_point;
struct timeval timer;
fd_set readfds;
@@ -136,7 +136,7 @@ rl_insert_close (count, invoking_key)
orig_point = rl_point;
rl_point = match_point;
(*rl_redisplay_function) ();
- ready = select (1, &readfds, (fd_set *)NULL, (fd_set *)NULL, &timer);
+ select (1, &readfds, (fd_set *)NULL, (fd_set *)NULL, &timer);
rl_point = orig_point;
#else /* !HAVE_SELECT */
_rl_insert_char (count, invoking_key);
diff --git a/cmd-line-utils/readline/readline.c b/cmd-line-utils/readline/readline.c
index 3a0f533fcd6..d98d7880005 100644
--- a/cmd-line-utils/readline/readline.c
+++ b/cmd-line-utils/readline/readline.c
@@ -446,11 +446,10 @@ readline_internal_char ()
readline_internal_charloop ()
#endif
{
- static int lastc, eof_found;
+ static int lastc;
int c, code, lk;
lastc = -1;
- eof_found = 0;
#if !defined (READLINE_CALLBACKS)
while (rl_done == 0)
diff --git a/cmd-line-utils/readline/terminal.c b/cmd-line-utils/readline/terminal.c
index 3f92821f9dd..e2785908160 100644
--- a/cmd-line-utils/readline/terminal.c
+++ b/cmd-line-utils/readline/terminal.c
@@ -268,7 +268,7 @@ _rl_get_screen_size (tty, ignore_env)
#if !defined (__DJGPP__)
if (_rl_screenwidth <= 0 && term_string_buffer)
- _rl_screenwidth = tgetnum ("co");
+ _rl_screenwidth = tgetnum ((char *)"co");
#endif
}
@@ -284,7 +284,7 @@ _rl_get_screen_size (tty, ignore_env)
#if !defined (__DJGPP__)
if (_rl_screenheight <= 0 && term_string_buffer)
- _rl_screenheight = tgetnum ("li");
+ _rl_screenheight = tgetnum ((char *)"li");
#endif
}
@@ -516,7 +516,7 @@ _rl_init_terminal_io (terminal_name)
if (!_rl_term_cr)
_rl_term_cr = "\r";
- _rl_term_autowrap = tgetflag ("am") && tgetflag ("xn");
+ _rl_term_autowrap = tgetflag ((char *)"am") && tgetflag ((char *)"xn");
/* Allow calling application to set default height and width, using
rl_set_screen_size */
@@ -531,7 +531,7 @@ _rl_init_terminal_io (terminal_name)
/* Check to see if this terminal has a meta key and clear the capability
variables if there is none. */
- term_has_meta = (tgetflag ("km") || tgetflag ("MT"));
+ term_has_meta = (tgetflag ((char *)"km") || tgetflag ((char *)"MT"));
if (!term_has_meta)
_rl_term_mm = _rl_term_mo = (char *)NULL;
diff --git a/cmd-line-utils/readline/text.c b/cmd-line-utils/readline/text.c
index 774ba1eb2c0..75ffd0e482a 100644
--- a/cmd-line-utils/readline/text.c
+++ b/cmd-line-utils/readline/text.c
@@ -811,11 +811,10 @@ _rl_overwrite_char (count, c)
int i;
#if defined (HANDLE_MULTIBYTE)
char mbkey[MB_LEN_MAX];
- int k;
/* Read an entire multibyte character sequence to insert COUNT times. */
if (count > 0 && MB_CUR_MAX > 1 && rl_byte_oriented == 0)
- k = _rl_read_mbstring (c, mbkey, MB_LEN_MAX);
+ _rl_read_mbstring (c, mbkey, MB_LEN_MAX);
#endif
rl_begin_undo_group ();
diff --git a/config/ac-macros/maintainer.m4 b/config/ac-macros/maintainer.m4
index 1b7df75d6f7..9b4bf3d076b 100644
--- a/config/ac-macros/maintainer.m4
+++ b/config/ac-macros/maintainer.m4
@@ -8,7 +8,8 @@ AC_DEFUN([MY_MAINTAINER_MODE], [
[AS_HELP_STRING([--enable-mysql-maintainer-mode],
[Enable a MySQL maintainer-specific development environment])],
[USE_MYSQL_MAINTAINER_MODE=$enableval],
- [USE_MYSQL_MAINTAINER_MODE=no])
+ [AS_IF([test "$with_debug" != "no" -a "$with_valgrind" = "no"],
+ [USE_MYSQL_MAINTAINER_MODE=yes], [USE_MYSQL_MAINTAINER_MODE=no])])
AC_MSG_RESULT([$USE_MYSQL_MAINTAINER_MODE])
])
@@ -16,7 +17,7 @@ AC_DEFUN([MY_MAINTAINER_MODE], [
AC_DEFUN([MY_MAINTAINER_MODE_WARNINGS], [
# Setup GCC warning options.
AS_IF([test "$GCC" = "yes"], [
- C_WARNINGS="-Wall -Wextra -Wunused -Wwrite-strings -Werror"
+ C_WARNINGS="-Wall -Wextra -Wunused -Wwrite-strings -Wno-strict-aliasing -Werror -DFORCE_INIT_OF_VARS"
CXX_WARNINGS="${C_WARNINGS} -Wno-unused-parameter"
])
diff --git a/config/ac-macros/plugins.m4 b/config/ac-macros/plugins.m4
index cfc70d188a9..aba68dbe04c 100644
--- a/config/ac-macros/plugins.m4
+++ b/config/ac-macros/plugins.m4
@@ -116,18 +116,32 @@ dnl ---------------------------------------------------------------------------
dnl Macro: MYSQL_PLUGIN_STATIC
dnl
dnl SYNOPSIS
-dnl MYSQL_PLUGIN_STATIC([name],[libmyplugin.a])
+dnl MYSQL_PLUGIN_STATIC([name],[libmyplugin.a],[libmyplugin_embedded.a])
dnl
dnl DESCRIPTION
-dnl Declare the name for the static library
+dnl Declare the name for the static library
+dnl
+dnl Third argument is optional, only needed for special plugins that depend
+dnl on server internals and have source files that must be compiled specially
+dnl with -DEMBEDDED_LIBRARY for embedded server. If specified, the third
+dnl argument is used to link embedded server instead of the second.
dnl
dnl ---------------------------------------------------------------------------
AC_DEFUN([MYSQL_PLUGIN_STATIC],[
MYSQL_REQUIRE_PLUGIN([$1])
m4_define([MYSQL_PLUGIN_STATIC_]AS_TR_CPP([$1]), [$2])
+ ifelse($#, 3, [
+ m4_define([MYSQL_PLUGIN_EMBEDDED_]AS_TR_CPP([$1]), [$3])
+ ])
])
+dnl ---------------------------------------------------------------------------
+dnl Substitution variable to use to compile source files specially for
+dnl embedded server.
+dnl To be used by plugins that have sources that depend on server internals.
+dnl ---------------------------------------------------------------------------
+AC_SUBST([plugin_embedded_defs], ["-DEMBEDDED_LIBRARY -DMYSQL_SERVER"])
dnl ---------------------------------------------------------------------------
dnl Macro: MYSQL_PLUGIN_DYNAMIC
@@ -222,7 +236,7 @@ AC_DEFUN([MYSQL_PLUGIN_WITHOUT],[
if test "X[$with_plugin_]$1" = Xyes; then
AC_MSG_ERROR([Plugin $1 cannot be built])
else
- [with_plugin_]$1=no
+ [mysql_plugin_]$1=no
fi
])
@@ -279,28 +293,6 @@ AC_DEFUN([MYSQL_PLUGIN_ACTIONS],[
])
dnl ---------------------------------------------------------------------------
-dnl Macro: MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS
-dnl
-dnl SYNOPSIS
-dnl MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS([name],[file name])
-dnl
-dnl DESCRIPTION
-dnl Some modules in plugins keep dependance on structures
-dnl declared in sql/ (THD class usually)
-dnl That has to be fixed in the future, but until then
-dnl we have to recompile these modules when we want to
-dnl to compile server parts with the different #defines
-dnl Normally it happens when we compile the embedded server
-dnl Thus one should mark such files in his handler using this macro
-dnl
-dnl ---------------------------------------------------------------------------
-
-AC_DEFUN([MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS],[
- MYSQL_REQUIRE_PLUGIN([$1])
- m4_define([MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS_]AS_TR_CPP([$1]), [$2])
-])
-
-dnl ---------------------------------------------------------------------------
dnl Macro: MYSQL_CONFIGURE_PLUGINS
dnl
dnl SYNOPSIS
@@ -360,11 +352,25 @@ AC_DEFUN([_MYSQL_EMIT_CHECK_PLUGIN],[
[MYSQL_PLUGIN_DYNAMIC_]AS_TR_CPP([$1]),
[MYSQL_PLUGIN_MANDATORY_]AS_TR_CPP([$1]),
[MYSQL_PLUGIN_DISABLED_]AS_TR_CPP([$1]),
- [MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS_]AS_TR_CPP([$1]),
+ [MYSQL_PLUGIN_EMBEDDED_]AS_TR_CPP([$1]),
[MYSQL_PLUGIN_ACTIONS_]AS_TR_CPP([$1])
)
])
+dnl __MYSQL_EMIT_CHECK_PLUGIN arguments:
+dnl
+dnl 1 - plugin identifying name
+dnl 2 - plugin identifying name, with `-' replaced by `_'
+dnl 3 - plugin long name
+dnl 4 - plugin description
+dnl 5 - mysql_plugin_define (eg. WITH_xxx_STORAGE_ENGINE)
+dnl 6 - directory
+dnl 7 - static target (if supports static build)
+dnl 8 - dynamic target (if supports dynamic build)
+dnl 9 - mandatory flag
+dnl 10 - disabled flag
+dnl 11 - static target for libmysqld (if different from $7)
+dnl 12 - actions
AC_DEFUN([__MYSQL_EMIT_CHECK_PLUGIN],[
m4_ifdef([$5],[
AH_TEMPLATE($5, [Include ]$3[ into mysqld])
@@ -381,6 +387,10 @@ AC_DEFUN([__MYSQL_EMIT_CHECK_PLUGIN],[
__MYSQL_EMIT_CHECK_RESULT($3,[no])
],[
+ if test "X[$mysql_plugin_]$2" = Xno; then
+ [with_plugin_]$2=no
+ fi
+
# Plugin is not disabled, determine if it should be built,
# or only distributed
@@ -439,11 +449,12 @@ AC_DEFUN([__MYSQL_EMIT_CHECK_PLUGIN],[
])
AC_SUBST([plugin_]$2[_shared_target], "$8")
AC_SUBST([plugin_]$2[_static_target], [""])
+ AC_SUBST([plugin_]$2[_embedded_static_target], [""])
[with_plugin_]$2=yes
__MYSQL_EMIT_CHECK_RESULT($3,[plugin])
m4_ifdef([$6],[
else
- [mysql_plugin_]$2=no
+ [with_plugin_]$2=no
__MYSQL_EMIT_CHECK_RESULT($3,[no])
fi
])
@@ -453,32 +464,47 @@ AC_DEFUN([__MYSQL_EMIT_CHECK_PLUGIN],[
])
else
m4_ifdef([$7],[
- ifelse(m4_bregexp($7, [^lib[^.]+\.a$]), -2, [
-dnl change above "-2" to "0" to enable this section
-dnl Although this is "pretty", it breaks libmysqld build
- m4_ifdef([$6],[
- mysql_use_plugin_dir="$6"
- mysql_plugin_libs="$mysql_plugin_libs -L[\$(top_builddir)]/$6"
- ])
- mysql_plugin_libs="$mysql_plugin_libs dnl
-[-l]m4_bregexp($7, [^lib\([^.]+\)], [\1])"
- ], m4_bregexp($7, [^\\\$]), 0, [
+ ifelse(m4_bregexp($7, [^\\\$]), 0, [
m4_ifdef([$6],[
mysql_use_plugin_dir="$6"
])
mysql_plugin_libs="$mysql_plugin_libs $7"
+ m4_ifdef([$11],[
+ mysql_embedded_plugin_libs="$mysql_embedded_plugin_libs $11"
+ ],[
+ mysql_embedded_plugin_libs="$mysql_embedded_plugin_libs $7"
+ ])
], [
m4_ifdef([$6],[
mysql_use_plugin_dir="$6"
mysql_plugin_libs="$mysql_plugin_libs \$(top_builddir)/$6/$7"
+ m4_ifdef([$11],[
+ mysql_embedded_plugin_libs="$mysql_embedded_plugin_libs \$(top_builddir)/$6/$11"
+ ],[
+ mysql_embedded_plugin_libs="$mysql_embedded_plugin_libs \$(top_builddir)/$6/$7"
+ ])
],[
mysql_plugin_libs="$mysql_plugin_libs $7"
+ m4_ifdef([$11],[
+ mysql_embedded_plugin_libs="$mysql_embedded_plugin_libs $11"
+ ],[
+ mysql_embedded_plugin_libs="$mysql_embedded_plugin_libs $7"
+ ])
])
])
m4_ifdef([$5],[
AC_DEFINE($5)
])
AC_SUBST([plugin_]$2[_static_target], "$7")
+ m4_ifdef([$11], [
+ if test "$with_embedded_server" = "yes"; then
+ AC_SUBST([plugin_]$2[_embedded_static_target], "$11")
+ else
+ AC_SUBST([plugin_]$2[_embedded_static_target], [""])
+ fi
+ ], [
+ AC_SUBST([plugin_]$2[_embedded_static_target], [""])
+ ])
AC_SUBST([plugin_]$2[_shared_target], [""])
],[
m4_ifdef([$6],[
@@ -495,14 +521,6 @@ dnl Although this is "pretty", it breaks libmysqld build
maria_plugin_defs="$maria_plugin_defs, [builtin_maria_]$2[_plugin]"
[with_plugin_]$2=yes
__MYSQL_EMIT_CHECK_RESULT($3,[yes])
- m4_ifdef([$11], [
- m4_foreach([plugin], [$11], [
- condition_dependent_plugin_modules="$condition_dependent_plugin_modules m4_bregexp(plugin, [[^/]+$], [\&])"
- condition_dependent_plugin_objects="$condition_dependent_plugin_objects m4_bregexp(plugin, [[^/]+\.], [\&o])"
- condition_dependent_plugin_links="$condition_dependent_plugin_links $6/plugin"
- condition_dependent_plugin_includes="$condition_dependent_plugin_includes -I[\$(top_srcdir)]/$6/m4_bregexp(plugin, [^.+[/$]], [\&])"
- ])
- ])
fi
fi
@@ -769,6 +787,10 @@ AC_DEFUN([_MYSQL_EMIT_PLUGINS],[
])
AC_DEFUN([_MYSQL_EMIT_PLUGIN_ENABLE],[
+ if test "X[$mysql_plugin_]$2" = Xno -a \
+ "X[$with_plugin_]$2" != Xno; then
+ AC_MSG_ERROR([Plugin $1 cannot be built])
+ fi
m4_ifdef([$5],m4_ifdef([$4],[
[mysql_plugin_]$2=yes
],[
diff --git a/configure.in b/configure.in
index 72cde9def8c..6d2148300de 100644
--- a/configure.in
+++ b/configure.in
@@ -12,7 +12,8 @@ dnl
dnl When changing the major version number please also check the switch
dnl statement in mysqlbinlog::check_master_version(). You may also need
dnl to update version.c in ndb.
-AC_INIT([MariaDB Server], [5.2.3-MariaDB], [], [mysql])
+
+AC_INIT([MariaDB Server], [5.2.5-MariaDB], [], [mysql])
AC_CONFIG_SRCDIR([sql/mysqld.cc])
AC_CANONICAL_SYSTEM
@@ -104,7 +105,26 @@ AC_SUBST(SHARED_LIB_MAJOR_VERSION)
AC_SUBST(SHARED_LIB_VERSION)
AC_SUBST(AVAILABLE_LANGUAGES)
+# Check whether a debug mode should be enabled.
+AC_ARG_WITH([debug],
+ AS_HELP_STRING([--with-debug@<:@=full@:>@],
+ [Enable various amounts of debugging support (full adds a slow memory checker).]),
+ [with_debug=$withval],
+ [with_debug=no])
+
+AC_ARG_WITH([valgrind],
+ [AS_HELP_STRING([--with-valgrind],
+ [Valgrind instrumentation @<:@default=no@:>@])],
+ [], [with_valgrind=no])
+
+if test "$with_valgrind" != "no"
+then
+ AC_CHECK_HEADERS([valgrind/valgrind.h valgrind/memcheck.h],
+ [AC_DEFINE([HAVE_VALGRIND], [1], [Define for Valgrind support])])
+fi
+
# Whether the maintainer mode should be enabled.
+# Note that this uses $with_debug and $with_valgrind
MY_MAINTAINER_MODE
# Canonicalize the configuration name.
@@ -250,7 +270,7 @@ AC_PROG_LIBTOOL
# Ensure that we have --preserve-dup-deps defines, otherwise we get link
# problems of 'mysql' with CXX=g++
-LIBTOOL="$LIBTOOL --preserve-dup-deps"
+#LIBTOOL="$LIBTOOL --preserve-dup-deps"
AC_SUBST(LIBTOOL)dnl
AC_SUBST(NM)dnl
@@ -1698,11 +1718,6 @@ then
DEBUG_OPTIMIZE_CXX=""
fi
-AC_ARG_WITH(debug,
- [ --with-debug Add debug code
- --with-debug=full Add debug code (adds memory checker, very slow)],
- [with_debug=$withval],
- [with_debug=no])
if test "$with_debug" = "yes"
then
# Medium debug.
@@ -1725,17 +1740,6 @@ else
CXXFLAGS="$OPTIMIZE_CXXFLAGS $CXXFLAGS"
fi
-AC_ARG_WITH([valgrind],
- [AS_HELP_STRING([--with-valgrind],
- [Valgrind instrumentation @<:@default=no@:>@])],
- [], [with_valgrind=no])
-
-if test "$with_valgrind" != "no"
-then
- AC_CHECK_HEADERS([valgrind/valgrind.h valgrind/memcheck.h],
- [AC_DEFINE([HAVE_VALGRIND], [1], [Define for Valgrind support])])
-fi
-
# Debug Sync Facility. NOTE: depends on 'with_debug'. Must be behind it.
AC_MSG_CHECKING(if Debug Sync Facility should be enabled.)
AC_ARG_ENABLE(debug_sync,
@@ -2105,6 +2109,13 @@ MYSQL_TYPE_QSORT
AC_FUNC_UTIME_NULL
AC_FUNC_VPRINTF
+AC_CHECK_DECLS([fdatasync],,,
+[
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+])
+
AC_CHECK_FUNCS(alarm bcmp bfill bmove bsearch bzero \
chsize cuserid fchmod fcntl \
fconvert fdatasync fesetround finite fpresetsticky fpsetmask fsync ftruncate \
@@ -2531,9 +2542,8 @@ MYSQL_CHECK_LIBEVENT
MYSQL_STORAGE_ENGINE(myisam,no, [MyISAM Storage Engine],
[Traditional non-transactional MySQL tables])
MYSQL_PLUGIN_DIRECTORY(myisam, [storage/myisam])
-MYSQL_PLUGIN_STATIC(myisam, [libmyisam.a])
+MYSQL_PLUGIN_STATIC(myisam, [libmyisam_s.la], [libmyisam_embedded.la])
MYSQL_PLUGIN_MANDATORY(myisam) dnl Default
-MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS(myisam, [ha_myisam.cc])
MYSQL_STORAGE_ENGINE(partition, partition, [Partition Support],
[MySQL Partitioning Support], [max,max-no-ndb])
@@ -2856,9 +2866,6 @@ if test "$with_server" != "no" -o "$THREAD_SAFE_CLIENT" != "no"
then
AC_DEFINE([THREAD], [1],
[Define if you want to have threaded code. This may be undef on client code])
- # Avoid _PROGRAMS names
- THREAD_LOBJECTS="thr_alarm.o thr_lock.o thr_mutex.o thr_rwlock.o my_pthread.o my_thr_init.o mf_keycache.o mf_keycaches.o waiting_threads.o"
- AC_SUBST(THREAD_LOBJECTS)
fi
AM_CONDITIONAL(NEED_THREAD, test "$with_server" != "no" -o "$THREAD_SAFE_CLIENT" != "no")
@@ -2887,6 +2894,7 @@ AC_SUBST(server_scripts)
AC_SUBST(mysql_plugin_dirs)
AC_SUBST(mysql_plugin_libs)
+AC_SUBST(mysql_embedded_plugin_libs)
AC_SUBST(maria_plugin_defs)
diff --git a/dbug/CMakeLists.txt b/dbug/CMakeLists.txt
index 8b27f79dcf4..fabb592dccc 100644
--- a/dbug/CMakeLists.txt
+++ b/dbug/CMakeLists.txt
@@ -18,7 +18,6 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/dbug)
SET(DBUG_SOURCES dbug.c factorial.c sanity.c)
IF(NOT SOURCE_SUBLIBS)
- SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
ADD_LIBRARY(dbug ${DBUG_SOURCES})
ENDIF(NOT SOURCE_SUBLIBS)
diff --git a/dbug/Makefile.am b/dbug/Makefile.am
index 528a6a02fbf..e8acb0ca2c0 100644
--- a/dbug/Makefile.am
+++ b/dbug/Makefile.am
@@ -16,10 +16,11 @@
# MA 02111-1307, USA
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include
-LDADD = libdbug.a ../mysys/libmysys.a ../strings/libmystrings.a
+LDADD = libdbug.a $(top_builddir)/mysys/libmysys.a $(top_builddir)/strings/libmystrings.a
pkglib_LIBRARIES = libdbug.a
+noinst_LTLIBRARIES = libdbug.la
noinst_HEADERS = dbug_long.h
-libdbug_a_SOURCES = dbug.c sanity.c
+libdbug_la_SOURCES = dbug.c sanity.c
EXTRA_DIST = CMakeLists.txt example1.c example2.c example3.c \
user.r monty.doc dbug_add_tags.pl \
my_main.c main.c factorial.c dbug_analyze.c \
@@ -65,3 +66,7 @@ output5.r: factorial
# a hack to have executable in builddir, not in srcdir
tests-t: tests-t.pl
cp -f $(srcdir)/tests-t.pl ./tests-t
+
+libdbug_a_SOURCES=
+libdbug.a: libdbug.la
+ $(CP) .libs/libdbug.a $@
diff --git a/dbug/dbug.c b/dbug/dbug.c
index 608b4395c81..490c91cbf0f 100644
--- a/dbug/dbug.c
+++ b/dbug/dbug.c
@@ -926,6 +926,7 @@ void _db_set_init_(const char *control)
CODE_STATE tmp_cs;
bzero((uchar*) &tmp_cs, sizeof(tmp_cs));
tmp_cs.stack= &init_settings;
+ tmp_cs.process= db_process ? db_process : "dbug";
DbugParse(&tmp_cs, control);
}
@@ -1637,8 +1638,8 @@ static void PushState(CODE_STATE *cs)
struct settings *new_malloc;
new_malloc= (struct settings *) DbugMalloc(sizeof(struct settings));
+ bzero(new_malloc, sizeof(struct settings));
new_malloc->next= cs->stack;
- new_malloc->out_file= NULL;
cs->stack= new_malloc;
}
@@ -2121,7 +2122,7 @@ static FILE *OpenProfile(CODE_STATE *cs, const char *name)
static void DBUGCloseFile(CODE_STATE *cs, FILE *fp)
{
- if (fp != stderr && fp != stdout && fclose(fp) == EOF)
+ if (fp != NULL && fp != stderr && fp != stdout && fclose(fp) == EOF)
{
if (!cs->locked)
pthread_mutex_lock(&THR_LOCK_dbug);
diff --git a/extra/CMakeLists.txt b/extra/CMakeLists.txt
index ba90492577d..6cc69d3251e 100755
--- a/extra/CMakeLists.txt
+++ b/extra/CMakeLists.txt
@@ -14,8 +14,6 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
diff --git a/extra/Makefile.am b/extra/Makefile.am
index 8d6d18f0031..9c66cedc013 100644
--- a/extra/Makefile.am
+++ b/extra/Makefile.am
@@ -15,8 +15,10 @@
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \
-I$(top_srcdir)/sql
-LDADD = @CLIENT_EXTRA_LDFLAGS@ ../mysys/libmysys.a \
- ../dbug/libdbug.a ../strings/libmystrings.a \
+LDADD = @CLIENT_EXTRA_LDFLAGS@ \
+ $(top_builddir)/mysys/libmysys.a \
+ $(top_builddir)/strings/libmystrings.a \
+ $(top_builddir)/dbug/libdbug.a \
$(ZLIB_LIBS)
BUILT_SOURCES= $(top_builddir)/include/mysqld_error.h \
$(top_builddir)/include/sql_state.h \
diff --git a/extra/libevent/epoll.c b/extra/libevent/epoll.c
index 7c8c60bdffa..93ed5b83aa4 100644
--- a/extra/libevent/epoll.c
+++ b/extra/libevent/epoll.c
@@ -155,8 +155,8 @@ epoll_init(struct event_base *base)
}
static int
-epoll_recalc(struct event_base *base __attribute__((unused)),
- void *arg, int max)
+epoll_recalc(struct event_base *base __attribute__((unused)), void *arg,
+ int max)
{
struct epollop *epollop = arg;
diff --git a/extra/libevent/evbuffer.c b/extra/libevent/evbuffer.c
index 432d75d1c53..97dc40c0e41 100644
--- a/extra/libevent/evbuffer.c
+++ b/extra/libevent/evbuffer.c
@@ -75,8 +75,10 @@ bufferevent_add(struct event *ev, int timeout)
*/
void
-bufferevent_read_pressure_cb(struct evbuffer *buf, size_t old __attribute__((unused)), size_t now,
- void *arg) {
+bufferevent_read_pressure_cb(struct evbuffer *buf,
+ size_t old __attribute__((unused)), size_t now,
+ void *arg)
+{
struct bufferevent *bufev = arg;
/*
* If we are below the watermark then reschedule reading if it's
diff --git a/extra/libevent/event.c b/extra/libevent/event.c
index 2042c2de626..07498c709c8 100644
--- a/extra/libevent/event.c
+++ b/extra/libevent/event.c
@@ -405,7 +405,7 @@ event_loopexit_cb(int fd __attribute__((unused)),
int
event_loopexit(struct timeval *tv)
{
- return (event_once(-1, EV_TIMEOUT, event_loopexit_cb,
+ return (event_once(-1, EV_TIMEOUT, &event_loopexit_cb,
current_base, tv));
}
diff --git a/extra/libevent/kqueue.c b/extra/libevent/kqueue.c
index eec5a6ab6fb..763236e40ac 100644
--- a/extra/libevent/kqueue.c
+++ b/extra/libevent/kqueue.c
@@ -95,7 +95,7 @@ const struct eventop kqops = {
};
static void *
-kq_init(struct event_base *base)
+kq_init(struct event_base *base __attribute__((unused)))
{
int kq;
struct kqop *kqueueop;
@@ -203,13 +203,14 @@ kq_insert(struct kqop *kqop, struct kevent *kev)
}
static void
-kq_sighandler(int sig)
+kq_sighandler(int sig __attribute__((unused)))
{
/* Do nothing here */
}
static int
-kq_dispatch(struct event_base *base, void *arg, struct timeval *tv)
+kq_dispatch(struct event_base *base __attribute__((unused)), void *arg,
+ struct timeval *tv)
{
struct kqop *kqop = arg;
struct kevent *changes = kqop->changes;
@@ -408,7 +409,7 @@ kq_del(void *arg, struct event *ev)
}
static void
-kq_dealloc(struct event_base *base, void *arg)
+kq_dealloc(struct event_base *base __attribute__((unused)), void *arg)
{
struct kqop *kqop = arg;
diff --git a/extra/libevent/signal.c b/extra/libevent/signal.c
index 5eb9d3c606e..ce164f2f5ea 100644
--- a/extra/libevent/signal.c
+++ b/extra/libevent/signal.c
@@ -69,7 +69,8 @@ static void evsignal_handler(int sig);
/* Callback for when the signal handler write a byte to our signaling socket */
static void
-evsignal_cb(int fd, short what __attribute__((unused)), void *arg __attribute__((unused)))
+evsignal_cb(int fd, short what __attribute__((unused)),
+ void *arg __attribute__((unused)))
{
static char signals[100];
#ifdef WIN32
@@ -113,7 +114,7 @@ evsignal_init(struct event_base *base)
evutil_make_socket_nonblocking(base->sig.ev_signal_pair[0]);
event_set(&base->sig.ev_signal, base->sig.ev_signal_pair[1],
- EV_READ | EV_PERSIST, evsignal_cb, &base->sig.ev_signal);
+ EV_READ | EV_PERSIST, &evsignal_cb, &base->sig.ev_signal);
base->sig.ev_signal.ev_base = base;
base->sig.ev_signal.ev_flags |= EVLIST_INTERNAL;
}
diff --git a/extra/replace.c b/extra/replace.c
index 40bddf6d8fb..47993857a43 100644
--- a/extra/replace.c
+++ b/extra/replace.c
@@ -1085,7 +1085,7 @@ static int convert_file(REPLACE *rep, char * name)
my_fclose(in,MYF(0)); my_fclose(out,MYF(0));
if (updated && ! error)
- my_redel(org_name,tempname,MYF(MY_WME | MY_LINK_WARNING));
+ my_redel(org_name, tempname, 0, MYF(MY_WME | MY_LINK_WARNING));
else
my_delete(tempname,MYF(MY_WME));
if (!silent && ! error)
diff --git a/extra/yassl/Makefile.am b/extra/yassl/Makefile.am
index ddd57d60a99..43cae0514f9 100644
--- a/extra/yassl/Makefile.am
+++ b/extra/yassl/Makefile.am
@@ -1,5 +1,2 @@
SUBDIRS = taocrypt src testsuite
EXTRA_DIST = CMakeLists.txt
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/extra/yassl/src/Makefile.am b/extra/yassl/src/Makefile.am
index d192eb03b49..300cdcd096f 100644
--- a/extra/yassl/src/Makefile.am
+++ b/extra/yassl/src/Makefile.am
@@ -6,7 +6,3 @@ libyassl_la_SOURCES = buffer.cpp cert_wrapper.cpp crypto_wrapper.cpp \
template_instnt.cpp timer.cpp yassl_imp.cpp yassl_error.cpp yassl_int.cpp
EXTRA_DIST = $(wildcard ../include/*.hpp) $(wildcard ../include/openssl/*.h)
AM_CXXFLAGS = -DYASSL_PURE_C -DYASSL_PREFIX @yassl_thread_cxxflags@
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
-
diff --git a/extra/yassl/taocrypt/Makefile.am b/extra/yassl/taocrypt/Makefile.am
index 11fea2064f0..deab5227f7f 100644
--- a/extra/yassl/taocrypt/Makefile.am
+++ b/extra/yassl/taocrypt/Makefile.am
@@ -1,5 +1,2 @@
SUBDIRS = src test benchmark
EXTRA_DIST = CMakeLists.txt $(wildcard mySTL/*.hpp)
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/extra/yassl/taocrypt/benchmark/Makefile.am b/extra/yassl/taocrypt/benchmark/Makefile.am
index 1f082f22f40..0171c7366bb 100644
--- a/extra/yassl/taocrypt/benchmark/Makefile.am
+++ b/extra/yassl/taocrypt/benchmark/Makefile.am
@@ -4,6 +4,3 @@ benchmark_SOURCES = benchmark.cpp
benchmark_LDADD = $(top_builddir)/extra/yassl/taocrypt/src/libtaocrypt.la
benchmark_CXXFLAGS = -DYASSL_PURE_C @yassl_thread_cxxflags@
EXTRA_DIST = benchmark.dsp rsa1024.der dh1024.der dsa1024.der make.bat
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/extra/yassl/taocrypt/src/Makefile.am b/extra/yassl/taocrypt/src/Makefile.am
index 6ca969ad686..a8d08b6e9d5 100644
--- a/extra/yassl/taocrypt/src/Makefile.am
+++ b/extra/yassl/taocrypt/src/Makefile.am
@@ -12,7 +12,3 @@ libtaocrypt_la_CXXFLAGS = @yassl_taocrypt_extra_cxxflags@ -DYASSL_PURE_C \
@yassl_thread_cxxflags@
EXTRA_DIST = $(wildcard ../include/*.hpp)
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
-
diff --git a/extra/yassl/taocrypt/test/Makefile.am b/extra/yassl/taocrypt/test/Makefile.am
index aa325ff9b75..38f04f1387f 100644
--- a/extra/yassl/taocrypt/test/Makefile.am
+++ b/extra/yassl/taocrypt/test/Makefile.am
@@ -4,6 +4,3 @@ test_SOURCES = test.cpp
test_LDADD = $(top_builddir)/extra/yassl/taocrypt/src/libtaocrypt.la
test_CXXFLAGS = -DYASSL_PURE_C @yassl_thread_cxxflags@
EXTRA_DIST = make.bat
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/extra/yassl/testsuite/Makefile.am b/extra/yassl/testsuite/Makefile.am
index e626b1822ec..d74c972a084 100644
--- a/extra/yassl/testsuite/Makefile.am
+++ b/extra/yassl/testsuite/Makefile.am
@@ -8,7 +8,3 @@ testsuite_CXXFLAGS = -DYASSL_PURE_C -DYASSL_PREFIX -DNO_MAIN_DRIVER @yassl_threa
testsuite_LDADD = $(top_builddir)/extra/yassl/src/libyassl.la \
$(top_builddir)/extra/yassl/taocrypt/src/libtaocrypt.la
EXTRA_DIST = testsuite.dsp test.hpp input quit make.bat
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
-
diff --git a/include/maria.h b/include/maria.h
index 8e5c485767a..1896eb7ed60 100644
--- a/include/maria.h
+++ b/include/maria.h
@@ -434,7 +434,8 @@ int maria_repair_by_sort(HA_CHECK *param, MARIA_HA *info,
int maria_repair_parallel(HA_CHECK *param, register MARIA_HA *info,
const char *name, my_bool rep_quick);
int maria_change_to_newfile(const char *filename, const char *old_ext,
- const char *new_ext, myf myflags);
+ const char *new_ext, time_t backup_time,
+ myf myflags);
void maria_lock_memory(HA_CHECK *param);
int maria_update_state_info(HA_CHECK *param, MARIA_HA *info, uint update);
void maria_update_key_parts(MARIA_KEYDEF *keyinfo, double *rec_per_key_part,
diff --git a/include/my_attribute.h b/include/my_attribute.h
index 8309d85f20a..ce14a5298ec 100644
--- a/include/my_attribute.h
+++ b/include/my_attribute.h
@@ -30,10 +30,15 @@
#ifndef __attribute__
# if !defined(__GNUC__)
# define __attribute__(A)
-# elif GCC_VERSION < 2008
-# define __attribute__(A)
-# elif defined(__cplusplus) && GCC_VERSION < 3004
-# define __attribute__(A)
+# else
+# ifndef GCC_VERSION
+# define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
+# endif
+# if GCC_VERSION < 2008
+# define __attribute__(A)
+# elif defined(__cplusplus) && GCC_VERSION < 3004
+# define __attribute__(A)
+# endif
# endif
#endif
diff --git a/include/my_compiler.h b/include/my_compiler.h
index 1cd46ff4260..c7d334999d0 100644
--- a/include/my_compiler.h
+++ b/include/my_compiler.h
@@ -32,8 +32,15 @@
/* GNU C/C++ */
#if defined __GNUC__
+/* Convenience macro to test the minimum required GCC version. */
+# define MY_GNUC_PREREQ(maj, min) \
+ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
/* Any after 2.95... */
# define MY_ALIGN_EXT
+/* Comunicate to the compiler the unreachability of the code. */
+# if MY_GNUC_PREREQ(4,5)
+# define MY_ASSERT_UNREACHABLE() __builtin_unreachable()
+# endif
/* Microsoft Visual C++ */
#elif defined _MSC_VER
@@ -67,7 +74,7 @@
#endif
/**
- Generic compiler-dependent features.
+ Generic (compiler-independent) features.
*/
#ifndef MY_ALIGNOF
# ifdef __cplusplus
@@ -79,6 +86,10 @@
# endif
#endif
+#ifndef MY_ASSERT_UNREACHABLE
+# define MY_ASSERT_UNREACHABLE() do { assert(0); } while (0)
+#endif
+
/**
C++ Type Traits
*/
diff --git a/include/my_dbug.h b/include/my_dbug.h
index b32f12af8a0..e1cd4e2b7dc 100644
--- a/include/my_dbug.h
+++ b/include/my_dbug.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB & 2009 Monty Program Ab
+/* Copyright (C) 2000 MySQL AB & Oracle & 2009 Monty Program Ab
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
@@ -13,8 +13,12 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#ifndef _dbug_h
-#define _dbug_h
+#ifndef _my_dbug_h
+#define _my_dbug_h
+
+#ifndef __WIN__
+#include <signal.h>
+#endif /* not __WIN__ */
#if defined(__cplusplus) && !defined(DBUG_OFF)
class Dbug_violation_helper
@@ -128,8 +132,35 @@ extern void _db_flush_();
#define DEBUGGER_OFF do { _dbug_on_= 0; } while(0)
#define DEBUGGER_ON do { _dbug_on_= 1; } while(0)
#define IF_DBUG(A) A
+#ifndef __WIN__
#define DBUG_ABORT() (_db_flush_(), abort())
-#else /* No debugger */
+#else
+/*
+ Avoid popup with abort/retry/ignore buttons. When BUG#31745 is fixed we can
+ call abort() instead of _exit(3) (now it would cause a "test signal" popup).
+*/
+#include <crtdbg.h>
+#define DBUG_ABORT() (_db_flush_(),\
+ (void)_CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE),\
+ (void)_CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR),\
+ _exit(3))
+#endif
+
+/*
+ Make the program fail, without creating a core file.
+ abort() will send SIGABRT which (most likely) generates core.
+ Use SIGKILL instead, which cannot be caught.
+ We also pause the current thread, until the signal is actually delivered.
+ An alternative would be to use _exit(EXIT_FAILURE),
+ but then valgrind would report lots of memory leaks.
+ */
+#ifdef __WIN__
+#define DBUG_SUICIDE() DBUG_ABORT()
+#else
+#define DBUG_SUICIDE() (_db_flush_(), kill(getpid(), SIGKILL), pause())
+#endif
+
+#else /* No debugger */
#define DBUG_ENTER(a1)
#define DBUG_VIOLATION_HELPER_LEAVE do { } while(0)
@@ -159,9 +190,12 @@ extern void _db_flush_();
#define DEBUGGER_OFF do { } while(0)
#define DEBUGGER_ON do { } while(0)
#define IF_DBUG(A)
-#define DBUG_ABORT() abort()
+#define DBUG_ABORT() do { } while(0)
+#define DBUG_SUICIDE() do { } while(0)
+
#endif
#ifdef __cplusplus
}
#endif
-#endif
+
+#endif /* _my_dbug_h */
diff --git a/include/my_pthread.h b/include/my_pthread.h
index f7aad5dec64..5cf6c5d5fac 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -128,8 +128,8 @@ struct tm *gmtime_r(const time_t *timep,struct tm *tmp);
void pthread_exit(void *a); /* was #define pthread_exit(A) ExitThread(A)*/
-#ifndef ETIMEDOUT
-#define ETIMEDOUT 145
+#ifndef ETIMEDOUT
+#define ETIMEDOUT 145 /* Win32 doesn't have this */
#endif
#define getpid() GetCurrentThreadId()
#define HAVE_LOCALTIME_R 1
@@ -517,7 +517,8 @@ int safe_mutex_destroy(safe_mutex_t *mp,const char *file, uint line);
int safe_cond_wait(pthread_cond_t *cond, safe_mutex_t *mp,const char *file,
uint line);
int safe_cond_timedwait(pthread_cond_t *cond, safe_mutex_t *mp,
- struct timespec *abstime, const char *file, uint line);
+ const struct timespec *abstime,
+ const char *file, uint line);
void safe_mutex_global_init(void);
void safe_mutex_end(FILE *file);
void safe_mutex_free_deadlock_data(safe_mutex_t *mp);
diff --git a/include/my_sys.h b/include/my_sys.h
index f01a9a6d4a6..f5e38c5858e 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -135,6 +135,9 @@ extern int NEAR my_errno; /* Last error in mysys */
#define GETDATE_GMT 8
#define GETDATE_FIXEDLENGTH 16
+/* Extra length needed for filename if one calls my_create_backup_name */
+#define MY_BACKUP_NAME_EXTRA_LENGTH 17
+
/* defines when allocating data */
#ifdef SAFEMALLOC
#define my_malloc(SZ,FLAG) _mymalloc((SZ), __FILE__, __LINE__, FLAG )
@@ -194,7 +197,7 @@ extern void my_large_free(uchar * ptr, myf my_flags);
#define my_large_free(A,B) my_free_lock((A),(B))
#endif /* HAVE_LARGE_PAGES */
-#ifdef HAVE_ALLOCA
+#if defined(HAVE_ALLOCA) && !defined(HAVE_valgrind)
#if defined(_AIX) && !defined(__GNUC__) && !defined(_AIX43)
#pragma alloca
#endif /* _AIX */
@@ -689,7 +692,10 @@ extern int my_message_no_curses(uint my_err, const char *str,myf MyFlags);
extern int my_message_curses(uint my_err, const char *str,myf MyFlags);
extern my_bool my_init(void);
extern void my_end(int infoflag);
-extern int my_redel(const char *from, const char *to, int MyFlags);
+extern int my_redel(const char *from, const char *to, time_t backup_time_stamp,
+ myf MyFlags);
+void my_create_backup_name(char *to, const char *from,
+ time_t backup_time_stamp);
extern int my_copystat(const char *from, const char *to, int MyFlags);
extern char * my_filename(File fd);
diff --git a/include/myisam.h b/include/myisam.h
index 8413b7936e3..bf31a96b792 100644
--- a/include/myisam.h
+++ b/include/myisam.h
@@ -295,6 +295,8 @@ extern int mi_is_changed(struct st_myisam_info *info);
extern int mi_delete_all_rows(struct st_myisam_info *info);
extern ulong _mi_calc_blob_length(uint length , const uchar *pos);
extern uint mi_get_pointer_length(ulonglong file_length, uint def);
+extern int mi_make_backup_of_index(struct st_myisam_info *info,
+ time_t backup_time, myf flags);
#define MEMMAP_EXTRA_MARGIN 7 /* Write this as a suffix for mmap file */
/* this is used to pass to mysql_myisamchk_table */
@@ -390,7 +392,8 @@ int mi_repair_by_sort(HA_CHECK *param, register MI_INFO *info,
int mi_repair_parallel(HA_CHECK *param, register MI_INFO *info,
const char * name, int rep_quick);
int change_to_newfile(const char * filename, const char * old_ext,
- const char * new_ext, uint raid_chunks,
+ const char * new_ext, time_t backup_time,
+ uint raid_chunks,
myf myflags);
int lock_file(HA_CHECK *param, File file, my_off_t start, int lock_type,
const char *filetype, const char *filename);
diff --git a/include/myisamchk.h b/include/myisamchk.h
index 057c06652a1..7d7100bdd71 100644
--- a/include/myisamchk.h
+++ b/include/myisamchk.h
@@ -74,7 +74,7 @@
#define TT_USEFRM 1
#define TT_FOR_UPGRADE 2
-#define O_NEW_INDEX 1 /* Bits set in out_flag */
+/* Bits set in out_flag */
#define O_NEW_DATA 2
#define O_DATA_LOST 4
@@ -141,6 +141,7 @@ typedef struct st_handler_check_param
ulonglong use_buffers; /* Used as param to getopt() */
size_t read_buffer_length, write_buffer_length;
size_t sort_buffer_length, sort_key_blocks;
+ time_t backup_time; /* To sign backup files */
ulong rec_per_key_part[HA_MAX_KEY_SEG * HA_MAX_POSSIBLE_KEY];
double new_rec_per_key_part[HA_MAX_KEY_SEG * HA_MAX_POSSIBLE_KEY];
uint out_flag, warning_printed, error_printed, verbose;
diff --git a/include/mysql.h b/include/mysql.h
index cbdfb8387c6..19aab89283b 100644
--- a/include/mysql.h
+++ b/include/mysql.h
@@ -230,7 +230,8 @@ struct st_mysql_options {
enum mysql_status
{
- MYSQL_STATUS_READY,MYSQL_STATUS_GET_RESULT,MYSQL_STATUS_USE_RESULT
+ MYSQL_STATUS_READY, MYSQL_STATUS_GET_RESULT, MYSQL_STATUS_USE_RESULT,
+ MYSQL_STATUS_STATEMENT_GET_RESULT
};
enum mysql_protocol_type
diff --git a/include/mysql.h.pp b/include/mysql.h.pp
index 48d3b804dd9..f9f38b67f96 100644
--- a/include/mysql.h.pp
+++ b/include/mysql.h.pp
@@ -293,7 +293,8 @@ struct st_mysql_options {
};
enum mysql_status
{
- MYSQL_STATUS_READY,MYSQL_STATUS_GET_RESULT,MYSQL_STATUS_USE_RESULT
+ MYSQL_STATUS_READY, MYSQL_STATUS_GET_RESULT, MYSQL_STATUS_USE_RESULT,
+ MYSQL_STATUS_STATEMENT_GET_RESULT
};
enum mysql_protocol_type
{
diff --git a/include/sha1.h b/include/sha1.h
index e476456a9bd..787896e7476 100644
--- a/include/sha1.h
+++ b/include/sha1.h
@@ -6,12 +6,13 @@
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
+ 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 */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
/*
This is the header file for code which implements the Secure
@@ -25,6 +26,38 @@
Please read the file sha1.c for more information.
Modified 2002 by Peter Zaitsev to better follow MySQL standards
+
+ Original Source from: http://www.faqs.org/rfcs/rfc3174.html
+
+ Copyright (C) The Internet Society (2001). All Rights Reserved.
+
+ This document and translations of it may be copied and furnished to
+ others, and derivative works that comment on or otherwise explain it
+ or assist in its implementation may be prepared, copied, published
+ and distributed, in whole or in part, without restriction of any
+ kind, provided that the above copyright notice and this paragraph are
+ included on all such copies and derivative works. However, this
+ document itself may not be modified in any way, such as by removing
+ the copyright notice or references to the Internet Society or other
+ Internet organizations, except as needed for the purpose of
+ developing Internet standards in which case the procedures for
+ copyrights defined in the Internet Standards process must be
+ followed, or as required to translate it into languages other than
+ English.
+
+ The limited permissions granted above are perpetual and will not be
+ revoked by the Internet Society or its successors or assigns.
+
+ This document and the information contained herein is provided on an
+ "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
+ TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
+ BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
+ HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+
+ Acknowledgement
+ Funding for the RFC Editor function is currently provided by the
+ Internet Society.
*/
diff --git a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt
index a048b596828..fad34ac89a3 100755
--- a/libmysql/CMakeLists.txt
+++ b/libmysql/CMakeLists.txt
@@ -14,9 +14,6 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-
# Note that we don't link with the libraries "strings" or "mysys"
# here, instead we recompile the files needed and include them
# directly. This means we don't have to worry here about if these
diff --git a/libmysql/Makefile.shared b/libmysql/Makefile.shared
index 34e8f2e3b92..706feef8df3 100644
--- a/libmysql/Makefile.shared
+++ b/libmysql/Makefile.shared
@@ -117,6 +117,3 @@ conf_to_src_LDADD=
#force static linking of conf_to_src - essential when linking against
#custom installation of libc
conf_to_src_LDFLAGS=@NOINST_LDFLAGS@
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index 53cb20cddc2..87aede33224 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -2455,6 +2455,8 @@ static my_bool execute(MYSQL_STMT *stmt, char *packet, ulong length)
set_stmt_errmsg(stmt, net);
DBUG_RETURN(1);
}
+ else if (mysql->status == MYSQL_STATUS_GET_RESULT)
+ stmt->mysql->status= MYSQL_STATUS_STATEMENT_GET_RESULT;
DBUG_RETURN(0);
}
@@ -2593,7 +2595,7 @@ static int stmt_read_row_unbuffered(MYSQL_STMT *stmt, unsigned char **row)
set_stmt_error(stmt, CR_SERVER_LOST, unknown_sqlstate, NULL);
return 1;
}
- if (mysql->status != MYSQL_STATUS_GET_RESULT)
+ if (mysql->status != MYSQL_STATUS_STATEMENT_GET_RESULT)
{
set_stmt_error(stmt, stmt->unbuffered_fetch_cancelled ?
CR_FETCH_CANCELED : CR_COMMANDS_OUT_OF_SYNC,
@@ -4799,7 +4801,7 @@ int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt)
DBUG_RETURN(1);
}
}
- else if (mysql->status != MYSQL_STATUS_GET_RESULT)
+ else if (mysql->status != MYSQL_STATUS_STATEMENT_GET_RESULT)
{
set_stmt_error(stmt, CR_COMMANDS_OUT_OF_SYNC, unknown_sqlstate, NULL);
DBUG_RETURN(1);
diff --git a/libmysqld/CMakeLists.txt b/libmysqld/CMakeLists.txt
index 2105585cc54..27850357127 100644
--- a/libmysqld/CMakeLists.txt
+++ b/libmysqld/CMakeLists.txt
@@ -13,8 +13,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
# Need to set USE_TLS, since __declspec(thread) approach to thread local
# storage does not work properly in DLLs.
diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am
index b70b78241e1..ef17a0a6923 100644
--- a/libmysqld/Makefile.am
+++ b/libmysqld/Makefile.am
@@ -34,10 +34,10 @@ INCLUDES= -I$(top_builddir)/include -I$(top_srcdir)/include \
-I$(top_srcdir)/sql/examples \
-I$(top_srcdir)/regex \
$(openssl_includes) @ZLIB_INCLUDES@ \
- @condition_dependent_plugin_includes@
+ @condition_dependent_plugin_includes@ \
+ @ndbcluster_includes@
-noinst_LIBRARIES = libmysqld_int.a
-pkglib_LIBRARIES = libmysqld.a
+pkglib_LTLIBRARIES = libmysqld.la
SUBDIRS = . examples
libmysqld_sources= libmysqld.c lib_sql.cc emb_qcache.cc
libmysqlsources = errmsg.c get_password.c libmysql.c client.c pack.c \
@@ -79,104 +79,28 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
rpl_injector.cc my_user.c partition_info.cc \
sql_servers.cc event_parse_data.cc opt_table_elimination.cc
-libmysqld_int_a_SOURCES= $(libmysqld_sources)
-nodist_libmysqld_int_a_SOURCES= $(libmysqlsources) $(sqlsources)
-libmysqld_a_SOURCES=
-
-sqlstoragesources = $(EXTRA_libmysqld_a_SOURCES)
-storagesources = @condition_dependent_plugin_modules@
-storageobjects = @condition_dependent_plugin_objects@
-storagesourceslinks = @condition_dependent_plugin_links@
-
# automake misses these
sql_yacc.cc sql_yacc.h: $(top_srcdir)/sql/sql_yacc.yy
# The following libraries should be included in libmysqld.a
-INC_LIB= $(top_builddir)/regex/libregex.a \
- $(top_builddir)/mysys/libmysys.a \
- $(top_builddir)/strings/libmystrings.a \
- $(top_builddir)/dbug/libdbug.a \
- $(top_builddir)/vio/libvio.a \
- @NDB_SCI_LIBS@ \
- @mysql_plugin_libs@ \
+INC_LIB= $(top_builddir)/regex/libregex.la \
+ $(top_builddir)/mysys/libmysys.la \
+ $(top_builddir)/strings/libmystrings.la \
+ $(top_builddir)/dbug/libdbug.la \
+ $(top_builddir)/vio/libvio.la \
+ @ndbcluster_libs@ @NDB_SCI_LIBS@ \
+ @mysql_embedded_plugin_libs@ \
$(libevent_inc_libs) \
$(yassl_inc_libs)
if HAVE_YASSL
-yassl_inc_libs= $(top_builddir)/extra/yassl/src/.libs/libyassl.a \
- $(top_builddir)/extra/yassl/taocrypt/src/.libs/libtaocrypt.a
+yassl_inc_libs= $(top_builddir)/extra/yassl/src/libyassl.la \
+ $(top_builddir)/extra/yassl/taocrypt/src/libtaocrypt.la
endif
-# Storage engine specific compilation options
-ha_ndbcluster.o:ha_ndbcluster.cc
- $(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $<
-
-ha_ndbcluster_cond.o:ha_ndbcluster_cond.cc
- $(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $<
-
-ha_ndbcluster_binlog.o: ha_ndbcluster_binlog.cc
- $(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $<
-
-# Until we can remove dependency on ha_ndbcluster.h
-handler.o: handler.cc
- $(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $<
-
-# We need rules to compile these as no good way
-# found to append fileslists that collected by configure
-# to the sources list
-
-ha_federatedx.o:ha_federatedx.cc
- $(CXXCOMPILE) $(LM_CFLAGS) -c $<
-
-ha_heap.o:ha_heap.cc
- $(CXXCOMPILE) $(LM_CFLAGS) -c $<
-
-ha_innodb.o:ha_innodb.cc
- $(CXXCOMPILE) $(LM_CFLAGS) -c $<
-
-ha_myisam.o:ha_myisam.cc
- $(CXXCOMPILE) $(LM_CFLAGS) -c $<
-
-ha_myisammrg.o:ha_myisammrg.cc
- $(CXXCOMPILE) $(LM_CFLAGS) -c $<
-
-#
-# To make it easy for the end user to use the embedded library we
-# generate a total libmysqld.a from all library files,
-
-# note - InnoDB libraries have circular dependencies, so in INC_LIB
-# few libraries are present two times. Metrowerks linker doesn't like
-# it at all. Traditional ar has no problems with it, but still there's no
-# need to add the same file twice to the library, so 'sort -u' save us
-# some time and spares unnecessary work.
-
-libmysqld.a: libmysqld_int.a $(INC_LIB) $(libmysqld_a_DEPENDENCIES) $(storageobjects)
-if DARWIN_MWCC
- mwld -lib -o $@ libmysqld_int.a `echo $(INC_LIB) | sort -u` $(storageobjects)
-else
- -rm -f libmysqld.a
- if test "$(host_os)" = "netware" ; \
- then \
- $(libmysqld_a_AR) libmysqld.a $(INC_LIB) libmysqld_int.a $(storageobjects); \
- else \
- current_dir=`pwd`; \
- rm -rf tmp; mkdir tmp; \
- (for arc in $(INC_LIB) ./libmysqld_int.a; do \
- arpath=`echo $$arc|sed 's|[^/]*$$||'|sed 's|\.libs/$$||'`; \
- artmp=`echo $$arc|sed 's|^.*/|tmp/lib-|'`; \
- for F in `$(AR) t $$arc | grep -v SYMDEF`; do \
- if test -e "$$arpath/$$F" ; then echo "$$arpath/$$F"; else \
- mkdir $$artmp; cd $$artmp > /dev/null; \
- $(AR) x ../../$$arc; \
- cd $$current_dir > /dev/null; \
- ls $$artmp/* | grep -v SYMDEF; \
- continue 2; fi; done; \
- done; echo $(libmysqld_a_DEPENDENCIES) ) | sort -u | xargs $(AR) cq libmysqld.a ; \
- $(AR) r libmysqld.a $(storageobjects); \
- $(RANLIB) libmysqld.a ; \
- rm -rf tmp; \
- fi
-endif
+libmysqld_la_SOURCES= $(libmysqld_sources)
+nodist_libmysqld_la_SOURCES= $(libmysqlsources) $(sqlsources)
+libmysqld_la_LIBADD = $(INC_LIB)
## XXX: any time the client interface changes, we'll need to bump
## the version info for libmysqld; however, it's possible for the
@@ -184,7 +108,7 @@ endif
## libmysqlclient interface. Should we make a separate version
## string for the two?
#libmysqld_la_LDFLAGS = -version-info @SHARED_LIB_VERSION@
-#CLEANFILES = $(libmysqld_la_LIBADD) libmysqld.la
+#CLEANFILES = libmysqld.la
BUILT_SOURCES = link_sources
@@ -209,20 +133,6 @@ link_sources:
@LN_CP_F@ $(top_builddir)/libmysql/$$f $$f; \
fi ; \
done; \
- if test -n "$(sqlstoragesources)" ; \
- then \
- for f in "$(sqlstoragesources)"; do \
- rm -f "$$f"; \
- @LN_CP_F@ `find $(srcdir)/../sql -name "$$f"` "$$f"; \
- done; \
- fi; \
- if test -n "$(storagesources)" ; \
- then \
- rm -f $(storagesources); \
- for f in $(storagesourceslinks); do \
- @LN_CP_F@ $(top_srcdir)/$$f . ; \
- done; \
- fi; \
rm -f client_settings.h; \
@LN_CP_F@ $(top_srcdir)/libmysql/client_settings.h \
client_settings.h; \
@@ -230,5 +140,5 @@ link_sources:
clean-local:
- rm -f `echo $(sqlsources) $(libmysqlsources) $(sqlstoragesources) $(storagesources) | sed "s;\.lo;.c;g"`; \
+ rm -f `echo $(sqlsources) $(libmysqlsources) | sed "s;\.lo;.c;g"`; \
rm -f client_settings.h
diff --git a/libmysqld/examples/Makefile.am b/libmysqld/examples/Makefile.am
index fd37f362960..a5ed182507a 100644
--- a/libmysqld/examples/Makefile.am
+++ b/libmysqld/examples/Makefile.am
@@ -37,12 +37,13 @@ INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I$(srcdir) \
-I$(top_srcdir) -I$(top_srcdir)/client -I$(top_srcdir)/regex \
$(openssl_includes)
LIBS = @LIBS@ @WRAPLIBS@ @CLIENT_LIBS@ $(yassl_libs)
-LDADD = @CLIENT_EXTRA_LDFLAGS@ ../libmysqld.a @LIBDL@ $(CXXLDFLAGS) \
- @NDB_SCI_LIBS@
+LDADD = @CLIENT_EXTRA_LDFLAGS@ \
+ $(top_builddir)/libmysqld/libmysqld.la @LIBDL@ $(CXXLDFLAGS) \
+ @ndbcluster_libs@ @NDB_SCI_LIBS@
mysqltest_embedded_LINK = $(CXXLINK)
nodist_mysqltest_embedded_SOURCES = mysqltest.cc
-mysqltest_embedded_LDADD = $(LDADD) $(top_builddir)/regex/libregex.a \
+mysqltest_embedded_LDADD = $(LDADD) $(top_builddir)/regex/libregex.la \
@MYSQLD_EXTRA_LDFLAGS@
nodist_mysql_SOURCES = mysql.cc readline.cc completion_hash.cc \
@@ -51,6 +52,3 @@ mysql_LDADD = @readline_link@ @TERMCAP_LIB@ $(LDADD)
mysql_client_test_embedded_LINK = $(CXXLINK)
nodist_mysql_client_test_embedded_SOURCES = mysql_client_test.c
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am
index e565521a8b0..07cf5fc8e7b 100644
--- a/mysql-test/Makefile.am
+++ b/mysql-test/Makefile.am
@@ -109,6 +109,7 @@ TEST_DIRS = t r include std_data std_data/parts collections \
suite/innodb suite/innodb/t suite/innodb/r suite/innodb/include \
suite/innodb_plugin suite/innodb_plugin/t suite/innodb_plugin/r \
suite/innodb_plugin/include \
+ suite/handler \
suite/engines suite/engines/funcs suite/engines/iuds suite/engines/rr_trx \
suite/engines/funcs/r suite/engines/funcs/t suite/engines/iuds/r \
suite/engines/iuds/t suite/engines/rr_trx/include suite/engines/rr_trx/r \
diff --git a/mysql-test/README b/mysql-test/README
index 3c8303ca070..d3be11278fc 100644
--- a/mysql-test/README
+++ b/mysql-test/README
@@ -4,13 +4,14 @@ this directory. It will fire up the newly built mysqld and test it.
Note that you do not have to have to do "make install", and you could
actually have a co-existing MySQL installation. The tests will not
-conflict with it.
+conflict with it. To run the test suite in a source directory, you
+must do make first.
All tests must pass. If one or more of them fail on your system, please
read the following manual section for instructions on how to report the
problem:
-http://dev.mysql.com/doc/mysql/en/mysql-test-suite.html
+http://kb.askmonty.org/v/reporting-bugs
If you want to use an already running MySQL server for specific tests,
use the --extern option to mysql-test-run. Please note that in this mode,
@@ -27,7 +28,6 @@ With no test cases named on the command line, mysql-test-run falls back
to the normal "non-extern" behavior. The reason for this is that some
tests cannot run with an external server.
-
You can create your own test cases. To create a test case, create a new
file in the t subdirectory using a text editor. The file should have a .test
extension. For example:
@@ -67,7 +67,12 @@ extension. For example:
edit the test result to the correct results so that we can verify
that the bug is corrected in future releases.
-To submit your test case, put your .test file and .result file(s) into
-a tar.gz archive, add a README that explains the problem, ftp the
-archive to ftp://support.mysql.com/pub/mysql/secret/ and send a mail
-to bugs@lists.mysql.com
+If you want to submit your test case you can send it
+to maria-developers@lists.launchpad.com or attach it to a bug report on
+https://bugs.launchpad.net/maria/.
+
+If the test case is really big or if it contains 'not public' data,
+then put your .test file and .result file(s) into a tar.gz archive,
+add a README that explains the problem, ftp the archive to
+ftp://ftp.askmonty.org/private and send a mail to
+https://bugs.launchpad.net/maria/ about it.
diff --git a/mysql-test/collections/default.daily b/mysql-test/collections/default.daily
index c71297878f7..0503bd49f73 100644
--- a/mysql-test/collections/default.daily
+++ b/mysql-test/collections/default.daily
@@ -1,5 +1,3 @@
-perl mysql-test-run.pl --timer --force --comment=rpl_ndb_row --vardir=var-rpl_ndb_row --suite=rpl_ndb,ndb --mysqld=--binlog-format=row --experimental=collections/default.experimental
-
perl mysql-test-run.pl --timer --force --parallel=auto --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed --experimental=collections/default.experimental
perl mysql-test-run.pl --timer --force --parallel=auto --comment=ps_row --vardir=var-ps_row --ps-protocol --mysqld=--binlog-format=row --experimental=collections/default.experimental
perl mysql-test-run.pl --timer --force --parallel=auto --comment=embedded --vardir=var-emebbed --embedded --experimental=collections/default.experimental
diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental
index 91dada3ee05..aa2f2e9f724 100644
--- a/mysql-test/collections/default.experimental
+++ b/mysql-test/collections/default.experimental
@@ -43,8 +43,6 @@ parts.partition_mgm_lc1_ndb # joro : NDB tests marked as experiment
parts.partition_mgm_lc2_ndb # joro : NDB tests marked as experimental as agreed with bochklin
parts.partition_syntax_ndb # joro : NDB tests marked as experimental as agreed with bochklin
parts.partition_value_ndb # joro : NDB tests marked as experimental as agreed with bochklin
-main.mysqlhotcopy_myisam # horst: due to bug#54129
-main.mysqlhotcopy_archive # horst: due to bug#54129
main.gis-rtree # svoj: due to BUG#38965
main.type_float # svoj: due to BUG#38965
main.type_newdecimal # svoj: due to BUG#38965
diff --git a/mysql-test/extra/rpl_tests/rpl_auto_increment.test b/mysql-test/extra/rpl_tests/rpl_auto_increment.test
index 86885a14f94..8d2f6c32233 100644
--- a/mysql-test/extra/rpl_tests/rpl_auto_increment.test
+++ b/mysql-test/extra/rpl_tests/rpl_auto_increment.test
@@ -241,3 +241,60 @@ DROP TABLE t1;
DROP TABLE t2;
SET SQL_MODE='';
sync_slave_with_master;
+
+#
+# Bug#54201: "SET INSERT_ID" event must be ignored if corresponding event is
+# ignored.
+#
+connection master;
+
+CREATE TABLE t1(s VARCHAR(10)) ENGINE=myisam;
+# -slave.opt has --replicate-ignore-table=test.t_ignored1
+CREATE TABLE t_ignored1(id INT AUTO_INCREMENT PRIMARY KEY) ENGINE=myisam;
+sync_slave_with_master;
+
+connection slave;
+
+CREATE TABLE test.slave_only(id INT AUTO_INCREMENT PRIMARY KEY) ENGINE=myisam;
+INSERT INTO slave_only VALUES(NULL);
+CREATE TRIGGER t1_update AFTER UPDATE ON t1 FOR EACH ROW INSERT INTO slave_only VALUES(NULL);
+
+connection master;
+
+INSERT INTO t_ignored1 VALUES(NULL);
+INSERT INTO t1 VALUES('s');
+UPDATE t1 SET s='s1';
+
+# With Bug#54201, slave stops with duplicate key error here due to trigger
+# using the insert_id from insert on master into t1_ignored1
+sync_slave_with_master;
+connection slave;
+SELECT * FROM t1;
+
+connection master;
+CREATE TABLE t_ignored2(id INT AUTO_INCREMENT PRIMARY KEY) ENGINE=myisam;
+sync_slave_with_master;
+
+connection slave;
+STOP SLAVE;
+# Ignore the next INSERT into t_ignored2 and the INSERT_ID event just before it.
+SET GLOBAL sql_slave_skip_counter = 2;
+START SLAVE;
+
+connection master;
+INSERT INTO t_ignored2 VALUES(NULL);
+UPDATE t1 SET s='s2';
+sync_slave_with_master;
+
+connection slave;
+SELECT * FROM t1;
+SHOW TABLES LIKE 't\_ignored_';
+SELECT * FROM t_ignored2;
+DROP TABLE slave_only;
+
+connection master;
+DROP TABLE t1;
+DROP TABLE t_ignored1;
+DROP TABLE t_ignored2;
+
+sync_slave_with_master;
diff --git a/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test b/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test
index 66bd61a8ea9..40e155bc314 100644
--- a/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test
+++ b/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test
@@ -34,7 +34,7 @@
#
connection slave;
-if (`SELECT $debug_sync_action = ''`)
+if (!$debug_sync_action)
{
--die Cannot continue. Please set value for debug_sync_action.
}
diff --git a/mysql-test/extra/rpl_tests/rpl_loaddata.test b/mysql-test/extra/rpl_tests/rpl_loaddata.test
index a3c7d032c32..c4fa9f16dc7 100644
--- a/mysql-test/extra/rpl_tests/rpl_loaddata.test
+++ b/mysql-test/extra/rpl_tests/rpl_loaddata.test
@@ -24,7 +24,7 @@ connection master;
# MTR is not case-sensitive.
let $lower_stmt_head= load data;
let $UPPER_STMT_HEAD= LOAD DATA;
-if (`SELECT '$lock_option' <> ''`)
+if ($lock_option)
{
#if $lock_option is null, an extra blank is added into the statement,
#this will change the result of rpl_loaddata test case. so $lock_option
diff --git a/mysql-test/extra/rpl_tests/rpl_stop_slave.test b/mysql-test/extra/rpl_tests/rpl_stop_slave.test
new file mode 100644
index 00000000000..5adfc99d59e
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_stop_slave.test
@@ -0,0 +1,62 @@
+#
+# Auxiliary file which is used to test BUG#56118
+#
+# Slave should apply all statements in the transaction before stop if any
+# temporary table is created or dropped.
+#
+# USEAGE:
+# --let $tmp_table_stm= a SQL statement
+# --source extra/rpl_tests/rpl_stop_slave.test
+#
+
+if (`SELECT "$tmp_table_stm" = ''`)
+{
+ --echo \$tmp_table_stm is NULL
+ --die $tmp_table_stm is NULL
+}
+
+--echo
+--echo [ On Master ]
+connection master;
+BEGIN;
+DELETE FROM t1;
+eval $tmp_table_stm;
+INSERT INTO t1 VALUES (1);
+DROP TEMPORARY TABLE tt1;
+COMMIT;
+
+--echo
+--echo [ On Slave ]
+connection slave;
+
+# To check if slave SQL thread is applying INSERT statement
+let $show_statement= SHOW PROCESSLIST;
+let $field= Info;
+let $condition= LIKE 'INSERT%';
+source include/wait_show_condition.inc;
+
+send STOP SLAVE SQL_THREAD;
+
+--echo
+--echo [ On Slave1 ]
+connection slave1;
+--echo # To resume slave SQL thread
+SET DEBUG_SYNC= 'now SIGNAL signal.continue';
+SET DEBUG_SYNC= 'now WAIT_FOR signal.continued';
+SET DEBUG_SYNC= 'RESET';
+
+--echo
+--echo [ On Slave ]
+connection slave;
+reap;
+source include/wait_for_slave_sql_to_stop.inc;
+
+--echo # Slave should stop after the transaction has committed.
+--echo # So t1 on master is same to t1 on slave.
+let diff_table_1=master:test.t1;
+let diff_table_2=slave:test.t1;
+source include/diff_tables.inc;
+
+connection slave;
+START SLAVE SQL_THREAD;
+source include/wait_for_slave_sql_to_start.inc;
diff --git a/mysql-test/include/check_concurrent_insert.inc b/mysql-test/include/check_concurrent_insert.inc
index f4bec3c9cdb..62de485d8f1 100644
--- a/mysql-test/include/check_concurrent_insert.inc
+++ b/mysql-test/include/check_concurrent_insert.inc
@@ -23,7 +23,7 @@
# Reset DEBUG_SYNC facility for safety.
set debug_sync= "RESET";
-if (`SELECT '$restore_table' <> ''`)
+if ($restore_table)
{
--eval create temporary table t_backup select * from $restore_table;
}
@@ -82,7 +82,7 @@ connection default;
--eval delete from $table where i = 0;
-if (`SELECT '$restore_table' <> ''`)
+if ($restore_table)
{
--eval truncate table $restore_table;
--eval insert into $restore_table select * from t_backup;
diff --git a/mysql-test/include/check_no_concurrent_insert.inc b/mysql-test/include/check_no_concurrent_insert.inc
index f60401bcad1..6938c53fd16 100644
--- a/mysql-test/include/check_no_concurrent_insert.inc
+++ b/mysql-test/include/check_no_concurrent_insert.inc
@@ -23,7 +23,7 @@
# Reset DEBUG_SYNC facility for safety.
set debug_sync= "RESET";
-if (`SELECT '$restore_table' <> ''`)
+if ($restore_table)
{
--eval create temporary table t_backup select * from $restore_table;
}
@@ -67,7 +67,7 @@ if (!$success)
--eval delete from $table where i = 0;
-if (`SELECT '$restore_table' <> ''`)
+if ($restore_table)
{
--eval truncate table $restore_table;
--eval insert into $restore_table select * from t_backup;
diff --git a/mysql-test/include/get_relay_log_pos.inc b/mysql-test/include/get_relay_log_pos.inc
index 7ce36fd3c50..61ee07fc655 100644
--- a/mysql-test/include/get_relay_log_pos.inc
+++ b/mysql-test/include/get_relay_log_pos.inc
@@ -10,12 +10,12 @@
# # at this point, get_relay_log_pos.inc sets $relay_log_pos. echo position
# # in $relay_log_file: $relay_log_pos.
-if (`SELECT '$relay_log_file' = ''`)
+if (!$relay_log_file)
{
--die 'variable $relay_log_file is null'
}
-if (`SELECT '$master_log_pos' = ''`)
+if (!$master_log_pos)
{
--die 'variable $master_log_pos is null'
}
diff --git a/mysql-test/include/have_not_innodb_plugin.inc b/mysql-test/include/have_not_innodb_plugin.inc
index aaefbaf661c..e40fd811021 100644
--- a/mysql-test/include/have_not_innodb_plugin.inc
+++ b/mysql-test/include/have_not_innodb_plugin.inc
@@ -1,4 +1,4 @@
disable_query_log;
--require r/not_true.require
-select (PLUGIN_LIBRARY LIKE 'ha_innodb_plugin%') as `TRUE` from information_schema.plugins where PLUGIN_NAME='InnoDB';
+select (PLUGIN_LIBRARY LIKE 'ha_innodb_plugin%' OR PLUGIN_DESCRIPTION LIKE '%xtradb%') as `TRUE` from information_schema.plugins where PLUGIN_NAME='InnoDB';
enable_query_log;
diff --git a/mysql-test/include/have_xtradb.inc b/mysql-test/include/have_xtradb.inc
index 6c2fc5155a9..3f3893e5642 100644
--- a/mysql-test/include/have_xtradb.inc
+++ b/mysql-test/include/have_xtradb.inc
@@ -1,4 +1,5 @@
-disable_query_log;
---require r/true.require
-SELECT (plugin_description LIKE '%xtradb%') AS `TRUE` FROM information_schema.plugins WHERE LOWER(plugin_name) = 'innodb' AND LOWER(plugin_status) = 'active';
-enable_query_log;
+if (!`SELECT count(*) FROM information_schema.plugins WHERE
+ plugin_name = 'innodb' AND plugin_status = 'active' AND
+ plugin_description LIKE '%xtradb%'`){
+ skip Need XtraDB engine;
+}
diff --git a/mysql-test/include/have_xtradb.opt b/mysql-test/include/have_xtradb.opt
new file mode 100644
index 00000000000..4fb96229a7b
--- /dev/null
+++ b/mysql-test/include/have_xtradb.opt
@@ -0,0 +1,2 @@
+--loose-innodb
+--plugin-load=$HA_XTRADB_SO
diff --git a/mysql-test/include/index_merge2.inc b/mysql-test/include/index_merge2.inc
index 32a176630ad..566e151dc7f 100644
--- a/mysql-test/include/index_merge2.inc
+++ b/mysql-test/include/index_merge2.inc
@@ -345,3 +345,55 @@ explain select * from t1 where (key3 > 30 and key3<35) or (key2 >32 and key2 < 4
select * from t1 where (key3 > 30 and key3<35) or (key2 >32 and key2 < 40);
drop table t1;
+--echo #
+--echo # Bug#56423: Different count with SELECT and CREATE SELECT queries
+--echo #
+
+CREATE TABLE t1 (
+ a INT,
+ b INT,
+ c INT,
+ d INT,
+ PRIMARY KEY (a),
+ KEY (c),
+ KEY bd (b,d)
+);
+
+INSERT INTO t1 VALUES
+(1, 0, 1, 0),
+(2, 1, 1, 1),
+(3, 1, 1, 1),
+(4, 0, 1, 1);
+
+EXPLAIN
+SELECT a
+FROM t1
+WHERE c = 1 AND b = 1 AND d = 1;
+
+CREATE TABLE t2 ( a INT )
+SELECT a
+FROM t1
+WHERE c = 1 AND b = 1 AND d = 1;
+
+SELECT * FROM t2;
+
+DROP TABLE t1, t2;
+
+CREATE TABLE t1( a INT, b INT, KEY(a), KEY(b) );
+INSERT INTO t1 VALUES (1, 2), (1, 2), (1, 2), (1, 2);
+SELECT * FROM t1 FORCE INDEX(a, b) WHERE a = 1 AND b = 2;
+
+DROP TABLE t1;
+
+--echo # Code coverage of fix.
+CREATE TABLE t1 ( a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, b INT);
+INSERT INTO t1 (b) VALUES (1);
+UPDATE t1 SET b = 2 WHERE a = 1;
+SELECT * FROM t1;
+
+CREATE TABLE t2 ( a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, b VARCHAR(1) );
+INSERT INTO t2 (b) VALUES ('a');
+UPDATE t2 SET b = 'b' WHERE a = 1;
+SELECT * FROM t2;
+
+DROP TABLE t1, t2;
diff --git a/mysql-test/include/index_merge_ror_cpk.inc b/mysql-test/include/index_merge_ror_cpk.inc
index cfc2ed3885e..3912aa34026 100644
--- a/mysql-test/include/index_merge_ror_cpk.inc
+++ b/mysql-test/include/index_merge_ror_cpk.inc
@@ -126,3 +126,19 @@ WHERE
drop table t1;
+--echo #
+--echo # Bug#50402 Optimizer producing wrong results when using Index Merge on InnoDB
+--echo #
+CREATE TABLE t1 (f1 INT, PRIMARY KEY (f1));
+INSERT INTO t1 VALUES (2);
+CREATE TABLE t2 (f1 INT, f2 INT, f3 char(1),
+ PRIMARY KEY (f1), KEY (f2), KEY (f3) );
+INSERT INTO t2 VALUES (1, 1, 'h'), (2, 3, 'h'), (3, 2, ''), (4, 2, '');
+
+SELECT t1.f1 FROM t1
+WHERE (SELECT COUNT(*) FROM t2 WHERE t2.f3 = 'h' AND t2.f2 = t1.f1) = 0 AND t1.f1 = 2;
+
+EXPLAIN SELECT t1.f1 FROM t1
+WHERE (SELECT COUNT(*) FROM t2 WHERE t2.f3 = 'h' AND t2.f2 = t1.f1) = 0 AND t1.f1 = 2;
+
+DROP TABLE t1,t2;
diff --git a/mysql-test/include/kill_query.inc b/mysql-test/include/kill_query.inc
index b303ed0ec39..1c949d3cbad 100644
--- a/mysql-test/include/kill_query.inc
+++ b/mysql-test/include/kill_query.inc
@@ -44,7 +44,7 @@ connection master;
# kill the query that is waiting
eval kill query $connection_id;
-if (`SELECT '$debug_lock' != ''`)
+if ($debug_lock)
{
# release the lock to allow binlog continue
eval SELECT RELEASE_LOCK($debug_lock);
@@ -57,7 +57,7 @@ reap;
connection master;
-if (`SELECT '$debug_lock' != ''`)
+if ($debug_lock)
{
# get lock again to make the next query wait
eval SELECT GET_LOCK($debug_lock, 10);
diff --git a/mysql-test/include/kill_query_and_diff_master_slave.inc b/mysql-test/include/kill_query_and_diff_master_slave.inc
index 611d6929c99..b3846d12df1 100644
--- a/mysql-test/include/kill_query_and_diff_master_slave.inc
+++ b/mysql-test/include/kill_query_and_diff_master_slave.inc
@@ -25,7 +25,7 @@ source include/kill_query.inc;
connection master;
disable_query_log;
disable_result_log;
-if (`SELECT '$debug_lock' != ''`)
+if ($debug_lock)
{
eval SELECT RELEASE_LOCK($debug_lock);
}
@@ -36,8 +36,8 @@ source include/diff_master_slave.inc;
# Acquire the debug lock again if used
connection master;
-disable_query_log; disable_result_log; if (`SELECT '$debug_lock' !=
-''`) { eval SELECT GET_LOCK($debug_lock, 10); } enable_result_log;
-enable_query_log;
+disable_query_log; disable_result_log;
+if ($debug_lock) { eval SELECT GET_LOCK($debug_lock, 10); }
+enable_result_log; enable_query_log;
connection $connection_name;
diff --git a/mysql-test/include/long_test.inc b/mysql-test/include/long_test.inc
new file mode 100644
index 00000000000..d9a3b338229
--- /dev/null
+++ b/mysql-test/include/long_test.inc
@@ -0,0 +1,4 @@
+# We use this --source include to mark a test as taking long to run.
+# We can use this to schedule such test early (to not be left with
+# only one or two long tests running, and rests of works idle), or to
+# run a quick test skipping long-running test cases.
diff --git a/mysql-test/include/mix1.inc b/mysql-test/include/mix1.inc
index 194d9e41108..7ef8adf8e08 100644
--- a/mysql-test/include/mix1.inc
+++ b/mysql-test/include/mix1.inc
@@ -1359,7 +1359,17 @@ INSERT INTO t1 VALUES (1,'init');
DELIMITER |;
CREATE PROCEDURE p1()
BEGIN
- UPDATE t1 SET b = CONCAT(b, '+con2') WHERE a = 1;
+ # retry the UPDATE in case it times out the lock before con1 has time
+ # to COMMIT.
+ DECLARE do_retry INT DEFAULT 0;
+ DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET do_retry = 1;
+ retry_loop:LOOP
+ UPDATE t1 SET b = CONCAT(b, '+con2') WHERE a = 1;
+ IF do_retry = 0 THEN
+ LEAVE retry_loop;
+ END IF;
+ SET do_retry = 0;
+ END LOOP;
INSERT INTO t2 VALUES ();
END|
DELIMITER ;|
diff --git a/mysql-test/include/percona_query_response_time_flush.inc b/mysql-test/include/percona_query_response_time_flush.inc
deleted file mode 100644
index 44bb320fe13..00000000000
--- a/mysql-test/include/percona_query_response_time_flush.inc
+++ /dev/null
@@ -1 +0,0 @@
-FLUSH QUERY_RESPONSE_TIME;
diff --git a/mysql-test/include/percona_query_response_time_show.inc b/mysql-test/include/percona_query_response_time_show.inc
deleted file mode 100644
index 709abf9872e..00000000000
--- a/mysql-test/include/percona_query_response_time_show.inc
+++ /dev/null
@@ -1,8 +0,0 @@
-SELECT d.count,
-(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
-(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
-FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
-SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
diff --git a/mysql-test/include/percona_query_response_time_sleep.inc b/mysql-test/include/percona_query_response_time_sleep.inc
deleted file mode 100644
index 40688b173b0..00000000000
--- a/mysql-test/include/percona_query_response_time_sleep.inc
+++ /dev/null
@@ -1,19 +0,0 @@
-SELECT SLEEP(0.31);
-SELECT SLEEP(0.32);
-SELECT SLEEP(0.33);
-SELECT SLEEP(0.34);
-SELECT SLEEP(0.35);
-SELECT SLEEP(0.36);
-SELECT SLEEP(0.37);
-SELECT SLEEP(0.38);
-SELECT SLEEP(0.39);
-SELECT SLEEP(0.40);
-SELECT SLEEP(1.1);
-SELECT SLEEP(1.2);
-SELECT SLEEP(1.3);
-SELECT SLEEP(1.5);
-SELECT SLEEP(1.4);
-SELECT SLEEP(0.5);
-SELECT SLEEP(2.1);
-SELECT SLEEP(2.3);
-SELECT SLEEP(2.5);
diff --git a/mysql-test/include/setup_fake_relay_log.inc b/mysql-test/include/setup_fake_relay_log.inc
index 5b9e7f72fdd..f881f3bf4e8 100644
--- a/mysql-test/include/setup_fake_relay_log.inc
+++ b/mysql-test/include/setup_fake_relay_log.inc
@@ -56,7 +56,7 @@ if (`SELECT "$_sql_running" = "Yes" OR "$_io_running" = "Yes"`) {
# Read server variables.
let $MYSQLD_DATADIR= `SELECT @@datadir`;
let $_fake_filename= query_get_value(SHOW VARIABLES LIKE 'relay_log', Value, 1);
-if (`SELECT '$_fake_filename' = ''`) {
+if (!$_fake_filename) {
--echo Badly written test case: relay_log variable is empty. Please use the
--echo server option --relay-log=FILE.
}
@@ -72,7 +72,7 @@ copy_file $fake_relay_log $_fake_relay_log;
if (`SELECT LENGTH(@@secure_file_priv) > 0`)
{
- -- let $_file_priv_dir= `SELECT @@secure_file_priv`;
+ -- let $_file_priv_dir= `SELECT @@secure_file_priv`
-- let $_suffix= `SELECT UUID()`
-- let $_tmp_file= $_file_priv_dir/fake-index.$_suffix
diff --git a/mysql-test/include/show_binlog_events.inc b/mysql-test/include/show_binlog_events.inc
index 8649f31ad9f..6d8c8196102 100644
--- a/mysql-test/include/show_binlog_events.inc
+++ b/mysql-test/include/show_binlog_events.inc
@@ -27,14 +27,14 @@ if (!$binlog_start)
}
--let $_statement=show binlog events
-if (`SELECT '$binlog_file' <> ''`)
+if ($binlog_file)
{
--let $_statement= $_statement in '$binlog_file'
}
--let $_statement= $_statement from $binlog_start
-if (`SELECT '$binlog_limit' <> ''`)
+if ($binlog_limit)
{
--let $_statement= $_statement limit $binlog_limit
}
diff --git a/mysql-test/include/show_rpl_debug_info.inc b/mysql-test/include/show_rpl_debug_info.inc
index 148d11f3b02..9944e6cd25f 100644
--- a/mysql-test/include/show_rpl_debug_info.inc
+++ b/mysql-test/include/show_rpl_debug_info.inc
@@ -48,13 +48,13 @@ let $binlog_name= query_get_value("SHOW MASTER STATUS", File, 1);
eval SHOW BINLOG EVENTS IN '$binlog_name';
let $_master_con= $master_connection;
-if (`SELECT '$_master_con' = ''`)
+if (!$_master_con)
{
if (`SELECT '$_con' = 'slave'`)
{
let $_master_con= master;
}
- if (`SELECT '$_master_con' = ''`)
+ if (!$_master_con)
{
--echo Unable to determine master connection. No debug info printed for master.
--echo Please fix the test case by setting $master_connection before sourcing
@@ -62,7 +62,7 @@ if (`SELECT '$_master_con' = ''`)
}
}
-if (`SELECT '$_master_con' != ''`)
+if ($_master_con)
{
let $master_binlog_name_io= query_get_value("SHOW SLAVE STATUS", Master_Log_File, 1);
diff --git a/mysql-test/include/wait_for_slave_io_error.inc b/mysql-test/include/wait_for_slave_io_error.inc
index 34cbf20a73b..ffdcf752873 100644
--- a/mysql-test/include/wait_for_slave_io_error.inc
+++ b/mysql-test/include/wait_for_slave_io_error.inc
@@ -31,7 +31,7 @@
# $master_connection
# See wait_for_slave_param.inc for description.
-if (`SELECT '$slave_io_errno' = ''`) {
+if (!$slave_io_errno) {
--die !!!ERROR IN TEST: you must set \$slave_io_errno before sourcing wait_for_slave_io_error.inc
}
diff --git a/mysql-test/include/wait_for_slave_param.inc b/mysql-test/include/wait_for_slave_param.inc
index ef864f9245e..98cd426fa11 100644
--- a/mysql-test/include/wait_for_slave_param.inc
+++ b/mysql-test/include/wait_for_slave_param.inc
@@ -51,7 +51,7 @@ if (!$_slave_timeout_counter)
}
let $_slave_param_comparison= $slave_param_comparison;
-if (`SELECT '$_slave_param_comparison' = ''`)
+if (!$_slave_param_comparison)
{
let $_slave_param_comparison= =;
}
@@ -71,7 +71,7 @@ while (`SELECT NOT('$_show_slave_status_value' $_slave_param_comparison '$slave_
if (!$_slave_timeout_counter)
{
--echo **** ERROR: timeout after $slave_timeout seconds while waiting for slave parameter $slave_param $_slave_param_comparison $slave_param_value ****
- if (`SELECT '$slave_error_message' != ''`)
+ if ($slave_error_message)
{
--echo Message: $slave_error_message
}
diff --git a/mysql-test/include/wait_for_slave_sql_error.inc b/mysql-test/include/wait_for_slave_sql_error.inc
index aab04036eea..80836f908c6 100644
--- a/mysql-test/include/wait_for_slave_sql_error.inc
+++ b/mysql-test/include/wait_for_slave_sql_error.inc
@@ -24,7 +24,7 @@
# $master_connection
# See wait_for_slave_param.inc for description.
-if (`SELECT '$slave_sql_errno' = ''`) {
+if (!$slave_sql_errno) {
--die !!!ERROR IN TEST: you must set \$slave_sql_errno before sourcing wait_for_slave_sql_error.inc
}
diff --git a/mysql-test/include/wait_for_status_var.inc b/mysql-test/include/wait_for_status_var.inc
index b8b4fa20b86..c3d6599e4d2 100644
--- a/mysql-test/include/wait_for_status_var.inc
+++ b/mysql-test/include/wait_for_status_var.inc
@@ -45,7 +45,7 @@ if (!$_status_timeout_counter)
}
let $_status_var_comparsion= $status_var_comparsion;
-if (`SELECT '$_status_var_comparsion' = ''`)
+if (!$_status_var_comparsion)
{
let $_status_var_comparsion= =;
}
diff --git a/mysql-test/lib/My/SafeProcess/Makefile.am b/mysql-test/lib/My/SafeProcess/Makefile.am
index 722331453fe..33cab066611 100644
--- a/mysql-test/lib/My/SafeProcess/Makefile.am
+++ b/mysql-test/lib/My/SafeProcess/Makefile.am
@@ -23,7 +23,3 @@ my_safe_process_SOURCES = safe_process.cc
EXTRA_DIST = safe_kill_win.cc \
safe_process_win.cc \
CMakeLists.txt
-
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm
index 9f2dca5efb6..f11c76a0727 100644
--- a/mysql-test/lib/mtr_cases.pm
+++ b/mysql-test/lib/mtr_cases.pm
@@ -89,6 +89,20 @@ sub init_pattern {
}
+sub testcase_sort_order {
+ my ($a, $b, $sort_criteria)= @_;
+ my $a_sort_criteria= $sort_criteria->{$a->fullname()};
+ my $b_sort_criteria= $sort_criteria->{$b->fullname()};
+ my $res= $a_sort_criteria cmp $b_sort_criteria;
+ return $res if $res;
+ # Run slow tests first, trying to avoid getting stuck at the end
+ # with a slow test in one worker and the other workers idle.
+ return -1 if $a->{'long_test'} && !$b->{'long_test'};
+ return 1 if !$a->{'long_test'} && $b->{'long_test'};
+
+ return $a->fullname() cmp $b->fullname();
+}
+
##############################################################################
#
# Collect information about test cases to be run
@@ -177,9 +191,7 @@ sub collect_test_cases ($$$) {
$sort_criteria{$tinfo->fullname()} = join(" ", @criteria);
}
- @$cases = sort {
- $sort_criteria{$a->fullname()} . $a->fullname() cmp
- $sort_criteria{$b->fullname()} . $b->fullname() } @$cases;
+ @$cases = sort { testcase_sort_order($a, $b, \%sort_criteria) } @$cases;
# For debugging the sort-order
# foreach my $tinfo (@$cases)
@@ -678,6 +690,13 @@ sub process_opts {
next;
}
+ $value= mtr_match_prefix($opt, "--testcase-timeout=");
+ if ( defined $value ) {
+ # Overrides test case timeout for this test
+ $tinfo->{'case-timeout'}= $value;
+ next;
+ }
+
# Ok, this was a real option, add it
push(@{$tinfo->{$opt_name}}, $opt);
}
@@ -688,6 +707,7 @@ sub process_opts {
}
}
+
##############################################################################
#
# Collect information about a single test case
@@ -900,7 +920,7 @@ sub collect_one_test_case {
{
# Ndb is not supported, skip it
$tinfo->{'skip'}= 1;
- $tinfo->{'comment'}= "No ndbcluster support";
+ $tinfo->{'comment'}= "No ndbcluster support or ndb tests not enabled";
return $tinfo;
}
elsif ( $::opt_skip_ndbcluster )
@@ -1057,6 +1077,7 @@ my @tags=
["include/have_example_plugin.inc", "example_plugin_test", 1],
["include/have_oqgraph_engine.inc", "oqgraph_test", 1],
["include/have_ssl.inc", "need_ssl", 1],
+ ["include/long_test.inc", "long_test", 1],
);
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 41501da6088..962f0553b01 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -111,12 +111,24 @@ my $path_vardir_trace; # unix formatted opt_vardir for trace files
my $opt_tmpdir; # Path to use for tmp/ dir
my $opt_tmpdir_pid;
+my $opt_start;
+my $opt_start_dirty;
+my $opt_start_exit;
+my $start_only;
+
END {
if ( defined $opt_tmpdir_pid and $opt_tmpdir_pid == $$ )
{
- # Remove the tempdir this process has created
- mtr_verbose("Removing tmpdir '$opt_tmpdir");
- rmtree($opt_tmpdir);
+ if (!$opt_start_exit)
+ {
+ # Remove the tempdir this process has created
+ mtr_verbose("Removing tmpdir $opt_tmpdir");
+ rmtree($opt_tmpdir);
+ }
+ else
+ {
+ mtr_warning("tmpdir $opt_tmpdir should be removed after the server has finished");
+ }
}
}
@@ -130,7 +142,7 @@ my $path_config_file; # The generated config file, var/my.cnf
# executables will be used by the test suite.
our $opt_vs_config = $ENV{'MTR_VS_CONFIG'};
-my $DEFAULT_SUITES= "main,binlog,federated,rpl,maria,parts,innodb,innodb_plugin,percona,ndb,vcol,oqgraph,sphinx";
+my $DEFAULT_SUITES= "main,binlog,federated,rpl,maria,handler,parts,innodb,innodb_plugin,percona,ndb,vcol,oqgraph,sphinx";
my $opt_suites;
our $opt_verbose= 0; # Verbose output, enable with --verbose
@@ -216,20 +228,16 @@ my $opt_suite_timeout = $ENV{MTR_SUITE_TIMEOUT} || 360; # minutes
my $opt_shutdown_timeout= $ENV{MTR_SHUTDOWN_TIMEOUT} || 10; # seconds
my $opt_start_timeout = $ENV{MTR_START_TIMEOUT} || 180; # seconds
-sub testcase_timeout { return $opt_testcase_timeout * 60; };
sub suite_timeout { return $opt_suite_timeout * 60; };
sub check_timeout { return $opt_testcase_timeout * 6; };
-my $opt_start;
-my $opt_start_dirty;
-my $opt_start_exit;
-my $start_only;
my $opt_wait_all;
my $opt_user_args;
my $opt_repeat= 1;
my $opt_retry= 1;
my $opt_retry_failure= env_or_val(MTR_RETRY_FAILURE => 2);
my $opt_reorder= 1;
+my $opt_force_restart= 0;
my $opt_strace_client;
@@ -247,9 +255,21 @@ my $opt_callgrind;
my %mysqld_logs;
my $opt_debug_sync_timeout= 300; # Default timeout for WAIT_FOR actions.
+sub testcase_timeout ($) {
+ my ($tinfo)= @_;
+ if (exists $tinfo->{'case-timeout'}) {
+ # Return test specific timeout if *longer* that the general timeout
+ my $test_to= $tinfo->{'case-timeout'};
+ $test_to*= 10 if $opt_valgrind;
+ return $test_to * 60 if $test_to > $opt_testcase_timeout;
+ }
+ return $opt_testcase_timeout * 60;
+}
+
our $opt_warnings= 1;
-our $opt_skip_ndbcluster= 0;
+our $opt_include_ndbcluster= 0;
+our $opt_skip_ndbcluster= 1;
my $exe_ndbd;
my $exe_ndb_mgmd;
@@ -611,13 +631,15 @@ sub run_test_server ($$$) {
if ($test_has_failed and $retries <= $opt_retry){
# Test should be run one more time unless it has failed
# too many times already
+ my $tname= $result->{name};
my $failures= $result->{failures};
if ($opt_retry > 1 and $failures >= $opt_retry_failure){
- mtr_report("\nTest has failed $failures times,",
+ mtr_report("\nTest $tname has failed $failures times,",
"no more retries!\n");
}
else {
- mtr_report("\nRetrying test, attempt($retries/$opt_retry)...\n");
+ mtr_report("\nRetrying test $tname, ".
+ "attempt($retries/$opt_retry)...\n");
delete($result->{result});
$result->{retries}= $retries+1;
$result->write_test($sock, 'TESTCASE');
@@ -707,9 +729,11 @@ sub run_test_server ($$$) {
last;
}
- # Second best choice is the first that does not fulfill
- # any of the above conditions
- if (!defined $second_best){
+ # From secondary choices, we prefer to pick a 'long-running' test if
+ # possible; this helps avoid getting stuck with a few of those at the
+ # end of high --parallel runs, with most workers being idle.
+ if (!defined $second_best ||
+ ($t->{'long_test'} && !($tests->[$second_best]{'long_test'}))){
#mtr_report("Setting second_best to $i");
$second_best= $i;
}
@@ -903,6 +927,7 @@ sub command_line_setup {
# Control what test suites or cases to run
'force' => \$opt_force,
'with-ndbcluster-only' => \&collect_option,
+ 'include-ndbcluster' => \$opt_include_ndbcluster,
'skip-ndbcluster|skip-ndb' => \$opt_skip_ndbcluster,
'suite|suites=s' => \$opt_suites,
'skip-rpl' => \&collect_option,
@@ -986,6 +1011,7 @@ sub command_line_setup {
'report-features' => \$opt_report_features,
'comment=s' => \$opt_comment,
'fast' => \$opt_fast,
+ 'force-restart' => \$opt_force_restart,
'reorder!' => \$opt_reorder,
'enable-disabled' => \&collect_option,
'verbose+' => \$opt_verbose,
@@ -2178,6 +2204,12 @@ sub environment_setup {
# Create an environment variable to make it possible
# to detect that valgrind is being used from test cases
$ENV{'VALGRIND_TEST'}= $opt_valgrind;
+
+ # Add dir of this perl to aid mysqltest in finding perl
+ my $perldir= dirname($^X);
+ my $pathsep= ":";
+ $pathsep= ";" if IS_WINDOWS && ! IS_CYGWIN;
+ $ENV{'PATH'}= "$ENV{'PATH'}".$pathsep.$perldir;
}
@@ -2483,14 +2515,12 @@ sub fix_vs_config_dir () {
my $modified = 1e30;
$opt_vs_config="";
- for my $dir (qw(client/*.dir libmysql/libmysql.dir sql/mysqld.dir
- sql/udf_example.dir storage/*/*.dir plugin/*/*.dir)) {
- for (<$basedir/$dir/*/BuildLog.htm>) {
- if (-M $_ < $modified)
- {
- $modified = -M _;
- $opt_vs_config = basename(dirname($_));
- }
+
+ for (<$basedir/sql/*/mysqld.exe>) {
+ if (-M $_ < $modified)
+ {
+ $modified = -M _;
+ $opt_vs_config = basename(dirname($_));
}
}
@@ -2502,6 +2532,11 @@ sub fix_vs_config_dir () {
sub check_ndbcluster_support ($) {
my $mysqld_variables= shift;
+ if ($opt_include_ndbcluster)
+ {
+ $opt_skip_ndbcluster= 0;
+ }
+
if ($opt_skip_ndbcluster)
{
mtr_report(" - skipping ndbcluster");
@@ -3341,7 +3376,8 @@ sub check_testcase($$)
"\nMTR's internal check of the test case '$tname' failed.
This means that the test case does not preserve the state that existed
before the test case was executed. Most likely the test case did not
-do a proper clean-up.
+do a proper clean-up. It could also be caused by the previous test run
+by this thread, if the server wasn't restarted.
This is the diff of the states of the servers before and after the
test case was executed:\n";
$tinfo->{check}.= $report;
@@ -3387,6 +3423,10 @@ test case was executed:\n";
# Kill any check processes still running
map($_->kill(), values(%started));
+ mtr_warning("Check-testcase failed, this could also be caused by the" .
+ " previous test run by this worker thread")
+ if $result > 1 && $mode eq "before";
+
return $result;
}
@@ -3841,7 +3881,7 @@ sub run_testcase ($$) {
}
}
- my $test_timeout= start_timer(testcase_timeout());
+ my $test_timeout= start_timer(testcase_timeout($tinfo));
do_before_run_mysqltest($tinfo);
@@ -3946,6 +3986,9 @@ sub run_testcase ($$) {
# Try to get reason from test log file
find_testcase_skipped_reason($tinfo);
mtr_report_test_skipped($tinfo);
+ # Restart if skipped due to missing perl, it may have had side effects
+ stop_all_servers($opt_shutdown_timeout)
+ if ($tinfo->{'comment'} =~ /^perl not found/);
}
elsif ( $res == 65 )
{
@@ -4052,7 +4095,7 @@ sub run_testcase ($$) {
{
my $log_file_name= $opt_vardir."/log/".$tinfo->{shortname}.".log";
$tinfo->{comment}=
- "Test case timeout after ".testcase_timeout().
+ "Test case timeout after ".testcase_timeout($tinfo).
" seconds\n\n";
# Add 20 last executed commands from test case log file
if (-e $log_file_name)
@@ -4061,7 +4104,7 @@ sub run_testcase ($$) {
"== $log_file_name == \n".
mtr_lastlinesfromfile($log_file_name, 20)."\n";
}
- $tinfo->{'timeout'}= testcase_timeout(); # Mark as timeout
+ $tinfo->{'timeout'}= testcase_timeout($tinfo); # Mark as timeout
run_on_all($tinfo, 'analyze-timeout');
report_failure_and_restart($tinfo);
@@ -4186,7 +4229,9 @@ sub get_log_from_proc ($$) {
foreach my $mysqld (all_servers()) {
if ($mysqld->{proc} eq $proc) {
my @srv_lines= extract_server_log($mysqld->if_exist('#log-error'), $name);
- $srv_log= "\nServer log from this test:\n" . join ("", @srv_lines);
+ $srv_log= "\nServer log from this test:\n" .
+ "----------SERVER LOG START-----------\n". join ("", @srv_lines) .
+ "----------SERVER LOG END-------------\n";
last;
}
}
@@ -5017,6 +5062,11 @@ sub server_need_restart {
return 1;
}
+ if ( $opt_force_restart ) {
+ mtr_verbose_restart($server, "forced restart turned on");
+ return 1;
+ }
+
if ( $tinfo->{template_path} ne $current_config_name)
{
mtr_verbose_restart($server, "using different config file");
@@ -5719,7 +5769,8 @@ Options to control what test suites or cases to run
force Continue to run the suite after failure
with-ndbcluster-only Run only tests that include "ndb" in the filename
- skip-ndb[cluster] Skip all tests that need cluster
+ skip-ndb[cluster] Skip all tests that need cluster. Default.
+ include-ndb[cluster] Enable all tests that need cluster
do-test=PREFIX or REGEX
Run test cases which name are prefixed with PREFIX
or fulfills REGEX
@@ -5843,7 +5894,8 @@ Misc options
servers to exit before finishing the process
fast Run as fast as possible, dont't wait for servers
to shutdown etc.
- parallel=N Run tests in N parallel threads (default 1)
+ force-restart Always restart servers between tests
+ parallel=N Run tests in N parallel threads (default=1)
Use parallel=auto for auto-setting of N
repeat=N Run each test N number of times
retry=N Retry tests that fail up to N times (default $opt_retry).
diff --git a/mysql-test/r/archive.result b/mysql-test/r/archive.result
index 5a731e6476c..ae79e237ade 100644
--- a/mysql-test/r/archive.result
+++ b/mysql-test/r/archive.result
@@ -12717,6 +12717,7 @@ COUNT(t1.a)
729
DROP TABLE t1;
SET @@join_buffer_size= @save_join_buffer_size;
+flush tables;
SHOW CREATE TABLE t1;
ERROR HY000: Table upgrade required. Please do "REPAIR TABLE `t1`" or dump/reload to fix it!
SELECT * FROM t1;
diff --git a/mysql-test/r/connect.result b/mysql-test/r/connect.result
index 690a6fb3bc3..00602093425 100644
--- a/mysql-test/r/connect.result
+++ b/mysql-test/r/connect.result
@@ -237,5 +237,9 @@ ERROR 28000: Access denied for user 'mysqltest_up2'@'localhost' (using password:
select user(), current_user();
user() current_user()
mysqltest_up2@localhost mysqltest_up2@%
+connect(localhost,mysqltest_nouser,newpw,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'mysqltest_nouser'@'localhost' (using password: YES)
+connect(localhost,mysqltest_nouser,,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'mysqltest_nouser'@'localhost' (using password: NO)
DROP USER mysqltest_up1@'%';
DROP USER mysqltest_up2@'%';
diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result
index d1af2f4d428..63f199ad3e8 100644
--- a/mysql-test/r/ctype_utf8.result
+++ b/mysql-test/r/ctype_utf8.result
@@ -1900,3 +1900,34 @@ CONVERT(a, CHAR) CONVERT(b, CHAR)
70000 1092
DROP TABLE t1;
End of 5.0 tests
+SELECT LENGTH(RPAD(0.0115E88, 61297, _utf8'ÑÑÑŽÑ'));
+LENGTH(RPAD(0.0115E88, 61297, _utf8'ÑÑÑŽÑ'))
+61297
+SELECT LENGTH(RPAD(0.0115E88, 61297, _utf8'йцуÑ'));
+LENGTH(RPAD(0.0115E88, 61297, _utf8'йцуÑ'))
+61297
+SELECT HEX(RPAD(0x20, 2, _utf8 0xD18F));
+HEX(RPAD(0x20, 2, _utf8 0xD18F))
+20D1
+SELECT HEX(RPAD(0x20, 4, _utf8 0xD18F));
+HEX(RPAD(0x20, 4, _utf8 0xD18F))
+20D18FD1
+SELECT HEX(LPAD(0x20, 2, _utf8 0xD18F));
+HEX(LPAD(0x20, 2, _utf8 0xD18F))
+D120
+SELECT HEX(LPAD(0x20, 4, _utf8 0xD18F));
+HEX(LPAD(0x20, 4, _utf8 0xD18F))
+D18FD120
+SELECT HEX(RPAD(_utf8 0xD18F, 3, 0x20));
+HEX(RPAD(_utf8 0xD18F, 3, 0x20))
+D18F20
+SELECT HEX(LPAD(_utf8 0xD18F, 3, 0x20));
+HEX(LPAD(_utf8 0xD18F, 3, 0x20))
+20D18F
+SELECT HEX(INSERT(_utf8 0xD18F, 2, 1, 0x20));
+HEX(INSERT(_utf8 0xD18F, 2, 1, 0x20))
+D120
+SELECT HEX(INSERT(_utf8 0xD18FD18E, 2, 1, 0x20));
+HEX(INSERT(_utf8 0xD18FD18E, 2, 1, 0x20))
+D120D18E
+End of 5.1 tests
diff --git a/mysql-test/r/explain.result b/mysql-test/r/explain.result
index f46fe8daaad..4bc6c0409f3 100644
--- a/mysql-test/r/explain.result
+++ b/mysql-test/r/explain.result
@@ -251,4 +251,50 @@ EXPLAIN SELECT c1 FROM t1 WHERE c2 = 1 AND c4 = 1 AND c5 = 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref c2,c2_2 c2 10 const,const 3 Using where
DROP TABLE t1;
+#
+# Bug#56814 Explain + subselect + fulltext crashes server
+#
+CREATE TABLE t1(f1 VARCHAR(6) NOT NULL,
+FULLTEXT KEY(f1),UNIQUE(f1));
+INSERT INTO t1 VALUES ('test');
+EXPLAIN SELECT 1 FROM t1
+WHERE 1 > ALL((SELECT 1 FROM t1 JOIN t1 a ON (MATCH(t1.f1) AGAINST (""))
+WHERE t1.f1 GROUP BY t1.f1));
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 system NULL NULL NULL NULL 1
+2 SUBQUERY a system NULL NULL NULL NULL 1 Using filesort
+2 SUBQUERY t1 fulltext f1 f1 0 1 Using where
+PREPARE stmt FROM
+'EXPLAIN SELECT 1 FROM t1
+ WHERE 1 > ALL((SELECT 1 FROM t1 RIGHT OUTER JOIN t1 a
+ ON (MATCH(t1.f1) AGAINST (""))
+ WHERE t1.f1 GROUP BY t1.f1))';
+EXECUTE stmt;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 system NULL NULL NULL NULL 1
+2 SUBQUERY a system NULL NULL NULL NULL 1 Using filesort
+2 SUBQUERY t1 fulltext f1 f1 0 1 Using where
+EXECUTE stmt;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 system NULL NULL NULL NULL 1
+2 SUBQUERY a system NULL NULL NULL NULL 1 Using filesort
+2 SUBQUERY t1 fulltext f1 f1 0 1 Using where
+DEALLOCATE PREPARE stmt;
+PREPARE stmt FROM
+'EXPLAIN SELECT 1 FROM t1
+ WHERE 1 > ALL((SELECT 1 FROM t1 JOIN t1 a
+ ON (MATCH(t1.f1) AGAINST (""))
+ WHERE t1.f1 GROUP BY t1.f1))';
+EXECUTE stmt;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 system NULL NULL NULL NULL 1
+2 SUBQUERY a system NULL NULL NULL NULL 1 Using filesort
+2 SUBQUERY t1 fulltext f1 f1 0 1 Using where
+EXECUTE stmt;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 system NULL NULL NULL NULL 1
+2 SUBQUERY a system NULL NULL NULL NULL 1 Using filesort
+2 SUBQUERY t1 fulltext f1 f1 0 1 Using where
+DEALLOCATE PREPARE stmt;
+DROP TABLE t1;
End of 5.1 tests.
diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result
index 8b88f3138c7..9d9e738b696 100644
--- a/mysql-test/r/fulltext.result
+++ b/mysql-test/r/fulltext.result
@@ -652,4 +652,40 @@ Table Op Msg_type Msg_text
test.t1 repair status OK
SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size;
DROP TABLE t1;
+#
+# Bug#54484 explain + prepared statement: crash and Got error -1 from storage engine
+#
+CREATE TABLE t1(f1 VARCHAR(6) NOT NULL, FULLTEXT KEY(f1), UNIQUE(f1));
+INSERT INTO t1 VALUES ('test');
+SELECT 1 FROM t1 WHERE 1 >
+ALL((SELECT 1 FROM t1 JOIN t1 a
+ON (MATCH(t1.f1) against (""))
+WHERE t1.f1 GROUP BY t1.f1)) xor f1;
+1
+1
+PREPARE stmt FROM
+'SELECT 1 FROM t1 WHERE 1 >
+ ALL((SELECT 1 FROM t1 RIGHT OUTER JOIN t1 a
+ ON (MATCH(t1.f1) against (""))
+ WHERE t1.f1 GROUP BY t1.f1)) xor f1';
+EXECUTE stmt;
+1
+1
+EXECUTE stmt;
+1
+1
+DEALLOCATE PREPARE stmt;
+PREPARE stmt FROM
+'SELECT 1 FROM t1 WHERE 1 >
+ ALL((SELECT 1 FROM t1 JOIN t1 a
+ ON (MATCH(t1.f1) against (""))
+ WHERE t1.f1 GROUP BY t1.f1))';
+EXECUTE stmt;
+1
+1
+EXECUTE stmt;
+1
+1
+DEALLOCATE PREPARE stmt;
+DROP TABLE t1;
End of 5.1 tests
diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result
index ae48eb1e0ff..de592ece285 100644
--- a/mysql-test/r/func_gconcat.result
+++ b/mysql-test/r/func_gconcat.result
@@ -1029,4 +1029,12 @@ GROUP_CONCAT(t1.a ORDER BY t1.a)
1,1,2,2
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
+#
+# Bug#57194 group_concat cause crash and/or invalid memory reads with type errors
+#
+CREATE TABLE t1(f1 int);
+INSERT INTO t1 values (0),(0);
+SELECT POLYGON((SELECT 1 FROM (SELECT 1 IN (GROUP_CONCAT(t1.f1)) FROM t1, t1 t GROUP BY t.f1 ) d));
+ERROR 22007: Illegal non geometric '(select 1 from (select (1 = group_concat(`test`.`t1`.`f1` separator ',')) AS `1 IN (GROUP_CONCAT(t1.f1))` from `test`.`t1` join `test`.`t1` `t` group by `t`.`f1`) `d`)' value found during parsing
+DROP TABLE t1;
End of 5.1 tests
diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result
index fd7ef72409e..649232e0b05 100644
--- a/mysql-test/r/func_math.result
+++ b/mysql-test/r/func_math.result
@@ -482,4 +482,20 @@ RAND(i)
0.155220427694936
DROP TABLE t1;
#
+# Bug#57477 SIGFPE when dividing a huge number a negative number
+#
+SELECT -9999999999999999991 DIV -1;
+-9999999999999999991 DIV -1
+-9223372036854775808
+Warnings:
+Error 1292 Truncated incorrect DECIMAL value: ''
+SELECT -9223372036854775808 DIV -1;
+-9223372036854775808 DIV -1
+-9223372036854775808
+SELECT -9223372036854775808 MOD -1;
+-9223372036854775808 MOD -1
+0
+SELECT -9223372036854775808999 MOD -1;
+-9223372036854775808999 MOD -1
+0
End of 5.1 tests
diff --git a/mysql-test/r/func_misc.result b/mysql-test/r/func_misc.result
index 2f768140b33..5910a45c839 100644
--- a/mysql-test/r/func_misc.result
+++ b/mysql-test/r/func_misc.result
@@ -258,4 +258,10 @@ GREATEST(a, (SELECT b FROM t1 LIMIT 1))
3
1
DROP TABLE t1;
+SELECT INET_NTOA(0);
+INET_NTOA(0)
+0.0.0.0
+SELECT '1' IN ('1', INET_NTOA(0));
+'1' IN ('1', INET_NTOA(0))
+1
End of tests
diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result
index b3cab2f409a..064d6a35bd6 100644
--- a/mysql-test/r/grant.result
+++ b/mysql-test/r/grant.result
@@ -1430,3 +1430,14 @@ DROP USER 'testbug'@localhost;
DROP TABLE db2.t1;
DROP DATABASE db1;
DROP DATABASE db2;
+#
+# Bug #36742
+#
+grant usage on Foo.* to myuser@Localhost identified by 'foo';
+grant select on Foo.* to myuser@localhost;
+select host,user from mysql.user where User='myuser';
+host user
+localhost myuser
+revoke select on Foo.* from myuser@localhost;
+delete from mysql.user where User='myuser';
+flush privileges;
diff --git a/mysql-test/r/grant3.result b/mysql-test/r/grant3.result
index 59c64ee84ae..fd51a83d4b2 100644
--- a/mysql-test/r/grant3.result
+++ b/mysql-test/r/grant3.result
@@ -21,123 +21,108 @@ grant select on test.* to CUser@LOCALHOST;
flush privileges;
SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
user host
-CUser LOCALHOST
CUser localhost
SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser' order by 1,2;
user host db select_priv
-CUser LOCALHOST test Y
CUser localhost test Y
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'LOCALHOST';
flush privileges;
SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
user host
-CUser LOCALHOST
CUser localhost
SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser' order by 1,2;
user host db select_priv
-CUser localhost test Y
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'localhost';
flush privileges;
SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
user host
-CUser LOCALHOST
CUser localhost
SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser' order by 1,2;
user host db select_priv
DROP USER CUser@localhost;
DROP USER CUser@LOCALHOST;
+ERROR HY000: Operation DROP USER failed for 'CUser'@'localhost'
create table t1 (a int);
grant select on test.t1 to CUser@localhost;
grant select on test.t1 to CUser@LOCALHOST;
flush privileges;
SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
user host
-CUser LOCALHOST
CUser localhost
SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2;
user host db Table_name Table_priv Column_priv
-CUser LOCALHOST test t1 Select
CUser localhost test t1 Select
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'LOCALHOST';
flush privileges;
SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
user host
-CUser LOCALHOST
CUser localhost
SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2;
user host db Table_name Table_priv Column_priv
-CUser localhost test t1 Select
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'localhost';
flush privileges;
SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
user host
-CUser LOCALHOST
CUser localhost
SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2;
user host db Table_name Table_priv Column_priv
DROP USER CUser@localhost;
DROP USER CUser@LOCALHOST;
+ERROR HY000: Operation DROP USER failed for 'CUser'@'localhost'
grant select(a) on test.t1 to CUser@localhost;
grant select(a) on test.t1 to CUser@LOCALHOST;
flush privileges;
SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
user host
-CUser LOCALHOST
CUser localhost
SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2;
user host db Table_name Table_priv Column_priv
-CUser LOCALHOST test t1 Select
CUser localhost test t1 Select
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'LOCALHOST';
flush privileges;
SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
user host
-CUser LOCALHOST
CUser localhost
SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2;
user host db Table_name Table_priv Column_priv
-CUser localhost test t1 Select
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'localhost';
flush privileges;
SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
user host
-CUser LOCALHOST
CUser localhost
SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2;
user host db Table_name Table_priv Column_priv
DROP USER CUser@localhost;
DROP USER CUser@LOCALHOST;
+ERROR HY000: Operation DROP USER failed for 'CUser'@'localhost'
drop table t1;
grant select on test.* to CUser2@localhost;
grant select on test.* to CUser2@LOCALHOST;
flush privileges;
SELECT user, host FROM mysql.user where user = 'CUser2' order by 1,2;
user host
-CUser2 LOCALHOST
CUser2 localhost
SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser2' order by 1,2;
user host db select_priv
-CUser2 LOCALHOST test Y
CUser2 localhost test Y
REVOKE SELECT ON test.* FROM 'CUser2'@'LOCALHOST';
flush privileges;
SELECT user, host FROM mysql.user where user = 'CUser2' order by 1,2;
user host
-CUser2 LOCALHOST
CUser2 localhost
SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser2' order by 1,2;
user host db select_priv
-CUser2 localhost test Y
REVOKE SELECT ON test.* FROM 'CUser2'@'localhost';
+ERROR 42000: There is no such grant defined for user 'CUser2' on host 'localhost'
flush privileges;
SELECT user, host FROM mysql.user where user = 'CUser2' order by 1,2;
user host
-CUser2 LOCALHOST
CUser2 localhost
SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser2' order by 1,2;
user host db select_priv
DROP USER CUser2@localhost;
DROP USER CUser2@LOCALHOST;
+ERROR HY000: Operation DROP USER failed for 'CUser2'@'localhost'
CREATE DATABASE mysqltest_1;
CREATE TABLE mysqltest_1.t1 (a INT);
CREATE USER 'mysqltest1'@'%';
diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result
index e04819fcbf9..95f0bbbe36a 100644
--- a/mysql-test/r/group_by.result
+++ b/mysql-test/r/group_by.result
@@ -1862,4 +1862,14 @@ SELECT SUBSTRING(a,1,10), LENGTH(a) FROM t1 GROUP BY a;
SUBSTRING(a,1,10) LENGTH(a)
1111111111 1300
DROP TABLE t1;
+#
+# Bug#57688 Assertion `!table || (!table->write_set || bitmap_is_set(table->write_set, field
+#
+CREATE TABLE t1(f1 INT NOT NULL);
+INSERT INTO t1 VALUES (16777214),(0);
+SELECT COUNT(*) FROM t1 LEFT JOIN t1 t2
+ON 1 WHERE t2.f1 > 1 GROUP BY t2.f1;
+COUNT(*)
+2
+DROP TABLE t1;
# End of 5.1 tests
diff --git a/mysql-test/r/index_merge_innodb.result b/mysql-test/r/index_merge_innodb.result
index bd49af16105..fdc5b57a2e3 100644
--- a/mysql-test/r/index_merge_innodb.result
+++ b/mysql-test/r/index_merge_innodb.result
@@ -324,6 +324,61 @@ key1 key2 key3
38 38 38
39 39 39
drop table t1;
+#
+# Bug#56423: Different count with SELECT and CREATE SELECT queries
+#
+CREATE TABLE t1 (
+a INT,
+b INT,
+c INT,
+d INT,
+PRIMARY KEY (a),
+KEY (c),
+KEY bd (b,d)
+);
+INSERT INTO t1 VALUES
+(1, 0, 1, 0),
+(2, 1, 1, 1),
+(3, 1, 1, 1),
+(4, 0, 1, 1);
+EXPLAIN
+SELECT a
+FROM t1
+WHERE c = 1 AND b = 1 AND d = 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index_merge c,bd c,bd 5,10 NULL 1 Using intersect(c,bd); Using where; Using index
+CREATE TABLE t2 ( a INT )
+SELECT a
+FROM t1
+WHERE c = 1 AND b = 1 AND d = 1;
+SELECT * FROM t2;
+a
+2
+3
+DROP TABLE t1, t2;
+CREATE TABLE t1( a INT, b INT, KEY(a), KEY(b) );
+INSERT INTO t1 VALUES (1, 2), (1, 2), (1, 2), (1, 2);
+SELECT * FROM t1 FORCE INDEX(a, b) WHERE a = 1 AND b = 2;
+a b
+1 2
+1 2
+1 2
+1 2
+DROP TABLE t1;
+# Code coverage of fix.
+CREATE TABLE t1 ( a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, b INT);
+INSERT INTO t1 (b) VALUES (1);
+UPDATE t1 SET b = 2 WHERE a = 1;
+SELECT * FROM t1;
+a b
+1 2
+CREATE TABLE t2 ( a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, b VARCHAR(1) );
+INSERT INTO t2 (b) VALUES ('a');
+UPDATE t2 SET b = 'b' WHERE a = 1;
+SELECT * FROM t2;
+a b
+1 b
+DROP TABLE t1, t2;
#---------------- 2-sweeps read Index merge test 2 -------------------------------
SET SESSION STORAGE_ENGINE = InnoDB;
drop table if exists t1;
@@ -581,6 +636,24 @@ WHERE
`RUNID`= '' AND `SUBMITNR`= '' AND `ORDERNR`='' AND `PROGRAMM`='' AND
`TESTID`='' AND `UCCHECK`='';
drop table t1;
+#
+# Bug#50402 Optimizer producing wrong results when using Index Merge on InnoDB
+#
+CREATE TABLE t1 (f1 INT, PRIMARY KEY (f1));
+INSERT INTO t1 VALUES (2);
+CREATE TABLE t2 (f1 INT, f2 INT, f3 char(1),
+PRIMARY KEY (f1), KEY (f2), KEY (f3) );
+INSERT INTO t2 VALUES (1, 1, 'h'), (2, 3, 'h'), (3, 2, ''), (4, 2, '');
+SELECT t1.f1 FROM t1
+WHERE (SELECT COUNT(*) FROM t2 WHERE t2.f3 = 'h' AND t2.f2 = t1.f1) = 0 AND t1.f1 = 2;
+f1
+2
+EXPLAIN SELECT t1.f1 FROM t1
+WHERE (SELECT COUNT(*) FROM t2 WHERE t2.f3 = 'h' AND t2.f2 = t1.f1) = 0 AND t1.f1 = 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 const PRIMARY PRIMARY 4 const 1 Using index
+2 DEPENDENT SUBQUERY t2 index_merge f2,f3 f3,f2 2,5 NULL 1 Using intersect(f3,f2); Using where; Using index
+DROP TABLE t1,t2;
#
# BUG#56862/640419: Wrong result with sort_union index merge when one
# of the merged index scans is the primary key scan
@@ -613,13 +686,13 @@ INSERT INTO t1 VALUES (1000000, 0, 0);
SET SESSION sort_buffer_size = 1024*36;
EXPLAIN
SELECT COUNT(*) FROM
-(SELECT * FROM t1
+(SELECT * FROM t1 FORCE INDEX(primary,idx)
WHERE a BETWEEN 2 AND 7 OR pk=1000000) AS t;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
2 DERIVED t1 index_merge PRIMARY,idx idx,PRIMARY 5,4 NULL 11419 Using sort_union(idx,PRIMARY); Using where
SELECT COUNT(*) FROM
-(SELECT * FROM t1
+(SELECT * FROM t1 FORCE INDEX(primary,idx)
WHERE a BETWEEN 2 AND 7 OR pk=1000000) AS t;
COUNT(*)
6145
diff --git a/mysql-test/r/index_merge_myisam.result b/mysql-test/r/index_merge_myisam.result
index 182455f8c06..df570e1f4ae 100644
--- a/mysql-test/r/index_merge_myisam.result
+++ b/mysql-test/r/index_merge_myisam.result
@@ -1158,6 +1158,61 @@ key1 key2 key3
38 38 38
39 39 39
drop table t1;
+#
+# Bug#56423: Different count with SELECT and CREATE SELECT queries
+#
+CREATE TABLE t1 (
+a INT,
+b INT,
+c INT,
+d INT,
+PRIMARY KEY (a),
+KEY (c),
+KEY bd (b,d)
+);
+INSERT INTO t1 VALUES
+(1, 0, 1, 0),
+(2, 1, 1, 1),
+(3, 1, 1, 1),
+(4, 0, 1, 1);
+EXPLAIN
+SELECT a
+FROM t1
+WHERE c = 1 AND b = 1 AND d = 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref c,bd bd 10 const,const 2 Using where
+CREATE TABLE t2 ( a INT )
+SELECT a
+FROM t1
+WHERE c = 1 AND b = 1 AND d = 1;
+SELECT * FROM t2;
+a
+2
+3
+DROP TABLE t1, t2;
+CREATE TABLE t1( a INT, b INT, KEY(a), KEY(b) );
+INSERT INTO t1 VALUES (1, 2), (1, 2), (1, 2), (1, 2);
+SELECT * FROM t1 FORCE INDEX(a, b) WHERE a = 1 AND b = 2;
+a b
+1 2
+1 2
+1 2
+1 2
+DROP TABLE t1;
+# Code coverage of fix.
+CREATE TABLE t1 ( a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, b INT);
+INSERT INTO t1 (b) VALUES (1);
+UPDATE t1 SET b = 2 WHERE a = 1;
+SELECT * FROM t1;
+a b
+1 2
+CREATE TABLE t2 ( a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, b VARCHAR(1) );
+INSERT INTO t2 (b) VALUES ('a');
+UPDATE t2 SET b = 'b' WHERE a = 1;
+SELECT * FROM t2;
+a b
+1 b
+DROP TABLE t1, t2;
#---------------- 2-sweeps read Index merge test 2 -------------------------------
SET SESSION STORAGE_ENGINE = MyISAM;
drop table if exists t1;
@@ -1416,6 +1471,24 @@ WHERE
`TESTID`='' AND `UCCHECK`='';
drop table t1;
#
+# Bug#50402 Optimizer producing wrong results when using Index Merge on InnoDB
+#
+CREATE TABLE t1 (f1 INT, PRIMARY KEY (f1));
+INSERT INTO t1 VALUES (2);
+CREATE TABLE t2 (f1 INT, f2 INT, f3 char(1),
+PRIMARY KEY (f1), KEY (f2), KEY (f3) );
+INSERT INTO t2 VALUES (1, 1, 'h'), (2, 3, 'h'), (3, 2, ''), (4, 2, '');
+SELECT t1.f1 FROM t1
+WHERE (SELECT COUNT(*) FROM t2 WHERE t2.f3 = 'h' AND t2.f2 = t1.f1) = 0 AND t1.f1 = 2;
+f1
+2
+EXPLAIN SELECT t1.f1 FROM t1
+WHERE (SELECT COUNT(*) FROM t2 WHERE t2.f3 = 'h' AND t2.f2 = t1.f1) = 0 AND t1.f1 = 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 system PRIMARY NULL NULL NULL 1
+2 DEPENDENT SUBQUERY t2 ref f2,f3 f2 5 1 Using where
+DROP TABLE t1,t2;
+#
# Generic @@optimizer_switch tests (move those into a separate file if
# we get another @@optimizer_switch user)
#
diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result
index f9fb545bd0e..aafb5dd8635 100644
--- a/mysql-test/r/join_outer.result
+++ b/mysql-test/r/join_outer.result
@@ -1508,4 +1508,33 @@ Handler_read_prev 0
Handler_read_rnd 0
Handler_read_rnd_next 1048581
drop table t1,t2,t3;
+# Bug#57688 Assertion `!table || (!table->write_set || bitmap_is_set(table->write_set, field
+#
+CREATE TABLE t1 (f1 INT NOT NULL, PRIMARY KEY (f1));
+CREATE TABLE t2 (f1 INT NOT NULL, f2 INT NOT NULL, PRIMARY KEY (f1, f2));
+INSERT INTO t1 VALUES (4);
+INSERT INTO t2 VALUES (3, 3);
+INSERT INTO t2 VALUES (7, 7);
+EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t2.f1 = t1.f1
+WHERE t1.f1 = 4
+GROUP BY t2.f1, t2.f2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 system PRIMARY NULL NULL NULL 1 Using temporary; Using filesort
+1 SIMPLE t2 ref PRIMARY PRIMARY 4 const 1 Using index
+SELECT * FROM t1 LEFT JOIN t2 ON t2.f1 = t1.f1
+WHERE t1.f1 = 4
+GROUP BY t2.f1, t2.f2;
+f1 f1 f2
+4 NULL NULL
+EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t2.f1 = t1.f1
+WHERE t1.f1 = 4 AND t2.f1 IS NOT NULL AND t2.f2 IS NOT NULL
+GROUP BY t2.f1, t2.f2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 system PRIMARY NULL NULL NULL 1 Using filesort
+1 SIMPLE t2 ref PRIMARY PRIMARY 4 const 1 Using where; Using index
+SELECT * FROM t1 LEFT JOIN t2 ON t2.f1 = t1.f1
+WHERE t1.f1 = 4 AND t2.f1 IS NOT NULL AND t2.f2 IS NOT NULL
+GROUP BY t2.f1, t2.f2;
+f1 f1 f2
+DROP TABLE t1,t2;
End of 5.1 tests
diff --git a/mysql-test/r/lock_multi.result b/mysql-test/r/lock_multi.result
index d8768e802ea..3fc4de3da06 100644
--- a/mysql-test/r/lock_multi.result
+++ b/mysql-test/r/lock_multi.result
@@ -162,13 +162,6 @@ ERROR 70100: Query execution was interrupted
unlock tables;
drop table t1;
drop table if exists t1;
-create table t1 (a int) ENGINE=MEMORY;
---> client 2
-handler t1 open;
-ERROR HY000: Table storage engine for 't1' doesn't have this option
---> client 1
-drop table t1;
-drop table if exists t1;
create table t1 (i int);
connection: default
lock tables t1 write;
diff --git a/mysql-test/r/log_tables.result b/mysql-test/r/log_tables.result
index f8321520880..cee912ffb2e 100644
--- a/mysql-test/r/log_tables.result
+++ b/mysql-test/r/log_tables.result
@@ -248,13 +248,13 @@ set global slow_query_log='OFF';
set @save_storage_engine= @@session.storage_engine;
set storage_engine= MEMORY;
alter table mysql.slow_log engine=ndb;
-ERROR HY000: This storage engine cannot be used for log tables"
+ERROR HY000: This storage engine cannot be used for log tables
alter table mysql.slow_log engine=innodb;
-ERROR HY000: This storage engine cannot be used for log tables"
+ERROR HY000: This storage engine cannot be used for log tables
alter table mysql.slow_log engine=archive;
-ERROR HY000: This storage engine cannot be used for log tables"
+ERROR HY000: This storage engine cannot be used for log tables
alter table mysql.slow_log engine=blackhole;
-ERROR HY000: This storage engine cannot be used for log tables"
+ERROR HY000: This storage engine cannot be used for log tables
set storage_engine= @save_storage_engine;
drop table mysql.slow_log;
drop table mysql.general_log;
diff --git a/mysql-test/r/lowercase_table4.result b/mysql-test/r/lowercase_table4.result
new file mode 100755
index 00000000000..e3f861f8884
--- /dev/null
+++ b/mysql-test/r/lowercase_table4.result
@@ -0,0 +1,7 @@
+#
+# Bug#46941 crash with lower_case_table_names=2 and
+# foreign data dictionary confusion
+#
+CREATE DATABASE XY;
+USE XY;
+DROP DATABASE XY;
diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result
index e4bcf775bab..717437a0532 100644
--- a/mysql-test/r/merge.result
+++ b/mysql-test/r/merge.result
@@ -2296,4 +2296,45 @@ t2 WHERE b SOUNDS LIKE e AND d = 1;
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 t2, t1;
+#
+# Bug#46339 - crash on REPAIR TABLE merge table USE_FRM
+#
+DROP TABLE IF EXISTS m1, t1;
+CREATE TABLE t1 (c1 INT) ENGINE=MYISAM;
+CREATE TABLE m1 (c1 INT) ENGINE=MRG_MyISAM UNION=(t1) INSERT_METHOD=LAST;
+LOCK TABLE m1 READ;
+REPAIR TABLE m1 USE_FRM;
+Table Op Msg_type Msg_text
+test.m1 repair note The storage engine for the table doesn't support repair
+UNLOCK TABLES;
+REPAIR TABLE m1 USE_FRM;
+Table Op Msg_type Msg_text
+test.m1 repair note The storage engine for the table doesn't support repair
+DROP TABLE m1,t1;
+CREATE TABLE m1 (f1 BIGINT) ENGINE=MRG_MyISAM UNION(t1);
+REPAIR TABLE m1 USE_FRM;
+Table Op Msg_type Msg_text
+test.m1 repair Error Can't open table
+test.m1 repair error Corrupt
+CREATE TABLE t1 (f1 BIGINT) ENGINE = MyISAM;
+REPAIR TABLE m1 USE_FRM;
+Table Op Msg_type Msg_text
+test.m1 repair note The storage engine for the table doesn't support repair
+REPAIR TABLE m1;
+Table Op Msg_type Msg_text
+test.m1 repair note The storage engine for the table doesn't support repair
+DROP TABLE m1, t1;
+CREATE TEMPORARY TABLE m1 (f1 BIGINT) ENGINE=MRG_MyISAM UNION(t1);
+REPAIR TABLE m1 USE_FRM;
+Table Op Msg_type Msg_text
+test.m1 repair Error Table 'test.m1' doesn't exist
+test.m1 repair error Corrupt
+CREATE TEMPORARY TABLE t1 (f1 BIGINT) ENGINE=MyISAM;
+REPAIR TABLE m1 USE_FRM;
+Table Op Msg_type Msg_text
+m1 repair error Cannot repair temporary table from .frm file
+REPAIR TABLE m1;
+Table Op Msg_type Msg_text
+test.m1 repair note The storage engine for the table doesn't support repair
+DROP TABLE m1, t1;
End of 5.1 tests
diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result
index ae72f416c79..d77ad1d2953 100644
--- a/mysql-test/r/multi_update.result
+++ b/mysql-test/r/multi_update.result
@@ -639,4 +639,24 @@ SET SESSION sql_safe_updates = 1;
UPDATE IGNORE t1, t1 t1a SET t1.a = 1 WHERE t1a.a = 1;
ERROR HY000: You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column
DROP TABLE t1;
+#
+# Bug#54543: update ignore with incorrect subquery leads to assertion
+# failure: inited==INDEX
+#
+SET SESSION sql_safe_updates = 0;
+CREATE TABLE t1 ( a INT );
+INSERT INTO t1 VALUES (1), (2);
+CREATE TABLE t2 ( a INT );
+INSERT INTO t2 VALUES (1), (2);
+CREATE TABLE t3 ( a INT );
+INSERT INTO t3 VALUES (1), (2);
+# Should not crash
+UPDATE IGNORE
+( SELECT ( SELECT COUNT(*) FROM t1 GROUP BY a, @v ) a FROM t2 ) x, t3
+SET t3.a = 0;
+Warnings:
+Error 1242 Subquery returns more than 1 row
+Error 1242 Subquery returns more than 1 row
+DROP TABLE t1, t2, t3;
+SET SESSION sql_safe_updates = DEFAULT;
end of tests
diff --git a/mysql-test/r/mysqlbinlog-innodb.result b/mysql-test/r/mysqlbinlog-innodb.result
new file mode 100644
index 00000000000..d9f83fb89f0
--- /dev/null
+++ b/mysql-test/r/mysqlbinlog-innodb.result
@@ -0,0 +1,85 @@
+SET TIMESTAMP=1000000000;
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb;
+CREATE DATABASE test2;
+RESET MASTER;
+USE test2;
+BEGIN;
+USE test;
+INSERT INTO t1 VALUES (1);
+USE test2;
+COMMIT;
+BEGIN;
+USE test;
+INSERT INTO t1 VALUES (2);
+USE test2;
+COMMIT;
+USE test;
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+FLUSH LOGS;
+/*!40019 SET @@session.max_insert_delayed_threads=0*/;
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+DELIMITER /*!*/;
+ROLLBACK/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.pseudo_thread_id=999999999/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.sql_mode=0/*!*/;
+SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
+/*!\C latin1 *//*!*/;
+SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
+SET @@session.lc_time_names=0/*!*/;
+SET @@session.collation_database=DEFAULT/*!*/;
+BEGIN
+/*!*/;
+use test/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+INSERT INTO t1 VALUES (1)
+/*!*/;
+COMMIT/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+BEGIN
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+INSERT INTO t1 VALUES (2)
+/*!*/;
+COMMIT/*!*/;
+DELIMITER ;
+# End of log file
+ROLLBACK /* added by mysqlbinlog */;
+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+/*!40019 SET @@session.max_insert_delayed_threads=0*/;
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+DELIMITER /*!*/;
+ROLLBACK/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.pseudo_thread_id=999999999/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.sql_mode=0/*!*/;
+SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
+/*!\C latin1 *//*!*/;
+SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
+SET @@session.lc_time_names=0/*!*/;
+SET @@session.collation_database=DEFAULT/*!*/;
+BEGIN
+/*!*/;
+use foo/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+INSERT INTO t1 VALUES (1)
+/*!*/;
+COMMIT/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+BEGIN
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+INSERT INTO t1 VALUES (2)
+/*!*/;
+COMMIT/*!*/;
+DELIMITER ;
+# End of log file
+ROLLBACK /* added by mysqlbinlog */;
+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+DROP DATABASE test2;
+DROP TABLE t1;
diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result
index 941ae63cf89..edb1ec72070 100644
--- a/mysql-test/r/mysqltest.result
+++ b/mysql-test/r/mysqltest.result
@@ -178,6 +178,9 @@ mysqltest: At line 1: End of line junk detected: "disconnect default # comment
"
mysqltest: At line 1: Extra delimiter ";" found
mysqltest: At line 1: Extra delimiter ";" found
+mysqltest: At line 1: Spurious text after `query` expression
+mysqltest: At line 1: Spurious text after `query` expression
+mysqltest: At line 2: Spurious text after `query` expression
mysqltest: At line 1: Missing argument(s) to 'error'
mysqltest: At line 1: Missing argument(s) to 'error'
mysqltest: At line 1: The sqlstate definition must start with an uppercase S
@@ -263,6 +266,9 @@ a long \$where variable content
banana = banana
Not a banana: ba\$cat\$cat
+with\`some"escaped\'quotes
+with\`some"escaped\'quotes
+single'tick`backtick
mysqltest: At line 1: Missing arguments to let
mysqltest: At line 1: Missing variable name in let
mysqltest: At line 1: Missing assignment operator in let
@@ -447,12 +453,16 @@ mysqltest: At line 1: Missing required argument 'host' to command 'connect'
mysqltest: At line 1: query 'connect con2,localhost,root,,illegal_db' failed: 1049: Unknown database 'illegal_db'
mysqltest: At line 1: Illegal argument for port: 'illegal_port'
mysqltest: At line 1: Illegal option to connect: SMTP
-OK
-mysqltest: The test didn't produce any output
+200 connects succeeded
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
show tables;
ERROR 3D000: No database selected
+connect con1,localhost,root,,;
+connection default;
+connection con1;
+disconnect con1;
+connection default;
Output from mysqltest-x.inc
Output from mysqltest-x.inc
Output from mysqltest-x.inc
diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result
index 6827fd0bc76..ba639fa9763 100644
--- a/mysql-test/r/order_by.result
+++ b/mysql-test/r/order_by.result
@@ -1617,4 +1617,25 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range a a 5 NULL 2 Using where; Using temporary; Using filesort
1 SIMPLE t2 ALL NULL NULL NULL NULL 10 Using join buffer
DROP TABLE t1, t2;
+#
+# Bug #50394: Regression in EXPLAIN with index scan, LIMIT, GROUP BY and
+# ORDER BY computed col
+#
+CREATE TABLE t1 ( a INT NOT NULL, b INT NOT NULL, KEY( a, b ) );
+INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5);
+INSERT INTO t1 SELECT a + 5, b + 5 FROM t1;
+CREATE TABLE t2( a INT PRIMARY KEY, b INT );
+INSERT INTO t2 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5);
+INSERT INTO t2 SELECT a + 5, b + 5 FROM t2;
+EXPLAIN
+SELECT count(*) AS c, t1.a
+FROM t1 JOIN t2 ON t1.b = t2.a
+WHERE t2.b = 1
+GROUP BY t1.a
+ORDER by c
+LIMIT 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a 8 NULL 10 Using index; Using temporary; Using filesort
+1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 Using where
+DROP TABLE t1, t2;
End of 5.1 tests
diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result
index 23a485dc5ed..8e65557d690 100644
--- a/mysql-test/r/partition.result
+++ b/mysql-test/r/partition.result
@@ -1,4 +1,44 @@
drop table if exists t1, t2;
+#
+# Bug#57113: ha_partition::extra(ha_extra_function):
+# Assertion `m_extra_cache' failed
+CREATE TABLE t1
+(id INT NOT NULL PRIMARY KEY,
+name VARCHAR(16) NOT NULL,
+year YEAR,
+INDEX name (name(8))
+)
+PARTITION BY HASH(id) PARTITIONS 2;
+INSERT INTO t1 VALUES ( 1, 'FooBar', '1924' );
+CREATE TABLE t2 (id INT);
+INSERT INTO t2 VALUES (1),(2);
+UPDATE t1, t2 SET t1.year = '1955' WHERE t1.name = 'FooBar';
+DROP TABLE t1, t2;
+#
+# Bug#55458: Partitioned MyISAM table gets crashed by multi-table update
+#
+CREATE TABLE t1 (
+`id` int NOT NULL,
+`user_num` int DEFAULT NULL,
+PRIMARY KEY (`id`)
+) ENGINE=MyISAM CHARSET=latin1;
+INSERT INTO t1 VALUES (1,8601);
+INSERT INTO t1 VALUES (2,8601);
+INSERT INTO t1 VALUES (3,8601);
+INSERT INTO t1 VALUES (4,8601);
+CREATE TABLE t2 (
+`id` int(11) NOT NULL,
+`user_num` int DEFAULT NULL,
+`name` varchar(64) NOT NULL,
+PRIMARY KEY (`id`)
+) ENGINE=MyISAM CHARSET=latin1
+PARTITION BY HASH (id)
+PARTITIONS 2;
+INSERT INTO t2 VALUES (1,8601,'John');
+INSERT INTO t2 VALUES (2,8601,'JS');
+INSERT INTO t2 VALUES (3,8601,'John S');
+UPDATE t1, t2 SET t2.name = 'John Smith' WHERE t1.user_num = t2.user_num;
+DROP TABLE t1, t2;
CREATE TABLE t1 (a INT, b INT)
PARTITION BY LIST (a)
SUBPARTITION BY HASH (b)
@@ -1382,7 +1422,7 @@ NULL
2
explain partitions select * from t1 where a is null or a < 0 or a > 1;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 pn,p2 ALL NULL NULL NULL NULL 4 Using where
+1 SIMPLE t1 pn,p2 ALL NULL NULL NULL NULL 2 Using where
drop table t1;
CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, name VARCHAR(20))
ENGINE=MyISAM DEFAULT CHARSET=latin1
diff --git a/mysql-test/r/partition_binlog_stmt.result b/mysql-test/r/partition_binlog_stmt.result
new file mode 100644
index 00000000000..5b9df742f70
--- /dev/null
+++ b/mysql-test/r/partition_binlog_stmt.result
@@ -0,0 +1,13 @@
+DROP TABLE IF EXISTS t1;
+#
+# Bug#51851: Server with SBR locks mutex twice on LOAD DATA into
+# partitioned MyISAM table
+CREATE TABLE t1
+(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+name TINYBLOB NOT NULL,
+modified TIMESTAMP DEFAULT '0000-00-00 00:00:00',
+INDEX namelocs (name(255))) ENGINE = MyISAM
+PARTITION BY HASH(id) PARTITIONS 2;
+LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/init_file.txt'
+INTO TABLE t1 (name);
+DROP TABLE t1;
diff --git a/mysql-test/r/partition_error.result b/mysql-test/r/partition_error.result
index 16428fba4d9..ea74f476ceb 100644
--- a/mysql-test/r/partition_error.result
+++ b/mysql-test/r/partition_error.result
@@ -1008,4 +1008,14 @@ PARTITION p VALUES LESS THAN (1219089600),
PARTITION pmax VALUES LESS THAN MAXVALUE);
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
DROP TABLE old;
+#
+# Bug #56709: Memory leaks at running the 5.1 test suite
+#
+CREATE TABLE t1 (a TIMESTAMP NOT NULL PRIMARY KEY);
+ALTER TABLE t1
+PARTITION BY RANGE (EXTRACT(DAY FROM a)) (
+PARTITION p VALUES LESS THAN (18),
+PARTITION pmax VALUES LESS THAN MAXVALUE);
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+DROP TABLE t1;
End of 5.1 tests
diff --git a/mysql-test/r/partition_hash.result b/mysql-test/r/partition_hash.result
index 19da70db5a0..94fefe77a77 100644
--- a/mysql-test/r/partition_hash.result
+++ b/mysql-test/r/partition_hash.result
@@ -69,25 +69,25 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0,p1,p2,p3 ALL NULL NULL NULL NULL 9 Using where
explain partitions select * from t1 where a is null or (a >= 5 and a <= 7);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0,p2,p3 ALL NULL NULL NULL NULL 9 Using where
+1 SIMPLE t1 p0,p2,p3 ALL NULL NULL NULL NULL 7 Using where
explain partitions select * from t1 where a is null;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 9 Using where
+1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 3 Using where
explain partitions select * from t1 where a is not null;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0,p1,p2,p3 ALL NULL NULL NULL NULL 9 Using where
explain partitions select * from t1 where a >= 1 and a < 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 9 Using where
+1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 5 Using where
explain partitions select * from t1 where a >= 3 and a <= 5;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p1,p2 ALL NULL NULL NULL NULL 9 Using where
+1 SIMPLE t1 p1,p2 ALL NULL NULL NULL NULL 4 Using where
explain partitions select * from t1 where a > 2 and a < 4;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p1 ALL NULL NULL NULL NULL 9 Using where
+1 SIMPLE t1 p1 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t1 where a > 3 and a <= 6;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p2,p3 ALL NULL NULL NULL NULL 9 Using where
+1 SIMPLE t1 p2,p3 ALL NULL NULL NULL NULL 4 Using where
explain partitions select * from t1 where a > 5;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0,p1,p2,p3 ALL NULL NULL NULL NULL 9 Using where
diff --git a/mysql-test/r/partition_innodb.result b/mysql-test/r/partition_innodb.result
index 2a04aafe554..5fcb0e796b1 100644
--- a/mysql-test/r/partition_innodb.result
+++ b/mysql-test/r/partition_innodb.result
@@ -1,5 +1,31 @@
drop table if exists t1, t2;
#
+# Bug#56287: crash when using Partition datetime in sub in query
+#
+CREATE TABLE t1
+(c1 bigint(20) unsigned NOT NULL AUTO_INCREMENT,
+c2 varchar(40) not null default '',
+c3 datetime not NULL,
+PRIMARY KEY (c1,c3),
+KEY partidx(c3))
+ENGINE=InnoDB
+PARTITION BY RANGE (TO_DAYS(c3))
+(PARTITION p200912 VALUES LESS THAN (to_days('2010-01-01')),
+PARTITION p201103 VALUES LESS THAN (to_days('2011-04-01')),
+PARTITION p201912 VALUES LESS THAN MAXVALUE);
+insert into t1(c2,c3) values ("Test row",'2010-01-01 00:00:00');
+SELECT PARTITION_NAME, TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME = 't1' AND TABLE_SCHEMA = 'test';
+PARTITION_NAME TABLE_ROWS
+p200912 0
+p201103 1
+p201912 0
+SELECT count(*) FROM t1 p where c3 in
+(select c3 from t1 t where t.c3 < date '2011-04-26 19:19:44'
+ and t.c3 > date '2011-04-26 19:18:44') ;
+count(*)
+0
+DROP TABLE t1;
+#
# Bug#51830: Incorrect partition pruning on range partition (regression)
#
CREATE TABLE t1 (a INT NOT NULL)
@@ -22,31 +48,31 @@ insert INTO t1 VALUES (110);
ERROR HY000: Table has no partition for value 110
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 90;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 0 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 90;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 0 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = 90;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 0 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = 89;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p90 ALL NULL NULL NULL NULL 7 Using where
+1 SIMPLE t1 p90 ALL NULL NULL NULL NULL 3 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 89;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p90 ALL NULL NULL NULL NULL 7 Using where
+1 SIMPLE t1 p90 ALL NULL NULL NULL NULL 3 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 89;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 7 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 0 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = 100;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 7 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 0 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 100;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 7 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 0 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 100;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 7 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 0 Using where
DROP TABLE t1;
#
# Bug#50104: Partitioned table with just 1 partion works with fk
@@ -387,3 +413,9 @@ a b
3 2003-03-03
COMMIT;
DROP TABLE t1;
+CREATE TABLE t1 (i1 int NOT NULL primary key, f1 int) ENGINE = InnoDB
+PARTITION BY HASH(i1) PARTITIONS 2;
+INSERT INTO t1 VALUES (1,1), (2,2);
+SELECT * FROM t1 WHERE i1 = ( SELECT i1 FROM t1 WHERE f1=0 LIMIT 1 );
+i1 f1
+DROP TABLE t1;
diff --git a/mysql-test/r/partition_innodb_semi_consistent.result b/mysql-test/r/partition_innodb_semi_consistent.result
index 471da4c1c2e..fbdd70528c5 100644
--- a/mysql-test/r/partition_innodb_semi_consistent.result
+++ b/mysql-test/r/partition_innodb_semi_consistent.result
@@ -75,7 +75,17 @@ TRUNCATE t1;
INSERT INTO t1 VALUES (1,'init');
CREATE PROCEDURE p1()
BEGIN
+# retry the UPDATE in case it times out the lock before con1 has time
+# to COMMIT.
+DECLARE do_retry INT DEFAULT 0;
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET do_retry = 1;
+retry_loop:LOOP
UPDATE t1 SET b = CONCAT(b, '+con2') WHERE a = 1;
+IF do_retry = 0 THEN
+LEAVE retry_loop;
+END IF;
+SET do_retry = 0;
+END LOOP;
INSERT INTO t2 VALUES ();
END|
BEGIN;
diff --git a/mysql-test/r/partition_pruning.result b/mysql-test/r/partition_pruning.result
index 568c21b27be..01ae3876fd0 100644
--- a/mysql-test/r/partition_pruning.result
+++ b/mysql-test/r/partition_pruning.result
@@ -1,5 +1,29 @@
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
#
+# Bug#53806: Wrong estimates for range query in partitioned MyISAM table
+# Bug#46754: 'rows' field doesn't reflect partition pruning
+#
+CREATE TABLE t1 (a INT PRIMARY KEY)
+PARTITION BY RANGE (a) (
+PARTITION p0 VALUES LESS THAN (1),
+PARTITION p1 VALUES LESS THAN (2),
+PARTITION p2 VALUES LESS THAN (3),
+PARTITION p3 VALUES LESS THAN (4),
+PARTITION p4 VALUES LESS THAN (5),
+PARTITION p5 VALUES LESS THAN (6),
+PARTITION max VALUES LESS THAN MAXVALUE);
+INSERT INTO t1 VALUES (-1),(0),(1),(2),(3),(4),(5),(6),(7),(8);
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= 1;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+# # # # # # # # # 3 #
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < 7;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+# # # # # # # # # 9 #
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= 1;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+# # # # # # # # # 3 #
+DROP TABLE t1;
+#
# Bug#49742: Partition Pruning not working correctly for RANGE
#
CREATE TABLE t1 (a INT PRIMARY KEY)
@@ -89,7 +113,7 @@ a
1
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 p0,p1 index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
+1 SIMPLE t1 p0,p1 index PRIMARY PRIMARY 4 NULL 3 Using where; Using index
SELECT * FROM t1 WHERE a <= 2;
a
-1
@@ -98,7 +122,7 @@ a
2
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= 2;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0,p1,p2 index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
+1 SIMPLE t1 p0,p1,p2 index PRIMARY PRIMARY 4 NULL 4 Using where; Using index
SELECT * FROM t1 WHERE a <= 3;
a
-1
@@ -108,7 +132,7 @@ a
3
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0,p1,p2,p3 index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
+1 SIMPLE t1 p0,p1,p2,p3 index PRIMARY PRIMARY 4 NULL 5 Using where; Using index
SELECT * FROM t1 WHERE a <= 4;
a
-1
@@ -119,7 +143,7 @@ a
4
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= 4;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0,p1,p2,p3,p4 index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
+1 SIMPLE t1 p0,p1,p2,p3,p4 index PRIMARY PRIMARY 4 NULL 6 Using where; Using index
SELECT * FROM t1 WHERE a <= 5;
a
-1
@@ -131,7 +155,7 @@ a
5
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= 5;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0,p1,p2,p3,p4,p5 index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
+1 SIMPLE t1 p0,p1,p2,p3,p4,p5 index PRIMARY PRIMARY 4 NULL 7 Using where; Using index
SELECT * FROM t1 WHERE a <= 6;
a
-1
@@ -213,7 +237,7 @@ a
8
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,p2,p3,p4,p5,max index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
+1 SIMPLE t1 p1,p2,p3,p4,p5,max index PRIMARY PRIMARY 4 NULL 8 Using where; Using index
SELECT * FROM t1 WHERE a >= 2;
a
2
@@ -225,7 +249,7 @@ a
8
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 2;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p2,p3,p4,p5,max index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
+1 SIMPLE t1 p2,p3,p4,p5,max index PRIMARY PRIMARY 4 NULL 7 Using where; Using index
SELECT * FROM t1 WHERE a >= 3;
a
3
@@ -236,7 +260,7 @@ a
8
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p3,p4,p5,max index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
+1 SIMPLE t1 p3,p4,p5,max index PRIMARY PRIMARY 4 NULL 6 Using where; Using index
SELECT * FROM t1 WHERE a >= 4;
a
4
@@ -246,7 +270,7 @@ a
8
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 4;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p4,p5,max index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
+1 SIMPLE t1 p4,p5,max index PRIMARY PRIMARY 4 NULL 5 Using where; Using index
SELECT * FROM t1 WHERE a >= 5;
a
5
@@ -255,7 +279,7 @@ a
8
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 5;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p5,max index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
+1 SIMPLE t1 p5,max index PRIMARY PRIMARY 4 NULL 4 Using where; Using index
SELECT * FROM t1 WHERE a >= 6;
a
6
@@ -263,14 +287,14 @@ a
8
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 6;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 max index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
+1 SIMPLE t1 max index PRIMARY PRIMARY 4 NULL 3 Using where; Using index
SELECT * FROM t1 WHERE a >= 7;
a
7
8
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 7;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 max index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
+1 SIMPLE t1 max index PRIMARY PRIMARY 4 NULL 3 Using where; Using index
SELECT * FROM t1 WHERE a > 1;
a
2
@@ -282,7 +306,7 @@ a
8
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 p2,p3,p4,p5,max index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
+1 SIMPLE t1 p2,p3,p4,p5,max index PRIMARY PRIMARY 4 NULL 7 Using where; Using index
SELECT * FROM t1 WHERE a > 2;
a
3
@@ -293,7 +317,7 @@ a
8
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 2;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p3,p4,p5,max index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
+1 SIMPLE t1 p3,p4,p5,max index PRIMARY PRIMARY 4 NULL 6 Using where; Using index
SELECT * FROM t1 WHERE a > 3;
a
4
@@ -303,7 +327,7 @@ a
8
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p4,p5,max index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
+1 SIMPLE t1 p4,p5,max index PRIMARY PRIMARY 4 NULL 5 Using where; Using index
SELECT * FROM t1 WHERE a > 4;
a
5
@@ -312,7 +336,7 @@ a
8
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 4;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p5,max index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
+1 SIMPLE t1 p5,max index PRIMARY PRIMARY 4 NULL 4 Using where; Using index
SELECT * FROM t1 WHERE a > 5;
a
6
@@ -320,20 +344,20 @@ a
8
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 5;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 max index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
+1 SIMPLE t1 max index PRIMARY PRIMARY 4 NULL 3 Using where; Using index
SELECT * FROM t1 WHERE a > 6;
a
7
8
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 6;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 max index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
+1 SIMPLE t1 max index PRIMARY PRIMARY 4 NULL 3 Using where; Using index
SELECT * FROM t1 WHERE a > 7;
a
8
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 7;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 max index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
+1 SIMPLE t1 max index PRIMARY PRIMARY 4 NULL 3 Using where; Using index
DROP TABLE t1;
CREATE TABLE t1 (a INT PRIMARY KEY)
PARTITION BY RANGE (a) (
@@ -408,7 +432,7 @@ a
1
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 p0,p1 index PRIMARY PRIMARY 4 NULL 9 Using where; Using index
+1 SIMPLE t1 p0,p1 index PRIMARY PRIMARY 4 NULL 3 Using where; Using index
SELECT * FROM t1 WHERE a <= 2;
a
-1
@@ -417,7 +441,7 @@ a
2
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= 2;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0,p1,p2 index PRIMARY PRIMARY 4 NULL 9 Using where; Using index
+1 SIMPLE t1 p0,p1,p2 index PRIMARY PRIMARY 4 NULL 4 Using where; Using index
SELECT * FROM t1 WHERE a <= 3;
a
-1
@@ -427,7 +451,7 @@ a
3
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0,p1,p2,p3 index PRIMARY PRIMARY 4 NULL 9 Using where; Using index
+1 SIMPLE t1 p0,p1,p2,p3 index PRIMARY PRIMARY 4 NULL 5 Using where; Using index
SELECT * FROM t1 WHERE a <= 4;
a
-1
@@ -438,7 +462,7 @@ a
4
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= 4;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0,p1,p2,p3,p4 index PRIMARY PRIMARY 4 NULL 9 Using where; Using index
+1 SIMPLE t1 p0,p1,p2,p3,p4 index PRIMARY PRIMARY 4 NULL 6 Using where; Using index
SELECT * FROM t1 WHERE a <= 5;
a
-1
@@ -511,7 +535,7 @@ a
7
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,p2,p3,p4,max index PRIMARY PRIMARY 4 NULL 9 Using where; Using index
+1 SIMPLE t1 p1,p2,p3,p4,max index PRIMARY PRIMARY 4 NULL 7 Using where; Using index
SELECT * FROM t1 WHERE a >= 2;
a
2
@@ -522,7 +546,7 @@ a
7
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 2;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p2,p3,p4,max index PRIMARY PRIMARY 4 NULL 9 Using where; Using index
+1 SIMPLE t1 p2,p3,p4,max index PRIMARY PRIMARY 4 NULL 6 Using where; Using index
SELECT * FROM t1 WHERE a >= 3;
a
3
@@ -532,7 +556,7 @@ a
7
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p3,p4,max index PRIMARY PRIMARY 4 NULL 9 Using where; Using index
+1 SIMPLE t1 p3,p4,max index PRIMARY PRIMARY 4 NULL 5 Using where; Using index
SELECT * FROM t1 WHERE a >= 4;
a
4
@@ -541,7 +565,7 @@ a
7
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 4;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p4,max index PRIMARY PRIMARY 4 NULL 9 Using where; Using index
+1 SIMPLE t1 p4,max index PRIMARY PRIMARY 4 NULL 4 Using where; Using index
SELECT * FROM t1 WHERE a >= 5;
a
5
@@ -549,14 +573,14 @@ a
7
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 5;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 max index PRIMARY PRIMARY 4 NULL 9 Using where; Using index
+1 SIMPLE t1 max index PRIMARY PRIMARY 4 NULL 3 Using where; Using index
SELECT * FROM t1 WHERE a >= 6;
a
6
7
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 6;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 max index PRIMARY PRIMARY 4 NULL 9 Using where; Using index
+1 SIMPLE t1 max index PRIMARY PRIMARY 4 NULL 3 Using where; Using index
SELECT * FROM t1 WHERE a > 1;
a
2
@@ -567,7 +591,7 @@ a
7
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 p2,p3,p4,max index PRIMARY PRIMARY 4 NULL 9 Using where; Using index
+1 SIMPLE t1 p2,p3,p4,max index PRIMARY PRIMARY 4 NULL 6 Using where; Using index
SELECT * FROM t1 WHERE a > 2;
a
3
@@ -577,7 +601,7 @@ a
7
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 2;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p3,p4,max index PRIMARY PRIMARY 4 NULL 9 Using where; Using index
+1 SIMPLE t1 p3,p4,max index PRIMARY PRIMARY 4 NULL 5 Using where; Using index
SELECT * FROM t1 WHERE a > 3;
a
4
@@ -586,7 +610,7 @@ a
7
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p4,max index PRIMARY PRIMARY 4 NULL 9 Using where; Using index
+1 SIMPLE t1 p4,max index PRIMARY PRIMARY 4 NULL 4 Using where; Using index
SELECT * FROM t1 WHERE a > 4;
a
5
@@ -594,20 +618,20 @@ a
7
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 4;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 max index PRIMARY PRIMARY 4 NULL 9 Using where; Using index
+1 SIMPLE t1 max index PRIMARY PRIMARY 4 NULL 3 Using where; Using index
SELECT * FROM t1 WHERE a > 5;
a
6
7
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 5;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 max index PRIMARY PRIMARY 4 NULL 9 Using where; Using index
+1 SIMPLE t1 max index PRIMARY PRIMARY 4 NULL 3 Using where; Using index
SELECT * FROM t1 WHERE a > 6;
a
7
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 6;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 max index PRIMARY PRIMARY 4 NULL 9 Using where; Using index
+1 SIMPLE t1 max index PRIMARY PRIMARY 4 NULL 3 Using where; Using index
DROP TABLE t1;
# test of RANGE and index
CREATE TABLE t1 (a DATE, KEY(a))
@@ -757,10 +781,10 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 pNULL,p0001-01-01,p1001-01-01,p2001-01-01 range a a 4 NULL 5 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1999-02-31';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 pNULL,p2001-01-01 index a a 4 NULL 7 Using where; Using index
+1 SIMPLE t1 pNULL,p2001-01-01 index a a 4 NULL 4 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1999-02-31';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 pNULL,p2001-01-01 index a a 4 NULL 7 Using where; Using index
+1 SIMPLE t1 pNULL,p2001-01-01 index a a 4 NULL 4 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1999-02-31';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 pNULL ref a a 4 const 1 Using where; Using index
@@ -880,34 +904,34 @@ a
1001-01-01
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1001-01-01';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 pNULL,p0001-01-01,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
+1 SIMPLE t1 pNULL,p0001-01-01,p1001-01-01 ALL NULL NULL NULL NULL 6 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= '1001-01-01';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 pNULL,p0001-01-01,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
+1 SIMPLE t1 pNULL,p0001-01-01,p1001-01-01 ALL NULL NULL NULL NULL 6 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1001-01-01';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 pNULL,p1001-01-01,p2001-01-01 ALL NULL NULL NULL NULL 7 Using where
+1 SIMPLE t1 pNULL,p1001-01-01,p2001-01-01 ALL NULL NULL NULL NULL 5 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1001-01-01';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 pNULL,p2001-01-01 ALL NULL NULL NULL NULL 7 Using where
+1 SIMPLE t1 pNULL,p2001-01-01 ALL NULL NULL NULL NULL 4 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1001-01-01';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p1001-01-01 system NULL NULL NULL NULL 1
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1001-00-00';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 pNULL,p0001-01-01,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
+1 SIMPLE t1 pNULL,p0001-01-01,p1001-01-01 ALL NULL NULL NULL NULL 6 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= '1001-00-00';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 pNULL,p0001-01-01,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
+1 SIMPLE t1 pNULL,p0001-01-01,p1001-01-01 ALL NULL NULL NULL NULL 6 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1001-00-00';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 pNULL,p1001-01-01,p2001-01-01 ALL NULL NULL NULL NULL 7 Using where
+1 SIMPLE t1 pNULL,p1001-01-01,p2001-01-01 ALL NULL NULL NULL NULL 5 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1001-00-00';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 pNULL,p1001-01-01,p2001-01-01 ALL NULL NULL NULL NULL 7 Using where
+1 SIMPLE t1 pNULL,p1001-01-01,p2001-01-01 ALL NULL NULL NULL NULL 5 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1001-00-00';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 pNULL ALL NULL NULL NULL NULL 7 Using where
+1 SIMPLE t1 pNULL ALL NULL NULL NULL NULL 3 Using where
# Disabling warnings for the invalid date
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1999-02-31';
id select_type table partitions type possible_keys key key_len ref rows Extra
@@ -917,25 +941,25 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 pNULL,p0001-01-01,p1001-01-01,p2001-01-01 ALL NULL NULL NULL NULL 7 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1999-02-31';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 pNULL,p2001-01-01 ALL NULL NULL NULL NULL 7 Using where
+1 SIMPLE t1 pNULL,p2001-01-01 ALL NULL NULL NULL NULL 4 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1999-02-31';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 pNULL,p2001-01-01 ALL NULL NULL NULL NULL 7 Using where
+1 SIMPLE t1 pNULL,p2001-01-01 ALL NULL NULL NULL NULL 4 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1999-02-31';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 pNULL ALL NULL NULL NULL NULL 7 Using where
+1 SIMPLE t1 pNULL ALL NULL NULL NULL NULL 3 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1002-00-00';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 pNULL,p0001-01-01,p1001-01-01,p2001-01-01 ALL NULL NULL NULL NULL 7 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1001-01-01';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 pNULL,p0001-01-01,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
+1 SIMPLE t1 pNULL,p0001-01-01,p1001-01-01 ALL NULL NULL NULL NULL 6 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0001-01-02' AND '1002-00-00';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 pNULL,p1001-01-01,p2001-01-01 ALL NULL NULL NULL NULL 7 Using where
+1 SIMPLE t1 pNULL,p1001-01-01,p2001-01-01 ALL NULL NULL NULL NULL 5 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0001-01-01' AND '1001-01-01';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 pNULL,p0001-01-01,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
+1 SIMPLE t1 pNULL,p0001-01-01,p1001-01-01 ALL NULL NULL NULL NULL 6 Using where
DROP TABLE t1;
# test of LIST and index
CREATE TABLE t1 (a DATE, KEY(a))
@@ -1086,10 +1110,10 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 range a a 4 NULL 5 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1999-02-31';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p2001-01-01,pNULL index a a 4 NULL 7 Using where; Using index
+1 SIMPLE t1 p2001-01-01,pNULL index a a 4 NULL 4 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1999-02-31';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p2001-01-01,pNULL index a a 4 NULL 7 Using where; Using index
+1 SIMPLE t1 p2001-01-01,pNULL index a a 4 NULL 4 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1999-02-31';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 pNULL ref a a 4 const 1 Using where; Using index
@@ -1101,7 +1125,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 range a a 4 NULL 4 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0001-01-02' AND '1002-00-00';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 pNULL,p1001-01-01 index a a 4 NULL 7 Using where; Using index
+1 SIMPLE t1 pNULL,p1001-01-01 index a a 4 NULL 4 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0001-01-01' AND '1001-01-01';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0001-01-01,pNULL,p1001-01-01 range a a 4 NULL 3 Using where; Using index
@@ -1209,62 +1233,62 @@ a
1001-01-01
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1001-01-01';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02 ALL NULL NULL NULL NULL 7 Using where
+1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02 ALL NULL NULL NULL NULL 5 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= '1001-01-01';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
+1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 ALL NULL NULL NULL NULL 6 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1001-01-01';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p2001-01-01,pNULL,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
+1 SIMPLE t1 p2001-01-01,pNULL,p1001-01-01 ALL NULL NULL NULL NULL 5 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1001-01-01';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p2001-01-01,pNULL ALL NULL NULL NULL NULL 7 Using where
+1 SIMPLE t1 p2001-01-01,pNULL ALL NULL NULL NULL NULL 4 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1001-01-01';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p1001-01-01 system NULL NULL NULL NULL 1
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1001-00-00';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02 ALL NULL NULL NULL NULL 7 Using where
+1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02 ALL NULL NULL NULL NULL 5 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= '1001-00-00';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02 ALL NULL NULL NULL NULL 7 Using where
+1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02 ALL NULL NULL NULL NULL 5 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1001-00-00';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p2001-01-01,pNULL,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
+1 SIMPLE t1 p2001-01-01,pNULL,p1001-01-01 ALL NULL NULL NULL NULL 5 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1001-00-00';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p2001-01-01,pNULL,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
+1 SIMPLE t1 p2001-01-01,pNULL,p1001-01-01 ALL NULL NULL NULL NULL 5 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1001-00-00';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 pNULL ALL NULL NULL NULL NULL 7 Using where
+1 SIMPLE t1 pNULL ALL NULL NULL NULL NULL 3 Using where
# Disabling warnings for the invalid date
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1999-02-31';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
+1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 ALL NULL NULL NULL NULL 6 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= '1999-02-31';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
+1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 ALL NULL NULL NULL NULL 6 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1999-02-31';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p2001-01-01,pNULL ALL NULL NULL NULL NULL 7 Using where
+1 SIMPLE t1 p2001-01-01,pNULL ALL NULL NULL NULL NULL 4 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1999-02-31';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p2001-01-01,pNULL ALL NULL NULL NULL NULL 7 Using where
+1 SIMPLE t1 p2001-01-01,pNULL ALL NULL NULL NULL NULL 4 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1999-02-31';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 pNULL ALL NULL NULL NULL NULL 7 Using where
+1 SIMPLE t1 pNULL ALL NULL NULL NULL NULL 3 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1002-00-00';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
+1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 ALL NULL NULL NULL NULL 6 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1001-01-01';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
+1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 ALL NULL NULL NULL NULL 6 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0001-01-02' AND '1002-00-00';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 pNULL,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
+1 SIMPLE t1 pNULL,p1001-01-01 ALL NULL NULL NULL NULL 4 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0001-01-01' AND '1001-01-01';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0001-01-01,pNULL,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
+1 SIMPLE t1 p0001-01-01,pNULL,p1001-01-01 ALL NULL NULL NULL NULL 5 Using where
DROP TABLE t1;
# Test with DATETIME column NOT NULL
CREATE TABLE t1 (
@@ -1289,25 +1313,25 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 12 NULL 8 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = CAST('2009-04-03' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090403 index NULL PRIMARY 12 NULL 8 Using where; Using index
+1 SIMPLE t1 p20090403 index NULL PRIMARY 12 NULL 2 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= CAST('2009-04-03' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 13 Using where; Using index
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 10 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > CAST('2009-04-03' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 13 Using where; Using index
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 10 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b < CAST('2009-04-02 23:59:59' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 12 NULL 13 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 12 NULL 6 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b <= CAST('2009-04-02 23:59:59' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 12 NULL 13 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 12 NULL 6 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b = CAST('2009-04-02 23:59:59' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090402 index NULL PRIMARY 12 NULL 13 Using where; Using index
+1 SIMPLE t1 p20090402 index NULL PRIMARY 12 NULL 3 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b >= CAST('2009-04-02 23:59:59' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
@@ -1315,99 +1339,99 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b > CAST('2009-04-02 23:59:59' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 13 Using where; Using index
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 10 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < CAST('2009-04-03' AS DATE);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 12 NULL 13 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 12 NULL 6 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b <= CAST('2009-04-03' AS DATE);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 12 NULL 13 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 12 NULL 8 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = CAST('2009-04-03' AS DATE);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090403 index NULL PRIMARY 12 NULL 13 Using where; Using index
+1 SIMPLE t1 p20090403 index NULL PRIMARY 12 NULL 2 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= CAST('2009-04-03' AS DATE);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 13 Using where; Using index
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 10 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > CAST('2009-04-03' AS DATE);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 13 Using where; Using index
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 10 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < '2009-04-03 00:00:00';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 12 NULL 13 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 12 NULL 6 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b <= '2009-04-03 00:00:00';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 12 NULL 13 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 12 NULL 8 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = '2009-04-03 00:00:00';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090403 index NULL PRIMARY 12 NULL 13 Using where; Using index
+1 SIMPLE t1 p20090403 index NULL PRIMARY 12 NULL 2 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= '2009-04-03 00:00:00';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 13 Using where; Using index
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 10 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > '2009-04-03 00:00:00';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 13 Using where; Using index
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 10 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < '2009-04-02 23:59:59';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 12 NULL 13 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 12 NULL 6 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b <= '2009-04-02 23:59:59';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 12 NULL 13 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 12 NULL 6 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = '2009-04-02 23:59:59';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090402 index NULL PRIMARY 12 NULL 13 Using where; Using index
+1 SIMPLE t1 p20090402 index NULL PRIMARY 12 NULL 3 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= '2009-04-02 23:59:59';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p20090401,p20090402,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 13 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > '2009-04-02 23:59:59';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 13 Using where; Using index
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 10 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < '2009-04-03';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 12 NULL 13 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 12 NULL 6 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b <= '2009-04-03';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 12 NULL 13 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 12 NULL 8 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = '2009-04-03';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090403 index NULL PRIMARY 12 NULL 13 Using where; Using index
+1 SIMPLE t1 p20090403 index NULL PRIMARY 12 NULL 2 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= '2009-04-03';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 13 Using where; Using index
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 10 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > '2009-04-03';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 13 Using where; Using index
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 10 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b < CAST('2009-04-03 00:00:01' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 12 NULL 13 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 12 NULL 8 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b <= CAST('2009-04-03 00:00:01' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 12 NULL 13 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 12 NULL 8 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b = CAST('2009-04-03 00:00:01' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090403 index NULL PRIMARY 12 NULL 13 Using where; Using index
+1 SIMPLE t1 p20090403 index NULL PRIMARY 12 NULL 2 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b >= CAST('2009-04-03 00:00:01' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 13 Using where; Using index
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 10 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b > CAST('2009-04-03 00:00:01' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 13 Using where; Using index
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 12 NULL 10 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b < CAST('2009-04-02 23:59:58' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 12 NULL 13 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 12 NULL 6 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b <= CAST('2009-04-02 23:59:58' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 12 NULL 13 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 12 NULL 6 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b = CAST('2009-04-02 23:59:58' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090402 index NULL PRIMARY 12 NULL 13 Using where; Using index
+1 SIMPLE t1 p20090402 index NULL PRIMARY 12 NULL 3 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b >= CAST('2009-04-02 23:59:58' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
@@ -1440,21 +1464,21 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 7 NULL 7 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = CAST('2009-04-03' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090403 index NULL PRIMARY 7 NULL 7 Using where; Using index
+1 SIMPLE t1 p20090403 index NULL PRIMARY 7 NULL 2 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= CAST('2009-04-03' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 7 NULL 12 Using where; Using index
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 7 NULL 10 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > CAST('2009-04-03' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090404,p20090405 index NULL PRIMARY 7 NULL 12 Using where; Using index
+1 SIMPLE t1 p20090401,p20090404,p20090405 index NULL PRIMARY 7 NULL 8 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b < CAST('2009-04-02 23:59:59' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 7 NULL 12 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 7 NULL 5 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b <= CAST('2009-04-02 23:59:59' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 7 NULL 12 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 7 NULL 5 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b = CAST('2009-04-02 23:59:59' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
@@ -1462,79 +1486,79 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b >= CAST('2009-04-02 23:59:59' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 7 NULL 12 Using where; Using index
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 7 NULL 10 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b > CAST('2009-04-02 23:59:59' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 7 NULL 12 Using where; Using index
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 7 NULL 10 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < CAST('2009-04-03' AS DATE);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 7 NULL 12 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 7 NULL 5 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b <= CAST('2009-04-03' AS DATE);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 7 NULL 12 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 7 NULL 7 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = CAST('2009-04-03' AS DATE);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090403 index NULL PRIMARY 7 NULL 12 Using where; Using index
+1 SIMPLE t1 p20090403 index NULL PRIMARY 7 NULL 2 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= CAST('2009-04-03' AS DATE);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 7 NULL 12 Using where; Using index
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 7 NULL 10 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > CAST('2009-04-03' AS DATE);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090404,p20090405 index NULL PRIMARY 7 NULL 12 Using where; Using index
+1 SIMPLE t1 p20090401,p20090404,p20090405 index NULL PRIMARY 7 NULL 8 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < '2009-04-03 00:00:00';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 7 NULL 12 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 7 NULL 5 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b <= '2009-04-03 00:00:00';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 7 NULL 12 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 7 NULL 7 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = '2009-04-03 00:00:00';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090403 index NULL PRIMARY 7 NULL 12 Using where; Using index
+1 SIMPLE t1 p20090403 index NULL PRIMARY 7 NULL 2 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= '2009-04-03 00:00:00';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 7 NULL 12 Using where; Using index
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 7 NULL 10 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > '2009-04-03 00:00:00';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090404,p20090405 index NULL PRIMARY 7 NULL 12 Using where; Using index
+1 SIMPLE t1 p20090401,p20090404,p20090405 index NULL PRIMARY 7 NULL 8 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < '2009-04-02 23:59:59';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 7 NULL 12 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 7 NULL 5 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b <= '2009-04-02 23:59:59';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 7 NULL 12 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 7 NULL 5 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = '2009-04-02 23:59:59';
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 b >= '2009-04-02 23:59:59';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 7 NULL 12 Using where; Using index
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 7 NULL 10 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > '2009-04-02 23:59:59';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 7 NULL 12 Using where; Using index
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 7 NULL 10 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < '2009-04-03';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 7 NULL 12 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 7 NULL 5 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b <= '2009-04-03';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 7 NULL 12 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 7 NULL 7 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = '2009-04-03';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090403 index NULL PRIMARY 7 NULL 12 Using where; Using index
+1 SIMPLE t1 p20090403 index NULL PRIMARY 7 NULL 2 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= '2009-04-03';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 7 NULL 12 Using where; Using index
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 7 NULL 10 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > '2009-04-03';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090404,p20090405 index NULL PRIMARY 7 NULL 12 Using where; Using index
+1 SIMPLE t1 p20090401,p20090404,p20090405 index NULL PRIMARY 7 NULL 8 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b < CAST('2009-04-03 00:00:01' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 7 NULL 12 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 7 NULL 7 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b <= CAST('2009-04-03 00:00:01' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 7 NULL 12 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402,p20090403 index NULL PRIMARY 7 NULL 7 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b = CAST('2009-04-03 00:00:01' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
@@ -1542,19 +1566,19 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b >= CAST('2009-04-03 00:00:01' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090404,p20090405 index NULL PRIMARY 7 NULL 12 Using where; Using index
+1 SIMPLE t1 p20090401,p20090404,p20090405 index NULL PRIMARY 7 NULL 8 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b > CAST('2009-04-03 00:00:01' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090404,p20090405 index NULL PRIMARY 7 NULL 12 Using where; Using index
+1 SIMPLE t1 p20090401,p20090404,p20090405 index NULL PRIMARY 7 NULL 8 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b < CAST('2009-04-02 23:59:58' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 7 NULL 12 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 7 NULL 5 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b <= CAST('2009-04-02 23:59:58' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 7 NULL 12 Using where; Using index
+1 SIMPLE t1 p20090401,p20090402 index NULL PRIMARY 7 NULL 5 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b = CAST('2009-04-02 23:59:58' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
@@ -1562,11 +1586,11 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b >= CAST('2009-04-02 23:59:58' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 7 NULL 12 Using where; Using index
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 7 NULL 10 Using where; Using index
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b > CAST('2009-04-02 23:59:58' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 7 NULL 12 Using where; Using index
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 index NULL PRIMARY 7 NULL 10 Using where; Using index
DROP TABLE t1;
# Test with DATETIME column NULL
CREATE TABLE t1 (
@@ -1590,25 +1614,25 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p20090401,p20090402,p20090403 ALL NULL NULL NULL NULL 8 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = CAST('2009-04-03' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090403 ALL NULL NULL NULL NULL 8 Using where
+1 SIMPLE t1 p20090403 ALL NULL NULL NULL NULL 2 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= CAST('2009-04-03' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 13 Using where
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 10 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > CAST('2009-04-03' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 13 Using where
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 10 Using where
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b < CAST('2009-04-02 23:59:59' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 13 Using where
+1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 6 Using where
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b <= CAST('2009-04-02 23:59:59' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 13 Using where
+1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 6 Using where
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b = CAST('2009-04-02 23:59:59' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090402 ALL NULL NULL NULL NULL 13 Using where
+1 SIMPLE t1 p20090402 ALL NULL NULL NULL NULL 3 Using where
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b >= CAST('2009-04-02 23:59:59' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
@@ -1616,99 +1640,99 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b > CAST('2009-04-02 23:59:59' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 13 Using where
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 10 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < CAST('2009-04-03' AS DATE);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 13 Using where
+1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 6 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b <= CAST('2009-04-03' AS DATE);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402,p20090403 ALL NULL NULL NULL NULL 13 Using where
+1 SIMPLE t1 p20090401,p20090402,p20090403 ALL NULL NULL NULL NULL 8 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = CAST('2009-04-03' AS DATE);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090403 ALL NULL NULL NULL NULL 13 Using where
+1 SIMPLE t1 p20090403 ALL NULL NULL NULL NULL 2 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= CAST('2009-04-03' AS DATE);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 13 Using where
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 10 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > CAST('2009-04-03' AS DATE);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 13 Using where
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 10 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < '2009-04-03 00:00:00';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 13 Using where
+1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 6 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b <= '2009-04-03 00:00:00';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402,p20090403 ALL NULL NULL NULL NULL 13 Using where
+1 SIMPLE t1 p20090401,p20090402,p20090403 ALL NULL NULL NULL NULL 8 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = '2009-04-03 00:00:00';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090403 ALL NULL NULL NULL NULL 13 Using where
+1 SIMPLE t1 p20090403 ALL NULL NULL NULL NULL 2 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= '2009-04-03 00:00:00';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 13 Using where
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 10 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > '2009-04-03 00:00:00';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 13 Using where
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 10 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < '2009-04-02 23:59:59';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 13 Using where
+1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 6 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b <= '2009-04-02 23:59:59';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 13 Using where
+1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 6 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = '2009-04-02 23:59:59';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090402 ALL NULL NULL NULL NULL 13 Using where
+1 SIMPLE t1 p20090402 ALL NULL NULL NULL NULL 3 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= '2009-04-02 23:59:59';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p20090401,p20090402,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 13 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > '2009-04-02 23:59:59';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 13 Using where
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 10 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < '2009-04-03';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 13 Using where
+1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 6 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b <= '2009-04-03';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402,p20090403 ALL NULL NULL NULL NULL 13 Using where
+1 SIMPLE t1 p20090401,p20090402,p20090403 ALL NULL NULL NULL NULL 8 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = '2009-04-03';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090403 ALL NULL NULL NULL NULL 13 Using where
+1 SIMPLE t1 p20090403 ALL NULL NULL NULL NULL 2 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= '2009-04-03';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 13 Using where
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 10 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > '2009-04-03';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 13 Using where
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 10 Using where
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b < CAST('2009-04-03 00:00:01' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402,p20090403 ALL NULL NULL NULL NULL 13 Using where
+1 SIMPLE t1 p20090401,p20090402,p20090403 ALL NULL NULL NULL NULL 8 Using where
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b <= CAST('2009-04-03 00:00:01' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402,p20090403 ALL NULL NULL NULL NULL 13 Using where
+1 SIMPLE t1 p20090401,p20090402,p20090403 ALL NULL NULL NULL NULL 8 Using where
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b = CAST('2009-04-03 00:00:01' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090403 ALL NULL NULL NULL NULL 13 Using where
+1 SIMPLE t1 p20090403 ALL NULL NULL NULL NULL 2 Using where
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b >= CAST('2009-04-03 00:00:01' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 13 Using where
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 10 Using where
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b > CAST('2009-04-03 00:00:01' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 13 Using where
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 10 Using where
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b < CAST('2009-04-02 23:59:58' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 13 Using where
+1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 6 Using where
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b <= CAST('2009-04-02 23:59:58' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 13 Using where
+1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 6 Using where
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b = CAST('2009-04-02 23:59:58' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090402 ALL NULL NULL NULL NULL 13 Using where
+1 SIMPLE t1 p20090402 ALL NULL NULL NULL NULL 3 Using where
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b >= CAST('2009-04-02 23:59:58' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
@@ -1740,21 +1764,21 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p20090401,p20090402,p20090403 ALL NULL NULL NULL NULL 7 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = CAST('2009-04-03' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090403 ALL NULL NULL NULL NULL 7 Using where
+1 SIMPLE t1 p20090403 ALL NULL NULL NULL NULL 2 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= CAST('2009-04-03' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 12 Using where
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 10 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > CAST('2009-04-03' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090404,p20090405 ALL NULL NULL NULL NULL 12 Using where
+1 SIMPLE t1 p20090401,p20090404,p20090405 ALL NULL NULL NULL NULL 8 Using where
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b < CAST('2009-04-02 23:59:59' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 12 Using where
+1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 5 Using where
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b <= CAST('2009-04-02 23:59:59' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 12 Using where
+1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 5 Using where
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b = CAST('2009-04-02 23:59:59' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
@@ -1762,79 +1786,79 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b >= CAST('2009-04-02 23:59:59' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 12 Using where
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 10 Using where
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b > CAST('2009-04-02 23:59:59' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 12 Using where
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 10 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < CAST('2009-04-03' AS DATE);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 12 Using where
+1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 5 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b <= CAST('2009-04-03' AS DATE);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402,p20090403 ALL NULL NULL NULL NULL 12 Using where
+1 SIMPLE t1 p20090401,p20090402,p20090403 ALL NULL NULL NULL NULL 7 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = CAST('2009-04-03' AS DATE);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090403 ALL NULL NULL NULL NULL 12 Using where
+1 SIMPLE t1 p20090403 ALL NULL NULL NULL NULL 2 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= CAST('2009-04-03' AS DATE);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 12 Using where
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 10 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > CAST('2009-04-03' AS DATE);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090404,p20090405 ALL NULL NULL NULL NULL 12 Using where
+1 SIMPLE t1 p20090401,p20090404,p20090405 ALL NULL NULL NULL NULL 8 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < '2009-04-03 00:00:00';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 12 Using where
+1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 5 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b <= '2009-04-03 00:00:00';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402,p20090403 ALL NULL NULL NULL NULL 12 Using where
+1 SIMPLE t1 p20090401,p20090402,p20090403 ALL NULL NULL NULL NULL 7 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = '2009-04-03 00:00:00';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090403 ALL NULL NULL NULL NULL 12 Using where
+1 SIMPLE t1 p20090403 ALL NULL NULL NULL NULL 2 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= '2009-04-03 00:00:00';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 12 Using where
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 10 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > '2009-04-03 00:00:00';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090404,p20090405 ALL NULL NULL NULL NULL 12 Using where
+1 SIMPLE t1 p20090401,p20090404,p20090405 ALL NULL NULL NULL NULL 8 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < '2009-04-02 23:59:59';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 12 Using where
+1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 5 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b <= '2009-04-02 23:59:59';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 12 Using where
+1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 5 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = '2009-04-02 23:59:59';
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 b >= '2009-04-02 23:59:59';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 12 Using where
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 10 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > '2009-04-02 23:59:59';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 12 Using where
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 10 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b < '2009-04-03';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 12 Using where
+1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 5 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b <= '2009-04-03';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402,p20090403 ALL NULL NULL NULL NULL 12 Using where
+1 SIMPLE t1 p20090401,p20090402,p20090403 ALL NULL NULL NULL NULL 7 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b = '2009-04-03';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090403 ALL NULL NULL NULL NULL 12 Using where
+1 SIMPLE t1 p20090403 ALL NULL NULL NULL NULL 2 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b >= '2009-04-03';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 12 Using where
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 10 Using where
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE b > '2009-04-03';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090404,p20090405 ALL NULL NULL NULL NULL 12 Using where
+1 SIMPLE t1 p20090401,p20090404,p20090405 ALL NULL NULL NULL NULL 8 Using where
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b < CAST('2009-04-03 00:00:01' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402,p20090403 ALL NULL NULL NULL NULL 12 Using where
+1 SIMPLE t1 p20090401,p20090402,p20090403 ALL NULL NULL NULL NULL 7 Using where
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b <= CAST('2009-04-03 00:00:01' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402,p20090403 ALL NULL NULL NULL NULL 12 Using where
+1 SIMPLE t1 p20090401,p20090402,p20090403 ALL NULL NULL NULL NULL 7 Using where
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b = CAST('2009-04-03 00:00:01' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
@@ -1842,19 +1866,19 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b >= CAST('2009-04-03 00:00:01' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090404,p20090405 ALL NULL NULL NULL NULL 12 Using where
+1 SIMPLE t1 p20090401,p20090404,p20090405 ALL NULL NULL NULL NULL 8 Using where
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b > CAST('2009-04-03 00:00:01' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090404,p20090405 ALL NULL NULL NULL NULL 12 Using where
+1 SIMPLE t1 p20090401,p20090404,p20090405 ALL NULL NULL NULL NULL 8 Using where
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b < CAST('2009-04-02 23:59:58' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 12 Using where
+1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 5 Using where
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b <= CAST('2009-04-02 23:59:58' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 12 Using where
+1 SIMPLE t1 p20090401,p20090402 ALL NULL NULL NULL NULL 5 Using where
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b = CAST('2009-04-02 23:59:58' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
@@ -1862,11 +1886,11 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b >= CAST('2009-04-02 23:59:58' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 12 Using where
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 10 Using where
EXPLAIN PARTITIONS SELECT * FROM t1
WHERE b > CAST('2009-04-02 23:59:58' AS DATETIME);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 12 Using where
+1 SIMPLE t1 p20090401,p20090403,p20090404,p20090405 ALL NULL NULL NULL NULL 10 Using where
DROP TABLE t1;
# For better code coverage of the patch
CREATE TABLE t1 (
@@ -1930,7 +1954,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t2 p0,p1 ALL NULL NULL NULL NULL 3 Using where
explain partitions select * from t2 where a=1 and b=1;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 p0 ALL NULL NULL NULL NULL 3 Using where
+1 SIMPLE t2 p0 ALL NULL NULL NULL NULL 2 Using where
create table t3 (
a int
)
@@ -1988,25 +2012,25 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
explain partitions select * from t5
where (a=10 and b=1) or (a=10 and b=2) or (a=10 and b = 3);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t5 p0_p0sp0,p0_p0sp1 ALL NULL NULL NULL NULL 4 Using where
+1 SIMPLE t5 p0_p0sp0,p0_p0sp1 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t5 where (a=10 and b=2) or (a=10 and b=3)
or (a=10 and b = 4);
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t5 p0_p0sp0,p0_p0sp1,p1_p1sp0,p1_p1sp1 ALL NULL NULL NULL NULL 4 Using where
explain partitions select * from t5 where (c=1 and d=1);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t5 p0_p0sp0,p1_p1sp0 ALL NULL NULL NULL NULL 4 Using where
+1 SIMPLE t5 p0_p0sp0,p1_p1sp0 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t5 where (c=2 and d=1);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t5 p0_p0sp1,p1_p1sp1 ALL NULL NULL NULL NULL 4 Using where
+1 SIMPLE t5 p0_p0sp1,p1_p1sp1 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t5 where (a=10 and b=2 and c=1 and d=1) or
(c=2 and d=1);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t5 p0_p0sp0,p0_p0sp1,p1_p1sp1 ALL NULL NULL NULL NULL 4 Using where
+1 SIMPLE t5 p0_p0sp0,p0_p0sp1,p1_p1sp1 ALL NULL NULL NULL NULL 3 Using where
explain partitions select * from t5 where (a=10 and b=2 and c=1 and d=1) or
(b=2 and c=2 and d=1);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t5 p0_p0sp0,p0_p0sp1,p1_p1sp1 ALL NULL NULL NULL NULL 4 Using where
+1 SIMPLE t5 p0_p0sp0,p0_p0sp1,p1_p1sp1 ALL NULL NULL NULL NULL 3 Using where
create table t6 (a int not null) partition by LIST(a) (
partition p1 values in (1),
partition p3 values in (3),
@@ -2044,7 +2068,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t6 p5,p7,p9 system NULL NULL NULL NULL 1
explain partitions select * from t6 where a >= 3 and a <= 8;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t6 p3,p5,p7 ALL NULL NULL NULL NULL 3 Using where
+1 SIMPLE t6 p3,p5,p7 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t6 where a > 3 and a < 5;
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
@@ -2086,7 +2110,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t6 p5,p7,p9 system NULL NULL NULL NULL 1
explain partitions select * from t6 where a >= 3 and a <= 8;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t6 p3,p5,p7 ALL NULL NULL NULL NULL 3 Using where
+1 SIMPLE t6 p3,p5,p7 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t6 where a > 3 and a < 5;
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
@@ -2325,7 +2349,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
explain partitions
select * from t1 X, t1 Y where X.a = Y.a and (X.a=1 or X.a=2);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE X p1,p2 ALL a NULL NULL NULL 4 Using where
+1 SIMPLE X p1,p2 ALL a NULL NULL NULL 2 Using where
1 SIMPLE Y p1,p2 ref a a 4 test.X.a 2
drop table t1;
create table t1 (a int) partition by hash(a) partitions 20;
@@ -2338,7 +2362,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p1,p2 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t1 where a > 1 and a <= 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p2,p3 ALL NULL NULL NULL NULL 3 Using where
+1 SIMPLE t1 p2,p3 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t1 where a >= 1 and a <= 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p1,p2,p3 ALL NULL NULL NULL NULL 3 Using where
@@ -2428,22 +2452,22 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t2 p0,p1,p2,p3,p4 ALL NULL NULL NULL NULL 1010
explain partitions select * from t2 where a < 801 and a > 200;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 p1,p2,p3,p4 ALL NULL NULL NULL NULL 1010 Using where
+1 SIMPLE t2 p1,p2,p3,p4 ALL NULL NULL NULL NULL 800 Using where
explain partitions select * from t2 where a < 801 and a > 800;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 p4 ALL NULL NULL NULL NULL 1010 Using where
+1 SIMPLE t2 p4 ALL NULL NULL NULL NULL 200 Using where
explain partitions select * from t2 where a > 600;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 p3,p4 ALL NULL NULL NULL NULL 1010 Using where
+1 SIMPLE t2 p3,p4 ALL NULL NULL NULL NULL 400 Using where
explain partitions select * from t2 where a > 600 and b = 1;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 p3,p4 ALL NULL NULL NULL NULL 1010 Using where
+1 SIMPLE t2 p3,p4 ALL NULL NULL NULL NULL 400 Using where
explain partitions select * from t2 where a > 600 and b = 4;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 p3,p4 ALL NULL NULL NULL NULL 1010 Using where
+1 SIMPLE t2 p3,p4 ALL NULL NULL NULL NULL 400 Using where
explain partitions select * from t2 where a > 600 and b = 5;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 p3,p4 ALL NULL NULL NULL NULL 1010 Using where
+1 SIMPLE t2 p3,p4 ALL NULL NULL NULL NULL 400 Using where
explain partitions select * from t2 where b = 5;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t2 p0,p1,p2,p3,p4 ALL NULL NULL NULL NULL 1010 Using where
@@ -2498,19 +2522,19 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t2 p0,p1,p2,p3,p4 ALL NULL NULL NULL NULL 910
explain partitions select * from t2 where a = 101;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 p0 ALL NULL NULL NULL NULL 910 Using where
+1 SIMPLE t2 p0 ALL NULL NULL NULL NULL 110 Using where
explain partitions select * from t2 where a = 550;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 p2 ALL NULL NULL NULL NULL 910 Using where
+1 SIMPLE t2 p2 ALL NULL NULL NULL NULL 200 Using where
explain partitions select * from t2 where a = 833;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 p4 ALL NULL NULL NULL NULL 910 Using where
+1 SIMPLE t2 p4 ALL NULL NULL NULL NULL 200 Using where
explain partitions select * from t2 where (a = 100 OR a = 900);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 p0,p4 ALL NULL NULL NULL NULL 910 Using where
+1 SIMPLE t2 p0,p4 ALL NULL NULL NULL NULL 310 Using where
explain partitions select * from t2 where (a > 100 AND a < 600);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 p0,p1,p2 ALL NULL NULL NULL NULL 910 Using where
+1 SIMPLE t2 p0,p1,p2 ALL NULL NULL NULL NULL 510 Using where
explain partitions select * from t2 where b = 4;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t2 p0,p1,p2,p3,p4 ref b b 5 const 76 Using where
@@ -2796,17 +2820,17 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
explain partitions select * from t1
where a >= 18446744073709551000-1 and a <= 18446744073709551000+1;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p3,p4 ALL NULL NULL NULL NULL 4 Using where
+1 SIMPLE t1 p3,p4 ALL NULL NULL NULL NULL 3 Using where
explain partitions select * from t1
where a between 18446744073709551001 and 18446744073709551002;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 4 Using where
+1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t1 where a = 18446744073709551000;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 4 Using where
+1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t1 where a = 18446744073709551613;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 4 Using where
+1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 2 Using where
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
@@ -2833,10 +2857,10 @@ 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 4 Using where
+1 SIMPLE t1 p2 ALL NULL NULL NULL NULL 2 Using where
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 4 Using where
+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
@@ -2845,22 +2869,22 @@ 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 4 Using where
+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 4 Using where
+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 4 Using where
+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 4 Using where
+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 6 Using where
+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 6 Using where
+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) (
diff --git a/mysql-test/r/partition_range.result b/mysql-test/r/partition_range.result
index 7a3ff4861cc..58945b563dc 100644
--- a/mysql-test/r/partition_range.result
+++ b/mysql-test/r/partition_range.result
@@ -73,13 +73,13 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 pnull system NULL NULL NULL NULL 1
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,p1 ALL NULL NULL NULL NULL 3 Using where
+1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t1 where a < 0;
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 <= 0;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 pnull,p0 ALL NULL NULL NULL NULL 3 Using where
+1 SIMPLE t1 pnull,p0 ALL NULL NULL NULL NULL 2 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 NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
@@ -112,16 +112,16 @@ select * from t1 where a > 1;
a b
explain partitions select * from t1 where a is null;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 pnull_pnullsp0,pnull_pnullsp1 ALL NULL NULL NULL NULL 6 Using where
+1 SIMPLE t1 pnull_pnullsp0,pnull_pnullsp1 ALL NULL NULL NULL NULL 2 Using where
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_p0sp0,p0_p0sp1,p1_p1sp0,p1_p1sp1 ALL NULL NULL NULL NULL 6 Using where
+1 SIMPLE t1 p0_p0sp0,p0_p0sp1,p1_p1sp0,p1_p1sp1 ALL NULL NULL NULL NULL 4 Using where
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 pnull_pnullsp0,pnull_pnullsp1 ALL NULL NULL NULL NULL 6 Using where
+1 SIMPLE t1 pnull_pnullsp0,pnull_pnullsp1 ALL NULL NULL NULL NULL 2 Using where
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 pnull_pnullsp0,pnull_pnullsp1,p0_p0sp0,p0_p0sp1 ALL NULL NULL NULL NULL 6 Using where
+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 NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
diff --git a/mysql-test/r/plugin.result b/mysql-test/r/plugin.result
index ec9d804d6da..98be0326ef0 100644
--- a/mysql-test/r/plugin.result
+++ b/mysql-test/r/plugin.result
@@ -75,9 +75,9 @@ SET SQL_MODE='IGNORE_BAD_TABLE_OPTIONS';
#illegal value fixed
CREATE TABLE t1 (a int) ENGINE=example ULL=10000000000000000000 one_or_two='ttt' YESNO=SSS;
Warnings:
-Warning 1652 Incorrect value '10000000000000000000' for option 'ULL'
-Warning 1652 Incorrect value 'ttt' for option 'one_or_two'
-Warning 1652 Incorrect value 'SSS' for option 'YESNO'
+Warning 1653 Incorrect value '10000000000000000000' for option 'ULL'
+Warning 1653 Incorrect value 'ttt' for option 'one_or_two'
+Warning 1653 Incorrect value 'SSS' for option 'YESNO'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result
index c802fc0f209..b3f4ad017d3 100644
--- a/mysql-test/r/ps.result
+++ b/mysql-test/r/ps.result
@@ -3001,4 +3001,42 @@ EXECUTE stmt;
1
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
+#
+# Bug#54494 crash with explain extended and prepared statements
+#
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (1),(2);
+PREPARE stmt FROM 'EXPLAIN EXTENDED SELECT 1 FROM t1 RIGHT JOIN t1 t2 ON 1';
+EXECUTE stmt;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00
+Warnings:
+Note 1003 select 1 AS `1` from `test`.`t1` `t2` left join `test`.`t1` on(1) where 1
+EXECUTE stmt;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00
+Warnings:
+Note 1003 select 1 AS `1` from `test`.`t1` `t2` left join `test`.`t1` on(1) where 1
+DEALLOCATE PREPARE stmt;
+DROP TABLE t1;
+#
+# Bug#54488 crash when using explain and prepared statements with subqueries
+#
+CREATE TABLE t1(f1 INT);
+INSERT INTO t1 VALUES (1),(1);
+PREPARE stmt FROM 'EXPLAIN SELECT 1 FROM t1 WHERE (SELECT (SELECT 1 FROM t1 GROUP BY f1))';
+EXECUTE stmt;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 2
+2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
+3 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
+EXECUTE stmt;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 2
+2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
+3 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
+DEALLOCATE PREPARE stmt;
+DROP TABLE t1;
End of 5.1 tests.
diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result
index ea6494962b6..528e66650cd 100644
--- a/mysql-test/r/ps_2myisam.result
+++ b/mysql-test/r/ps_2myisam.result
@@ -1929,26 +1929,26 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 128 30 63
def @arg12 246 83 6 Y 128 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 250 16777215 10 Y 128 31 63
+def @arg14 250 16777215 19 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 8 Y 128 31 63
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
-def @arg20 251 16777216 1 Y 0 31 8
-def @arg21 251 16777216 10 Y 0 31 8
-def @arg22 251 16777216 30 Y 0 31 8
-def @arg23 251 16777216 8 Y 128 31 63
-def @arg24 251 16777216 8 Y 0 31 8
-def @arg25 251 16777216 4 Y 128 31 63
-def @arg26 251 16777216 4 Y 0 31 8
-def @arg27 251 16777216 10 Y 128 31 63
-def @arg28 251 16777216 10 Y 0 31 8
-def @arg29 251 16777216 8 Y 128 31 63
-def @arg30 251 16777216 8 Y 0 31 8
-def @arg31 251 16777216 3 Y 0 31 8
-def @arg32 251 16777216 6 Y 0 31 8
+def @arg20 250 16777215 1 Y 0 31 8
+def @arg21 250 16777215 10 Y 0 31 8
+def @arg22 250 16777215 30 Y 0 31 8
+def @arg23 250 16777215 8 Y 128 31 63
+def @arg24 250 16777215 8 Y 0 31 8
+def @arg25 250 16777215 4 Y 128 31 63
+def @arg26 250 16777215 4 Y 0 31 8
+def @arg27 250 16777215 10 Y 128 31 63
+def @arg28 250 16777215 10 Y 0 31 8
+def @arg29 250 16777215 8 Y 128 31 63
+def @arg30 250 16777215 8 Y 0 31 8
+def @arg31 250 16777215 3 Y 0 31 8
+def @arg32 250 16777215 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
@@ -1976,26 +1976,26 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 128 30 63
def @arg12 246 83 0 Y 128 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 250 16777215 0 Y 128 31 63
+def @arg14 250 16777215 0 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 0 Y 128 31 63
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
-def @arg20 251 16777216 0 Y 0 31 8
-def @arg21 251 16777216 0 Y 0 31 8
-def @arg22 251 16777216 0 Y 0 31 8
-def @arg23 251 16777216 0 Y 128 31 63
-def @arg24 251 16777216 0 Y 0 31 8
-def @arg25 251 16777216 0 Y 128 31 63
-def @arg26 251 16777216 0 Y 0 31 8
-def @arg27 251 16777216 0 Y 128 31 63
-def @arg28 251 16777216 0 Y 0 31 8
-def @arg29 251 16777216 0 Y 128 31 63
-def @arg30 251 16777216 0 Y 0 31 8
-def @arg31 251 16777216 0 Y 0 31 8
-def @arg32 251 16777216 0 Y 0 31 8
+def @arg20 250 16777215 0 Y 0 31 8
+def @arg21 250 16777215 0 Y 0 31 8
+def @arg22 250 16777215 0 Y 0 31 8
+def @arg23 250 16777215 0 Y 128 31 63
+def @arg24 250 16777215 0 Y 0 31 8
+def @arg25 250 16777215 0 Y 128 31 63
+def @arg26 250 16777215 0 Y 0 31 8
+def @arg27 250 16777215 0 Y 128 31 63
+def @arg28 250 16777215 0 Y 0 31 8
+def @arg29 250 16777215 0 Y 128 31 63
+def @arg30 250 16777215 0 Y 0 31 8
+def @arg31 250 16777215 0 Y 0 31 8
+def @arg32 250 16777215 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select
@@ -2026,26 +2026,26 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 128 30 63
def @arg12 246 83 6 Y 128 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 250 16777215 10 Y 128 31 63
+def @arg14 250 16777215 19 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 8 Y 128 31 63
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
-def @arg20 251 16777216 1 Y 0 31 8
-def @arg21 251 16777216 10 Y 0 31 8
-def @arg22 251 16777216 30 Y 0 31 8
-def @arg23 251 16777216 8 Y 128 31 63
-def @arg24 251 16777216 8 Y 0 31 8
-def @arg25 251 16777216 4 Y 128 31 63
-def @arg26 251 16777216 4 Y 0 31 8
-def @arg27 251 16777216 10 Y 128 31 63
-def @arg28 251 16777216 10 Y 0 31 8
-def @arg29 251 16777216 8 Y 128 31 63
-def @arg30 251 16777216 8 Y 0 31 8
-def @arg31 251 16777216 3 Y 0 31 8
-def @arg32 251 16777216 6 Y 0 31 8
+def @arg20 250 16777215 1 Y 0 31 8
+def @arg21 250 16777215 10 Y 0 31 8
+def @arg22 250 16777215 30 Y 0 31 8
+def @arg23 250 16777215 8 Y 128 31 63
+def @arg24 250 16777215 8 Y 0 31 8
+def @arg25 250 16777215 4 Y 128 31 63
+def @arg26 250 16777215 4 Y 0 31 8
+def @arg27 250 16777215 10 Y 128 31 63
+def @arg28 250 16777215 10 Y 0 31 8
+def @arg29 250 16777215 8 Y 128 31 63
+def @arg30 250 16777215 8 Y 0 31 8
+def @arg31 250 16777215 3 Y 0 31 8
+def @arg32 250 16777215 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
set @my_key= 0 ;
@@ -2066,26 +2066,26 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 128 30 63
def @arg12 246 83 0 Y 128 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 250 16777215 0 Y 128 31 63
+def @arg14 250 16777215 0 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 0 Y 128 31 63
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
-def @arg20 251 16777216 0 Y 0 31 8
-def @arg21 251 16777216 0 Y 0 31 8
-def @arg22 251 16777216 0 Y 0 31 8
-def @arg23 251 16777216 0 Y 128 31 63
-def @arg24 251 16777216 0 Y 0 31 8
-def @arg25 251 16777216 0 Y 128 31 63
-def @arg26 251 16777216 0 Y 0 31 8
-def @arg27 251 16777216 0 Y 128 31 63
-def @arg28 251 16777216 0 Y 0 31 8
-def @arg29 251 16777216 0 Y 128 31 63
-def @arg30 251 16777216 0 Y 0 31 8
-def @arg31 251 16777216 0 Y 0 31 8
-def @arg32 251 16777216 0 Y 0 31 8
+def @arg20 250 16777215 0 Y 0 31 8
+def @arg21 250 16777215 0 Y 0 31 8
+def @arg22 250 16777215 0 Y 0 31 8
+def @arg23 250 16777215 0 Y 128 31 63
+def @arg24 250 16777215 0 Y 0 31 8
+def @arg25 250 16777215 0 Y 128 31 63
+def @arg26 250 16777215 0 Y 0 31 8
+def @arg27 250 16777215 0 Y 128 31 63
+def @arg28 250 16777215 0 Y 0 31 8
+def @arg29 250 16777215 0 Y 128 31 63
+def @arg30 250 16777215 0 Y 0 31 8
+def @arg31 250 16777215 0 Y 0 31 8
+def @arg32 250 16777215 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select ? := c1 from t9 where c1= 1" ;
@@ -2114,26 +2114,26 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 128 30 63
def @arg12 246 83 6 Y 128 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 250 16777215 10 Y 128 31 63
+def @arg14 250 16777215 19 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 8 Y 128 31 63
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
-def @arg20 251 16777216 1 Y 0 31 8
-def @arg21 251 16777216 10 Y 0 31 8
-def @arg22 251 16777216 30 Y 0 31 8
-def @arg23 251 16777216 8 Y 128 31 63
-def @arg24 251 16777216 8 Y 0 31 8
-def @arg25 251 16777216 4 Y 128 31 63
-def @arg26 251 16777216 4 Y 0 31 8
-def @arg27 251 16777216 10 Y 128 31 63
-def @arg28 251 16777216 10 Y 0 31 8
-def @arg29 251 16777216 8 Y 128 31 63
-def @arg30 251 16777216 8 Y 0 31 8
-def @arg31 251 16777216 3 Y 0 31 8
-def @arg32 251 16777216 6 Y 0 31 8
+def @arg20 250 16777215 1 Y 0 31 8
+def @arg21 250 16777215 10 Y 0 31 8
+def @arg22 250 16777215 30 Y 0 31 8
+def @arg23 250 16777215 8 Y 128 31 63
+def @arg24 250 16777215 8 Y 0 31 8
+def @arg25 250 16777215 4 Y 128 31 63
+def @arg26 250 16777215 4 Y 0 31 8
+def @arg27 250 16777215 10 Y 128 31 63
+def @arg28 250 16777215 10 Y 0 31 8
+def @arg29 250 16777215 8 Y 128 31 63
+def @arg30 250 16777215 8 Y 0 31 8
+def @arg31 250 16777215 3 Y 0 31 8
+def @arg32 250 16777215 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
@@ -2158,26 +2158,26 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 128 30 63
def @arg12 246 83 0 Y 128 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 250 16777215 0 Y 128 31 63
+def @arg14 250 16777215 0 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 0 Y 128 31 63
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
-def @arg20 251 16777216 0 Y 0 31 8
-def @arg21 251 16777216 0 Y 0 31 8
-def @arg22 251 16777216 0 Y 0 31 8
-def @arg23 251 16777216 0 Y 128 31 63
-def @arg24 251 16777216 0 Y 0 31 8
-def @arg25 251 16777216 0 Y 128 31 63
-def @arg26 251 16777216 0 Y 0 31 8
-def @arg27 251 16777216 0 Y 128 31 63
-def @arg28 251 16777216 0 Y 0 31 8
-def @arg29 251 16777216 0 Y 128 31 63
-def @arg30 251 16777216 0 Y 0 31 8
-def @arg31 251 16777216 0 Y 0 31 8
-def @arg32 251 16777216 0 Y 0 31 8
+def @arg20 250 16777215 0 Y 0 31 8
+def @arg21 250 16777215 0 Y 0 31 8
+def @arg22 250 16777215 0 Y 0 31 8
+def @arg23 250 16777215 0 Y 128 31 63
+def @arg24 250 16777215 0 Y 0 31 8
+def @arg25 250 16777215 0 Y 128 31 63
+def @arg26 250 16777215 0 Y 0 31 8
+def @arg27 250 16777215 0 Y 128 31 63
+def @arg28 250 16777215 0 Y 0 31 8
+def @arg29 250 16777215 0 Y 128 31 63
+def @arg30 250 16777215 0 Y 0 31 8
+def @arg31 250 16777215 0 Y 0 31 8
+def @arg32 250 16777215 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
@@ -2204,26 +2204,26 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 128 30 63
def @arg12 246 83 6 Y 128 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 250 16777215 10 Y 128 31 63
+def @arg14 250 16777215 19 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 8 Y 128 31 63
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
-def @arg20 251 16777216 1 Y 0 31 8
-def @arg21 251 16777216 10 Y 0 31 8
-def @arg22 251 16777216 30 Y 0 31 8
-def @arg23 251 16777216 8 Y 128 31 63
-def @arg24 251 16777216 8 Y 0 31 8
-def @arg25 251 16777216 4 Y 128 31 63
-def @arg26 251 16777216 4 Y 0 31 8
-def @arg27 251 16777216 10 Y 128 31 63
-def @arg28 251 16777216 10 Y 0 31 8
-def @arg29 251 16777216 8 Y 128 31 63
-def @arg30 251 16777216 8 Y 0 31 8
-def @arg31 251 16777216 3 Y 0 31 8
-def @arg32 251 16777216 6 Y 0 31 8
+def @arg20 250 16777215 1 Y 0 31 8
+def @arg21 250 16777215 10 Y 0 31 8
+def @arg22 250 16777215 30 Y 0 31 8
+def @arg23 250 16777215 8 Y 128 31 63
+def @arg24 250 16777215 8 Y 0 31 8
+def @arg25 250 16777215 4 Y 128 31 63
+def @arg26 250 16777215 4 Y 0 31 8
+def @arg27 250 16777215 10 Y 128 31 63
+def @arg28 250 16777215 10 Y 0 31 8
+def @arg29 250 16777215 8 Y 128 31 63
+def @arg30 250 16777215 8 Y 0 31 8
+def @arg31 250 16777215 3 Y 0 31 8
+def @arg32 250 16777215 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
set @my_key= 0 ;
@@ -2242,26 +2242,26 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 128 30 63
def @arg12 246 83 0 Y 128 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 250 16777215 0 Y 128 31 63
+def @arg14 250 16777215 0 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 0 Y 128 31 63
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
-def @arg20 251 16777216 0 Y 0 31 8
-def @arg21 251 16777216 0 Y 0 31 8
-def @arg22 251 16777216 0 Y 0 31 8
-def @arg23 251 16777216 0 Y 128 31 63
-def @arg24 251 16777216 0 Y 0 31 8
-def @arg25 251 16777216 0 Y 128 31 63
-def @arg26 251 16777216 0 Y 0 31 8
-def @arg27 251 16777216 0 Y 128 31 63
-def @arg28 251 16777216 0 Y 0 31 8
-def @arg29 251 16777216 0 Y 128 31 63
-def @arg30 251 16777216 0 Y 0 31 8
-def @arg31 251 16777216 0 Y 0 31 8
-def @arg32 251 16777216 0 Y 0 31 8
+def @arg20 250 16777215 0 Y 0 31 8
+def @arg21 250 16777215 0 Y 0 31 8
+def @arg22 250 16777215 0 Y 0 31 8
+def @arg23 250 16777215 0 Y 128 31 63
+def @arg24 250 16777215 0 Y 0 31 8
+def @arg25 250 16777215 0 Y 128 31 63
+def @arg26 250 16777215 0 Y 0 31 8
+def @arg27 250 16777215 0 Y 128 31 63
+def @arg28 250 16777215 0 Y 0 31 8
+def @arg29 250 16777215 0 Y 128 31 63
+def @arg30 250 16777215 0 Y 0 31 8
+def @arg31 250 16777215 0 Y 0 31 8
+def @arg32 250 16777215 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select c1 into ? from t9 where c1= 1" ;
diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result
index b12728cd76e..9ba5e607b5d 100644
--- a/mysql-test/r/ps_3innodb.result
+++ b/mysql-test/r/ps_3innodb.result
@@ -1912,26 +1912,26 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 128 30 63
def @arg12 246 83 6 Y 128 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 250 16777215 10 Y 128 31 63
+def @arg14 250 16777215 19 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 8 Y 128 31 63
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
-def @arg20 251 16777216 1 Y 0 31 8
-def @arg21 251 16777216 10 Y 0 31 8
-def @arg22 251 16777216 30 Y 0 31 8
-def @arg23 251 16777216 8 Y 128 31 63
-def @arg24 251 16777216 8 Y 0 31 8
-def @arg25 251 16777216 4 Y 128 31 63
-def @arg26 251 16777216 4 Y 0 31 8
-def @arg27 251 16777216 10 Y 128 31 63
-def @arg28 251 16777216 10 Y 0 31 8
-def @arg29 251 16777216 8 Y 128 31 63
-def @arg30 251 16777216 8 Y 0 31 8
-def @arg31 251 16777216 3 Y 0 31 8
-def @arg32 251 16777216 6 Y 0 31 8
+def @arg20 250 16777215 1 Y 0 31 8
+def @arg21 250 16777215 10 Y 0 31 8
+def @arg22 250 16777215 30 Y 0 31 8
+def @arg23 250 16777215 8 Y 128 31 63
+def @arg24 250 16777215 8 Y 0 31 8
+def @arg25 250 16777215 4 Y 128 31 63
+def @arg26 250 16777215 4 Y 0 31 8
+def @arg27 250 16777215 10 Y 128 31 63
+def @arg28 250 16777215 10 Y 0 31 8
+def @arg29 250 16777215 8 Y 128 31 63
+def @arg30 250 16777215 8 Y 0 31 8
+def @arg31 250 16777215 3 Y 0 31 8
+def @arg32 250 16777215 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
@@ -1959,26 +1959,26 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 128 30 63
def @arg12 246 83 0 Y 128 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 250 16777215 0 Y 128 31 63
+def @arg14 250 16777215 0 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 0 Y 128 31 63
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
-def @arg20 251 16777216 0 Y 0 31 8
-def @arg21 251 16777216 0 Y 0 31 8
-def @arg22 251 16777216 0 Y 0 31 8
-def @arg23 251 16777216 0 Y 128 31 63
-def @arg24 251 16777216 0 Y 0 31 8
-def @arg25 251 16777216 0 Y 128 31 63
-def @arg26 251 16777216 0 Y 0 31 8
-def @arg27 251 16777216 0 Y 128 31 63
-def @arg28 251 16777216 0 Y 0 31 8
-def @arg29 251 16777216 0 Y 128 31 63
-def @arg30 251 16777216 0 Y 0 31 8
-def @arg31 251 16777216 0 Y 0 31 8
-def @arg32 251 16777216 0 Y 0 31 8
+def @arg20 250 16777215 0 Y 0 31 8
+def @arg21 250 16777215 0 Y 0 31 8
+def @arg22 250 16777215 0 Y 0 31 8
+def @arg23 250 16777215 0 Y 128 31 63
+def @arg24 250 16777215 0 Y 0 31 8
+def @arg25 250 16777215 0 Y 128 31 63
+def @arg26 250 16777215 0 Y 0 31 8
+def @arg27 250 16777215 0 Y 128 31 63
+def @arg28 250 16777215 0 Y 0 31 8
+def @arg29 250 16777215 0 Y 128 31 63
+def @arg30 250 16777215 0 Y 0 31 8
+def @arg31 250 16777215 0 Y 0 31 8
+def @arg32 250 16777215 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select
@@ -2009,26 +2009,26 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 128 30 63
def @arg12 246 83 6 Y 128 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 250 16777215 10 Y 128 31 63
+def @arg14 250 16777215 19 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 8 Y 128 31 63
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
-def @arg20 251 16777216 1 Y 0 31 8
-def @arg21 251 16777216 10 Y 0 31 8
-def @arg22 251 16777216 30 Y 0 31 8
-def @arg23 251 16777216 8 Y 128 31 63
-def @arg24 251 16777216 8 Y 0 31 8
-def @arg25 251 16777216 4 Y 128 31 63
-def @arg26 251 16777216 4 Y 0 31 8
-def @arg27 251 16777216 10 Y 128 31 63
-def @arg28 251 16777216 10 Y 0 31 8
-def @arg29 251 16777216 8 Y 128 31 63
-def @arg30 251 16777216 8 Y 0 31 8
-def @arg31 251 16777216 3 Y 0 31 8
-def @arg32 251 16777216 6 Y 0 31 8
+def @arg20 250 16777215 1 Y 0 31 8
+def @arg21 250 16777215 10 Y 0 31 8
+def @arg22 250 16777215 30 Y 0 31 8
+def @arg23 250 16777215 8 Y 128 31 63
+def @arg24 250 16777215 8 Y 0 31 8
+def @arg25 250 16777215 4 Y 128 31 63
+def @arg26 250 16777215 4 Y 0 31 8
+def @arg27 250 16777215 10 Y 128 31 63
+def @arg28 250 16777215 10 Y 0 31 8
+def @arg29 250 16777215 8 Y 128 31 63
+def @arg30 250 16777215 8 Y 0 31 8
+def @arg31 250 16777215 3 Y 0 31 8
+def @arg32 250 16777215 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
set @my_key= 0 ;
@@ -2049,26 +2049,26 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 128 30 63
def @arg12 246 83 0 Y 128 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 250 16777215 0 Y 128 31 63
+def @arg14 250 16777215 0 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 0 Y 128 31 63
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
-def @arg20 251 16777216 0 Y 0 31 8
-def @arg21 251 16777216 0 Y 0 31 8
-def @arg22 251 16777216 0 Y 0 31 8
-def @arg23 251 16777216 0 Y 128 31 63
-def @arg24 251 16777216 0 Y 0 31 8
-def @arg25 251 16777216 0 Y 128 31 63
-def @arg26 251 16777216 0 Y 0 31 8
-def @arg27 251 16777216 0 Y 128 31 63
-def @arg28 251 16777216 0 Y 0 31 8
-def @arg29 251 16777216 0 Y 128 31 63
-def @arg30 251 16777216 0 Y 0 31 8
-def @arg31 251 16777216 0 Y 0 31 8
-def @arg32 251 16777216 0 Y 0 31 8
+def @arg20 250 16777215 0 Y 0 31 8
+def @arg21 250 16777215 0 Y 0 31 8
+def @arg22 250 16777215 0 Y 0 31 8
+def @arg23 250 16777215 0 Y 128 31 63
+def @arg24 250 16777215 0 Y 0 31 8
+def @arg25 250 16777215 0 Y 128 31 63
+def @arg26 250 16777215 0 Y 0 31 8
+def @arg27 250 16777215 0 Y 128 31 63
+def @arg28 250 16777215 0 Y 0 31 8
+def @arg29 250 16777215 0 Y 128 31 63
+def @arg30 250 16777215 0 Y 0 31 8
+def @arg31 250 16777215 0 Y 0 31 8
+def @arg32 250 16777215 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select ? := c1 from t9 where c1= 1" ;
@@ -2097,26 +2097,26 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 128 30 63
def @arg12 246 83 6 Y 128 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 250 16777215 10 Y 128 31 63
+def @arg14 250 16777215 19 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 8 Y 128 31 63
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
-def @arg20 251 16777216 1 Y 0 31 8
-def @arg21 251 16777216 10 Y 0 31 8
-def @arg22 251 16777216 30 Y 0 31 8
-def @arg23 251 16777216 8 Y 128 31 63
-def @arg24 251 16777216 8 Y 0 31 8
-def @arg25 251 16777216 4 Y 128 31 63
-def @arg26 251 16777216 4 Y 0 31 8
-def @arg27 251 16777216 10 Y 128 31 63
-def @arg28 251 16777216 10 Y 0 31 8
-def @arg29 251 16777216 8 Y 128 31 63
-def @arg30 251 16777216 8 Y 0 31 8
-def @arg31 251 16777216 3 Y 0 31 8
-def @arg32 251 16777216 6 Y 0 31 8
+def @arg20 250 16777215 1 Y 0 31 8
+def @arg21 250 16777215 10 Y 0 31 8
+def @arg22 250 16777215 30 Y 0 31 8
+def @arg23 250 16777215 8 Y 128 31 63
+def @arg24 250 16777215 8 Y 0 31 8
+def @arg25 250 16777215 4 Y 128 31 63
+def @arg26 250 16777215 4 Y 0 31 8
+def @arg27 250 16777215 10 Y 128 31 63
+def @arg28 250 16777215 10 Y 0 31 8
+def @arg29 250 16777215 8 Y 128 31 63
+def @arg30 250 16777215 8 Y 0 31 8
+def @arg31 250 16777215 3 Y 0 31 8
+def @arg32 250 16777215 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
@@ -2141,26 +2141,26 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 128 30 63
def @arg12 246 83 0 Y 128 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 250 16777215 0 Y 128 31 63
+def @arg14 250 16777215 0 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 0 Y 128 31 63
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
-def @arg20 251 16777216 0 Y 0 31 8
-def @arg21 251 16777216 0 Y 0 31 8
-def @arg22 251 16777216 0 Y 0 31 8
-def @arg23 251 16777216 0 Y 128 31 63
-def @arg24 251 16777216 0 Y 0 31 8
-def @arg25 251 16777216 0 Y 128 31 63
-def @arg26 251 16777216 0 Y 0 31 8
-def @arg27 251 16777216 0 Y 128 31 63
-def @arg28 251 16777216 0 Y 0 31 8
-def @arg29 251 16777216 0 Y 128 31 63
-def @arg30 251 16777216 0 Y 0 31 8
-def @arg31 251 16777216 0 Y 0 31 8
-def @arg32 251 16777216 0 Y 0 31 8
+def @arg20 250 16777215 0 Y 0 31 8
+def @arg21 250 16777215 0 Y 0 31 8
+def @arg22 250 16777215 0 Y 0 31 8
+def @arg23 250 16777215 0 Y 128 31 63
+def @arg24 250 16777215 0 Y 0 31 8
+def @arg25 250 16777215 0 Y 128 31 63
+def @arg26 250 16777215 0 Y 0 31 8
+def @arg27 250 16777215 0 Y 128 31 63
+def @arg28 250 16777215 0 Y 0 31 8
+def @arg29 250 16777215 0 Y 128 31 63
+def @arg30 250 16777215 0 Y 0 31 8
+def @arg31 250 16777215 0 Y 0 31 8
+def @arg32 250 16777215 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
@@ -2187,26 +2187,26 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 128 30 63
def @arg12 246 83 6 Y 128 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 250 16777215 10 Y 128 31 63
+def @arg14 250 16777215 19 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 8 Y 128 31 63
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
-def @arg20 251 16777216 1 Y 0 31 8
-def @arg21 251 16777216 10 Y 0 31 8
-def @arg22 251 16777216 30 Y 0 31 8
-def @arg23 251 16777216 8 Y 128 31 63
-def @arg24 251 16777216 8 Y 0 31 8
-def @arg25 251 16777216 4 Y 128 31 63
-def @arg26 251 16777216 4 Y 0 31 8
-def @arg27 251 16777216 10 Y 128 31 63
-def @arg28 251 16777216 10 Y 0 31 8
-def @arg29 251 16777216 8 Y 128 31 63
-def @arg30 251 16777216 8 Y 0 31 8
-def @arg31 251 16777216 3 Y 0 31 8
-def @arg32 251 16777216 6 Y 0 31 8
+def @arg20 250 16777215 1 Y 0 31 8
+def @arg21 250 16777215 10 Y 0 31 8
+def @arg22 250 16777215 30 Y 0 31 8
+def @arg23 250 16777215 8 Y 128 31 63
+def @arg24 250 16777215 8 Y 0 31 8
+def @arg25 250 16777215 4 Y 128 31 63
+def @arg26 250 16777215 4 Y 0 31 8
+def @arg27 250 16777215 10 Y 128 31 63
+def @arg28 250 16777215 10 Y 0 31 8
+def @arg29 250 16777215 8 Y 128 31 63
+def @arg30 250 16777215 8 Y 0 31 8
+def @arg31 250 16777215 3 Y 0 31 8
+def @arg32 250 16777215 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
set @my_key= 0 ;
@@ -2225,26 +2225,26 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 128 30 63
def @arg12 246 83 0 Y 128 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 250 16777215 0 Y 128 31 63
+def @arg14 250 16777215 0 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 0 Y 128 31 63
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
-def @arg20 251 16777216 0 Y 0 31 8
-def @arg21 251 16777216 0 Y 0 31 8
-def @arg22 251 16777216 0 Y 0 31 8
-def @arg23 251 16777216 0 Y 128 31 63
-def @arg24 251 16777216 0 Y 0 31 8
-def @arg25 251 16777216 0 Y 128 31 63
-def @arg26 251 16777216 0 Y 0 31 8
-def @arg27 251 16777216 0 Y 128 31 63
-def @arg28 251 16777216 0 Y 0 31 8
-def @arg29 251 16777216 0 Y 128 31 63
-def @arg30 251 16777216 0 Y 0 31 8
-def @arg31 251 16777216 0 Y 0 31 8
-def @arg32 251 16777216 0 Y 0 31 8
+def @arg20 250 16777215 0 Y 0 31 8
+def @arg21 250 16777215 0 Y 0 31 8
+def @arg22 250 16777215 0 Y 0 31 8
+def @arg23 250 16777215 0 Y 128 31 63
+def @arg24 250 16777215 0 Y 0 31 8
+def @arg25 250 16777215 0 Y 128 31 63
+def @arg26 250 16777215 0 Y 0 31 8
+def @arg27 250 16777215 0 Y 128 31 63
+def @arg28 250 16777215 0 Y 0 31 8
+def @arg29 250 16777215 0 Y 128 31 63
+def @arg30 250 16777215 0 Y 0 31 8
+def @arg31 250 16777215 0 Y 0 31 8
+def @arg32 250 16777215 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select c1 into ? from t9 where c1= 1" ;
diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result
index e9d19aa92e4..e7252473c49 100644
--- a/mysql-test/r/ps_4heap.result
+++ b/mysql-test/r/ps_4heap.result
@@ -1913,26 +1913,26 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 128 30 63
def @arg12 246 83 6 Y 128 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 250 16777215 10 Y 128 31 63
+def @arg14 250 16777215 19 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 8 Y 128 31 63
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
-def @arg20 251 16777216 1 Y 0 31 8
-def @arg21 251 16777216 10 Y 0 31 8
-def @arg22 251 16777216 30 Y 0 31 8
-def @arg23 251 16777216 8 Y 0 31 8
-def @arg24 251 16777216 8 Y 0 31 8
-def @arg25 251 16777216 4 Y 0 31 8
-def @arg26 251 16777216 4 Y 0 31 8
-def @arg27 251 16777216 10 Y 0 31 8
-def @arg28 251 16777216 10 Y 0 31 8
-def @arg29 251 16777216 8 Y 0 31 8
-def @arg30 251 16777216 8 Y 0 31 8
-def @arg31 251 16777216 3 Y 0 31 8
-def @arg32 251 16777216 6 Y 0 31 8
+def @arg20 250 16777215 1 Y 0 31 8
+def @arg21 250 16777215 10 Y 0 31 8
+def @arg22 250 16777215 30 Y 0 31 8
+def @arg23 250 16777215 8 Y 0 31 8
+def @arg24 250 16777215 8 Y 0 31 8
+def @arg25 250 16777215 4 Y 0 31 8
+def @arg26 250 16777215 4 Y 0 31 8
+def @arg27 250 16777215 10 Y 0 31 8
+def @arg28 250 16777215 10 Y 0 31 8
+def @arg29 250 16777215 8 Y 0 31 8
+def @arg30 250 16777215 8 Y 0 31 8
+def @arg31 250 16777215 3 Y 0 31 8
+def @arg32 250 16777215 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
@@ -1960,26 +1960,26 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 128 30 63
def @arg12 246 83 0 Y 128 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 250 16777215 0 Y 128 31 63
+def @arg14 250 16777215 0 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 0 Y 128 31 63
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
-def @arg20 251 16777216 0 Y 0 31 8
-def @arg21 251 16777216 0 Y 0 31 8
-def @arg22 251 16777216 0 Y 0 31 8
-def @arg23 251 16777216 0 Y 0 31 8
-def @arg24 251 16777216 0 Y 0 31 8
-def @arg25 251 16777216 0 Y 0 31 8
-def @arg26 251 16777216 0 Y 0 31 8
-def @arg27 251 16777216 0 Y 0 31 8
-def @arg28 251 16777216 0 Y 0 31 8
-def @arg29 251 16777216 0 Y 0 31 8
-def @arg30 251 16777216 0 Y 0 31 8
-def @arg31 251 16777216 0 Y 0 31 8
-def @arg32 251 16777216 0 Y 0 31 8
+def @arg20 250 16777215 0 Y 0 31 8
+def @arg21 250 16777215 0 Y 0 31 8
+def @arg22 250 16777215 0 Y 0 31 8
+def @arg23 250 16777215 0 Y 0 31 8
+def @arg24 250 16777215 0 Y 0 31 8
+def @arg25 250 16777215 0 Y 0 31 8
+def @arg26 250 16777215 0 Y 0 31 8
+def @arg27 250 16777215 0 Y 0 31 8
+def @arg28 250 16777215 0 Y 0 31 8
+def @arg29 250 16777215 0 Y 0 31 8
+def @arg30 250 16777215 0 Y 0 31 8
+def @arg31 250 16777215 0 Y 0 31 8
+def @arg32 250 16777215 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select
@@ -2010,26 +2010,26 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 128 30 63
def @arg12 246 83 6 Y 128 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 250 16777215 10 Y 128 31 63
+def @arg14 250 16777215 19 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 8 Y 128 31 63
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
-def @arg20 251 16777216 1 Y 0 31 8
-def @arg21 251 16777216 10 Y 0 31 8
-def @arg22 251 16777216 30 Y 0 31 8
-def @arg23 251 16777216 8 Y 0 31 8
-def @arg24 251 16777216 8 Y 0 31 8
-def @arg25 251 16777216 4 Y 0 31 8
-def @arg26 251 16777216 4 Y 0 31 8
-def @arg27 251 16777216 10 Y 0 31 8
-def @arg28 251 16777216 10 Y 0 31 8
-def @arg29 251 16777216 8 Y 0 31 8
-def @arg30 251 16777216 8 Y 0 31 8
-def @arg31 251 16777216 3 Y 0 31 8
-def @arg32 251 16777216 6 Y 0 31 8
+def @arg20 250 16777215 1 Y 0 31 8
+def @arg21 250 16777215 10 Y 0 31 8
+def @arg22 250 16777215 30 Y 0 31 8
+def @arg23 250 16777215 8 Y 0 31 8
+def @arg24 250 16777215 8 Y 0 31 8
+def @arg25 250 16777215 4 Y 0 31 8
+def @arg26 250 16777215 4 Y 0 31 8
+def @arg27 250 16777215 10 Y 0 31 8
+def @arg28 250 16777215 10 Y 0 31 8
+def @arg29 250 16777215 8 Y 0 31 8
+def @arg30 250 16777215 8 Y 0 31 8
+def @arg31 250 16777215 3 Y 0 31 8
+def @arg32 250 16777215 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
set @my_key= 0 ;
@@ -2050,26 +2050,26 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 128 30 63
def @arg12 246 83 0 Y 128 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 250 16777215 0 Y 128 31 63
+def @arg14 250 16777215 0 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 0 Y 128 31 63
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
-def @arg20 251 16777216 0 Y 0 31 8
-def @arg21 251 16777216 0 Y 0 31 8
-def @arg22 251 16777216 0 Y 0 31 8
-def @arg23 251 16777216 0 Y 0 31 8
-def @arg24 251 16777216 0 Y 0 31 8
-def @arg25 251 16777216 0 Y 0 31 8
-def @arg26 251 16777216 0 Y 0 31 8
-def @arg27 251 16777216 0 Y 0 31 8
-def @arg28 251 16777216 0 Y 0 31 8
-def @arg29 251 16777216 0 Y 0 31 8
-def @arg30 251 16777216 0 Y 0 31 8
-def @arg31 251 16777216 0 Y 0 31 8
-def @arg32 251 16777216 0 Y 0 31 8
+def @arg20 250 16777215 0 Y 0 31 8
+def @arg21 250 16777215 0 Y 0 31 8
+def @arg22 250 16777215 0 Y 0 31 8
+def @arg23 250 16777215 0 Y 0 31 8
+def @arg24 250 16777215 0 Y 0 31 8
+def @arg25 250 16777215 0 Y 0 31 8
+def @arg26 250 16777215 0 Y 0 31 8
+def @arg27 250 16777215 0 Y 0 31 8
+def @arg28 250 16777215 0 Y 0 31 8
+def @arg29 250 16777215 0 Y 0 31 8
+def @arg30 250 16777215 0 Y 0 31 8
+def @arg31 250 16777215 0 Y 0 31 8
+def @arg32 250 16777215 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select ? := c1 from t9 where c1= 1" ;
@@ -2098,26 +2098,26 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 128 30 63
def @arg12 246 83 6 Y 128 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 250 16777215 10 Y 128 31 63
+def @arg14 250 16777215 19 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 8 Y 128 31 63
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
-def @arg20 251 16777216 1 Y 0 31 8
-def @arg21 251 16777216 10 Y 0 31 8
-def @arg22 251 16777216 30 Y 0 31 8
-def @arg23 251 16777216 8 Y 0 31 8
-def @arg24 251 16777216 8 Y 0 31 8
-def @arg25 251 16777216 4 Y 0 31 8
-def @arg26 251 16777216 4 Y 0 31 8
-def @arg27 251 16777216 10 Y 0 31 8
-def @arg28 251 16777216 10 Y 0 31 8
-def @arg29 251 16777216 8 Y 0 31 8
-def @arg30 251 16777216 8 Y 0 31 8
-def @arg31 251 16777216 3 Y 0 31 8
-def @arg32 251 16777216 6 Y 0 31 8
+def @arg20 250 16777215 1 Y 0 31 8
+def @arg21 250 16777215 10 Y 0 31 8
+def @arg22 250 16777215 30 Y 0 31 8
+def @arg23 250 16777215 8 Y 0 31 8
+def @arg24 250 16777215 8 Y 0 31 8
+def @arg25 250 16777215 4 Y 0 31 8
+def @arg26 250 16777215 4 Y 0 31 8
+def @arg27 250 16777215 10 Y 0 31 8
+def @arg28 250 16777215 10 Y 0 31 8
+def @arg29 250 16777215 8 Y 0 31 8
+def @arg30 250 16777215 8 Y 0 31 8
+def @arg31 250 16777215 3 Y 0 31 8
+def @arg32 250 16777215 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
@@ -2142,26 +2142,26 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 128 30 63
def @arg12 246 83 0 Y 128 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 250 16777215 0 Y 128 31 63
+def @arg14 250 16777215 0 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 0 Y 128 31 63
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
-def @arg20 251 16777216 0 Y 0 31 8
-def @arg21 251 16777216 0 Y 0 31 8
-def @arg22 251 16777216 0 Y 0 31 8
-def @arg23 251 16777216 0 Y 0 31 8
-def @arg24 251 16777216 0 Y 0 31 8
-def @arg25 251 16777216 0 Y 0 31 8
-def @arg26 251 16777216 0 Y 0 31 8
-def @arg27 251 16777216 0 Y 0 31 8
-def @arg28 251 16777216 0 Y 0 31 8
-def @arg29 251 16777216 0 Y 0 31 8
-def @arg30 251 16777216 0 Y 0 31 8
-def @arg31 251 16777216 0 Y 0 31 8
-def @arg32 251 16777216 0 Y 0 31 8
+def @arg20 250 16777215 0 Y 0 31 8
+def @arg21 250 16777215 0 Y 0 31 8
+def @arg22 250 16777215 0 Y 0 31 8
+def @arg23 250 16777215 0 Y 0 31 8
+def @arg24 250 16777215 0 Y 0 31 8
+def @arg25 250 16777215 0 Y 0 31 8
+def @arg26 250 16777215 0 Y 0 31 8
+def @arg27 250 16777215 0 Y 0 31 8
+def @arg28 250 16777215 0 Y 0 31 8
+def @arg29 250 16777215 0 Y 0 31 8
+def @arg30 250 16777215 0 Y 0 31 8
+def @arg31 250 16777215 0 Y 0 31 8
+def @arg32 250 16777215 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
@@ -2188,26 +2188,26 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 128 30 63
def @arg12 246 83 6 Y 128 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 250 16777215 10 Y 128 31 63
+def @arg14 250 16777215 19 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 8 Y 128 31 63
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
-def @arg20 251 16777216 1 Y 0 31 8
-def @arg21 251 16777216 10 Y 0 31 8
-def @arg22 251 16777216 30 Y 0 31 8
-def @arg23 251 16777216 8 Y 0 31 8
-def @arg24 251 16777216 8 Y 0 31 8
-def @arg25 251 16777216 4 Y 0 31 8
-def @arg26 251 16777216 4 Y 0 31 8
-def @arg27 251 16777216 10 Y 0 31 8
-def @arg28 251 16777216 10 Y 0 31 8
-def @arg29 251 16777216 8 Y 0 31 8
-def @arg30 251 16777216 8 Y 0 31 8
-def @arg31 251 16777216 3 Y 0 31 8
-def @arg32 251 16777216 6 Y 0 31 8
+def @arg20 250 16777215 1 Y 0 31 8
+def @arg21 250 16777215 10 Y 0 31 8
+def @arg22 250 16777215 30 Y 0 31 8
+def @arg23 250 16777215 8 Y 0 31 8
+def @arg24 250 16777215 8 Y 0 31 8
+def @arg25 250 16777215 4 Y 0 31 8
+def @arg26 250 16777215 4 Y 0 31 8
+def @arg27 250 16777215 10 Y 0 31 8
+def @arg28 250 16777215 10 Y 0 31 8
+def @arg29 250 16777215 8 Y 0 31 8
+def @arg30 250 16777215 8 Y 0 31 8
+def @arg31 250 16777215 3 Y 0 31 8
+def @arg32 250 16777215 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
set @my_key= 0 ;
@@ -2226,26 +2226,26 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 128 30 63
def @arg12 246 83 0 Y 128 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 250 16777215 0 Y 128 31 63
+def @arg14 250 16777215 0 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 0 Y 128 31 63
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
-def @arg20 251 16777216 0 Y 0 31 8
-def @arg21 251 16777216 0 Y 0 31 8
-def @arg22 251 16777216 0 Y 0 31 8
-def @arg23 251 16777216 0 Y 0 31 8
-def @arg24 251 16777216 0 Y 0 31 8
-def @arg25 251 16777216 0 Y 0 31 8
-def @arg26 251 16777216 0 Y 0 31 8
-def @arg27 251 16777216 0 Y 0 31 8
-def @arg28 251 16777216 0 Y 0 31 8
-def @arg29 251 16777216 0 Y 0 31 8
-def @arg30 251 16777216 0 Y 0 31 8
-def @arg31 251 16777216 0 Y 0 31 8
-def @arg32 251 16777216 0 Y 0 31 8
+def @arg20 250 16777215 0 Y 0 31 8
+def @arg21 250 16777215 0 Y 0 31 8
+def @arg22 250 16777215 0 Y 0 31 8
+def @arg23 250 16777215 0 Y 0 31 8
+def @arg24 250 16777215 0 Y 0 31 8
+def @arg25 250 16777215 0 Y 0 31 8
+def @arg26 250 16777215 0 Y 0 31 8
+def @arg27 250 16777215 0 Y 0 31 8
+def @arg28 250 16777215 0 Y 0 31 8
+def @arg29 250 16777215 0 Y 0 31 8
+def @arg30 250 16777215 0 Y 0 31 8
+def @arg31 250 16777215 0 Y 0 31 8
+def @arg32 250 16777215 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select c1 into ? from t9 where c1= 1" ;
diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result
index 31ca26cffa3..7530b3ebe0b 100644
--- a/mysql-test/r/ps_5merge.result
+++ b/mysql-test/r/ps_5merge.result
@@ -1849,26 +1849,26 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 128 30 63
def @arg12 246 83 6 Y 128 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 250 16777215 10 Y 128 31 63
+def @arg14 250 16777215 19 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 8 Y 128 31 63
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
-def @arg20 251 16777216 1 Y 0 31 8
-def @arg21 251 16777216 10 Y 0 31 8
-def @arg22 251 16777216 30 Y 0 31 8
-def @arg23 251 16777216 8 Y 128 31 63
-def @arg24 251 16777216 8 Y 0 31 8
-def @arg25 251 16777216 4 Y 128 31 63
-def @arg26 251 16777216 4 Y 0 31 8
-def @arg27 251 16777216 10 Y 128 31 63
-def @arg28 251 16777216 10 Y 0 31 8
-def @arg29 251 16777216 8 Y 128 31 63
-def @arg30 251 16777216 8 Y 0 31 8
-def @arg31 251 16777216 3 Y 0 31 8
-def @arg32 251 16777216 6 Y 0 31 8
+def @arg20 250 16777215 1 Y 0 31 8
+def @arg21 250 16777215 10 Y 0 31 8
+def @arg22 250 16777215 30 Y 0 31 8
+def @arg23 250 16777215 8 Y 128 31 63
+def @arg24 250 16777215 8 Y 0 31 8
+def @arg25 250 16777215 4 Y 128 31 63
+def @arg26 250 16777215 4 Y 0 31 8
+def @arg27 250 16777215 10 Y 128 31 63
+def @arg28 250 16777215 10 Y 0 31 8
+def @arg29 250 16777215 8 Y 128 31 63
+def @arg30 250 16777215 8 Y 0 31 8
+def @arg31 250 16777215 3 Y 0 31 8
+def @arg32 250 16777215 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
@@ -1896,26 +1896,26 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 128 30 63
def @arg12 246 83 0 Y 128 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 250 16777215 0 Y 128 31 63
+def @arg14 250 16777215 0 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 0 Y 128 31 63
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
-def @arg20 251 16777216 0 Y 0 31 8
-def @arg21 251 16777216 0 Y 0 31 8
-def @arg22 251 16777216 0 Y 0 31 8
-def @arg23 251 16777216 0 Y 128 31 63
-def @arg24 251 16777216 0 Y 0 31 8
-def @arg25 251 16777216 0 Y 128 31 63
-def @arg26 251 16777216 0 Y 0 31 8
-def @arg27 251 16777216 0 Y 128 31 63
-def @arg28 251 16777216 0 Y 0 31 8
-def @arg29 251 16777216 0 Y 128 31 63
-def @arg30 251 16777216 0 Y 0 31 8
-def @arg31 251 16777216 0 Y 0 31 8
-def @arg32 251 16777216 0 Y 0 31 8
+def @arg20 250 16777215 0 Y 0 31 8
+def @arg21 250 16777215 0 Y 0 31 8
+def @arg22 250 16777215 0 Y 0 31 8
+def @arg23 250 16777215 0 Y 128 31 63
+def @arg24 250 16777215 0 Y 0 31 8
+def @arg25 250 16777215 0 Y 128 31 63
+def @arg26 250 16777215 0 Y 0 31 8
+def @arg27 250 16777215 0 Y 128 31 63
+def @arg28 250 16777215 0 Y 0 31 8
+def @arg29 250 16777215 0 Y 128 31 63
+def @arg30 250 16777215 0 Y 0 31 8
+def @arg31 250 16777215 0 Y 0 31 8
+def @arg32 250 16777215 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select
@@ -1946,26 +1946,26 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 128 30 63
def @arg12 246 83 6 Y 128 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 250 16777215 10 Y 128 31 63
+def @arg14 250 16777215 19 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 8 Y 128 31 63
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
-def @arg20 251 16777216 1 Y 0 31 8
-def @arg21 251 16777216 10 Y 0 31 8
-def @arg22 251 16777216 30 Y 0 31 8
-def @arg23 251 16777216 8 Y 128 31 63
-def @arg24 251 16777216 8 Y 0 31 8
-def @arg25 251 16777216 4 Y 128 31 63
-def @arg26 251 16777216 4 Y 0 31 8
-def @arg27 251 16777216 10 Y 128 31 63
-def @arg28 251 16777216 10 Y 0 31 8
-def @arg29 251 16777216 8 Y 128 31 63
-def @arg30 251 16777216 8 Y 0 31 8
-def @arg31 251 16777216 3 Y 0 31 8
-def @arg32 251 16777216 6 Y 0 31 8
+def @arg20 250 16777215 1 Y 0 31 8
+def @arg21 250 16777215 10 Y 0 31 8
+def @arg22 250 16777215 30 Y 0 31 8
+def @arg23 250 16777215 8 Y 128 31 63
+def @arg24 250 16777215 8 Y 0 31 8
+def @arg25 250 16777215 4 Y 128 31 63
+def @arg26 250 16777215 4 Y 0 31 8
+def @arg27 250 16777215 10 Y 128 31 63
+def @arg28 250 16777215 10 Y 0 31 8
+def @arg29 250 16777215 8 Y 128 31 63
+def @arg30 250 16777215 8 Y 0 31 8
+def @arg31 250 16777215 3 Y 0 31 8
+def @arg32 250 16777215 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
set @my_key= 0 ;
@@ -1986,26 +1986,26 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 128 30 63
def @arg12 246 83 0 Y 128 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 250 16777215 0 Y 128 31 63
+def @arg14 250 16777215 0 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 0 Y 128 31 63
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
-def @arg20 251 16777216 0 Y 0 31 8
-def @arg21 251 16777216 0 Y 0 31 8
-def @arg22 251 16777216 0 Y 0 31 8
-def @arg23 251 16777216 0 Y 128 31 63
-def @arg24 251 16777216 0 Y 0 31 8
-def @arg25 251 16777216 0 Y 128 31 63
-def @arg26 251 16777216 0 Y 0 31 8
-def @arg27 251 16777216 0 Y 128 31 63
-def @arg28 251 16777216 0 Y 0 31 8
-def @arg29 251 16777216 0 Y 128 31 63
-def @arg30 251 16777216 0 Y 0 31 8
-def @arg31 251 16777216 0 Y 0 31 8
-def @arg32 251 16777216 0 Y 0 31 8
+def @arg20 250 16777215 0 Y 0 31 8
+def @arg21 250 16777215 0 Y 0 31 8
+def @arg22 250 16777215 0 Y 0 31 8
+def @arg23 250 16777215 0 Y 128 31 63
+def @arg24 250 16777215 0 Y 0 31 8
+def @arg25 250 16777215 0 Y 128 31 63
+def @arg26 250 16777215 0 Y 0 31 8
+def @arg27 250 16777215 0 Y 128 31 63
+def @arg28 250 16777215 0 Y 0 31 8
+def @arg29 250 16777215 0 Y 128 31 63
+def @arg30 250 16777215 0 Y 0 31 8
+def @arg31 250 16777215 0 Y 0 31 8
+def @arg32 250 16777215 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select ? := c1 from t9 where c1= 1" ;
@@ -2034,26 +2034,26 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 128 30 63
def @arg12 246 83 6 Y 128 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 250 16777215 10 Y 128 31 63
+def @arg14 250 16777215 19 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 8 Y 128 31 63
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
-def @arg20 251 16777216 1 Y 0 31 8
-def @arg21 251 16777216 10 Y 0 31 8
-def @arg22 251 16777216 30 Y 0 31 8
-def @arg23 251 16777216 8 Y 128 31 63
-def @arg24 251 16777216 8 Y 0 31 8
-def @arg25 251 16777216 4 Y 128 31 63
-def @arg26 251 16777216 4 Y 0 31 8
-def @arg27 251 16777216 10 Y 128 31 63
-def @arg28 251 16777216 10 Y 0 31 8
-def @arg29 251 16777216 8 Y 128 31 63
-def @arg30 251 16777216 8 Y 0 31 8
-def @arg31 251 16777216 3 Y 0 31 8
-def @arg32 251 16777216 6 Y 0 31 8
+def @arg20 250 16777215 1 Y 0 31 8
+def @arg21 250 16777215 10 Y 0 31 8
+def @arg22 250 16777215 30 Y 0 31 8
+def @arg23 250 16777215 8 Y 128 31 63
+def @arg24 250 16777215 8 Y 0 31 8
+def @arg25 250 16777215 4 Y 128 31 63
+def @arg26 250 16777215 4 Y 0 31 8
+def @arg27 250 16777215 10 Y 128 31 63
+def @arg28 250 16777215 10 Y 0 31 8
+def @arg29 250 16777215 8 Y 128 31 63
+def @arg30 250 16777215 8 Y 0 31 8
+def @arg31 250 16777215 3 Y 0 31 8
+def @arg32 250 16777215 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
@@ -2078,26 +2078,26 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 128 30 63
def @arg12 246 83 0 Y 128 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 250 16777215 0 Y 128 31 63
+def @arg14 250 16777215 0 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 0 Y 128 31 63
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
-def @arg20 251 16777216 0 Y 0 31 8
-def @arg21 251 16777216 0 Y 0 31 8
-def @arg22 251 16777216 0 Y 0 31 8
-def @arg23 251 16777216 0 Y 128 31 63
-def @arg24 251 16777216 0 Y 0 31 8
-def @arg25 251 16777216 0 Y 128 31 63
-def @arg26 251 16777216 0 Y 0 31 8
-def @arg27 251 16777216 0 Y 128 31 63
-def @arg28 251 16777216 0 Y 0 31 8
-def @arg29 251 16777216 0 Y 128 31 63
-def @arg30 251 16777216 0 Y 0 31 8
-def @arg31 251 16777216 0 Y 0 31 8
-def @arg32 251 16777216 0 Y 0 31 8
+def @arg20 250 16777215 0 Y 0 31 8
+def @arg21 250 16777215 0 Y 0 31 8
+def @arg22 250 16777215 0 Y 0 31 8
+def @arg23 250 16777215 0 Y 128 31 63
+def @arg24 250 16777215 0 Y 0 31 8
+def @arg25 250 16777215 0 Y 128 31 63
+def @arg26 250 16777215 0 Y 0 31 8
+def @arg27 250 16777215 0 Y 128 31 63
+def @arg28 250 16777215 0 Y 0 31 8
+def @arg29 250 16777215 0 Y 128 31 63
+def @arg30 250 16777215 0 Y 0 31 8
+def @arg31 250 16777215 0 Y 0 31 8
+def @arg32 250 16777215 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
@@ -2124,26 +2124,26 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 128 30 63
def @arg12 246 83 6 Y 128 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 250 16777215 10 Y 128 31 63
+def @arg14 250 16777215 19 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 8 Y 128 31 63
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
-def @arg20 251 16777216 1 Y 0 31 8
-def @arg21 251 16777216 10 Y 0 31 8
-def @arg22 251 16777216 30 Y 0 31 8
-def @arg23 251 16777216 8 Y 128 31 63
-def @arg24 251 16777216 8 Y 0 31 8
-def @arg25 251 16777216 4 Y 128 31 63
-def @arg26 251 16777216 4 Y 0 31 8
-def @arg27 251 16777216 10 Y 128 31 63
-def @arg28 251 16777216 10 Y 0 31 8
-def @arg29 251 16777216 8 Y 128 31 63
-def @arg30 251 16777216 8 Y 0 31 8
-def @arg31 251 16777216 3 Y 0 31 8
-def @arg32 251 16777216 6 Y 0 31 8
+def @arg20 250 16777215 1 Y 0 31 8
+def @arg21 250 16777215 10 Y 0 31 8
+def @arg22 250 16777215 30 Y 0 31 8
+def @arg23 250 16777215 8 Y 128 31 63
+def @arg24 250 16777215 8 Y 0 31 8
+def @arg25 250 16777215 4 Y 128 31 63
+def @arg26 250 16777215 4 Y 0 31 8
+def @arg27 250 16777215 10 Y 128 31 63
+def @arg28 250 16777215 10 Y 0 31 8
+def @arg29 250 16777215 8 Y 128 31 63
+def @arg30 250 16777215 8 Y 0 31 8
+def @arg31 250 16777215 3 Y 0 31 8
+def @arg32 250 16777215 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
set @my_key= 0 ;
@@ -2162,26 +2162,26 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 128 30 63
def @arg12 246 83 0 Y 128 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 250 16777215 0 Y 128 31 63
+def @arg14 250 16777215 0 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 0 Y 128 31 63
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
-def @arg20 251 16777216 0 Y 0 31 8
-def @arg21 251 16777216 0 Y 0 31 8
-def @arg22 251 16777216 0 Y 0 31 8
-def @arg23 251 16777216 0 Y 128 31 63
-def @arg24 251 16777216 0 Y 0 31 8
-def @arg25 251 16777216 0 Y 128 31 63
-def @arg26 251 16777216 0 Y 0 31 8
-def @arg27 251 16777216 0 Y 128 31 63
-def @arg28 251 16777216 0 Y 0 31 8
-def @arg29 251 16777216 0 Y 128 31 63
-def @arg30 251 16777216 0 Y 0 31 8
-def @arg31 251 16777216 0 Y 0 31 8
-def @arg32 251 16777216 0 Y 0 31 8
+def @arg20 250 16777215 0 Y 0 31 8
+def @arg21 250 16777215 0 Y 0 31 8
+def @arg22 250 16777215 0 Y 0 31 8
+def @arg23 250 16777215 0 Y 128 31 63
+def @arg24 250 16777215 0 Y 0 31 8
+def @arg25 250 16777215 0 Y 128 31 63
+def @arg26 250 16777215 0 Y 0 31 8
+def @arg27 250 16777215 0 Y 128 31 63
+def @arg28 250 16777215 0 Y 0 31 8
+def @arg29 250 16777215 0 Y 128 31 63
+def @arg30 250 16777215 0 Y 0 31 8
+def @arg31 250 16777215 0 Y 0 31 8
+def @arg32 250 16777215 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select c1 into ? from t9 where c1= 1" ;
@@ -4871,26 +4871,26 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 128 30 63
def @arg12 246 83 6 Y 128 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 250 16777215 10 Y 128 31 63
+def @arg14 250 16777215 19 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 8 Y 128 31 63
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
-def @arg20 251 16777216 1 Y 0 31 8
-def @arg21 251 16777216 10 Y 0 31 8
-def @arg22 251 16777216 30 Y 0 31 8
-def @arg23 251 16777216 8 Y 128 31 63
-def @arg24 251 16777216 8 Y 0 31 8
-def @arg25 251 16777216 4 Y 128 31 63
-def @arg26 251 16777216 4 Y 0 31 8
-def @arg27 251 16777216 10 Y 128 31 63
-def @arg28 251 16777216 10 Y 0 31 8
-def @arg29 251 16777216 8 Y 128 31 63
-def @arg30 251 16777216 8 Y 0 31 8
-def @arg31 251 16777216 3 Y 0 31 8
-def @arg32 251 16777216 6 Y 0 31 8
+def @arg20 250 16777215 1 Y 0 31 8
+def @arg21 250 16777215 10 Y 0 31 8
+def @arg22 250 16777215 30 Y 0 31 8
+def @arg23 250 16777215 8 Y 128 31 63
+def @arg24 250 16777215 8 Y 0 31 8
+def @arg25 250 16777215 4 Y 128 31 63
+def @arg26 250 16777215 4 Y 0 31 8
+def @arg27 250 16777215 10 Y 128 31 63
+def @arg28 250 16777215 10 Y 0 31 8
+def @arg29 250 16777215 8 Y 128 31 63
+def @arg30 250 16777215 8 Y 0 31 8
+def @arg31 250 16777215 3 Y 0 31 8
+def @arg32 250 16777215 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
@@ -4918,26 +4918,26 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 128 30 63
def @arg12 246 83 0 Y 128 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 250 16777215 0 Y 128 31 63
+def @arg14 250 16777215 0 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 0 Y 128 31 63
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
-def @arg20 251 16777216 0 Y 0 31 8
-def @arg21 251 16777216 0 Y 0 31 8
-def @arg22 251 16777216 0 Y 0 31 8
-def @arg23 251 16777216 0 Y 128 31 63
-def @arg24 251 16777216 0 Y 0 31 8
-def @arg25 251 16777216 0 Y 128 31 63
-def @arg26 251 16777216 0 Y 0 31 8
-def @arg27 251 16777216 0 Y 128 31 63
-def @arg28 251 16777216 0 Y 0 31 8
-def @arg29 251 16777216 0 Y 128 31 63
-def @arg30 251 16777216 0 Y 0 31 8
-def @arg31 251 16777216 0 Y 0 31 8
-def @arg32 251 16777216 0 Y 0 31 8
+def @arg20 250 16777215 0 Y 0 31 8
+def @arg21 250 16777215 0 Y 0 31 8
+def @arg22 250 16777215 0 Y 0 31 8
+def @arg23 250 16777215 0 Y 128 31 63
+def @arg24 250 16777215 0 Y 0 31 8
+def @arg25 250 16777215 0 Y 128 31 63
+def @arg26 250 16777215 0 Y 0 31 8
+def @arg27 250 16777215 0 Y 128 31 63
+def @arg28 250 16777215 0 Y 0 31 8
+def @arg29 250 16777215 0 Y 128 31 63
+def @arg30 250 16777215 0 Y 0 31 8
+def @arg31 250 16777215 0 Y 0 31 8
+def @arg32 250 16777215 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select
@@ -4968,26 +4968,26 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 128 30 63
def @arg12 246 83 6 Y 128 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 250 16777215 10 Y 128 31 63
+def @arg14 250 16777215 19 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 8 Y 128 31 63
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
-def @arg20 251 16777216 1 Y 0 31 8
-def @arg21 251 16777216 10 Y 0 31 8
-def @arg22 251 16777216 30 Y 0 31 8
-def @arg23 251 16777216 8 Y 128 31 63
-def @arg24 251 16777216 8 Y 0 31 8
-def @arg25 251 16777216 4 Y 128 31 63
-def @arg26 251 16777216 4 Y 0 31 8
-def @arg27 251 16777216 10 Y 128 31 63
-def @arg28 251 16777216 10 Y 0 31 8
-def @arg29 251 16777216 8 Y 128 31 63
-def @arg30 251 16777216 8 Y 0 31 8
-def @arg31 251 16777216 3 Y 0 31 8
-def @arg32 251 16777216 6 Y 0 31 8
+def @arg20 250 16777215 1 Y 0 31 8
+def @arg21 250 16777215 10 Y 0 31 8
+def @arg22 250 16777215 30 Y 0 31 8
+def @arg23 250 16777215 8 Y 128 31 63
+def @arg24 250 16777215 8 Y 0 31 8
+def @arg25 250 16777215 4 Y 128 31 63
+def @arg26 250 16777215 4 Y 0 31 8
+def @arg27 250 16777215 10 Y 128 31 63
+def @arg28 250 16777215 10 Y 0 31 8
+def @arg29 250 16777215 8 Y 128 31 63
+def @arg30 250 16777215 8 Y 0 31 8
+def @arg31 250 16777215 3 Y 0 31 8
+def @arg32 250 16777215 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
set @my_key= 0 ;
@@ -5008,26 +5008,26 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 128 30 63
def @arg12 246 83 0 Y 128 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 250 16777215 0 Y 128 31 63
+def @arg14 250 16777215 0 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 0 Y 128 31 63
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
-def @arg20 251 16777216 0 Y 0 31 8
-def @arg21 251 16777216 0 Y 0 31 8
-def @arg22 251 16777216 0 Y 0 31 8
-def @arg23 251 16777216 0 Y 128 31 63
-def @arg24 251 16777216 0 Y 0 31 8
-def @arg25 251 16777216 0 Y 128 31 63
-def @arg26 251 16777216 0 Y 0 31 8
-def @arg27 251 16777216 0 Y 128 31 63
-def @arg28 251 16777216 0 Y 0 31 8
-def @arg29 251 16777216 0 Y 128 31 63
-def @arg30 251 16777216 0 Y 0 31 8
-def @arg31 251 16777216 0 Y 0 31 8
-def @arg32 251 16777216 0 Y 0 31 8
+def @arg20 250 16777215 0 Y 0 31 8
+def @arg21 250 16777215 0 Y 0 31 8
+def @arg22 250 16777215 0 Y 0 31 8
+def @arg23 250 16777215 0 Y 128 31 63
+def @arg24 250 16777215 0 Y 0 31 8
+def @arg25 250 16777215 0 Y 128 31 63
+def @arg26 250 16777215 0 Y 0 31 8
+def @arg27 250 16777215 0 Y 128 31 63
+def @arg28 250 16777215 0 Y 0 31 8
+def @arg29 250 16777215 0 Y 128 31 63
+def @arg30 250 16777215 0 Y 0 31 8
+def @arg31 250 16777215 0 Y 0 31 8
+def @arg32 250 16777215 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select ? := c1 from t9 where c1= 1" ;
@@ -5056,26 +5056,26 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 128 30 63
def @arg12 246 83 6 Y 128 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 250 16777215 10 Y 128 31 63
+def @arg14 250 16777215 19 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 8 Y 128 31 63
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
-def @arg20 251 16777216 1 Y 0 31 8
-def @arg21 251 16777216 10 Y 0 31 8
-def @arg22 251 16777216 30 Y 0 31 8
-def @arg23 251 16777216 8 Y 128 31 63
-def @arg24 251 16777216 8 Y 0 31 8
-def @arg25 251 16777216 4 Y 128 31 63
-def @arg26 251 16777216 4 Y 0 31 8
-def @arg27 251 16777216 10 Y 128 31 63
-def @arg28 251 16777216 10 Y 0 31 8
-def @arg29 251 16777216 8 Y 128 31 63
-def @arg30 251 16777216 8 Y 0 31 8
-def @arg31 251 16777216 3 Y 0 31 8
-def @arg32 251 16777216 6 Y 0 31 8
+def @arg20 250 16777215 1 Y 0 31 8
+def @arg21 250 16777215 10 Y 0 31 8
+def @arg22 250 16777215 30 Y 0 31 8
+def @arg23 250 16777215 8 Y 128 31 63
+def @arg24 250 16777215 8 Y 0 31 8
+def @arg25 250 16777215 4 Y 128 31 63
+def @arg26 250 16777215 4 Y 0 31 8
+def @arg27 250 16777215 10 Y 128 31 63
+def @arg28 250 16777215 10 Y 0 31 8
+def @arg29 250 16777215 8 Y 128 31 63
+def @arg30 250 16777215 8 Y 0 31 8
+def @arg31 250 16777215 3 Y 0 31 8
+def @arg32 250 16777215 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
@@ -5100,26 +5100,26 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 128 30 63
def @arg12 246 83 0 Y 128 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 250 16777215 0 Y 128 31 63
+def @arg14 250 16777215 0 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 0 Y 128 31 63
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
-def @arg20 251 16777216 0 Y 0 31 8
-def @arg21 251 16777216 0 Y 0 31 8
-def @arg22 251 16777216 0 Y 0 31 8
-def @arg23 251 16777216 0 Y 128 31 63
-def @arg24 251 16777216 0 Y 0 31 8
-def @arg25 251 16777216 0 Y 128 31 63
-def @arg26 251 16777216 0 Y 0 31 8
-def @arg27 251 16777216 0 Y 128 31 63
-def @arg28 251 16777216 0 Y 0 31 8
-def @arg29 251 16777216 0 Y 128 31 63
-def @arg30 251 16777216 0 Y 0 31 8
-def @arg31 251 16777216 0 Y 0 31 8
-def @arg32 251 16777216 0 Y 0 31 8
+def @arg20 250 16777215 0 Y 0 31 8
+def @arg21 250 16777215 0 Y 0 31 8
+def @arg22 250 16777215 0 Y 0 31 8
+def @arg23 250 16777215 0 Y 128 31 63
+def @arg24 250 16777215 0 Y 0 31 8
+def @arg25 250 16777215 0 Y 128 31 63
+def @arg26 250 16777215 0 Y 0 31 8
+def @arg27 250 16777215 0 Y 128 31 63
+def @arg28 250 16777215 0 Y 0 31 8
+def @arg29 250 16777215 0 Y 128 31 63
+def @arg30 250 16777215 0 Y 0 31 8
+def @arg31 250 16777215 0 Y 0 31 8
+def @arg32 250 16777215 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
@@ -5146,26 +5146,26 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 128 30 63
def @arg12 246 83 6 Y 128 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 250 16777215 10 Y 128 31 63
+def @arg14 250 16777215 19 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 8 Y 128 31 63
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
-def @arg20 251 16777216 1 Y 0 31 8
-def @arg21 251 16777216 10 Y 0 31 8
-def @arg22 251 16777216 30 Y 0 31 8
-def @arg23 251 16777216 8 Y 128 31 63
-def @arg24 251 16777216 8 Y 0 31 8
-def @arg25 251 16777216 4 Y 128 31 63
-def @arg26 251 16777216 4 Y 0 31 8
-def @arg27 251 16777216 10 Y 128 31 63
-def @arg28 251 16777216 10 Y 0 31 8
-def @arg29 251 16777216 8 Y 128 31 63
-def @arg30 251 16777216 8 Y 0 31 8
-def @arg31 251 16777216 3 Y 0 31 8
-def @arg32 251 16777216 6 Y 0 31 8
+def @arg20 250 16777215 1 Y 0 31 8
+def @arg21 250 16777215 10 Y 0 31 8
+def @arg22 250 16777215 30 Y 0 31 8
+def @arg23 250 16777215 8 Y 128 31 63
+def @arg24 250 16777215 8 Y 0 31 8
+def @arg25 250 16777215 4 Y 128 31 63
+def @arg26 250 16777215 4 Y 0 31 8
+def @arg27 250 16777215 10 Y 128 31 63
+def @arg28 250 16777215 10 Y 0 31 8
+def @arg29 250 16777215 8 Y 128 31 63
+def @arg30 250 16777215 8 Y 0 31 8
+def @arg31 250 16777215 3 Y 0 31 8
+def @arg32 250 16777215 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
set @my_key= 0 ;
@@ -5184,26 +5184,26 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 128 30 63
def @arg12 246 83 0 Y 128 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 250 16777215 0 Y 128 31 63
+def @arg14 250 16777215 0 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 0 Y 128 31 63
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
-def @arg20 251 16777216 0 Y 0 31 8
-def @arg21 251 16777216 0 Y 0 31 8
-def @arg22 251 16777216 0 Y 0 31 8
-def @arg23 251 16777216 0 Y 128 31 63
-def @arg24 251 16777216 0 Y 0 31 8
-def @arg25 251 16777216 0 Y 128 31 63
-def @arg26 251 16777216 0 Y 0 31 8
-def @arg27 251 16777216 0 Y 128 31 63
-def @arg28 251 16777216 0 Y 0 31 8
-def @arg29 251 16777216 0 Y 128 31 63
-def @arg30 251 16777216 0 Y 0 31 8
-def @arg31 251 16777216 0 Y 0 31 8
-def @arg32 251 16777216 0 Y 0 31 8
+def @arg20 250 16777215 0 Y 0 31 8
+def @arg21 250 16777215 0 Y 0 31 8
+def @arg22 250 16777215 0 Y 0 31 8
+def @arg23 250 16777215 0 Y 128 31 63
+def @arg24 250 16777215 0 Y 0 31 8
+def @arg25 250 16777215 0 Y 128 31 63
+def @arg26 250 16777215 0 Y 0 31 8
+def @arg27 250 16777215 0 Y 128 31 63
+def @arg28 250 16777215 0 Y 0 31 8
+def @arg29 250 16777215 0 Y 128 31 63
+def @arg30 250 16777215 0 Y 0 31 8
+def @arg31 250 16777215 0 Y 0 31 8
+def @arg32 250 16777215 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select c1 into ? from t9 where c1= 1" ;
diff --git a/mysql-test/r/row.result b/mysql-test/r/row.result
index 2962123fcb2..789b9c4f383 100644
--- a/mysql-test/r/row.result
+++ b/mysql-test/r/row.result
@@ -466,3 +466,26 @@ SELECT 1 FROM t1 WHERE ROW(a, b) >=
ROW('1', (SELECT 1 FROM t1 WHERE a > 1234));
1
DROP TABLE t1;
+#
+# Bug #54190: Comparison to row subquery produces incorrect result
+#
+SELECT ROW(1,2) = (SELECT 1,2 FROM DUAL WHERE 1 = 0);
+ROW(1,2) = (SELECT 1,2 FROM DUAL WHERE 1 = 0)
+NULL
+SELECT ROW(1,2) = (SELECT 1,3 FROM DUAL WHERE 1 = 0);
+ROW(1,2) = (SELECT 1,3 FROM DUAL WHERE 1 = 0)
+NULL
+CREATE TABLE t1 (i INT);
+INSERT INTO t1 () VALUES (1), (2), (3);
+SELECT ROW(1,2) = (SELECT 1,2 FROM t1 WHERE 1 = 0);
+ROW(1,2) = (SELECT 1,2 FROM t1 WHERE 1 = 0)
+NULL
+SELECT ROW(1,2) = (SELECT 1,3 FROM t1 WHERE 1 = 0);
+ROW(1,2) = (SELECT 1,3 FROM t1 WHERE 1 = 0)
+NULL
+SELECT i FROM t1 WHERE ROW(1,2) = (SELECT 1,2 FROM DUAL WHERE 1 = 0);
+i
+SELECT i FROM t1 WHERE ROW(1,2) = (SELECT 1,3 FROM DUAL WHERE 1 = 0);
+i
+DROP TABLE t1;
+End of 5.1 tests
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index cbb6149a148..6710b8fc941 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -922,7 +922,7 @@ select a, (select a,b,c from t1 where t1.a=t2.a) = ROW(a,2,'a'),(select c from t
a (select a,b,c from t1 where t1.a=t2.a) = ROW(a,2,'a') (select c from t1 where a=t2.a)
1 1 a
2 0 b
-NULL 0 NULL
+NULL NULL NULL
select a, (select a,b,c from t1 where t1.a=t2.a) = ROW(a,3,'b'),(select c from t1 where a=t2.a) from t2;
a (select a,b,c from t1 where t1.a=t2.a) = ROW(a,3,'b') (select c from t1 where a=t2.a)
1 0 a
@@ -932,7 +932,7 @@ select a, (select a,b,c from t1 where t1.a=t2.a) = ROW(a,4,'c'),(select c from t
a (select a,b,c from t1 where t1.a=t2.a) = ROW(a,4,'c') (select c from t1 where a=t2.a)
1 0 a
2 0 b
-NULL 0 NULL
+NULL NULL NULL
drop table t1,t2;
create table t1 (a int, b real, c varchar(10));
insert into t1 values (1, 1, 'a'), (2,2,'b'), (NULL, 2, 'b');
@@ -4730,4 +4730,34 @@ ORDER BY (SELECT * FROM t1 WHERE MATCH(a) AGAINST ('+abc' IN BOOLEAN MODE));
SELECT * FROM t2 UNION SELECT * FROM t2
ORDER BY (SELECT * FROM t1 WHERE MATCH(a) AGAINST ('+abc' IN BOOLEAN MODE));
DROP TABLE t1,t2;
+# LP BUG#675248 - select->prep_where references on freed memory
+CREATE TABLE t1 (a int, b int);
+insert into t1 values (1,1),(0,0);
+CREATE TABLE t2 (c int);
+insert into t2 values (1),(2);
+prepare stmt1 from "select sum(a),(select sum(c) from t2 where table1.b) as sub
+from t1 as table1 group by sub";
+execute stmt1;
+sum(a) sub
+0 NULL
+1 3
+deallocate prepare stmt1;
+prepare stmt1 from "select sum(a),(select sum(c) from t2 having table1.b) as sub
+from t1 as table1";
+execute stmt1;
+sum(a) sub
+1 3
+deallocate prepare stmt1;
+drop table t1,t2;
+#
+# Bug LP#693935/#58727: Assertion failure with
+# a single row subquery returning more than one row
+#
+create table t1 (a char(1) charset utf8);
+insert into t1 values ('a'), ('b');
+create table t2 (a binary(1));
+insert into t2 values ('x'), ('y');
+select * from t2 where a=(select a from t1) and a='x';
+ERROR 21000: Subquery returns more than 1 row
+drop table t1,t2;
End of 5.1 tests
diff --git a/mysql-test/r/subselect4.result b/mysql-test/r/subselect4.result
index 87f52572e88..50c0d14968a 100644
--- a/mysql-test/r/subselect4.result
+++ b/mysql-test/r/subselect4.result
@@ -99,6 +99,92 @@ Note 1249 Select 2 was reduced during optimization
CREATE VIEW v1 AS SELECT 1 LIKE ( 1 IN ( SELECT 1 ) );
CREATE VIEW v2 AS SELECT 1 LIKE '%' ESCAPE ( 1 IN ( SELECT 1 ) );
DROP VIEW v1, v2;
+#
+# Bug#51070: Query with a NOT IN subquery predicate returns a wrong
+# result set
+#
+CREATE TABLE t1 ( a INT, b INT );
+INSERT INTO t1 VALUES ( 1, NULL ), ( 2, NULL );
+CREATE TABLE t2 ( c INT, d INT );
+INSERT INTO t2 VALUES ( NULL, 3 ), ( NULL, 4 );
+CREATE TABLE t3 ( e INT, f INT );
+INSERT INTO t3 VALUES ( NULL, NULL ), ( NULL, NULL );
+CREATE TABLE t4 ( a INT );
+INSERT INTO t4 VALUES (1), (2), (3);
+CREATE TABLE t5 ( a INT );
+INSERT INTO t5 VALUES (NULL), (2);
+EXPLAIN
+SELECT * FROM t1 WHERE ( a, b ) NOT IN ( SELECT c, d FROM t2 );
+id select_type table type possible_keys key key_len ref rows Extra
+x PRIMARY x x x x x x x x
+x DEPENDENT SUBQUERY x x x x x x x x
+SELECT * FROM t1 WHERE ( a, b ) NOT IN ( SELECT c, d FROM t2 );
+a b
+EXPLAIN
+SELECT * FROM t1 WHERE ( a, b ) NOT IN ( SELECT c, d FROM t2 ) IS NULL;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
+SELECT * FROM t1 WHERE ( a, b ) NOT IN ( SELECT c, d FROM t2 ) IS NULL;
+a b
+1 NULL
+2 NULL
+SELECT * FROM t1 WHERE ( a, b ) IN ( SELECT c, d FROM t2 ) IS NULL;
+a b
+1 NULL
+2 NULL
+SELECT * FROM t1 WHERE ( a, b ) NOT IN ( SELECT c, d FROM t2 ) IS UNKNOWN;
+a b
+1 NULL
+2 NULL
+SELECT * FROM t1 WHERE (( a, b ) NOT IN ( SELECT c, d FROM t2 )) IS UNKNOWN;
+a b
+1 NULL
+2 NULL
+SELECT * FROM t1 WHERE 1 = 1 AND ( a, b ) NOT IN ( SELECT c, d FROM t2 );
+a b
+EXPLAIN
+SELECT * FROM t1 WHERE ( a, b ) NOT IN ( SELECT e, f FROM t3 );
+id select_type table type possible_keys key key_len ref rows Extra
+x PRIMARY x x x x x x x x
+x DEPENDENT SUBQUERY x x x x x x x x
+SELECT * FROM t1 WHERE ( a, b ) NOT IN ( SELECT e, f FROM t3 );
+a b
+EXPLAIN
+SELECT * FROM t2 WHERE ( c, d ) NOT IN ( SELECT a, b FROM t1 );
+id select_type table type possible_keys key key_len ref rows Extra
+x PRIMARY x x x x x x x x
+x DEPENDENT SUBQUERY x x x x x x x x
+SELECT * FROM t2 WHERE ( c, d ) NOT IN ( SELECT a, b FROM t1 );
+c d
+EXPLAIN
+SELECT * FROM t3 WHERE ( e, f ) NOT IN ( SELECT c, d FROM t2 );
+id select_type table type possible_keys key key_len ref rows Extra
+x PRIMARY x x x x x x x x
+x DEPENDENT SUBQUERY x x x x x x x x
+SELECT * FROM t3 WHERE ( e, f ) NOT IN ( SELECT c, d FROM t2 );
+e f
+EXPLAIN
+SELECT * FROM t2 WHERE ( c, d ) NOT IN ( SELECT e, f FROM t3 );
+id select_type table type possible_keys key key_len ref rows Extra
+x PRIMARY x x x x x x x x
+x DEPENDENT SUBQUERY x x x x x x x x
+SELECT * FROM t2 WHERE ( c, d ) NOT IN ( SELECT e, f FROM t3 );
+c d
+SELECT * FROM t1 WHERE ( a, b ) NOT IN
+( SELECT c, d FROM t2 WHERE c = 1 AND c <> 1 );
+a b
+1 NULL
+2 NULL
+SELECT * FROM t1 WHERE b NOT IN ( SELECT c FROM t2 WHERE c = 1 );
+a b
+1 NULL
+2 NULL
+SELECT * FROM t1 WHERE NULL NOT IN ( SELECT c FROM t2 WHERE c = 1 AND c <> 1 );
+a b
+1 NULL
+2 NULL
+DROP TABLE t1, t2, t3, t4, t5;
#
# End of 5.1 tests.
#
diff --git a/mysql-test/r/table_elim.result b/mysql-test/r/table_elim.result
index 395b0be7e34..6c713946b27 100644
--- a/mysql-test/r/table_elim.result
+++ b/mysql-test/r/table_elim.result
@@ -535,3 +535,34 @@ HAVING
field4 != 6;
field1 field2 field3 field4 field5 field6
drop table t0,t1,t2,t3,t4,t5,t6;
+#
+# BUG#675118: Elimination of a table results in an invalid execution plan
+#
+CREATE TABLE t1 (f1 int(11), PRIMARY KEY (f1)) ;
+CREATE TABLE t2 (f4 varchar(1024), KEY (f4)) ;
+Warnings:
+Warning 1071 Specified key was too long; max key length is 1000 bytes
+INSERT IGNORE INTO t2 VALUES ('xcddwntkbxyorzdv'),
+('cnxxcddwntkbxyor'),('r'),('r'), ('did'),('I'),('when'),
+('hczkfqjeggivdvac'),('e'),('okay'),('up');
+CREATE TABLE t3 (f4 varchar(1024), f1 int(11), f2 int(11)) ;
+INSERT IGNORE INTO t3 VALUES ('f','4','0'),('n','5','-996540416');
+CREATE TABLE t4 (f1 int(11), f3 varchar(10)) ;
+INSERT IGNORE INTO t4 VALUES ('8','n'),('9','nwzcerzsgx'),('10','c');
+CREATE TABLE t5 (f5 int(11), KEY (f5)) ;
+EXPLAIN
+SELECT t3.f2
+FROM t2
+LEFT JOIN t3
+LEFT JOIN t4
+LEFT JOIN t1 ON t4.f1 = t1.f1
+JOIN t5 ON t4.f3 ON t3.f1 = t5.f5 ON t2.f4 = t3.f4
+WHERE t3.f2 ;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t3 ALL NULL NULL NULL NULL 2 Using where
+1 SIMPLE t5 ref f5 f5 5 test.t3.f1 2 Using index
+1 SIMPLE t4 ALL NULL NULL NULL NULL 3
+1 SIMPLE t2 ALL f4 NULL NULL NULL 11 Using where; Using join buffer
+# ^^ The above must not produce a QEP of t3,t5,t2,t4
+# as that violates the "no interleaving of outer join nests" rule.
+DROP TABLE t1,t2,t3,t4,t5;
diff --git a/mysql-test/r/table_options.result b/mysql-test/r/table_options.result
index ed6fe4fb3de..ddb7bd13c03 100644
--- a/mysql-test/r/table_options.result
+++ b/mysql-test/r/table_options.result
@@ -3,9 +3,9 @@ SET @OLD_SQL_MODE=@@SQL_MODE;
SET SQL_MODE='IGNORE_BAD_TABLE_OPTIONS';
create table t1 (a int fkey=vvv, key akey (a) dff=vvv) tkey1='1v1';
Warnings:
-Warning 1651 Unknown option 'fkey'
-Warning 1651 Unknown option 'dff'
-Warning 1651 Unknown option 'tkey1'
+Warning 1652 Unknown option 'fkey'
+Warning 1652 Unknown option 'dff'
+Warning 1652 Unknown option 'tkey1'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -16,10 +16,10 @@ drop table t1;
#reassiginig options in the same line
create table t1 (a int fkey=vvv, key akey (a) dff=vvv) tkey1=1v1 TKEY1=DEFAULT tkey1=1v2 tkey2=2v1;
Warnings:
-Warning 1651 Unknown option 'fkey'
-Warning 1651 Unknown option 'dff'
-Warning 1651 Unknown option 'tkey1'
-Warning 1651 Unknown option 'tkey2'
+Warning 1652 Unknown option 'fkey'
+Warning 1652 Unknown option 'dff'
+Warning 1652 Unknown option 'tkey1'
+Warning 1652 Unknown option 'tkey2'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -29,7 +29,7 @@ t1 CREATE TABLE `t1` (
#add option
alter table t1 tkey4=4v1;
Warnings:
-Warning 1651 Unknown option 'tkey4'
+Warning 1652 Unknown option 'tkey4'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -39,8 +39,8 @@ t1 CREATE TABLE `t1` (
#remove options
alter table t1 tkey3=DEFAULT tkey4=DEFAULT;
Warnings:
-Warning 1651 Unknown option 'tkey3'
-Warning 1651 Unknown option 'tkey4'
+Warning 1652 Unknown option 'tkey3'
+Warning 1652 Unknown option 'tkey4'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -50,11 +50,11 @@ t1 CREATE TABLE `t1` (
drop table t1;
create table t1 (a int fkey1=v1, key akey (a) kkey1=v1) tkey1=1v1 tkey1=1v2 TKEY1=DEFAULT tkey2=2v1 tkey3=3v1;
Warnings:
-Warning 1651 Unknown option 'fkey1'
-Warning 1651 Unknown option 'kkey1'
-Warning 1651 Unknown option 'TKEY1'
-Warning 1651 Unknown option 'tkey2'
-Warning 1651 Unknown option 'tkey3'
+Warning 1652 Unknown option 'fkey1'
+Warning 1652 Unknown option 'kkey1'
+Warning 1652 Unknown option 'TKEY1'
+Warning 1652 Unknown option 'tkey2'
+Warning 1652 Unknown option 'tkey3'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -64,7 +64,7 @@ t1 CREATE TABLE `t1` (
#change field with option with the same value
alter table t1 change a a int `FKEY1`='v1';
Warnings:
-Warning 1651 Unknown option 'FKEY1'
+Warning 1652 Unknown option 'FKEY1'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -74,7 +74,7 @@ t1 CREATE TABLE `t1` (
#change field with option with a different value
alter table t1 change a a int fkey1=v2;
Warnings:
-Warning 1651 Unknown option 'fkey1'
+Warning 1652 Unknown option 'fkey1'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -93,7 +93,7 @@ t1 CREATE TABLE `t1` (
#new key with options
alter table t1 add key bkey (b) kkey2=v1;
Warnings:
-Warning 1651 Unknown option 'kkey2'
+Warning 1652 Unknown option 'kkey2'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -105,8 +105,8 @@ t1 CREATE TABLE `t1` (
#new column with options
alter table t1 add column c int fkey1=v1 fkey2=v2;
Warnings:
-Warning 1651 Unknown option 'fkey1'
-Warning 1651 Unknown option 'fkey2'
+Warning 1652 Unknown option 'fkey1'
+Warning 1652 Unknown option 'fkey2'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -141,7 +141,7 @@ t1 CREATE TABLE `t1` (
#add column with options after delete
alter table t1 add column b int fkey2=v1;
Warnings:
-Warning 1651 Unknown option 'fkey2'
+Warning 1652 Unknown option 'fkey2'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -154,7 +154,7 @@ t1 CREATE TABLE `t1` (
#add key
alter table t1 add key bkey (b) kkey2=v2;
Warnings:
-Warning 1651 Unknown option 'kkey2'
+Warning 1652 Unknown option 'kkey2'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -168,7 +168,7 @@ t1 CREATE TABLE `t1` (
drop table t1;
create table t1 (a int) tkey1=100;
Warnings:
-Warning 1651 Unknown option 'tkey1'
+Warning 1652 Unknown option 'tkey1'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
diff --git a/mysql-test/r/trigger_notembedded.result b/mysql-test/r/trigger_notembedded.result
index 14c499692a8..6f021c6ec5a 100644
--- a/mysql-test/r/trigger_notembedded.result
+++ b/mysql-test/r/trigger_notembedded.result
@@ -501,4 +501,25 @@ SHOW CREATE TRIGGER db1.trg;
ERROR 42000: Access denied; you need the TRIGGER privilege for this operation
DROP USER 'no_rights'@'localhost';
DROP DATABASE db1;
+DROP DATABASE IF EXISTS mysqltest_db1;
+CREATE DATABASE mysqltest_db1;
+USE mysqltest_db1;
+GRANT ALL ON mysqltest_db1.* TO mysqltest_u1@localhost;
+CREATE TABLE t1 (
+a1 int,
+a2 int
+);
+INSERT INTO t1 VALUES (1, 20);
+CREATE TRIGGER mysqltest_db1.upd_t1
+BEFORE UPDATE ON t1 FOR EACH ROW SET new.a2 = 200;
+CREATE TABLE t2 (
+a1 int
+);
+INSERT INTO t2 VALUES (2);
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+UPDATE IGNORE t1, t2 SET t1.a1 = 2, t2.a1 = 3 WHERE t1.a1 = 1 AND t2.a1 = 2;
+ERROR 42000: TRIGGER command denied to user 'mysqltest_u1'@'localhost' for table 't1'
+DROP DATABASE mysqltest_db1;
+DROP USER mysqltest_u1@localhost;
+USE test;
End of 5.1 tests.
diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result
index e26c2e68775..e88d3462466 100644
--- a/mysql-test/r/type_timestamp.result
+++ b/mysql-test/r/type_timestamp.result
@@ -527,3 +527,24 @@ f1 f2-f3
5 0
DROP TABLE t1;
End of 5.0 tests
+#
+# Bug #55779: select does not work properly in mysql server
+# Version "5.1.42 SUSE MySQL RPM"
+#
+CREATE TABLE t1 (a TIMESTAMP, KEY (a));
+INSERT INTO t1 VALUES ('2000-01-01 00:00:00'), ('2000-01-01 00:00:00'),
+('2000-01-01 00:00:01'), ('2000-01-01 00:00:01');
+SELECT a FROM t1 WHERE a >= 20000101000000;
+a
+2000-01-01 00:00:00
+2000-01-01 00:00:00
+2000-01-01 00:00:01
+2000-01-01 00:00:01
+SELECT a FROM t1 WHERE a >= '20000101000000';
+a
+2000-01-01 00:00:00
+2000-01-01 00:00:00
+2000-01-01 00:00:01
+2000-01-01 00:00:01
+DROP TABLE t1;
+End of 5.1 tests
diff --git a/mysql-test/r/variables_debug.result b/mysql-test/r/variables_debug.result
index d578fa957fc..41d77007b26 100644
--- a/mysql-test/r/variables_debug.result
+++ b/mysql-test/r/variables_debug.result
@@ -24,4 +24,17 @@ SELECT @@global.debug;
@@global.debug
SET GLOBAL debug=@old_debug;
+#
+# Bug #56709: Memory leaks at running the 5.1 test suite
+#
+SET @old_local_debug = @@debug;
+SET @@debug='d,foo';
+SELECT @@debug;
+@@debug
+d,foo
+SET @@debug='';
+SELECT @@debug;
+@@debug
+
+SET @@debug = @old_local_debug;
End of 5.1 tests
diff --git a/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
index 8b42cadf6cb..8ee531c6ce2 100644
--- a/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
+++ b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
@@ -48,12 +48,12 @@ Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # SAVEPOINT my_savepoint
+master-bin.000001 # Query # # SAVEPOINT `my_savepoint`
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.t2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # ROLLBACK TO my_savepoint
+master-bin.000001 # Query # # ROLLBACK TO `my_savepoint`
master-bin.000001 # Xid # # COMMIT /* XID */
delete from t1;
delete from t2;
@@ -77,12 +77,12 @@ Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # SAVEPOINT my_savepoint
+master-bin.000001 # Query # # SAVEPOINT `my_savepoint`
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.t2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # ROLLBACK TO my_savepoint
+master-bin.000001 # Query # # ROLLBACK TO `my_savepoint`
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 */
diff --git a/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result b/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result
index 5a6fbc953b4..5e48f13932d 100644
--- a/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result
+++ b/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result
@@ -159,7 +159,6 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-use new_test1/*!*/;
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
BEGIN
@@ -354,7 +353,6 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
-use new_test1/*!*/;
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
BEGIN
diff --git a/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result b/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result
index a26fcc1dc1a..d2f47e56c61 100644
--- a/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result
@@ -44,10 +44,10 @@ show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; insert into t1 values(3)
-master-bin.000001 # Query # # SAVEPOINT my_savepoint
+master-bin.000001 # Query # # SAVEPOINT `my_savepoint`
master-bin.000001 # Query # # use `test`; insert into t1 values(4)
master-bin.000001 # Query # # use `test`; insert into t2 select * from t1
-master-bin.000001 # Query # # ROLLBACK TO my_savepoint
+master-bin.000001 # Query # # ROLLBACK TO `my_savepoint`
master-bin.000001 # Xid # # COMMIT /* XID */
delete from t1;
delete from t2;
@@ -70,10 +70,10 @@ show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; insert into t1 values(5)
-master-bin.000001 # Query # # SAVEPOINT my_savepoint
+master-bin.000001 # Query # # SAVEPOINT `my_savepoint`
master-bin.000001 # Query # # use `test`; insert into t1 values(6)
master-bin.000001 # Query # # use `test`; insert into t2 select * from t1
-master-bin.000001 # Query # # ROLLBACK TO my_savepoint
+master-bin.000001 # Query # # ROLLBACK TO `my_savepoint`
master-bin.000001 # Query # # use `test`; insert into t1 values(7)
master-bin.000001 # Xid # # COMMIT /* XID */
delete from t1;
diff --git a/mysql-test/suite/binlog/t/disabled.def b/mysql-test/suite/binlog/t/disabled.def
index 0018387de94..d261364756e 100644
--- a/mysql-test/suite/binlog/t/disabled.def
+++ b/mysql-test/suite/binlog/t/disabled.def
@@ -9,5 +9,6 @@
# Do not use any TAB characters for whitespace.
#
##############################################################################
-binlog_truncate_innodb : BUG#42643 2009-02-06 mats Changes to InnoDB requires to complete fix for BUG#36763
+binlog_truncate_innodb : BUG#57291 2010-10-20 anitha Originally disabled due to BUG#42643. Product bug fixed, but test changes needed
+
diff --git a/mysql-test/suite/federated/federated_debug.test b/mysql-test/suite/federated/federated_debug.test
index 4152d2975b3..d63c1007088 100644
--- a/mysql-test/suite/federated/federated_debug.test
+++ b/mysql-test/suite/federated/federated_debug.test
@@ -1,4 +1,5 @@
--source include/have_debug.inc
+--source include/long_test.inc
--source federated.inc
--echo #
diff --git a/mysql-test/suite/handler/aria.result b/mysql-test/suite/handler/aria.result
new file mode 100644
index 00000000000..a912a2559e3
--- /dev/null
+++ b/mysql-test/suite/handler/aria.result
@@ -0,0 +1,671 @@
+SET SESSION STORAGE_ENGINE = Aria;
+drop table if exists t1,t3,t4,t5;
+create table t1 (a int, b char(10), key a (a), key b (a,b));
+insert into t1 values
+(17,"ddd"),(18,"eee"),(19,"fff"),(19,"yyy"),
+(14,"aaa"),(16,"ccc"),(16,"xxx"),
+(20,"ggg"),(21,"hhh"),(22,"iii");
+handler t1 open as t2;
+handler t2 read a first;
+a b
+14 aaa
+handler t2 read a next;
+a b
+16 ccc
+handler t2 read a next;
+a b
+16 xxx
+handler t2 read a prev;
+a b
+16 ccc
+handler t2 read a last;
+a b
+22 iii
+handler t2 read a prev;
+a b
+21 hhh
+handler t2 read a prev;
+a b
+20 ggg
+handler t2 read a first;
+a b
+14 aaa
+handler t2 read a prev;
+a b
+handler t2 read a last;
+a b
+22 iii
+handler t2 read a prev;
+a b
+21 hhh
+handler t2 read a next;
+a b
+22 iii
+handler t2 read a next;
+a b
+handler t2 read a=(15);
+a b
+handler t2 read a=(16);
+a b
+16 ccc
+handler t2 read a=(19,"fff");
+ERROR 42000: Too many key parts specified; max 1 parts allowed
+handler t2 read b=(19,"fff");
+a b
+19 fff
+handler t2 read b=(19,"yyy");
+a b
+19 yyy
+handler t2 read b=(19);
+a b
+19 fff
+handler t1 read a last;
+ERROR 42S02: Unknown table 't1' in HANDLER
+handler t2 read a=(11);
+a b
+handler t2 read a>=(11);
+a b
+14 aaa
+handler t2 read a=(18);
+a b
+18 eee
+handler t2 read a>=(18);
+a b
+18 eee
+handler t2 read a>(18);
+a b
+19 fff
+handler t2 read a<=(18);
+a b
+18 eee
+handler t2 read a<(18);
+a b
+17 ddd
+handler t2 read a=(15);
+a b
+handler t2 read a>=(15);
+a b
+16 ccc
+handler t2 read a>(15);
+a b
+16 ccc
+handler t2 read a<=(15);
+a b
+14 aaa
+handler t2 read a<(15);
+a b
+14 aaa
+handler t2 read a=(54);
+a b
+handler t2 read a>=(54);
+a b
+handler t2 read a>(54);
+a b
+handler t2 read a<=(54);
+a b
+22 iii
+handler t2 read a<(54);
+a b
+22 iii
+handler t2 read a=(1);
+a b
+handler t2 read a>=(1);
+a b
+14 aaa
+handler t2 read a>(1);
+a b
+14 aaa
+handler t2 read a<=(1);
+a b
+handler t2 read a<(1);
+a b
+handler t2 read a first limit 5;
+a b
+14 aaa
+16 ccc
+16 xxx
+17 ddd
+18 eee
+handler t2 read a next limit 3;
+a b
+19 fff
+19 yyy
+20 ggg
+handler t2 read a prev limit 10;
+a b
+19 yyy
+19 fff
+18 eee
+17 ddd
+16 xxx
+16 ccc
+14 aaa
+handler t2 read a>=(16) limit 4;
+a b
+16 ccc
+16 xxx
+17 ddd
+18 eee
+handler t2 read a>=(16) limit 2,2;
+a b
+17 ddd
+18 eee
+handler t2 read a last limit 3;
+a b
+22 iii
+21 hhh
+20 ggg
+handler t2 read a=(19);
+a b
+19 fff
+handler t2 read a=(19) where b="yyy";
+a b
+19 yyy
+handler t2 read first;
+a b
+17 ddd
+handler t2 read next;
+a b
+18 eee
+handler t2 read next;
+a b
+19 fff
+handler t2 close;
+handler t1 open;
+handler t1 read a next;
+a b
+14 aaa
+handler t1 read a next;
+a b
+16 ccc
+handler t1 close;
+handler t1 open;
+handler t1 read a prev;
+a b
+22 iii
+handler t1 read a prev;
+a b
+21 hhh
+handler t1 close;
+handler t1 open as t2;
+handler t2 read first;
+a b
+17 ddd
+alter table t1 engine = Aria;
+handler t2 read first;
+ERROR 42S02: Unknown table 't2' in HANDLER
+handler t1 open as t2;
+drop table t1;
+create table t1 (a int not null);
+insert into t1 values (17);
+handler t2 read first;
+ERROR 42S02: Unknown table 't2' in HANDLER
+handler t1 open as t2;
+alter table t1 engine=CSV;
+handler t2 read first;
+ERROR 42S02: Unknown table 't2' in HANDLER
+drop table t1;
+create table t1 (a int);
+insert into t1 values (1),(2),(3),(4),(5),(6);
+delete from t1 limit 2;
+handler t1 open;
+handler t1 read first;
+a
+3
+handler t1 read first limit 1,1;
+a
+4
+handler t1 read first limit 2,2;
+a
+5
+6
+delete from t1 limit 3;
+handler t1 read first;
+a
+6
+drop table t1;
+create table t1(a int, index (a));
+insert into t1 values (1), (2), (3);
+handler t1 open;
+handler t1 read a=(W);
+ERROR 42S22: Unknown column 'W' in 'field list'
+handler t1 read a=(a);
+ERROR HY000: Incorrect arguments to HANDLER ... READ
+drop table t1;
+create table t1 (a char(5));
+insert into t1 values ("Ok");
+handler t1 open as t;
+handler t read first;
+a
+Ok
+use mysql;
+handler t read first;
+a
+Ok
+handler t close;
+handler test.t1 open as t;
+handler t read first;
+a
+Ok
+handler t close;
+use test;
+drop table t1;
+create table t1 ( a int, b int, INDEX a (a) );
+insert into t1 values (1,2), (2,1);
+handler t1 open;
+handler t1 read a=(1) where b=2;
+a b
+1 2
+handler t1 read a=(1) where b=3;
+a b
+handler t1 read a=(1) where b=1;
+a b
+handler t1 close;
+drop table t1;
+create table t1 (c1 char(20));
+insert into t1 values ("t1");
+handler t1 open as h1;
+handler h1 read first limit 9;
+c1
+t1
+create table t2 (c1 char(20));
+insert into t2 values ("t2");
+handler t2 open as h2;
+handler h2 read first limit 9;
+c1
+t2
+create table t3 (c1 char(20));
+insert into t3 values ("t3");
+handler t3 open as h3;
+handler h3 read first limit 9;
+c1
+t3
+create table t4 (c1 char(20));
+insert into t4 values ("t4");
+handler t4 open as h4;
+handler h4 read first limit 9;
+c1
+t4
+create table t5 (c1 char(20));
+insert into t5 values ("t5");
+handler t5 open as h5;
+handler h5 read first limit 9;
+c1
+t5
+alter table t1 engine=MyISAM;
+handler h1 read first limit 9;
+ERROR 42S02: Unknown table 'h1' in HANDLER
+handler h2 read first limit 9;
+c1
+t2
+handler h3 read first limit 9;
+c1
+t3
+handler h4 read first limit 9;
+c1
+t4
+handler h5 read first limit 9;
+c1
+t5
+alter table t5 engine=MyISAM;
+handler h1 read first limit 9;
+ERROR 42S02: Unknown table 'h1' in HANDLER
+handler h2 read first limit 9;
+c1
+t2
+handler h3 read first limit 9;
+c1
+t3
+handler h4 read first limit 9;
+c1
+t4
+handler h5 read first limit 9;
+ERROR 42S02: Unknown table 'h5' in HANDLER
+alter table t3 engine=MyISAM;
+handler h1 read first limit 9;
+ERROR 42S02: Unknown table 'h1' in HANDLER
+handler h2 read first limit 9;
+c1
+t2
+handler h3 read first limit 9;
+ERROR 42S02: Unknown table 'h3' in HANDLER
+handler h4 read first limit 9;
+c1
+t4
+handler h5 read first limit 9;
+ERROR 42S02: Unknown table 'h5' in HANDLER
+handler h2 close;
+handler h4 close;
+handler t1 open as h1_1;
+handler t1 open as h1_2;
+handler t1 open as h1_3;
+handler h1_1 read first limit 9;
+c1
+t1
+handler h1_2 read first limit 9;
+c1
+t1
+handler h1_3 read first limit 9;
+c1
+t1
+alter table t1 engine=Aria;
+handler h1_1 read first limit 9;
+ERROR 42S02: Unknown table 'h1_1' in HANDLER
+handler h1_2 read first limit 9;
+ERROR 42S02: Unknown table 'h1_2' in HANDLER
+handler h1_3 read first limit 9;
+ERROR 42S02: Unknown table 'h1_3' in HANDLER
+drop table t1;
+drop table t2;
+drop table t3;
+drop table t4;
+drop table t5;
+create table t1 (c1 int);
+insert into t1 values (1);
+handler t1 open;
+handler t1 read first;
+c1
+1
+send the below to another connection, do not wait for the result
+optimize table t1;
+proceed with the normal connection
+handler t1 read next;
+c1
+1
+handler t1 close;
+read the result from the other connection
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+proceed with the normal connection
+drop table t1;
+CREATE TABLE t1 ( no1 smallint(5) NOT NULL default '0', no2 int(10) NOT NULL default '0', PRIMARY KEY (no1,no2));
+INSERT INTO t1 VALUES (1,274),(1,275),(2,6),(2,8),(4,1),(4,2);
+HANDLER t1 OPEN;
+HANDLER t1 READ `primary` = (1, 1000);
+no1 no2
+HANDLER t1 READ `primary` PREV;
+no1 no2
+1 275
+HANDLER t1 READ `primary` = (1, 1000);
+no1 no2
+HANDLER t1 READ `primary` NEXT;
+no1 no2
+2 6
+DROP TABLE t1;
+create table t1 (c1 int);
+insert into t1 values (14397);
+flush tables with read lock;
+drop table t1;
+ERROR HY000: Can't execute the query because you have a conflicting read lock
+send the below to another connection, do not wait for the result
+drop table t1;
+proceed with the normal connection
+select * from t1;
+c1
+14397
+unlock tables;
+read the result from the other connection
+proceed with the normal connection
+select * from t1;
+ERROR 42S02: Table 'test.t1' doesn't exist
+drop table if exists t1;
+Warnings:
+Note 1051 Unknown table 't1'
+create table t1 (a int not null) ENGINE=CSV;
+--> client 2
+handler t1 open;
+ERROR HY000: Table storage engine for 't1' doesn't have this option
+--> client 1
+drop table t1;
+create table t1 (a int);
+handler t1 open as t1_alias;
+handler t1_alias read a next;
+ERROR 42000: Key 'a' doesn't exist in table 't1_alias'
+handler t1_alias READ a next where inexistent > 0;
+ERROR 42S22: Unknown column 'inexistent' in 'field list'
+handler t1_alias read a next;
+ERROR 42000: Key 'a' doesn't exist in table 't1_alias'
+handler t1_alias READ a next where inexistent > 0;
+ERROR 42S22: Unknown column 'inexistent' in 'field list'
+handler t1_alias close;
+drop table t1;
+create temporary table t1 (a int, b char(1), key a (a), key b(a,b));
+insert into t1 values (0,"a"),(1,"b"),(2,"c"),(3,"d"),(4,"e"),
+(5,"f"),(6,"g"),(7,"h"),(8,"i"),(9,"j"),(9,'k');
+select a,b from t1;
+a b
+0 a
+1 b
+2 c
+3 d
+4 e
+5 f
+6 g
+7 h
+8 i
+9 j
+9 k
+handler t1 open as a1;
+handler a1 read a=(1);
+a b
+1 b
+handler a1 read a next;
+a b
+2 c
+handler a1 read a next;
+a b
+3 d
+select a,b from t1;
+ERROR HY000: Can't reopen table: 'a1'
+handler a1 read a prev;
+a b
+2 c
+handler a1 read a prev;
+a b
+1 b
+handler a1 read a=(6) where b="g";
+a b
+6 g
+handler a1 close;
+select a,b from t1;
+a b
+0 a
+1 b
+2 c
+3 d
+4 e
+5 f
+6 g
+7 h
+8 i
+9 j
+9 k
+handler t1 open as a2;
+handler a2 read a=(9);
+a b
+9 j
+handler a2 read a next;
+a b
+9 k
+handler a2 read a prev limit 2;
+a b
+9 j
+8 i
+handler a2 read a last;
+a b
+9 k
+handler a2 read a prev;
+a b
+9 j
+handler a2 close;
+drop table t1;
+create table t1 (a int);
+create temporary table t2 (a int, key (a));
+handler t1 open as a1;
+handler t2 open as a2;
+handler a2 read a first;
+a
+drop table t1, t2;
+handler a2 read a next;
+ERROR 42S02: Unknown table 'a2' in HANDLER
+handler a1 close;
+ERROR 42S02: Unknown table 'a1' in HANDLER
+create table t1 (a int, key (a));
+create table t2 like t1;
+handler t1 open as a1;
+handler t2 open as a2;
+handler a1 read a first;
+a
+handler a2 read a first;
+a
+alter table t1 add b int;
+handler a1 close;
+ERROR 42S02: Unknown table 'a1' in HANDLER
+handler a2 close;
+drop table t1, t2;
+create table t1 (a int, key (a));
+handler t1 open as a1;
+handler a1 read a first;
+a
+rename table t1 to t2;
+handler a1 read a first;
+ERROR 42S02: Unknown table 'a1' in HANDLER
+drop table t2;
+create table t1 (a int, key (a));
+create table t2 like t1;
+handler t1 open as a1;
+handler t2 open as a2;
+handler a1 read a first;
+a
+handler a2 read a first;
+a
+optimize table t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status Table is already up to date
+handler a1 close;
+ERROR 42S02: Unknown table 'a1' in HANDLER
+handler a2 close;
+drop table t1, t2;
+#
+# BUG#51877 - HANDLER interface causes invalid memory read
+#
+CREATE TABLE t1(a INT, KEY (a));
+HANDLER t1 OPEN;
+HANDLER t1 READ a FIRST;
+a
+INSERT INTO t1 VALUES(1);
+HANDLER t1 READ a NEXT;
+a
+1
+HANDLER t1 CLOSE;
+DROP TABLE t1;
+#
+# BUG #46456: HANDLER OPEN + TRUNCATE + DROP (temporary) TABLE, crash
+#
+CREATE TABLE t1 AS SELECT 1 AS f1;
+HANDLER t1 OPEN;
+TRUNCATE t1;
+HANDLER t1 READ FIRST;
+ERROR 42S02: Unknown table 't1' in HANDLER
+DROP TABLE t1;
+CREATE TEMPORARY TABLE t1 AS SELECT 1 AS f1;
+HANDLER t1 OPEN;
+TRUNCATE t1;
+HANDLER t1 READ FIRST;
+ERROR 42S02: Unknown table 't1' in HANDLER
+DROP TABLE t1;
+#
+# Bug #54007: assert in ha_myisam::index_next , HANDLER
+#
+CREATE TABLE t1(a INT, b INT, PRIMARY KEY(a), KEY b(b), KEY ab(a, b));
+HANDLER t1 OPEN;
+HANDLER t1 READ FIRST;
+a b
+HANDLER t1 READ `PRIMARY` NEXT;
+a b
+HANDLER t1 READ ab NEXT;
+a b
+HANDLER t1 READ b NEXT;
+a b
+HANDLER t1 READ NEXT;
+a b
+HANDLER t1 CLOSE;
+INSERT INTO t1 VALUES (2, 20), (1, 10), (4, 40), (3, 30);
+HANDLER t1 OPEN;
+HANDLER t1 READ FIRST;
+a b
+2 20
+HANDLER t1 READ NEXT;
+a b
+1 10
+HANDLER t1 READ `PRIMARY` NEXT;
+a b
+1 10
+HANDLER t1 READ `PRIMARY` NEXT;
+a b
+2 20
+HANDLER t1 READ ab NEXT;
+a b
+1 10
+HANDLER t1 READ ab NEXT;
+a b
+2 20
+HANDLER t1 READ b NEXT;
+a b
+1 10
+HANDLER t1 READ b NEXT;
+a b
+2 20
+HANDLER t1 READ b NEXT;
+a b
+3 30
+HANDLER t1 READ b NEXT;
+a b
+4 40
+HANDLER t1 READ b NEXT;
+a b
+HANDLER t1 READ NEXT;
+a b
+2 20
+HANDLER t1 READ NEXT;
+a b
+1 10
+HANDLER t1 READ NEXT;
+a b
+4 40
+HANDLER t1 CLOSE;
+HANDLER t1 OPEN;
+HANDLER t1 READ FIRST;
+a b
+2 20
+HANDLER t1 READ `PRIMARY` PREV;
+a b
+4 40
+HANDLER t1 READ `PRIMARY` PREV;
+a b
+3 30
+HANDLER t1 READ b PREV;
+a b
+4 40
+HANDLER t1 READ b PREV;
+a b
+3 30
+HANDLER t1 CLOSE;
+HANDLER t1 OPEN;
+HANDLER t1 READ FIRST;
+a b
+2 20
+HANDLER t1 READ `PRIMARY` PREV LIMIT 3;
+a b
+4 40
+3 30
+2 20
+HANDLER t1 READ b NEXT LIMIT 5;
+a b
+1 10
+2 20
+3 30
+4 40
+HANDLER t1 CLOSE;
+DROP TABLE t1;
+End of 5.1 tests
diff --git a/mysql-test/suite/handler/aria.test b/mysql-test/suite/handler/aria.test
new file mode 100644
index 00000000000..1913d2b791c
--- /dev/null
+++ b/mysql-test/suite/handler/aria.test
@@ -0,0 +1,82 @@
+# t/handler_innodb.test
+#
+# test of HANDLER ...
+#
+# Last update:
+# 2006-07-31 ML test refactored (MySQL 5.1)
+# code of t/handler.test and t/innodb_handler.test united
+# main testing code put into handler.inc
+# rename t/innodb_handler.test to t/handler_innodb.test
+#
+
+--source include/have_maria.inc
+let $engine_type= Aria;
+
+--source init.inc
+--source handler.inc
+
+--echo #
+--echo # BUG #46456: HANDLER OPEN + TRUNCATE + DROP (temporary) TABLE, crash
+--echo #
+CREATE TABLE t1 AS SELECT 1 AS f1;
+HANDLER t1 OPEN;
+TRUNCATE t1;
+--error ER_UNKNOWN_TABLE
+HANDLER t1 READ FIRST;
+DROP TABLE t1;
+
+CREATE TEMPORARY TABLE t1 AS SELECT 1 AS f1;
+HANDLER t1 OPEN;
+TRUNCATE t1;
+--error ER_UNKNOWN_TABLE
+HANDLER t1 READ FIRST;
+DROP TABLE t1;
+
+--echo #
+--echo # Bug #54007: assert in ha_myisam::index_next , HANDLER
+--echo #
+CREATE TABLE t1(a INT, b INT, PRIMARY KEY(a), KEY b(b), KEY ab(a, b));
+
+HANDLER t1 OPEN;
+HANDLER t1 READ FIRST;
+HANDLER t1 READ `PRIMARY` NEXT;
+HANDLER t1 READ ab NEXT;
+HANDLER t1 READ b NEXT;
+HANDLER t1 READ NEXT;
+HANDLER t1 CLOSE;
+
+INSERT INTO t1 VALUES (2, 20), (1, 10), (4, 40), (3, 30);
+HANDLER t1 OPEN;
+HANDLER t1 READ FIRST;
+HANDLER t1 READ NEXT;
+HANDLER t1 READ `PRIMARY` NEXT;
+HANDLER t1 READ `PRIMARY` NEXT;
+HANDLER t1 READ ab NEXT;
+HANDLER t1 READ ab NEXT;
+HANDLER t1 READ b NEXT;
+HANDLER t1 READ b NEXT;
+HANDLER t1 READ b NEXT;
+HANDLER t1 READ b NEXT;
+HANDLER t1 READ b NEXT;
+HANDLER t1 READ NEXT;
+HANDLER t1 READ NEXT;
+HANDLER t1 READ NEXT;
+HANDLER t1 CLOSE;
+
+HANDLER t1 OPEN;
+HANDLER t1 READ FIRST;
+HANDLER t1 READ `PRIMARY` PREV;
+HANDLER t1 READ `PRIMARY` PREV;
+HANDLER t1 READ b PREV;
+HANDLER t1 READ b PREV;
+HANDLER t1 CLOSE;
+
+HANDLER t1 OPEN;
+HANDLER t1 READ FIRST;
+HANDLER t1 READ `PRIMARY` PREV LIMIT 3;
+HANDLER t1 READ b NEXT LIMIT 5;
+HANDLER t1 CLOSE;
+
+DROP TABLE t1;
+
+--echo End of 5.1 tests
diff --git a/mysql-test/include/handler.inc b/mysql-test/suite/handler/handler.inc
index 6e7f53ba9b2..48ed2ce0b8a 100644
--- a/mysql-test/include/handler.inc
+++ b/mysql-test/suite/handler/handler.inc
@@ -1,5 +1,7 @@
-# include/handler.inc
+# handler.inc
#
+# See init.inc for setup of variables for this script
+#
# The variables
# $engine_type -- storage engine to be tested
# $other_engine_type -- storage engine <> $engine_type
@@ -8,31 +10,19 @@
# 2. $other_handler_engine_type must point to an all
# time available storage engine
# 2006-08 MySQL 5.1 MyISAM and MEMORY only
-# have to be set before sourcing this script.
--- source include/not_embedded.inc
#
# test of HANDLER ...
#
# Last update:
# 2006-07-31 ML test refactored (MySQL 5.1)
# code of t/handler.test and t/innodb_handler.test united
-# main testing code put into include/handler.inc
+# main testing code put into handler.inc
#
-eval SET SESSION STORAGE_ENGINE = $engine_type;
-
---disable_warnings
-drop table if exists t1,t3,t4,t5;
---enable_warnings
-
-create table t1 (a int, b char(10), key a(a), key b(a,b));
-insert into t1 values
-(17,"ddd"),(18,"eee"),(19,"fff"),(19,"yyy"),
-(14,"aaa"),(15,"bbb"),(16,"ccc"),(16,"xxx"),
-(20,"ggg"),(21,"hhh"),(22,"iii");
+#
+# Start testing the table created in init.inc
+#
handler t1 open as t2;
--- error 1064
-handler t2 read a=(SELECT 1);
handler t2 read a first;
handler t2 read a next;
handler t2 read a next;
@@ -65,12 +55,34 @@ handler t1 read a last;
handler t2 read a=(11);
handler t2 read a>=(11);
+# Search on something we ca nfind
handler t2 read a=(18);
handler t2 read a>=(18);
handler t2 read a>(18);
handler t2 read a<=(18);
handler t2 read a<(18);
+# Search on something we can't find
+handler t2 read a=(15);
+handler t2 read a>=(15);
+handler t2 read a>(15);
+handler t2 read a<=(15);
+handler t2 read a<(15);
+
+# Search from upper end
+handler t2 read a=(54);
+handler t2 read a>=(54);
+handler t2 read a>(54);
+handler t2 read a<=(54);
+handler t2 read a<(54);
+
+# Search from lower end
+handler t2 read a=(1);
+handler t2 read a>=(1);
+handler t2 read a>(1);
+handler t2 read a<=(1);
+handler t2 read a<(1);
+
handler t2 read a first limit 5;
handler t2 read a next limit 3;
handler t2 read a prev limit 10;
@@ -85,8 +97,6 @@ handler t2 read a=(19) where b="yyy";
handler t2 read first;
handler t2 read next;
handler t2 read next;
---error 1064
-handler t2 read last;
handler t2 close;
handler t1 open;
@@ -110,7 +120,7 @@ handler t2 read first;
#
handler t1 open as t2;
drop table t1;
-create table t1 (a int);
+create table t1 (a int not null);
insert into t1 values (17);
--error 1109
handler t2 read first;
@@ -137,7 +147,7 @@ drop table t1;
#
# Test for #751
#
-create table t1(a int, index(a));
+eval create table t1(a int, index $key_type (a));
insert into t1 values (1), (2), (3);
handler t1 open;
--error 1054
@@ -164,7 +174,7 @@ drop table t1;
#
# BUG#3649
#
-create table t1 ( a int, b int, INDEX a (a) );
+eval create table t1 ( a int, b int, INDEX a $key_type (a) );
insert into t1 values (1,2), (2,1);
handler t1 open;
handler t1 read a=(1) where b=2;
@@ -174,143 +184,6 @@ handler t1 close;
drop table t1;
#
-# Check if two database names beginning the same are seen as different.
-#
-# This database begins like the usual 'test' database.
-#
---disable_warnings
-drop database if exists test_test;
---enable_warnings
-create database test_test;
-use test_test;
-create table t1(table_id char(20) primary key);
-insert into t1 values ('test_test.t1');
-insert into t1 values ('');
-handler t1 open;
-handler t1 read first limit 9;
-create table t2(table_id char(20) primary key);
-insert into t2 values ('test_test.t2');
-insert into t2 values ('');
-handler t2 open;
-handler t2 read first limit 9;
-#
-# This is the usual 'test' database.
-#
-use test;
---disable_warnings
-drop table if exists t1;
---enable_warnings
-create table t1(table_id char(20) primary key);
-insert into t1 values ('test.t1');
-insert into t1 values ('');
---error 1066
-handler t1 open;
-#
-# Check accesibility of all the tables.
-#
-use test;
---error 1064
-handler test.t1 read first limit 9;
---error 1064
-handler test_test.t1 read first limit 9;
-handler t1 read first limit 9;
---error 1064
-handler test_test.t2 read first limit 9;
-handler t2 read first limit 9;
-
-#
-# Cleanup.
-#
-
---error 1064
-handler test_test.t1 close;
-handler t1 close;
-drop table test_test.t1;
---error 1064
-handler test_test.t2 close;
-handler t2 close;
-drop table test_test.t2;
-drop database test_test;
-
-#
-use test;
---error 1064
-handler test.t1 close;
---error 1109
-handler t1 close;
-drop table test.t1;
-
-#
-# BUG#4335
-#
---disable_warnings
-drop database if exists test_test;
-drop table if exists t1;
-drop table if exists t2;
-drop table if exists t3;
---enable_warnings
-create database test_test;
-use test_test;
-create table t1 (c1 char(20));
-insert into t1 values ('test_test.t1');
-create table t3 (c1 char(20));
-insert into t3 values ('test_test.t3');
-handler t1 open;
-handler t1 read first limit 9;
-handler t1 open h1;
-handler h1 read first limit 9;
-use test;
-create table t1 (c1 char(20));
-create table t2 (c1 char(20));
-create table t3 (c1 char(20));
-insert into t1 values ('t1');
-insert into t2 values ('t2');
-insert into t3 values ('t3');
---error 1066
-handler t1 open;
---error 1066
-handler t2 open t1;
---error 1066
-handler t3 open t1;
-handler t1 read first limit 9;
---error 1064
-handler test.t1 close;
---error 1066
-handler test.t1 open h1;
---error 1066
-handler test_test.t1 open h1;
-handler test_test.t3 open h3;
-handler test.t1 open h2;
-handler t1 read first limit 9;
-handler h1 read first limit 9;
-handler h2 read first limit 9;
-handler h3 read first limit 9;
-handler h2 read first limit 9;
---error 1064
-handler test.h1 close;
-handler t1 close;
-handler h1 close;
-handler h2 close;
---error 1109
-handler t1 read first limit 9;
---error 1109
-handler h1 read first limit 9;
---error 1109
-handler h2 read first limit 9;
-handler h3 read first limit 9;
-handler h3 read first limit 9;
-use test_test;
-handler h3 read first limit 9;
---error 1064
-handler test.h3 read first limit 9;
-handler h3 close;
-use test;
-drop table t3;
-drop table t2;
-drop table t1;
-drop database test_test;
-
-#
# Test if fix for BUG#4286 correctly closes handler tables.
#
create table t1 (c1 char(20));
@@ -410,11 +283,13 @@ reap;
connection default;
drop table t1;
-CREATE TABLE t1 ( no1 smallint(5) NOT NULL default '0', no2 int(10) NOT NULL default '0', PRIMARY KEY (no1,no2));
+eval CREATE TABLE t1 ( no1 smallint(5) NOT NULL default '0', no2 int(10) NOT NULL default '0', PRIMARY KEY $key_type (no1,no2));
INSERT INTO t1 VALUES (1,274),(1,275),(2,6),(2,8),(4,1),(4,2);
HANDLER t1 OPEN;
HANDLER t1 READ `primary` = (1, 1000);
HANDLER t1 READ `primary` PREV;
+HANDLER t1 READ `primary` = (1, 1000);
+HANDLER t1 READ `primary` NEXT;
DROP TABLE t1;
# End of 4.1 tests
@@ -468,10 +343,7 @@ drop table if exists t1;
#
# Bug#25856 - HANDLER table OPEN in one connection lock DROP TABLE in another one
#
---disable_warnings
-drop table if exists t1;
---enable_warnings
-eval create table t1 (a int) ENGINE=$other_engine_type;
+eval create table t1 (a int not null) ENGINE=$other_engine_type;
--echo --> client 2
connection con2;
--error 1031
@@ -484,9 +356,6 @@ disconnect con2;
#
# Bug#30632 HANDLER read failure causes hang
#
---disable_warnings
-drop table if exists t1;
---enable_warnings
create table t1 (a int);
handler t1 open as t1_alias;
--error 1176
@@ -501,89 +370,18 @@ handler t1_alias close;
drop table t1;
#
-# Bug#21587 FLUSH TABLES causes server crash when used with HANDLER statements
-#
-
---disable_warnings
-drop table if exists t1,t2;
---enable_warnings
-create table t1 (c1 int);
-create table t2 (c1 int);
-insert into t1 values (1);
-insert into t2 values (2);
---echo connection: default
-handler t1 open;
-handler t1 read first;
-connect (flush,localhost,root,,);
-connection flush;
---echo connection: flush
---send flush tables;
-connection default;
---echo connection: default
-let $wait_condition=
- select count(*) = 1 from information_schema.processlist
- where state = "Flushing tables";
---source include/wait_condition.inc
-handler t2 open;
-handler t2 read first;
-handler t1 read next;
-handler t1 close;
-handler t2 close;
-connection flush;
-reap;
-connection default;
-drop table t1,t2;
-disconnect flush;
-
-#
-# Bug#31409 RENAME TABLE causes server crash or deadlock when used with HANDLER statements
-#
-
---disable_warnings
-drop table if exists t1,t2;
---enable_warnings
-create table t1 (c1 int);
---echo connection: default
-handler t1 open;
-handler t1 read first;
-connect (flush,localhost,root,,);
-connection flush;
---echo connection: flush
---send rename table t1 to t2;
-connection default;
---echo connection: default
-let $wait_condition=
- select count(*) = 1 from information_schema.processlist
- where state = "Waiting for table" and info = "rename table t1 to t2";
---source include/wait_condition.inc
-handler t2 open;
-handler t2 read first;
---error ER_NO_SUCH_TABLE
-handler t1 read next;
-handler t1 close;
-handler t2 close;
-connection flush;
-reap;
-connection default;
-drop table t2;
-disconnect flush;
-
-#
# Bug#30882 Dropping a temporary table inside a stored function may cause a server crash
#
# Test HANDLER statements in conjunction with temporary tables. While the temporary table
# is open by a HANDLER, no other statement can access it.
#
---disable_warnings
-drop table if exists t1;
---enable_warnings
-create temporary table t1 (a int, b char(1), key a(a), key b(a,b));
+eval create temporary table t1 (a int, b char(1), key a $key_type (a), key b(a,b));
insert into t1 values (0,"a"),(1,"b"),(2,"c"),(3,"d"),(4,"e"),
- (5,"f"),(6,"g"),(7,"h"),(8,"i"),(9,"j");
+ (5,"f"),(6,"g"),(7,"h"),(8,"i"),(9,"j"),(9,'k');
select a,b from t1;
handler t1 open as a1;
-handler a1 read a first;
+handler a1 read a=(1);
handler a1 read a next;
handler a1 read a next;
--error ER_CANT_REOPEN_TABLE
@@ -594,41 +392,19 @@ handler a1 read a=(6) where b="g";
handler a1 close;
select a,b from t1;
handler t1 open as a2;
-handler a2 read a first;
+handler a2 read a=(9);
+handler a2 read a next;
+handler a2 read a prev limit 2;
+--error 0,1031
handler a2 read a last;
handler a2 read a prev;
handler a2 close;
drop table t1;
-#
-# Bug#31397 Inconsistent drop table behavior of handler tables.
-#
-
---disable_warnings
-drop table if exists t1,t2;
---enable_warnings
-create table t1 (a int);
-handler t1 open as t1_alias;
-drop table t1;
-create table t1 (a int);
-handler t1 open as t1_alias;
-flush tables;
-drop table t1;
-create table t1 (a int);
-handler t1 open as t1_alias;
-handler t1_alias close;
-drop table t1;
-create table t1 (a int);
-handler t1 open as t1_alias;
-handler t1_alias read first;
-drop table t1;
---error ER_UNKNOWN_TABLE
-handler t1_alias read next;
-
# Test that temporary tables associated with handlers are properly dropped.
create table t1 (a int);
-create temporary table t2 (a int, key(a));
+eval create temporary table t2 (a int, key $key_type (a));
handler t1 open as a1;
handler t2 open as a2;
handler a2 read a first;
@@ -640,7 +416,7 @@ handler a1 close;
# Alter table drop handlers
-create table t1 (a int, key(a));
+eval create table t1 (a int, key $key_type (a));
create table t2 like t1;
handler t1 open as a1;
handler t2 open as a2;
@@ -654,7 +430,7 @@ drop table t1, t2;
# Rename table drop handlers
-create table t1 (a int, key(a));
+eval create table t1 (a int, key $key_type (a));
handler t1 open as a1;
handler a1 read a first;
rename table t1 to t2;
@@ -664,7 +440,7 @@ drop table t2;
# Optimize table drop handlers
-create table t1 (a int, key(a));
+eval create table t1 (a int, key $key_type (a));
create table t2 like t1;
handler t1 open as a1;
handler t2 open as a2;
@@ -676,56 +452,14 @@ handler a1 close;
handler a2 close;
drop table t1, t2;
-# Flush tables causes handlers reopen
-
-create table t1 (a int, b char(1), key a(a), key b(a,b));
-insert into t1 values (0,"a"),(1,"b"),(2,"c"),(3,"d"),(4,"e"),
- (5,"f"),(6,"g"),(7,"h"),(8,"i"),(9,"j");
-handler t1 open;
-handler t1 read a first;
-handler t1 read a next;
-flush tables;
-handler t1 read a next;
-handler t1 read a next;
-flush tables with read lock;
-handler t1 read a next;
-unlock tables;
-drop table t1;
---error ER_UNKNOWN_TABLE
-handler t1 read a next;
-
-#
-# Bug#41110: crash with handler command when used concurrently with alter table
-# Bug#41112: crash in mysql_ha_close_table/get_lock_data with alter table
-#
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-create table t1 (a int);
-insert into t1 values (1);
-handler t1 open;
-connect(con1,localhost,root,,);
-send alter table t1 engine=memory;
-connection default;
-let $wait_condition=
- select count(*) = 1 from information_schema.processlist
- where state = "rename result table" and info = "alter table t1 engine=memory";
---source include/wait_condition.inc
---error ER_ILLEGAL_HA
-handler t1 read a next;
-handler t1 close;
-connection con1;
---reap
-drop table t1;
-disconnect con1;
---source include/wait_until_disconnected.inc
-connection default;
-
-#
-# Bug#44151 using handler commands on information_schema tables crashes server
-#
-USE information_schema;
---error ER_WRONG_USAGE
-HANDLER COLUMNS OPEN;
-USE test;
+--echo #
+--echo # BUG#51877 - HANDLER interface causes invalid memory read
+--echo #
+eval CREATE TABLE t1(a INT, KEY $key_type (a));
+HANDLER t1 OPEN;
+HANDLER t1 READ a FIRST;
+INSERT INTO t1 VALUES(1);
+--error 0,ER_CHECKREAD
+HANDLER t1 READ a NEXT;
+HANDLER t1 CLOSE;
+DROP TABLE t1;
diff --git a/mysql-test/suite/handler/init.inc b/mysql-test/suite/handler/init.inc
new file mode 100644
index 00000000000..32c6010f95b
--- /dev/null
+++ b/mysql-test/suite/handler/init.inc
@@ -0,0 +1,33 @@
+# Setup things for handler.inc
+#
+# Input variables
+# $engine_type -- storage engine to be tested
+# $key_type -- set if you want a non standard key type
+#
+# This scripts sets up default values for:
+# $other_engine_type -- storage engine <> $engine_type
+# $other_handler_engine_type -- storage engine <> $engine_type, if possible
+# 1. $other_handler_engine_type must support handler
+# 2. $other_handler_engine_type must point to an all
+# time available storage engine
+# have to be set before sourcing this script.
+#
+# Handler tests don't work with embedded server
+#
+-- source include/not_embedded.inc
+
+eval SET SESSION STORAGE_ENGINE = $engine_type;
+let $other_engine_type= CSV;
+let $other_handler_engine_type= MyISAM;
+
+--disable_warnings
+drop table if exists t1,t3,t4,t5;
+--enable_warnings
+
+# Create default test table
+
+eval create table t1 (a int, b char(10), key a $key_type (a), key b $key_type (a,b));
+insert into t1 values
+(17,"ddd"),(18,"eee"),(19,"fff"),(19,"yyy"),
+(14,"aaa"),(16,"ccc"),(16,"xxx"),
+(20,"ggg"),(21,"hhh"),(22,"iii");
diff --git a/mysql-test/r/handler_innodb.result b/mysql-test/suite/handler/innodb.result
index 957fc30acef..2cdaa0c4664 100644
--- a/mysql-test/r/handler_innodb.result
+++ b/mysql-test/suite/handler/innodb.result
@@ -1,25 +1,23 @@
SET SESSION STORAGE_ENGINE = InnoDB;
drop table if exists t1,t3,t4,t5;
-create table t1 (a int, b char(10), key a(a), key b(a,b));
+create table t1 (a int, b char(10), key a (a), key b (a,b));
insert into t1 values
(17,"ddd"),(18,"eee"),(19,"fff"),(19,"yyy"),
-(14,"aaa"),(15,"bbb"),(16,"ccc"),(16,"xxx"),
+(14,"aaa"),(16,"ccc"),(16,"xxx"),
(20,"ggg"),(21,"hhh"),(22,"iii");
handler t1 open as t2;
-handler t2 read a=(SELECT 1);
-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 'SELECT 1)' at line 1
handler t2 read a first;
a b
14 aaa
handler t2 read a next;
a b
-15 bbb
+16 ccc
handler t2 read a next;
a b
-16 ccc
+16 xxx
handler t2 read a prev;
a b
-15 bbb
+16 ccc
handler t2 read a last;
a b
22 iii
@@ -47,7 +45,6 @@ handler t2 read a next;
a b
handler t2 read a=(15);
a b
-15 bbb
handler t2 read a=(16);
a b
16 ccc
@@ -84,26 +81,64 @@ a b
handler t2 read a<(18);
a b
17 ddd
+handler t2 read a=(15);
+a b
+handler t2 read a>=(15);
+a b
+16 ccc
+handler t2 read a>(15);
+a b
+16 ccc
+handler t2 read a<=(15);
+a b
+14 aaa
+handler t2 read a<(15);
+a b
+14 aaa
+handler t2 read a=(54);
+a b
+handler t2 read a>=(54);
+a b
+handler t2 read a>(54);
+a b
+handler t2 read a<=(54);
+a b
+22 iii
+handler t2 read a<(54);
+a b
+22 iii
+handler t2 read a=(1);
+a b
+handler t2 read a>=(1);
+a b
+14 aaa
+handler t2 read a>(1);
+a b
+14 aaa
+handler t2 read a<=(1);
+a b
+handler t2 read a<(1);
+a b
handler t2 read a first limit 5;
a b
14 aaa
-15 bbb
16 ccc
16 xxx
17 ddd
+18 eee
handler t2 read a next limit 3;
a b
-18 eee
19 fff
19 yyy
+20 ggg
handler t2 read a prev limit 10;
a b
+19 yyy
19 fff
18 eee
17 ddd
16 xxx
16 ccc
-15 bbb
14 aaa
handler t2 read a>=(16) limit 4;
a b
@@ -135,8 +170,6 @@ a b
handler t2 read next;
a b
19 fff
-handler t2 read last;
-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
handler t2 close;
handler t1 open;
handler t1 read a next;
@@ -144,7 +177,7 @@ a b
14 aaa
handler t1 read a next;
a b
-15 bbb
+16 ccc
handler t1 close;
handler t1 open;
handler t1 read a prev;
@@ -163,12 +196,12 @@ handler t2 read first;
ERROR 42S02: Unknown table 't2' in HANDLER
handler t1 open as t2;
drop table t1;
-create table t1 (a int);
+create table t1 (a int not null);
insert into t1 values (17);
handler t2 read first;
ERROR 42S02: Unknown table 't2' in HANDLER
handler t1 open as t2;
-alter table t1 engine=MEMORY;
+alter table t1 engine=CSV;
handler t2 read first;
ERROR 42S02: Unknown table 't2' in HANDLER
drop table t1;
@@ -191,7 +224,7 @@ handler t1 read first;
a
6
drop table t1;
-create table t1(a int, index(a));
+create table t1(a int, index (a));
insert into t1 values (1), (2), (3);
handler t1 open;
handler t1 read a=(W);
@@ -217,7 +250,7 @@ Ok
handler t close;
use test;
drop table t1;
-create table t1 ( a int, b int, INDEX a (a) );
+create table t1 ( a int, b int, INDEX a (a) );
insert into t1 values (1,2), (2,1);
handler t1 open;
handler t1 read a=(1) where b=2;
@@ -229,148 +262,6 @@ handler t1 read a=(1) where b=1;
a b
handler t1 close;
drop table t1;
-drop database if exists test_test;
-create database test_test;
-use test_test;
-create table t1(table_id char(20) primary key);
-insert into t1 values ('test_test.t1');
-insert into t1 values ('');
-handler t1 open;
-handler t1 read first limit 9;
-table_id
-
-test_test.t1
-create table t2(table_id char(20) primary key);
-insert into t2 values ('test_test.t2');
-insert into t2 values ('');
-handler t2 open;
-handler t2 read first limit 9;
-table_id
-
-test_test.t2
-use test;
-drop table if exists t1;
-create table t1(table_id char(20) primary key);
-insert into t1 values ('test.t1');
-insert into t1 values ('');
-handler t1 open;
-ERROR 42000: Not unique table/alias: 't1'
-use test;
-handler test.t1 read first limit 9;
-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 'read first limit 9' at line 1
-handler test_test.t1 read first limit 9;
-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 'read first limit 9' at line 1
-handler t1 read first limit 9;
-table_id
-
-test_test.t1
-handler test_test.t2 read first limit 9;
-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 'read first limit 9' at line 1
-handler t2 read first limit 9;
-table_id
-
-test_test.t2
-handler test_test.t1 close;
-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 'close' at line 1
-handler t1 close;
-drop table test_test.t1;
-handler test_test.t2 close;
-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 'close' at line 1
-handler t2 close;
-drop table test_test.t2;
-drop database test_test;
-use test;
-handler test.t1 close;
-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 'close' at line 1
-handler t1 close;
-ERROR 42S02: Unknown table 't1' in HANDLER
-drop table test.t1;
-drop database if exists test_test;
-drop table if exists t1;
-drop table if exists t2;
-drop table if exists t3;
-create database test_test;
-use test_test;
-create table t1 (c1 char(20));
-insert into t1 values ('test_test.t1');
-create table t3 (c1 char(20));
-insert into t3 values ('test_test.t3');
-handler t1 open;
-handler t1 read first limit 9;
-c1
-test_test.t1
-handler t1 open h1;
-handler h1 read first limit 9;
-c1
-test_test.t1
-use test;
-create table t1 (c1 char(20));
-create table t2 (c1 char(20));
-create table t3 (c1 char(20));
-insert into t1 values ('t1');
-insert into t2 values ('t2');
-insert into t3 values ('t3');
-handler t1 open;
-ERROR 42000: Not unique table/alias: 't1'
-handler t2 open t1;
-ERROR 42000: Not unique table/alias: 't1'
-handler t3 open t1;
-ERROR 42000: Not unique table/alias: 't1'
-handler t1 read first limit 9;
-c1
-test_test.t1
-handler test.t1 close;
-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 'close' at line 1
-handler test.t1 open h1;
-ERROR 42000: Not unique table/alias: 'h1'
-handler test_test.t1 open h1;
-ERROR 42000: Not unique table/alias: 'h1'
-handler test_test.t3 open h3;
-handler test.t1 open h2;
-handler t1 read first limit 9;
-c1
-test_test.t1
-handler h1 read first limit 9;
-c1
-test_test.t1
-handler h2 read first limit 9;
-c1
-t1
-handler h3 read first limit 9;
-c1
-test_test.t3
-handler h2 read first limit 9;
-c1
-t1
-handler test.h1 close;
-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 'close' at line 1
-handler t1 close;
-handler h1 close;
-handler h2 close;
-handler t1 read first limit 9;
-ERROR 42S02: Unknown table 't1' in HANDLER
-handler h1 read first limit 9;
-ERROR 42S02: Unknown table 'h1' in HANDLER
-handler h2 read first limit 9;
-ERROR 42S02: Unknown table 'h2' in HANDLER
-handler h3 read first limit 9;
-c1
-test_test.t3
-handler h3 read first limit 9;
-c1
-test_test.t3
-use test_test;
-handler h3 read first limit 9;
-c1
-test_test.t3
-handler test.h3 read first limit 9;
-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 'read first limit 9' at line 1
-handler h3 close;
-use test;
-drop table t3;
-drop table t2;
-drop table t1;
-drop database test_test;
create table t1 (c1 char(20));
insert into t1 values ("t1");
handler t1 open as h1;
@@ -496,6 +387,11 @@ no1 no2
HANDLER t1 READ `primary` PREV;
no1 no2
1 275
+HANDLER t1 READ `primary` = (1, 1000);
+no1 no2
+HANDLER t1 READ `primary` NEXT;
+no1 no2
+2 8
DROP TABLE t1;
create table t1 (c1 int);
insert into t1 values (14397);
@@ -516,14 +412,12 @@ ERROR 42S02: Table 'test.t1' doesn't exist
drop table if exists t1;
Warnings:
Note 1051 Unknown table 't1'
-drop table if exists t1;
-create table t1 (a int) ENGINE=MEMORY;
+create table t1 (a int not null) ENGINE=CSV;
--> client 2
handler t1 open;
ERROR HY000: Table storage engine for 't1' doesn't have this option
--> client 1
drop table t1;
-drop table if exists t1;
create table t1 (a int);
handler t1 open as t1_alias;
handler t1_alias read a next;
@@ -536,50 +430,9 @@ handler t1_alias READ a next where inexistent > 0;
ERROR 42S22: Unknown column 'inexistent' in 'field list'
handler t1_alias close;
drop table t1;
-drop table if exists t1,t2;
-create table t1 (c1 int);
-create table t2 (c1 int);
-insert into t1 values (1);
-insert into t2 values (2);
-connection: default
-handler t1 open;
-handler t1 read first;
-c1
-1
-connection: flush
-flush tables;;
-connection: default
-handler t2 open;
-handler t2 read first;
-c1
-2
-handler t1 read next;
-c1
-1
-handler t1 close;
-handler t2 close;
-drop table t1,t2;
-drop table if exists t1,t2;
-create table t1 (c1 int);
-connection: default
-handler t1 open;
-handler t1 read first;
-c1
-connection: flush
-rename table t1 to t2;;
-connection: default
-handler t2 open;
-handler t2 read first;
-c1
-handler t1 read next;
-ERROR 42S02: Table 'test.t1' doesn't exist
-handler t1 close;
-handler t2 close;
-drop table t2;
-drop table if exists t1;
-create temporary table t1 (a int, b char(1), key a(a), key b(a,b));
+create temporary table t1 (a int, b char(1), key a (a), key b(a,b));
insert into t1 values (0,"a"),(1,"b"),(2,"c"),(3,"d"),(4,"e"),
-(5,"f"),(6,"g"),(7,"h"),(8,"i"),(9,"j");
+(5,"f"),(6,"g"),(7,"h"),(8,"i"),(9,"j"),(9,'k');
select a,b from t1;
a b
0 a
@@ -592,24 +445,25 @@ a b
7 h
8 i
9 j
+9 k
handler t1 open as a1;
-handler a1 read a first;
-a b
-0 a
-handler a1 read a next;
+handler a1 read a=(1);
a b
1 b
handler a1 read a next;
a b
2 c
+handler a1 read a next;
+a b
+3 d
select a,b from t1;
ERROR HY000: Can't reopen table: 'a1'
handler a1 read a prev;
a b
-1 b
+2 c
handler a1 read a prev;
a b
-0 a
+1 b
handler a1 read a=(6) where b="g";
a b
6 g
@@ -626,39 +480,28 @@ a b
7 h
8 i
9 j
+9 k
handler t1 open as a2;
-handler a2 read a first;
+handler a2 read a=(9);
a b
-0 a
-handler a2 read a last;
+9 j
+handler a2 read a next;
+a b
+9 k
+handler a2 read a prev limit 2;
a b
9 j
+8 i
+handler a2 read a last;
+a b
+9 k
handler a2 read a prev;
a b
-8 i
+9 j
handler a2 close;
drop table t1;
-drop table if exists t1,t2;
-create table t1 (a int);
-handler t1 open as t1_alias;
-drop table t1;
create table t1 (a int);
-handler t1 open as t1_alias;
-flush tables;
-drop table t1;
-create table t1 (a int);
-handler t1 open as t1_alias;
-handler t1_alias close;
-drop table t1;
-create table t1 (a int);
-handler t1 open as t1_alias;
-handler t1_alias read first;
-a
-drop table t1;
-handler t1_alias read next;
-ERROR 42S02: Unknown table 't1_alias' in HANDLER
-create table t1 (a int);
-create temporary table t2 (a int, key(a));
+create temporary table t2 (a int, key (a));
handler t1 open as a1;
handler t2 open as a2;
handler a2 read a first;
@@ -668,7 +511,7 @@ handler a2 read a next;
ERROR 42S02: Unknown table 'a2' in HANDLER
handler a1 close;
ERROR 42S02: Unknown table 'a1' in HANDLER
-create table t1 (a int, key(a));
+create table t1 (a int, key (a));
create table t2 like t1;
handler t1 open as a1;
handler t2 open as a2;
@@ -681,7 +524,7 @@ handler a1 close;
ERROR 42S02: Unknown table 'a1' in HANDLER
handler a2 close;
drop table t1, t2;
-create table t1 (a int, key(a));
+create table t1 (a int, key (a));
handler t1 open as a1;
handler a1 read a first;
a
@@ -689,7 +532,7 @@ rename table t1 to t2;
handler a1 read a first;
ERROR 42S02: Unknown table 'a1' in HANDLER
drop table t2;
-create table t1 (a int, key(a));
+create table t1 (a int, key (a));
create table t2 like t1;
handler t1 open as a1;
handler t2 open as a2;
@@ -705,41 +548,25 @@ handler a1 close;
ERROR 42S02: Unknown table 'a1' in HANDLER
handler a2 close;
drop table t1, t2;
-create table t1 (a int, b char(1), key a(a), key b(a,b));
-insert into t1 values (0,"a"),(1,"b"),(2,"c"),(3,"d"),(4,"e"),
-(5,"f"),(6,"g"),(7,"h"),(8,"i"),(9,"j");
-handler t1 open;
-handler t1 read a first;
-a b
-0 a
-handler t1 read a next;
-a b
-1 b
-flush tables;
-handler t1 read a next;
-a b
-0 a
-handler t1 read a next;
-a b
-1 b
-flush tables with read lock;
-handler t1 read a next;
-a b
-0 a
-unlock tables;
-drop table t1;
-handler t1 read a next;
-ERROR 42S02: Unknown table 't1' in HANDLER
-drop table if exists t1;
-create table t1 (a int);
-insert into t1 values (1);
-handler t1 open;
-alter table t1 engine=memory;
-handler t1 read a next;
-ERROR HY000: Table storage engine for 't1' doesn't have this option
-handler t1 close;
-drop table t1;
-USE information_schema;
-HANDLER COLUMNS OPEN;
-ERROR HY000: Incorrect usage of HANDLER OPEN and information_schema
-USE test;
+#
+# BUG#51877 - HANDLER interface causes invalid memory read
+#
+CREATE TABLE t1(a INT, KEY (a));
+HANDLER t1 OPEN;
+HANDLER t1 READ a FIRST;
+a
+INSERT INTO t1 VALUES(1);
+HANDLER t1 READ a NEXT;
+a
+HANDLER t1 CLOSE;
+DROP TABLE t1;
+CREATE TABLE t1 (f1 integer, f2 integer, primary key (f1), key (f2)) engine=innodb;
+INSERT INTO t1 VALUES (1,1),(2,2),(3,3);
+HANDLER t1 OPEN;
+HANDLER t1 READ FIRST WHERE f2 <= 1;
+f1 f2
+1 1
+HANDLER t1 READ `PRIMARY` PREV;
+f1 f2
+3 3
+DROP TABLE t1;
diff --git a/mysql-test/suite/handler/innodb.test b/mysql-test/suite/handler/innodb.test
new file mode 100644
index 00000000000..6527c4bb8bb
--- /dev/null
+++ b/mysql-test/suite/handler/innodb.test
@@ -0,0 +1,28 @@
+# t/handler_innodb.test
+#
+# test of HANDLER ...
+#
+# Last update:
+# 2006-07-31 ML test refactored (MySQL 5.1)
+# code of t/handler.test and t/innodb_handler.test united
+# main testing code put into handler.inc
+# rename t/innodb_handler.test to t/handler_innodb.test
+#
+
+--source include/have_innodb.inc
+
+let $engine_type= InnoDB;
+
+--source init.inc
+--source handler.inc
+
+#
+# LP#697610 ha_index_prev(uchar*): Assertion `inited==INDEX'
+#
+
+CREATE TABLE t1 (f1 integer, f2 integer, primary key (f1), key (f2)) engine=innodb;
+INSERT INTO t1 VALUES (1,1),(2,2),(3,3);
+HANDLER t1 OPEN;
+HANDLER t1 READ FIRST WHERE f2 <= 1;
+HANDLER t1 READ `PRIMARY` PREV;
+DROP TABLE t1;
diff --git a/mysql-test/suite/handler/interface.result b/mysql-test/suite/handler/interface.result
new file mode 100644
index 00000000000..0b5a4447739
--- /dev/null
+++ b/mysql-test/suite/handler/interface.result
@@ -0,0 +1,259 @@
+drop table if exists t1,t3,t4,t5;
+drop database if exists test_test;
+SET SESSION STORAGE_ENGINE = MyISAM;
+drop table if exists t1,t3,t4,t5;
+create table t1 (a int, b char(10), key a (a), key b (a,b));
+insert into t1 values
+(17,"ddd"),(18,"eee"),(19,"fff"),(19,"yyy"),
+(14,"aaa"),(16,"ccc"),(16,"xxx"),
+(20,"ggg"),(21,"hhh"),(22,"iii");
+handler t1 open;
+handler t1 read a=(SELECT 1);
+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 'SELECT 1)' at line 1
+handler t1 read a=(1) FIRST;
+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 'FIRST' at line 1
+handler t1 read a=(1) NEXT;
+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 'NEXT' at line 1
+handler t1 read last;
+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
+handler t1 close;
+drop table t1;
+CREATE TABLE t1(a INT, PRIMARY KEY(a));
+insert into t1 values(1),(2);
+handler t1 open;
+handler t1 read primary=(1);
+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 'primary=(1)' at line 1
+handler t1 read `primary`=(1);
+a
+1
+handler t1 close;
+drop table t1;
+create database test_test;
+use test_test;
+create table t1(table_id char(20), primary key (table_id));
+insert into t1 values ('test_test.t1');
+insert into t1 values ('');
+handler t1 open;
+handler t1 read first limit 9;
+table_id
+test_test.t1
+
+create table t2(table_id char(20), primary key (table_id));
+insert into t2 values ('test_test.t2');
+insert into t2 values ('');
+handler t2 open;
+handler t2 read first limit 9;
+table_id
+test_test.t2
+
+use test;
+create table t1(table_id char(20), primary key (table_id));
+insert into t1 values ('test.t1');
+insert into t1 values ('');
+handler t1 open;
+ERROR 42000: Not unique table/alias: 't1'
+use test;
+handler test.t1 read first limit 9;
+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 'read first limit 9' at line 1
+handler test_test.t1 read first limit 9;
+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 'read first limit 9' at line 1
+handler t1 read first limit 9;
+table_id
+test_test.t1
+
+handler test_test.t2 read first limit 9;
+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 'read first limit 9' at line 1
+handler t2 read first limit 9;
+table_id
+test_test.t2
+
+handler test_test.t1 close;
+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 'close' at line 1
+handler t1 close;
+drop table test_test.t1;
+handler test_test.t2 close;
+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 'close' at line 1
+handler t2 close;
+drop table test_test.t2;
+drop database test_test;
+use test;
+handler test.t1 close;
+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 'close' at line 1
+handler t1 close;
+ERROR 42S02: Unknown table 't1' in HANDLER
+drop table test.t1;
+create database test_test;
+use test_test;
+create table t1 (c1 char(20));
+insert into t1 values ('test_test.t1');
+create table t3 (c1 char(20));
+insert into t3 values ('test_test.t3');
+handler t1 open;
+handler t1 read first limit 9;
+c1
+test_test.t1
+handler t1 open h1;
+handler h1 read first limit 9;
+c1
+test_test.t1
+use test;
+create table t1 (c1 char(20));
+create table t2 (c1 char(20));
+create table t3 (c1 char(20));
+insert into t1 values ('t1');
+insert into t2 values ('t2');
+insert into t3 values ('t3');
+handler t1 open;
+ERROR 42000: Not unique table/alias: 't1'
+handler t2 open t1;
+ERROR 42000: Not unique table/alias: 't1'
+handler t3 open t1;
+ERROR 42000: Not unique table/alias: 't1'
+handler t1 read first limit 9;
+c1
+test_test.t1
+handler test.t1 close;
+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 'close' at line 1
+handler test.t1 open h1;
+ERROR 42000: Not unique table/alias: 'h1'
+handler test_test.t1 open h1;
+ERROR 42000: Not unique table/alias: 'h1'
+handler test_test.t3 open h3;
+handler test.t1 open h2;
+handler t1 read first limit 9;
+c1
+test_test.t1
+handler h1 read first limit 9;
+c1
+test_test.t1
+handler h2 read first limit 9;
+c1
+t1
+handler h3 read first limit 9;
+c1
+test_test.t3
+handler h2 read first limit 9;
+c1
+t1
+handler test.h1 close;
+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 'close' at line 1
+handler t1 close;
+handler h1 close;
+handler h2 close;
+handler t1 read first limit 9;
+ERROR 42S02: Unknown table 't1' in HANDLER
+handler h1 read first limit 9;
+ERROR 42S02: Unknown table 'h1' in HANDLER
+handler h2 read first limit 9;
+ERROR 42S02: Unknown table 'h2' in HANDLER
+handler h3 read first limit 9;
+c1
+test_test.t3
+handler h3 read first limit 9;
+c1
+test_test.t3
+use test_test;
+handler h3 read first limit 9;
+c1
+test_test.t3
+handler test.h3 read first limit 9;
+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 'read first limit 9' at line 1
+handler h3 close;
+use test;
+drop table t3;
+drop table t2;
+drop table t1;
+drop database test_test;
+create table t1 (c1 int);
+create table t2 (c1 int);
+insert into t1 values (1);
+insert into t2 values (2);
+connection: default
+handler t1 open;
+handler t1 read first;
+c1
+1
+connection: flush
+flush tables;;
+connection: default
+handler t2 open;
+handler t2 read first;
+c1
+2
+handler t1 read next;
+c1
+1
+handler t1 close;
+handler t2 close;
+drop table t1,t2;
+create table t1 (a int);
+handler t1 open as t1_alias;
+drop table t1;
+create table t1 (a int);
+handler t1 open as t1_alias;
+flush tables;
+drop table t1;
+create table t1 (a int);
+handler t1 open as t1_alias;
+handler t1_alias close;
+drop table t1;
+create table t1 (a int);
+handler t1 open as t1_alias;
+handler t1_alias read first;
+a
+drop table t1;
+handler t1_alias read next;
+ERROR 42S02: Unknown table 't1_alias' in HANDLER
+create table t1 (c1 int);
+connection: default
+handler t1 open;
+handler t1 read first;
+c1
+connection: flush
+rename table t1 to t2;;
+connection: default
+handler t2 open;
+handler t2 read first;
+c1
+handler t1 read next;
+ERROR 42S02: Table 'test.t1' doesn't exist
+handler t1 close;
+handler t2 close;
+drop table t2;
+create table t1 (a int, b char(1), key a (a), key b (a,b));
+insert into t1 values (0,"a"),(1,"b"),(2,"c"),(3,"d"),(4,"e"),
+(5,"f"),(6,"g"),(7,"h"),(8,"i"),(9,"j");
+handler t1 open;
+handler t1 read a first;
+a b
+0 a
+handler t1 read a next;
+a b
+1 b
+flush tables;
+handler t1 read a next;
+a b
+0 a
+handler t1 read a next;
+a b
+1 b
+flush tables with read lock;
+handler t1 read a next;
+a b
+0 a
+unlock tables;
+drop table t1;
+handler t1 read a next;
+ERROR 42S02: Unknown table 't1' in HANDLER
+drop table if exists t1;
+create table t1 (a int not null);
+insert into t1 values (1);
+handler t1 open;
+alter table t1 engine=csv;
+handler t1 read a next;
+ERROR HY000: Table storage engine for 't1' doesn't have this option
+handler t1 close;
+drop table t1;
+USE information_schema;
+HANDLER COLUMNS OPEN;
+ERROR HY000: Incorrect usage of HANDLER OPEN and information_schema
diff --git a/mysql-test/suite/handler/interface.test b/mysql-test/suite/handler/interface.test
new file mode 100644
index 00000000000..809f0228f98
--- /dev/null
+++ b/mysql-test/suite/handler/interface.test
@@ -0,0 +1,307 @@
+#
+# Tests of handler interface that are system independent
+#
+# Handler tests don't work yet with embedded server
+#
+-- source include/not_embedded.inc
+
+--disable_warnings
+drop table if exists t1,t3,t4,t5;
+drop database if exists test_test;
+--enable_warnings
+
+# Run tests with myisam (any engine should be ok)
+
+let $engine_type= MyISAM;
+
+--source init.inc
+
+#
+# Do some syntax checking
+#
+
+handler t1 open;
+--error ER_PARSE_ERROR
+handler t1 read a=(SELECT 1);
+--error ER_PARSE_ERROR
+handler t1 read a=(1) FIRST;
+--error ER_PARSE_ERROR
+handler t1 read a=(1) NEXT;
+--error ER_PARSE_ERROR
+handler t1 read last;
+handler t1 close;
+drop table t1;
+
+CREATE TABLE t1(a INT, PRIMARY KEY(a));
+insert into t1 values(1),(2);
+handler t1 open;
+--error ER_PARSE_ERROR
+handler t1 read primary=(1);
+handler t1 read `primary`=(1);
+handler t1 close;
+drop table t1;
+
+#
+# Check if two database names beginning the same are seen as different.
+#
+# This database begins like the usual 'test' database.
+#
+create database test_test;
+use test_test;
+eval create table t1(table_id char(20), primary key $key_type (table_id));
+insert into t1 values ('test_test.t1');
+insert into t1 values ('');
+handler t1 open;
+handler t1 read first limit 9;
+eval create table t2(table_id char(20), primary key $key_type (table_id));
+insert into t2 values ('test_test.t2');
+insert into t2 values ('');
+handler t2 open;
+handler t2 read first limit 9;
+#
+# This is the usual 'test' database.
+#
+use test;
+eval create table t1(table_id char(20), primary key $key_type (table_id));
+insert into t1 values ('test.t1');
+insert into t1 values ('');
+--error 1066
+handler t1 open;
+#
+# Check accessibility of all the tables.
+#
+use test;
+--error 1064
+handler test.t1 read first limit 9;
+--error 1064
+handler test_test.t1 read first limit 9;
+handler t1 read first limit 9;
+--error 1064
+handler test_test.t2 read first limit 9;
+handler t2 read first limit 9;
+
+#
+# Cleanup.
+#
+
+--error 1064
+handler test_test.t1 close;
+handler t1 close;
+drop table test_test.t1;
+--error 1064
+handler test_test.t2 close;
+handler t2 close;
+drop table test_test.t2;
+drop database test_test;
+
+#
+use test;
+--error 1064
+handler test.t1 close;
+--error 1109
+handler t1 close;
+drop table test.t1;
+
+#
+# BUG#4335 one name can be handler open'ed many times
+#
+
+create database test_test;
+use test_test;
+create table t1 (c1 char(20));
+insert into t1 values ('test_test.t1');
+create table t3 (c1 char(20));
+insert into t3 values ('test_test.t3');
+handler t1 open;
+handler t1 read first limit 9;
+handler t1 open h1;
+handler h1 read first limit 9;
+use test;
+create table t1 (c1 char(20));
+create table t2 (c1 char(20));
+create table t3 (c1 char(20));
+insert into t1 values ('t1');
+insert into t2 values ('t2');
+insert into t3 values ('t3');
+--error 1066
+handler t1 open;
+--error 1066
+handler t2 open t1;
+--error 1066
+handler t3 open t1;
+handler t1 read first limit 9;
+--error 1064
+handler test.t1 close;
+--error 1066
+handler test.t1 open h1;
+--error 1066
+handler test_test.t1 open h1;
+handler test_test.t3 open h3;
+handler test.t1 open h2;
+handler t1 read first limit 9;
+handler h1 read first limit 9;
+handler h2 read first limit 9;
+handler h3 read first limit 9;
+handler h2 read first limit 9;
+--error 1064
+handler test.h1 close;
+handler t1 close;
+handler h1 close;
+handler h2 close;
+--error 1109
+handler t1 read first limit 9;
+--error 1109
+handler h1 read first limit 9;
+--error 1109
+handler h2 read first limit 9;
+handler h3 read first limit 9;
+handler h3 read first limit 9;
+use test_test;
+handler h3 read first limit 9;
+--error 1064
+handler test.h3 read first limit 9;
+handler h3 close;
+use test;
+drop table t3;
+drop table t2;
+drop table t1;
+drop database test_test;
+
+#
+# Bug#21587 FLUSH TABLES causes server crash when used with HANDLER statements
+#
+
+create table t1 (c1 int);
+create table t2 (c1 int);
+insert into t1 values (1);
+insert into t2 values (2);
+--echo connection: default
+handler t1 open;
+handler t1 read first;
+connect (flush,localhost,root,,);
+connection flush;
+--echo connection: flush
+--send flush tables;
+connection default;
+--echo connection: default
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Flushing tables";
+--source include/wait_condition.inc
+handler t2 open;
+handler t2 read first;
+handler t1 read next;
+handler t1 close;
+handler t2 close;
+connection flush;
+reap;
+connection default;
+drop table t1,t2;
+disconnect flush;
+
+#
+# Bug#31397 Inconsistent drop table behavior of handler tables.
+#
+
+create table t1 (a int);
+handler t1 open as t1_alias;
+drop table t1;
+create table t1 (a int);
+handler t1 open as t1_alias;
+flush tables;
+drop table t1;
+create table t1 (a int);
+handler t1 open as t1_alias;
+handler t1_alias close;
+drop table t1;
+create table t1 (a int);
+handler t1 open as t1_alias;
+handler t1_alias read first;
+drop table t1;
+--error ER_UNKNOWN_TABLE
+handler t1_alias read next;
+
+#
+# Bug#31409 RENAME TABLE causes server crash or deadlock when used with
+# HANDLER statements
+#
+
+create table t1 (c1 int);
+--echo connection: default
+handler t1 open;
+handler t1 read first;
+connect (flush,localhost,root,,);
+connection flush;
+--echo connection: flush
+--send rename table t1 to t2;
+connection default;
+--echo connection: default
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for table" and info = "rename table t1 to t2";
+--source include/wait_condition.inc
+handler t2 open;
+handler t2 read first;
+--error ER_NO_SUCH_TABLE
+handler t1 read next;
+handler t1 close;
+handler t2 close;
+connection flush;
+reap;
+connection default;
+drop table t2;
+disconnect flush;
+
+# Flush tables causes handlers reopen
+
+eval create table t1 (a int, b char(1), key a $key_type (a), key b $key_type (a,b));
+insert into t1 values (0,"a"),(1,"b"),(2,"c"),(3,"d"),(4,"e"),
+ (5,"f"),(6,"g"),(7,"h"),(8,"i"),(9,"j");
+handler t1 open;
+handler t1 read a first;
+handler t1 read a next;
+flush tables;
+handler t1 read a next;
+handler t1 read a next;
+flush tables with read lock;
+handler t1 read a next;
+unlock tables;
+drop table t1;
+--error ER_UNKNOWN_TABLE
+handler t1 read a next;
+
+#
+# Bug#41110: crash with handler command when used concurrently with alter table
+# Bug#41112: crash in mysql_ha_close_table/get_lock_data with alter table
+#
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (a int not null);
+insert into t1 values (1);
+handler t1 open;
+connect(con1,localhost,root,,);
+send alter table t1 engine=csv;
+connection default;
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "rename result table" and info = "alter table t1 engine=csv";
+--source include/wait_condition.inc
+--error ER_ILLEGAL_HA
+handler t1 read a next;
+handler t1 close;
+connection con1;
+--reap
+drop table t1;
+disconnect con1;
+--source include/wait_until_disconnected.inc
+connection default;
+
+#
+# Bug#44151 using handler commands on information_schema tables crashes server
+#
+
+USE information_schema;
+--error ER_WRONG_USAGE
+HANDLER COLUMNS OPEN;
diff --git a/mysql-test/r/handler_myisam.result b/mysql-test/suite/handler/myisam.result
index b20b8dbb138..bd356d6e81d 100644
--- a/mysql-test/r/handler_myisam.result
+++ b/mysql-test/suite/handler/myisam.result
@@ -1,25 +1,23 @@
SET SESSION STORAGE_ENGINE = MyISAM;
drop table if exists t1,t3,t4,t5;
-create table t1 (a int, b char(10), key a(a), key b(a,b));
+create table t1 (a int, b char(10), key a (a), key b (a,b));
insert into t1 values
(17,"ddd"),(18,"eee"),(19,"fff"),(19,"yyy"),
-(14,"aaa"),(15,"bbb"),(16,"ccc"),(16,"xxx"),
+(14,"aaa"),(16,"ccc"),(16,"xxx"),
(20,"ggg"),(21,"hhh"),(22,"iii");
handler t1 open as t2;
-handler t2 read a=(SELECT 1);
-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 'SELECT 1)' at line 1
handler t2 read a first;
a b
14 aaa
handler t2 read a next;
a b
-15 bbb
+16 ccc
handler t2 read a next;
a b
-16 ccc
+16 xxx
handler t2 read a prev;
a b
-15 bbb
+16 ccc
handler t2 read a last;
a b
22 iii
@@ -47,7 +45,6 @@ handler t2 read a next;
a b
handler t2 read a=(15);
a b
-15 bbb
handler t2 read a=(16);
a b
16 ccc
@@ -84,26 +81,64 @@ a b
handler t2 read a<(18);
a b
17 ddd
+handler t2 read a=(15);
+a b
+handler t2 read a>=(15);
+a b
+16 ccc
+handler t2 read a>(15);
+a b
+16 ccc
+handler t2 read a<=(15);
+a b
+14 aaa
+handler t2 read a<(15);
+a b
+14 aaa
+handler t2 read a=(54);
+a b
+handler t2 read a>=(54);
+a b
+handler t2 read a>(54);
+a b
+handler t2 read a<=(54);
+a b
+22 iii
+handler t2 read a<(54);
+a b
+22 iii
+handler t2 read a=(1);
+a b
+handler t2 read a>=(1);
+a b
+14 aaa
+handler t2 read a>(1);
+a b
+14 aaa
+handler t2 read a<=(1);
+a b
+handler t2 read a<(1);
+a b
handler t2 read a first limit 5;
a b
14 aaa
-15 bbb
16 ccc
16 xxx
17 ddd
+18 eee
handler t2 read a next limit 3;
a b
-18 eee
19 fff
19 yyy
+20 ggg
handler t2 read a prev limit 10;
a b
+19 yyy
19 fff
18 eee
17 ddd
16 xxx
16 ccc
-15 bbb
14 aaa
handler t2 read a>=(16) limit 4;
a b
@@ -135,8 +170,6 @@ a b
handler t2 read next;
a b
19 fff
-handler t2 read last;
-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
handler t2 close;
handler t1 open;
handler t1 read a next;
@@ -144,7 +177,7 @@ a b
14 aaa
handler t1 read a next;
a b
-15 bbb
+16 ccc
handler t1 close;
handler t1 open;
handler t1 read a prev;
@@ -163,12 +196,12 @@ handler t2 read first;
ERROR 42S02: Unknown table 't2' in HANDLER
handler t1 open as t2;
drop table t1;
-create table t1 (a int);
+create table t1 (a int not null);
insert into t1 values (17);
handler t2 read first;
ERROR 42S02: Unknown table 't2' in HANDLER
handler t1 open as t2;
-alter table t1 engine=MEMORY;
+alter table t1 engine=CSV;
handler t2 read first;
ERROR 42S02: Unknown table 't2' in HANDLER
drop table t1;
@@ -191,7 +224,7 @@ handler t1 read first;
a
6
drop table t1;
-create table t1(a int, index(a));
+create table t1(a int, index (a));
insert into t1 values (1), (2), (3);
handler t1 open;
handler t1 read a=(W);
@@ -217,7 +250,7 @@ Ok
handler t close;
use test;
drop table t1;
-create table t1 ( a int, b int, INDEX a (a) );
+create table t1 ( a int, b int, INDEX a (a) );
insert into t1 values (1,2), (2,1);
handler t1 open;
handler t1 read a=(1) where b=2;
@@ -229,148 +262,6 @@ handler t1 read a=(1) where b=1;
a b
handler t1 close;
drop table t1;
-drop database if exists test_test;
-create database test_test;
-use test_test;
-create table t1(table_id char(20) primary key);
-insert into t1 values ('test_test.t1');
-insert into t1 values ('');
-handler t1 open;
-handler t1 read first limit 9;
-table_id
-test_test.t1
-
-create table t2(table_id char(20) primary key);
-insert into t2 values ('test_test.t2');
-insert into t2 values ('');
-handler t2 open;
-handler t2 read first limit 9;
-table_id
-test_test.t2
-
-use test;
-drop table if exists t1;
-create table t1(table_id char(20) primary key);
-insert into t1 values ('test.t1');
-insert into t1 values ('');
-handler t1 open;
-ERROR 42000: Not unique table/alias: 't1'
-use test;
-handler test.t1 read first limit 9;
-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 'read first limit 9' at line 1
-handler test_test.t1 read first limit 9;
-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 'read first limit 9' at line 1
-handler t1 read first limit 9;
-table_id
-test_test.t1
-
-handler test_test.t2 read first limit 9;
-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 'read first limit 9' at line 1
-handler t2 read first limit 9;
-table_id
-test_test.t2
-
-handler test_test.t1 close;
-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 'close' at line 1
-handler t1 close;
-drop table test_test.t1;
-handler test_test.t2 close;
-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 'close' at line 1
-handler t2 close;
-drop table test_test.t2;
-drop database test_test;
-use test;
-handler test.t1 close;
-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 'close' at line 1
-handler t1 close;
-ERROR 42S02: Unknown table 't1' in HANDLER
-drop table test.t1;
-drop database if exists test_test;
-drop table if exists t1;
-drop table if exists t2;
-drop table if exists t3;
-create database test_test;
-use test_test;
-create table t1 (c1 char(20));
-insert into t1 values ('test_test.t1');
-create table t3 (c1 char(20));
-insert into t3 values ('test_test.t3');
-handler t1 open;
-handler t1 read first limit 9;
-c1
-test_test.t1
-handler t1 open h1;
-handler h1 read first limit 9;
-c1
-test_test.t1
-use test;
-create table t1 (c1 char(20));
-create table t2 (c1 char(20));
-create table t3 (c1 char(20));
-insert into t1 values ('t1');
-insert into t2 values ('t2');
-insert into t3 values ('t3');
-handler t1 open;
-ERROR 42000: Not unique table/alias: 't1'
-handler t2 open t1;
-ERROR 42000: Not unique table/alias: 't1'
-handler t3 open t1;
-ERROR 42000: Not unique table/alias: 't1'
-handler t1 read first limit 9;
-c1
-test_test.t1
-handler test.t1 close;
-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 'close' at line 1
-handler test.t1 open h1;
-ERROR 42000: Not unique table/alias: 'h1'
-handler test_test.t1 open h1;
-ERROR 42000: Not unique table/alias: 'h1'
-handler test_test.t3 open h3;
-handler test.t1 open h2;
-handler t1 read first limit 9;
-c1
-test_test.t1
-handler h1 read first limit 9;
-c1
-test_test.t1
-handler h2 read first limit 9;
-c1
-t1
-handler h3 read first limit 9;
-c1
-test_test.t3
-handler h2 read first limit 9;
-c1
-t1
-handler test.h1 close;
-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 'close' at line 1
-handler t1 close;
-handler h1 close;
-handler h2 close;
-handler t1 read first limit 9;
-ERROR 42S02: Unknown table 't1' in HANDLER
-handler h1 read first limit 9;
-ERROR 42S02: Unknown table 'h1' in HANDLER
-handler h2 read first limit 9;
-ERROR 42S02: Unknown table 'h2' in HANDLER
-handler h3 read first limit 9;
-c1
-test_test.t3
-handler h3 read first limit 9;
-c1
-test_test.t3
-use test_test;
-handler h3 read first limit 9;
-c1
-test_test.t3
-handler test.h3 read first limit 9;
-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 'read first limit 9' at line 1
-handler h3 close;
-use test;
-drop table t3;
-drop table t2;
-drop table t1;
-drop database test_test;
create table t1 (c1 char(20));
insert into t1 values ("t1");
handler t1 open as h1;
@@ -495,6 +386,11 @@ no1 no2
HANDLER t1 READ `primary` PREV;
no1 no2
1 275
+HANDLER t1 READ `primary` = (1, 1000);
+no1 no2
+HANDLER t1 READ `primary` NEXT;
+no1 no2
+2 6
DROP TABLE t1;
create table t1 (c1 int);
insert into t1 values (14397);
@@ -515,14 +411,12 @@ ERROR 42S02: Table 'test.t1' doesn't exist
drop table if exists t1;
Warnings:
Note 1051 Unknown table 't1'
-drop table if exists t1;
-create table t1 (a int) ENGINE=MEMORY;
+create table t1 (a int not null) ENGINE=CSV;
--> client 2
handler t1 open;
ERROR HY000: Table storage engine for 't1' doesn't have this option
--> client 1
drop table t1;
-drop table if exists t1;
create table t1 (a int);
handler t1 open as t1_alias;
handler t1_alias read a next;
@@ -535,50 +429,9 @@ handler t1_alias READ a next where inexistent > 0;
ERROR 42S22: Unknown column 'inexistent' in 'field list'
handler t1_alias close;
drop table t1;
-drop table if exists t1,t2;
-create table t1 (c1 int);
-create table t2 (c1 int);
-insert into t1 values (1);
-insert into t2 values (2);
-connection: default
-handler t1 open;
-handler t1 read first;
-c1
-1
-connection: flush
-flush tables;;
-connection: default
-handler t2 open;
-handler t2 read first;
-c1
-2
-handler t1 read next;
-c1
-1
-handler t1 close;
-handler t2 close;
-drop table t1,t2;
-drop table if exists t1,t2;
-create table t1 (c1 int);
-connection: default
-handler t1 open;
-handler t1 read first;
-c1
-connection: flush
-rename table t1 to t2;;
-connection: default
-handler t2 open;
-handler t2 read first;
-c1
-handler t1 read next;
-ERROR 42S02: Table 'test.t1' doesn't exist
-handler t1 close;
-handler t2 close;
-drop table t2;
-drop table if exists t1;
-create temporary table t1 (a int, b char(1), key a(a), key b(a,b));
+create temporary table t1 (a int, b char(1), key a (a), key b(a,b));
insert into t1 values (0,"a"),(1,"b"),(2,"c"),(3,"d"),(4,"e"),
-(5,"f"),(6,"g"),(7,"h"),(8,"i"),(9,"j");
+(5,"f"),(6,"g"),(7,"h"),(8,"i"),(9,"j"),(9,'k');
select a,b from t1;
a b
0 a
@@ -591,24 +444,25 @@ a b
7 h
8 i
9 j
+9 k
handler t1 open as a1;
-handler a1 read a first;
-a b
-0 a
-handler a1 read a next;
+handler a1 read a=(1);
a b
1 b
handler a1 read a next;
a b
2 c
+handler a1 read a next;
+a b
+3 d
select a,b from t1;
ERROR HY000: Can't reopen table: 'a1'
handler a1 read a prev;
a b
-1 b
+2 c
handler a1 read a prev;
a b
-0 a
+1 b
handler a1 read a=(6) where b="g";
a b
6 g
@@ -625,39 +479,28 @@ a b
7 h
8 i
9 j
+9 k
handler t1 open as a2;
-handler a2 read a first;
+handler a2 read a=(9);
a b
-0 a
-handler a2 read a last;
+9 j
+handler a2 read a next;
+a b
+9 k
+handler a2 read a prev limit 2;
a b
9 j
+8 i
+handler a2 read a last;
+a b
+9 k
handler a2 read a prev;
a b
-8 i
+9 j
handler a2 close;
drop table t1;
-drop table if exists t1,t2;
-create table t1 (a int);
-handler t1 open as t1_alias;
-drop table t1;
-create table t1 (a int);
-handler t1 open as t1_alias;
-flush tables;
-drop table t1;
-create table t1 (a int);
-handler t1 open as t1_alias;
-handler t1_alias close;
-drop table t1;
-create table t1 (a int);
-handler t1 open as t1_alias;
-handler t1_alias read first;
-a
-drop table t1;
-handler t1_alias read next;
-ERROR 42S02: Unknown table 't1_alias' in HANDLER
create table t1 (a int);
-create temporary table t2 (a int, key(a));
+create temporary table t2 (a int, key (a));
handler t1 open as a1;
handler t2 open as a2;
handler a2 read a first;
@@ -667,7 +510,7 @@ handler a2 read a next;
ERROR 42S02: Unknown table 'a2' in HANDLER
handler a1 close;
ERROR 42S02: Unknown table 'a1' in HANDLER
-create table t1 (a int, key(a));
+create table t1 (a int, key (a));
create table t2 like t1;
handler t1 open as a1;
handler t2 open as a2;
@@ -680,7 +523,7 @@ handler a1 close;
ERROR 42S02: Unknown table 'a1' in HANDLER
handler a2 close;
drop table t1, t2;
-create table t1 (a int, key(a));
+create table t1 (a int, key (a));
handler t1 open as a1;
handler a1 read a first;
a
@@ -688,7 +531,7 @@ rename table t1 to t2;
handler a1 read a first;
ERROR 42S02: Unknown table 'a1' in HANDLER
drop table t2;
-create table t1 (a int, key(a));
+create table t1 (a int, key (a));
create table t2 like t1;
handler t1 open as a1;
handler t2 open as a2;
@@ -703,44 +546,19 @@ handler a1 close;
ERROR 42S02: Unknown table 'a1' in HANDLER
handler a2 close;
drop table t1, t2;
-create table t1 (a int, b char(1), key a(a), key b(a,b));
-insert into t1 values (0,"a"),(1,"b"),(2,"c"),(3,"d"),(4,"e"),
-(5,"f"),(6,"g"),(7,"h"),(8,"i"),(9,"j");
-handler t1 open;
-handler t1 read a first;
-a b
-0 a
-handler t1 read a next;
-a b
-1 b
-flush tables;
-handler t1 read a next;
-a b
-0 a
-handler t1 read a next;
-a b
-1 b
-flush tables with read lock;
-handler t1 read a next;
-a b
-0 a
-unlock tables;
-drop table t1;
-handler t1 read a next;
-ERROR 42S02: Unknown table 't1' in HANDLER
-drop table if exists t1;
-create table t1 (a int);
-insert into t1 values (1);
-handler t1 open;
-alter table t1 engine=memory;
-handler t1 read a next;
-ERROR HY000: Table storage engine for 't1' doesn't have this option
-handler t1 close;
-drop table t1;
-USE information_schema;
-HANDLER COLUMNS OPEN;
-ERROR HY000: Incorrect usage of HANDLER OPEN and information_schema
-USE test;
+#
+# BUG#51877 - HANDLER interface causes invalid memory read
+#
+CREATE TABLE t1(a INT, KEY (a));
+HANDLER t1 OPEN;
+HANDLER t1 READ a FIRST;
+a
+INSERT INTO t1 VALUES(1);
+HANDLER t1 READ a NEXT;
+a
+1
+HANDLER t1 CLOSE;
+DROP TABLE t1;
#
# BUG #46456: HANDLER OPEN + TRUNCATE + DROP (temporary) TABLE, crash
#
@@ -757,19 +575,6 @@ HANDLER t1 READ FIRST;
ERROR 42S02: Unknown table 't1' in HANDLER
DROP TABLE t1;
#
-# BUG#51877 - HANDLER interface causes invalid memory read
-#
-CREATE TABLE t1(a INT, KEY(a));
-HANDLER t1 OPEN;
-HANDLER t1 READ a FIRST;
-a
-INSERT INTO t1 VALUES(1);
-HANDLER t1 READ a NEXT;
-a
-1
-HANDLER t1 CLOSE;
-DROP TABLE t1;
-#
# Bug #54007: assert in ha_myisam::index_next , HANDLER
#
CREATE TABLE t1(a INT, b INT, PRIMARY KEY(a), KEY b(b), KEY ab(a, b));
@@ -821,12 +626,13 @@ HANDLER t1 READ b NEXT;
a b
HANDLER t1 READ NEXT;
a b
-4 40
+2 20
HANDLER t1 READ NEXT;
a b
-3 30
+1 10
HANDLER t1 READ NEXT;
a b
+4 40
HANDLER t1 CLOSE;
HANDLER t1 OPEN;
HANDLER t1 READ FIRST;
diff --git a/mysql-test/t/handler_myisam.test b/mysql-test/suite/handler/myisam.test
index e78072ef8a0..c6acf1e822c 100644
--- a/mysql-test/t/handler_myisam.test
+++ b/mysql-test/suite/handler/myisam.test
@@ -5,20 +5,14 @@
# Last update:
# 2006-07-31 ML test refactored (MySQL 5.1)
# code of t/handler.test and t/innodb_handler.test united
-# main testing code put into include/handler.inc
+# main testing code put into handler.inc
# rename t/handler.test to t/handler_myisam.test
#
-# should work in embedded server after mysqltest is fixed
---source include/not_embedded.inc
-
let $engine_type= MyISAM;
-let $other_engine_type= MEMORY;
-# There is unfortunately no other all time available storage engine
-# which supports the handler interface
-let $other_handler_engine_type= MyISAM;
---source include/handler.inc
+--source init.inc
+--source handler.inc
--echo #
--echo # BUG #46456: HANDLER OPEN + TRUNCATE + DROP (temporary) TABLE, crash
@@ -38,18 +32,6 @@ HANDLER t1 READ FIRST;
DROP TABLE t1;
--echo #
---echo # BUG#51877 - HANDLER interface causes invalid memory read
---echo #
-CREATE TABLE t1(a INT, KEY(a));
-HANDLER t1 OPEN;
-HANDLER t1 READ a FIRST;
-INSERT INTO t1 VALUES(1);
-HANDLER t1 READ a NEXT;
-HANDLER t1 CLOSE;
-DROP TABLE t1;
-
-
---echo #
--echo # Bug #54007: assert in ha_myisam::index_next , HANDLER
--echo #
CREATE TABLE t1(a INT, b INT, PRIMARY KEY(a), KEY b(b), KEY ab(a, b));
diff --git a/mysql-test/suite/innodb/r/innodb_bug56143.result b/mysql-test/suite/innodb/r/innodb_bug56143.result
new file mode 100644
index 00000000000..cfff4d60d1b
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_bug56143.result
@@ -0,0 +1,560 @@
+SHOW CREATE TABLE bug56143;
+Table Create Table
+bug56143 CREATE TABLE `bug56143` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL,
+ KEY `a` (`a`),
+ KEY `b` (`b`),
+ KEY `c` (`c`),
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa10` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa100` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa101` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa102` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa103` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa104` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa105` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa106` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa107` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa108` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa109` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa11` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa110` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa111` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa112` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa113` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa114` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa115` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa116` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa117` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa118` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa119` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa12` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa120` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa121` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa122` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa123` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa124` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa125` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa126` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa127` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa128` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa129` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa13` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa130` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa131` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa132` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa133` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa134` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa135` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa136` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa137` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa138` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa139` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa14` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa140` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa141` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa142` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa143` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa144` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa145` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa146` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa147` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa148` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa149` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa15` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa150` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa151` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa152` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa153` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa154` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa155` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa156` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa157` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa158` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa159` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa16` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa160` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa161` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa162` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa163` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa164` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa165` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa166` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa167` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa168` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa169` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa17` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa170` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa171` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa172` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa173` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa174` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa175` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa176` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa177` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa178` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa179` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa18` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa180` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa181` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa182` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa183` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa184` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa185` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa186` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa187` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa188` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa189` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa19` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa190` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa191` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa192` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa193` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa194` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa195` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa196` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa197` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa198` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa199` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa20` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa200` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa201` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa202` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa203` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa204` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa205` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa206` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa207` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa208` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa209` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa21` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa210` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa211` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa212` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa213` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa214` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa215` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa216` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa217` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa218` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa219` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa22` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa220` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa221` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa222` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa223` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa224` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa225` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa226` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa227` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa228` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa229` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa23` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa230` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa231` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa232` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa233` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa234` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa235` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa236` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa237` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa238` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa239` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa24` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa240` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa241` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa242` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa243` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa244` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa245` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa246` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa247` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa248` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa249` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa25` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa250` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa251` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa252` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa253` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa254` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa255` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa256` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa257` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa258` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa259` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa26` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa260` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa261` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa262` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa263` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa264` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa265` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa266` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa267` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa268` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa269` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa27` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa270` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa271` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa272` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa273` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa274` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa275` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa276` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa277` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa278` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa279` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa28` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa280` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa281` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa282` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa283` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa284` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa285` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa286` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa287` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa288` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa289` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa29` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa290` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa291` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa292` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa293` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa294` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa295` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa296` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa297` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa298` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa299` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa3` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa30` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa300` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa301` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa302` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa303` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa304` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa305` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa306` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa307` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa308` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa309` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa31` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa310` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa311` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa312` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa313` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa314` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa315` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa316` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa317` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa318` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa319` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa32` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa320` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa321` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa322` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa323` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa324` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa325` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa326` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa327` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa328` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa329` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa33` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa330` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa331` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa332` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa333` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa334` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa335` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa336` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa337` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa338` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa339` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa34` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa340` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa341` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa342` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa343` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa344` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa345` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa346` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa347` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa348` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa349` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa35` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa350` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa351` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa352` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa353` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa354` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa355` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa356` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa357` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa358` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa359` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa36` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa360` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa361` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa362` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa363` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa364` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa365` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa366` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa367` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa368` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa369` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa37` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa370` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa371` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa372` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa373` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa374` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa375` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa376` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa377` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa378` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa379` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa38` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa380` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa381` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa382` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa383` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa384` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa385` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa386` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa387` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa388` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa389` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa39` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa390` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa391` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa392` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa393` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa394` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa395` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa396` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa397` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa398` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa399` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa40` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa400` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa401` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa402` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa403` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa404` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa405` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa406` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa407` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa408` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa409` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa41` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa410` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa411` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa412` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa413` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa414` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa415` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa416` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa417` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa418` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa419` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa42` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa420` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa421` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa422` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa423` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa424` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa425` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa426` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa427` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa428` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa429` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa43` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa430` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa431` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa432` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa433` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa434` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa435` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa436` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa437` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa438` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa439` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa44` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa440` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa441` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa442` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa443` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa444` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa445` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa446` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa447` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa448` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa449` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa45` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa450` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa451` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa452` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa453` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa454` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa455` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa456` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa457` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa458` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa459` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa46` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa460` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa461` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa462` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa463` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa464` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa465` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa466` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa467` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa468` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa469` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa47` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa470` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa471` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa472` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa473` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa474` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa475` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa476` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa477` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa478` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa479` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa48` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa480` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa481` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa482` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa483` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa484` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa485` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa486` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa487` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa488` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa489` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa49` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa490` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa491` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa492` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa493` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa494` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa495` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa496` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa497` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa498` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa499` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa5` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa50` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa500` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa501` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa502` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa503` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa504` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa505` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa506` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa507` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa508` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa509` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa51` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa510` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa511` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa512` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa513` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa514` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa515` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa516` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa517` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa518` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa519` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa52` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa520` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa521` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa522` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa523` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa524` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa525` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa526` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa527` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa528` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa529` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa53` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa530` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa531` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa532` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa533` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa534` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa535` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa536` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa537` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa538` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa539` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa54` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa540` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa541` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa542` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa543` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa544` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa545` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa546` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa547` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa548` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa549` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa55` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa550` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa56` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa57` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa58` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa59` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa6` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa60` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa61` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa62` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa63` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa64` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa65` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa66` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa67` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa68` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa69` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa7` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa70` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa71` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa72` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa73` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa74` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa75` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa76` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa77` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa78` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa79` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa8` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa80` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa81` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa82` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa83` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa84` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa85` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa86` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa87` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa88` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa89` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa90` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa91` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa92` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa93` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa94` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa95` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa96` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa97` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa98` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa99` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
diff --git a/mysql-test/suite/innodb/r/innodb_bug56680.result b/mysql-test/suite/innodb/r/innodb_bug56680.result
new file mode 100644
index 00000000000..c3afc3e6581
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_bug56680.result
@@ -0,0 +1,102 @@
+SET GLOBAL tx_isolation='REPEATABLE-READ';
+CREATE TABLE bug56680(
+a INT AUTO_INCREMENT PRIMARY KEY,
+b CHAR(1),
+c INT,
+INDEX(b))
+ENGINE=InnoDB;
+INSERT INTO bug56680 VALUES(0,'x',1);
+BEGIN;
+SELECT b FROM bug56680;
+b
+x
+BEGIN;
+UPDATE bug56680 SET b='X';
+SELECT b FROM bug56680;
+b
+x
+SELECT * FROM bug56680;
+a b c
+1 x 1
+ROLLBACK;
+SELECT b FROM bug56680;
+b
+x
+SET GLOBAL tx_isolation='READ-UNCOMMITTED';
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+BEGIN;
+SELECT b FROM bug56680 LIMIT 2;
+b
+x
+x
+BEGIN;
+DELETE FROM bug56680 WHERE a=1;
+INSERT INTO bug56680 VALUES(1,'X',1);
+SELECT b FROM bug56680 LIMIT 3;
+b
+X
+x
+x
+SELECT b FROM bug56680 LIMIT 2;
+b
+x
+x
+CHECK TABLE bug56680;
+Table Op Msg_type Msg_text
+test.bug56680 check status OK
+ROLLBACK;
+SELECT b FROM bug56680 LIMIT 2;
+b
+x
+x
+CHECK TABLE bug56680;
+Table Op Msg_type Msg_text
+test.bug56680 check status OK
+SELECT b FROM bug56680 LIMIT 2;
+b
+x
+x
+CREATE TABLE bug56680_2(
+a INT AUTO_INCREMENT PRIMARY KEY,
+b VARCHAR(2) CHARSET latin1 COLLATE latin1_german2_ci,
+c INT,
+INDEX(b))
+ENGINE=InnoDB;
+INSERT INTO bug56680_2 SELECT 0,_latin1 0xdf,c FROM bug56680;
+BEGIN;
+SELECT HEX(b) FROM bug56680_2 LIMIT 2;
+HEX(b)
+DF
+DF
+DELETE FROM bug56680_2 WHERE a=1;
+INSERT INTO bug56680_2 VALUES(1,'SS',1);
+SELECT HEX(b) FROM bug56680_2 LIMIT 3;
+HEX(b)
+5353
+DF
+DF
+CHECK TABLE bug56680_2;
+Table Op Msg_type Msg_text
+test.bug56680_2 check status OK
+DELETE FROM bug56680_2 WHERE a=1;
+INSERT INTO bug56680_2 VALUES(1,_latin1 0xdf,1);
+SELECT HEX(b) FROM bug56680_2 LIMIT 3;
+HEX(b)
+DF
+DF
+DF
+CHECK TABLE bug56680_2;
+Table Op Msg_type Msg_text
+test.bug56680_2 check status OK
+DROP TABLE bug56680_2;
+DROP TABLE bug56680;
diff --git a/mysql-test/suite/innodb/r/innodb_bug56716.result b/mysql-test/suite/innodb/r/innodb_bug56716.result
new file mode 100644
index 00000000000..50d83e8d87a
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_bug56716.result
@@ -0,0 +1,4 @@
+CREATE TABLE bug56716 (a INT PRIMARY KEY,b INT,c INT,INDEX(b)) ENGINE=InnoDB;
+SELECT * FROM bug56716 WHERE b<=42 ORDER BY b DESC FOR UPDATE;
+a b c
+DROP TABLE bug56716;
diff --git a/mysql-test/suite/innodb/r/innodb_bug57252.result b/mysql-test/suite/innodb/r/innodb_bug57252.result
new file mode 100644
index 00000000000..efa50c742e0
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_bug57252.result
@@ -0,0 +1,6 @@
+cardinality
+10
+Table Op Msg_type Msg_text
+test.bug57252 analyze status OK
+cardinality
+10
diff --git a/mysql-test/suite/innodb/r/innodb_bug57255.result b/mysql-test/suite/innodb/r/innodb_bug57255.result
new file mode 100644
index 00000000000..d61a0d42ba3
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_bug57255.result
@@ -0,0 +1,10 @@
+create table A(id int not null primary key) engine=innodb;
+create table B(id int not null auto_increment primary key, f1 int not null, foreign key(f1) references A(id) on delete cascade) engine=innodb;
+create table C(id int not null auto_increment primary key, f1 int not null, foreign key(f1) references B(id) on delete cascade) engine=innodb;
+insert into A values(1), (2);
+DELETE FROM A where id = 1;
+DELETE FROM C where f1 = 2;
+DELETE FROM A where id = 1;
+DROP TABLE C;
+DROP TABLE B;
+DROP TABLE A;
diff --git a/mysql-test/suite/innodb/r/innodb_mysql.result b/mysql-test/suite/innodb/r/innodb_mysql.result
index 12ff0ae8ac6..08fb0bdfe2e 100644
--- a/mysql-test/suite/innodb/r/innodb_mysql.result
+++ b/mysql-test/suite/innodb/r/innodb_mysql.result
@@ -1594,7 +1594,17 @@ TRUNCATE t1;
INSERT INTO t1 VALUES (1,'init');
CREATE PROCEDURE p1()
BEGIN
+# retry the UPDATE in case it times out the lock before con1 has time
+# to COMMIT.
+DECLARE do_retry INT DEFAULT 0;
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET do_retry = 1;
+retry_loop:LOOP
UPDATE t1 SET b = CONCAT(b, '+con2') WHERE a = 1;
+IF do_retry = 0 THEN
+LEAVE retry_loop;
+END IF;
+SET do_retry = 0;
+END LOOP;
INSERT INTO t2 VALUES ();
END|
BEGIN;
@@ -2607,4 +2617,31 @@ rows 3
Extra Using index
DROP TABLE t1;
#
+# ALTER TABLE IGNORE didn't ignore duplicates for unique add index
+#
+create table t1 (a int primary key, b int) engine = innodb;
+insert into t1 values (1,1),(2,1);
+alter ignore table t1 add unique `main` (b);
+drop table t1;
+#
End of 5.1 tests
+#
+# Test for bug #39932 "create table fails if column for FK is in different
+# case than in corr index".
+#
+drop tables if exists t1, t2;
+create table t1 (pk int primary key) engine=InnoDB;
+# Even although the below statement uses uppercased field names in
+# foreign key definition it still should be able to find explicitly
+# created supporting index. So it should succeed and should not
+# create any additional supporting indexes.
+create table t2 (fk int, key x (fk),
+constraint x foreign key (FK) references t1 (PK)) engine=InnoDB;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `fk` int(11) DEFAULT NULL,
+ KEY `x` (`fk`),
+ CONSTRAINT `x` FOREIGN KEY (`fk`) REFERENCES `t1` (`pk`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+drop table t2, t1;
diff --git a/mysql-test/suite/innodb/t/innodb_bug38231.test b/mysql-test/suite/innodb/t/innodb_bug38231.test
index 1611cb56203..5021f23d07e 100644
--- a/mysql-test/suite/innodb/t/innodb_bug38231.test
+++ b/mysql-test/suite/innodb/t/innodb_bug38231.test
@@ -76,6 +76,11 @@ UNLOCK TABLES;
UNLOCK TABLES;
-- connection con3
+#
+# We may get a timeout error here if the tables are locked in a different
+# order than expected. This is ok as the purpose of this patch is to ensure
+# we don't get a crash in the previous unlock tables.
+-- error 0, 1205
-- reap
UNLOCK TABLES;
diff --git a/mysql-test/suite/innodb/t/innodb_bug53756.test b/mysql-test/suite/innodb/t/innodb_bug53756.test
index 8324f2640a2..d3b0a77c680 100644
--- a/mysql-test/suite/innodb/t/innodb_bug53756.test
+++ b/mysql-test/suite/innodb/t/innodb_bug53756.test
@@ -34,8 +34,8 @@ INSERT INTO bug_53756 VALUES(1, 11), (2, 22), (3, 33), (4, 44);
--echo
--echo # Select a less restrictive isolation level.
# Don't use user variables. They won't survive server crash.
---let $global_isolation= `SELECT @@global.tx_isolation`;
---let $session_isolation= `SELECT @@session.tx_isolation`;
+--let $global_isolation= `SELECT @@global.tx_isolation`
+--let $session_isolation= `SELECT @@session.tx_isolation`
SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
COMMIT;
diff --git a/mysql-test/suite/innodb/t/innodb_bug56143.test b/mysql-test/suite/innodb/t/innodb_bug56143.test
new file mode 100644
index 00000000000..6532022283f
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_bug56143.test
@@ -0,0 +1,580 @@
+#
+# Bug#56143 too many foreign keys causes output of show create table to become invalid
+# http://bugs.mysql.com/56143
+#
+
+-- source include/have_innodb.inc
+-- source include/have_not_innodb_plugin.inc
+
+-- disable_query_log
+-- disable_result_log
+
+SET foreign_key_checks=0;
+DROP TABLE IF EXISTS bug56143;
+CREATE TABLE `bug56143` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL,
+ KEY `a` (`a`),
+ KEY `b` (`b`),
+ KEY `c` (`c`),
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa10` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa100` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa101` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa102` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa103` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa104` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa105` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa106` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa107` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa108` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa109` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa11` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa110` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa111` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa112` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa113` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa114` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa115` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa116` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa117` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa118` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa119` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa12` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa120` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa121` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa122` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa123` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa124` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa125` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa126` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa127` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa128` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa129` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa13` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa130` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa131` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa132` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa133` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa134` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa135` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa136` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa137` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa138` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa139` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa14` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa140` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa141` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa142` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa143` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa144` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa145` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa146` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa147` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa148` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa149` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa15` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa150` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa151` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa152` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa153` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa154` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa155` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa156` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa157` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa158` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa159` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa16` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa160` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa161` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa162` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa163` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa164` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa165` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa166` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa167` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa168` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa169` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa17` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa170` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa171` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa172` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa173` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa174` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa175` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa176` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa177` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa178` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa179` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa18` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa180` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa181` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa182` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa183` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa184` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa185` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa186` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa187` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa188` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa189` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa19` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa190` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa191` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa192` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa193` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa194` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa195` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa196` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa197` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa198` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa199` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa20` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa200` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa201` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa202` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa203` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa204` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa205` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa206` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa207` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa208` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa209` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa21` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa210` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa211` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa212` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa213` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa214` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa215` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa216` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa217` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa218` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa219` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa22` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa220` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa221` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa222` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa223` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa224` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa225` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa226` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa227` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa228` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa229` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa23` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa230` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa231` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa232` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa233` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa234` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa235` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa236` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa237` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa238` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa239` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa24` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa240` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa241` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa242` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa243` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa244` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa245` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa246` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa247` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa248` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa249` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa25` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa250` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa251` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa252` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa253` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa254` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa255` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa256` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa257` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa258` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa259` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa26` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa260` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa261` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa262` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa263` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa264` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa265` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa266` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa267` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa268` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa269` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa27` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa270` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa271` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa272` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa273` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa274` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa275` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa276` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa277` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa278` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa279` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa28` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa280` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa281` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa282` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa283` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa284` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa285` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa286` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa287` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa288` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa289` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa29` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa290` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa291` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa292` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa293` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa294` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa295` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa296` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa297` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa298` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa299` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa3` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa30` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa300` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa301` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa302` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa303` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa304` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa305` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa306` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa307` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa308` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa309` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa31` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa310` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa311` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa312` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa313` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa314` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa315` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa316` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa317` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa318` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa319` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa32` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa320` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa321` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa322` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa323` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa324` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa325` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa326` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa327` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa328` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa329` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa33` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa330` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa331` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa332` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa333` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa334` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa335` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa336` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa337` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa338` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa339` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa34` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa340` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa341` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa342` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa343` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa344` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa345` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa346` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa347` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa348` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa349` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa35` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa350` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa351` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa352` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa353` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa354` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa355` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa356` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa357` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa358` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa359` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa36` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa360` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa361` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa362` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa363` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa364` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa365` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa366` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa367` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa368` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa369` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa37` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa370` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa371` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa372` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa373` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa374` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa375` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa376` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa377` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa378` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa379` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa38` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa380` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa381` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa382` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa383` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa384` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa385` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa386` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa387` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa388` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa389` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa39` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa390` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa391` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa392` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa393` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa394` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa395` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa396` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa397` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa398` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa399` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa40` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa400` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa401` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa402` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa403` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa404` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa405` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa406` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa407` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa408` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa409` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa41` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa410` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa411` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa412` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa413` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa414` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa415` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa416` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa417` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa418` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa419` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa42` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa420` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa421` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa422` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa423` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa424` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa425` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa426` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa427` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa428` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa429` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa43` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa430` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa431` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa432` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa433` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa434` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa435` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa436` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa437` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa438` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa439` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa44` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa440` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa441` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa442` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa443` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa444` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa445` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa446` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa447` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa448` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa449` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa45` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa450` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa451` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa452` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa453` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa454` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa455` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa456` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa457` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa458` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa459` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa46` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa460` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa461` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa462` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa463` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa464` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa465` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa466` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa467` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa468` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa469` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa47` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa470` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa471` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa472` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa473` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa474` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa475` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa476` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa477` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa478` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa479` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa48` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa480` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa481` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa482` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa483` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa484` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa485` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa486` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa487` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa488` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa489` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa49` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa490` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa491` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa492` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa493` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa494` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa495` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa496` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa497` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa498` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa499` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa5` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa50` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa500` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa501` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa502` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa503` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa504` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa505` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa506` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa507` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa508` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa509` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa51` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa510` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa511` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa512` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa513` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa514` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa515` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa516` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa517` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa518` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa519` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa52` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa520` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa521` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa522` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa523` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa524` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa525` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa526` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa527` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa528` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa529` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa53` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa530` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa531` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa532` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa533` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa534` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa535` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa536` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa537` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa538` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa539` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa54` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa540` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa541` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa542` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa543` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa544` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa545` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa546` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa547` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa548` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa549` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa55` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa550` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa56` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa57` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa58` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa59` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa6` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa60` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa61` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa62` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa63` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa64` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa65` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa66` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa67` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa68` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa69` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa7` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa70` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa71` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa72` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa73` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa74` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa75` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa76` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa77` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa78` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa79` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa8` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa80` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa81` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa82` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa83` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa84` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa85` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa86` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa87` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa88` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa89` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa90` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa91` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa92` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa93` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa94` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa95` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa96` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa97` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa98` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa99` FOREIGN KEY (`b`) REFERENCES `bug56143` (`b`) ON UPDATE SET NULL
+) ENGINE=InnoDB;
+
+-- enable_query_log
+-- enable_result_log
+
+SHOW CREATE TABLE bug56143;
+
+-- disable_query_log
+-- disable_result_log
+DROP TABLE bug56143;
diff --git a/mysql-test/suite/innodb/t/innodb_bug56680.test b/mysql-test/suite/innodb/t/innodb_bug56680.test
new file mode 100644
index 00000000000..ab81ca2f8e6
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_bug56680.test
@@ -0,0 +1,130 @@
+#
+# Bug #56680 InnoDB may return wrong results from a case-insensitive index
+#
+-- source include/have_innodb.inc
+
+-- disable_query_log
+SET @tx_isolation_orig = @@tx_isolation;
+# The flag innodb_change_buffering_debug is only available in debug builds.
+# It instructs InnoDB to try to evict pages from the buffer pool when
+# change buffering is possible, so that the change buffer will be used
+# whenever possible.
+-- error 0,ER_UNKNOWN_SYSTEM_VARIABLE
+SET @innodb_change_buffering_debug_orig = @@innodb_change_buffering_debug;
+-- error 0,ER_UNKNOWN_SYSTEM_VARIABLE
+SET GLOBAL innodb_change_buffering_debug = 1;
+-- enable_query_log
+SET GLOBAL tx_isolation='REPEATABLE-READ';
+
+CREATE TABLE bug56680(
+ a INT AUTO_INCREMENT PRIMARY KEY,
+ b CHAR(1),
+ c INT,
+ INDEX(b))
+ENGINE=InnoDB;
+
+INSERT INTO bug56680 VALUES(0,'x',1);
+BEGIN;
+SELECT b FROM bug56680;
+
+connect (con1,localhost,root,,);
+connection con1;
+BEGIN;
+UPDATE bug56680 SET b='X';
+
+connection default;
+# This should return the last committed value 'x', but would return 'X'
+# due to a bug in row_search_for_mysql().
+SELECT b FROM bug56680;
+# This would always return the last committed value 'x'.
+SELECT * FROM bug56680;
+
+connection con1;
+ROLLBACK;
+disconnect con1;
+
+connection default;
+
+SELECT b FROM bug56680;
+
+# For the rest of this test, use the READ UNCOMMITTED isolation level
+# to see what exists in the secondary index.
+SET GLOBAL tx_isolation='READ-UNCOMMITTED';
+
+# Create enough rows for the table, so that the insert buffer will be
+# used for modifying the secondary index page. There must be multiple
+# index pages, because changes to the root page are never buffered.
+
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+
+BEGIN;
+SELECT b FROM bug56680 LIMIT 2;
+
+connect (con1,localhost,root,,);
+connection con1;
+BEGIN;
+DELETE FROM bug56680 WHERE a=1;
+# This should be buffered, if innodb_change_buffering_debug = 1 is in effect.
+INSERT INTO bug56680 VALUES(1,'X',1);
+
+# This should force an insert buffer merge, and return 'X' in the first row.
+SELECT b FROM bug56680 LIMIT 3;
+
+connection default;
+SELECT b FROM bug56680 LIMIT 2;
+CHECK TABLE bug56680;
+
+connection con1;
+ROLLBACK;
+SELECT b FROM bug56680 LIMIT 2;
+CHECK TABLE bug56680;
+
+connection default;
+disconnect con1;
+
+SELECT b FROM bug56680 LIMIT 2;
+
+CREATE TABLE bug56680_2(
+ a INT AUTO_INCREMENT PRIMARY KEY,
+ b VARCHAR(2) CHARSET latin1 COLLATE latin1_german2_ci,
+ c INT,
+ INDEX(b))
+ENGINE=InnoDB;
+
+INSERT INTO bug56680_2 SELECT 0,_latin1 0xdf,c FROM bug56680;
+
+BEGIN;
+SELECT HEX(b) FROM bug56680_2 LIMIT 2;
+DELETE FROM bug56680_2 WHERE a=1;
+# This should be buffered, if innodb_change_buffering_debug = 1 is in effect.
+INSERT INTO bug56680_2 VALUES(1,'SS',1);
+
+# This should force an insert buffer merge, and return 'SS' in the first row.
+SELECT HEX(b) FROM bug56680_2 LIMIT 3;
+CHECK TABLE bug56680_2;
+
+DELETE FROM bug56680_2 WHERE a=1;
+# This should be buffered, if innodb_change_buffering_debug = 1 is in effect.
+INSERT INTO bug56680_2 VALUES(1,_latin1 0xdf,1);
+
+# This should force an insert buffer merge, and return 0xdf in the first row.
+SELECT HEX(b) FROM bug56680_2 LIMIT 3;
+CHECK TABLE bug56680_2;
+
+DROP TABLE bug56680_2;
+DROP TABLE bug56680;
+
+-- disable_query_log
+SET GLOBAL tx_isolation = @tx_isolation_orig;
+-- error 0, ER_UNKNOWN_SYSTEM_VARIABLE
+SET GLOBAL innodb_change_buffering_debug = @innodb_change_buffering_debug_orig;
diff --git a/mysql-test/suite/innodb/t/innodb_bug56716.test b/mysql-test/suite/innodb/t/innodb_bug56716.test
new file mode 100644
index 00000000000..3345038d9c1
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_bug56716.test
@@ -0,0 +1,10 @@
+#
+# Bug #56716 InnoDB locks a record gap without locking the table
+#
+-- source include/have_innodb.inc
+
+CREATE TABLE bug56716 (a INT PRIMARY KEY,b INT,c INT,INDEX(b)) ENGINE=InnoDB;
+
+SELECT * FROM bug56716 WHERE b<=42 ORDER BY b DESC FOR UPDATE;
+
+DROP TABLE bug56716;
diff --git a/mysql-test/suite/innodb/t/innodb_bug57252.test b/mysql-test/suite/innodb/t/innodb_bug57252.test
new file mode 100644
index 00000000000..04c3ed0cea7
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_bug57252.test
@@ -0,0 +1,46 @@
+#
+# Bug#57252 disabling innobase_stats_on_metadata disables ANALYZE
+# http://bugs.mysql.com/57252
+#
+
+-- source include/have_innodb.inc
+
+-- disable_query_log
+-- disable_result_log
+
+SET @innodb_stats_on_metadata_orig = @@innodb_stats_on_metadata;
+
+CREATE TABLE bug57252 (a INT, KEY akey (a)) ENGINE=INNODB;
+
+BEGIN;
+let $i = 10;
+while ($i) {
+ eval INSERT INTO bug57252 VALUES ($i);
+ dec $i;
+}
+COMMIT;
+
+-- enable_result_log
+
+SET GLOBAL innodb_stats_on_metadata=0;
+
+# this calls ::info() without HA_STATUS_CONST and so
+# index->stat_n_diff_key_vals[] is not copied to the mysql-visible
+# rec_per_key
+SELECT cardinality FROM information_schema.statistics
+WHERE table_name='bug57252' AND index_name='akey';
+
+# this calls ::info() with HA_STATUS_CONST and so
+# index->stat_n_diff_key_vals[] is copied to the mysql-visible
+# rec_per_key at the end; when the bug is present dict_update_statistics()
+# is not called beforehand and so index->stat_n_diff_key_vals[] contains
+# an outdated data and thus we get an outdated data in the result when the
+# bug is present
+ANALYZE TABLE bug57252;
+
+SELECT cardinality FROM information_schema.statistics
+WHERE table_name='bug57252' AND index_name='akey';
+
+DROP TABLE bug57252;
+
+SET GLOBAL innodb_stats_on_metadata = @innodb_stats_on_metadata_orig;
diff --git a/mysql-test/suite/innodb/t/innodb_bug57255.test b/mysql-test/suite/innodb/t/innodb_bug57255.test
new file mode 100644
index 00000000000..0bf686578b2
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_bug57255.test
@@ -0,0 +1,38 @@
+# Test Bug #57255. Cascade deletes that affect different rows should not
+# result in DB_FOREIGN_EXCEED_MAX_CASCADE error
+
+--source include/have_innodb.inc
+
+create table A(id int not null primary key) engine=innodb;
+
+create table B(id int not null auto_increment primary key, f1 int not null, foreign key(f1) references A(id) on delete cascade) engine=innodb;
+
+create table C(id int not null auto_increment primary key, f1 int not null, foreign key(f1) references B(id) on delete cascade) engine=innodb;
+
+insert into A values(1), (2);
+
+--disable_query_log
+begin;
+let $i=257;
+while ($i)
+{
+insert into B(f1) values(1);
+dec $i;
+}
+let $i=486;
+while ($i)
+{
+insert into C(f1) values(2);
+dec $i;
+}
+commit;
+--enable_query_log
+
+# Following Deletes should not report error
+DELETE FROM A where id = 1;
+DELETE FROM C where f1 = 2;
+DELETE FROM A where id = 1;
+
+DROP TABLE C;
+DROP TABLE B;
+DROP TABLE A;
diff --git a/mysql-test/suite/innodb/t/innodb_mysql.test b/mysql-test/suite/innodb/t/innodb_mysql.test
index e346d91aaa4..177dabdc3e1 100644
--- a/mysql-test/suite/innodb/t/innodb_mysql.test
+++ b/mysql-test/suite/innodb/t/innodb_mysql.test
@@ -841,6 +841,33 @@ CREATE INDEX b ON t1(a,b,c,d);
DROP TABLE t1;
--echo #
+--echo # ALTER TABLE IGNORE didn't ignore duplicates for unique add index
+--echo #
+
+create table t1 (a int primary key, b int) engine = innodb;
+insert into t1 values (1,1),(2,1);
+alter ignore table t1 add unique `main` (b);
+drop table t1;
+
+--echo #
--echo End of 5.1 tests
+
+
+--echo #
+--echo # Test for bug #39932 "create table fails if column for FK is in different
+--echo # case than in corr index".
+--echo #
+--disable_warnings
+drop tables if exists t1, t2;
+--enable_warnings
+create table t1 (pk int primary key) engine=InnoDB;
+--echo # Even although the below statement uses uppercased field names in
+--echo # foreign key definition it still should be able to find explicitly
+--echo # created supporting index. So it should succeed and should not
+--echo # create any additional supporting indexes.
+create table t2 (fk int, key x (fk),
+ constraint x foreign key (FK) references t1 (PK)) engine=InnoDB;
+show create table t2;
+drop table t2, t1;
diff --git a/mysql-test/suite/innodb_plugin/r/innodb_bug53756.result b/mysql-test/suite/innodb_plugin/r/innodb_bug53756.result
new file mode 100644
index 00000000000..37453be8201
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug53756.result
@@ -0,0 +1,118 @@
+DROP TABLE IF EXISTS bug_53756 ;
+CREATE TABLE bug_53756 (pk INT, c1 INT) ENGINE=InnoDB;
+ALTER TABLE bug_53756 ADD PRIMARY KEY (pk);
+INSERT INTO bug_53756 VALUES(1, 11), (2, 22), (3, 33), (4, 44);
+
+# Select a less restrictive isolation level.
+SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+COMMIT;
+
+# Start a transaction in the default connection for isolation.
+START TRANSACTION;
+SELECT @@tx_isolation;
+@@tx_isolation
+READ-COMMITTED
+SELECT * FROM bug_53756;
+pk c1
+1 11
+2 22
+3 33
+4 44
+
+# connection con1 deletes row 1
+START TRANSACTION;
+SELECT @@tx_isolation;
+@@tx_isolation
+READ-COMMITTED
+DELETE FROM bug_53756 WHERE pk=1;
+
+# connection con2 deletes row 2
+START TRANSACTION;
+SELECT @@tx_isolation;
+@@tx_isolation
+READ-COMMITTED
+DELETE FROM bug_53756 WHERE pk=2;
+
+# connection con3 updates row 3
+START TRANSACTION;
+SELECT @@tx_isolation;
+@@tx_isolation
+READ-COMMITTED
+UPDATE bug_53756 SET c1=77 WHERE pk=3;
+
+# connection con4 updates row 4
+START TRANSACTION;
+SELECT @@tx_isolation;
+@@tx_isolation
+READ-COMMITTED
+UPDATE bug_53756 SET c1=88 WHERE pk=4;
+
+# connection con5 inserts row 5
+START TRANSACTION;
+SELECT @@tx_isolation;
+@@tx_isolation
+READ-COMMITTED
+INSERT INTO bug_53756 VALUES(5, 55);
+
+# connection con6 inserts row 6
+START TRANSACTION;
+SELECT @@tx_isolation;
+@@tx_isolation
+READ-COMMITTED
+INSERT INTO bug_53756 VALUES(6, 66);
+
+# connection con1 commits.
+COMMIT;
+
+# connection con3 commits.
+COMMIT;
+
+# connection con4 rolls back.
+ROLLBACK;
+
+# connection con6 rolls back.
+ROLLBACK;
+
+# The connections 2 and 5 stay open.
+
+# connection default selects resulting data.
+# Delete of row 1 was committed.
+# Update of row 3 was committed.
+# Due to isolation level read committed, these should be included.
+# All other changes should not be included.
+SELECT * FROM bug_53756;
+pk c1
+2 22
+3 77
+4 44
+
+# connection default
+#
+# Crash server.
+START TRANSACTION;
+INSERT INTO bug_53756 VALUES (666,666);
+SET SESSION debug="+d,crash_commit_before";
+COMMIT;
+ERROR HY000: Lost connection to MySQL server during query
+
+#
+# disconnect con1, con2, con3, con4, con5, con6.
+#
+# Restart server.
+
+#
+# Select recovered data.
+# Delete of row 1 was committed.
+# Update of row 3 was committed.
+# These should be included.
+# All other changes should not be included.
+# Delete of row 2 and insert of row 5 should be rolled back
+SELECT * FROM bug_53756;
+pk c1
+2 22
+3 77
+4 44
+
+# Clean up.
+DROP TABLE bug_53756;
diff --git a/mysql-test/suite/innodb_plugin/r/innodb_bug56143.result b/mysql-test/suite/innodb_plugin/r/innodb_bug56143.result
new file mode 100644
index 00000000000..1efec7e8887
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug56143.result
@@ -0,0 +1,556 @@
+SHOW CREATE TABLE bug56143_2;
+Table Create Table
+bug56143_2 CREATE TABLE `bug56143_2` (
+ `a` int(11) DEFAULT NULL,
+ KEY `a` (`a`),
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa10` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa100` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa101` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa102` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa103` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa104` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa105` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa106` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa107` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa108` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa109` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa11` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa110` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa111` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa112` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa113` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa114` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa115` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa116` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa117` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa118` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa119` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa12` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa120` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa121` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa122` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa123` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa124` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa125` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa126` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa127` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa128` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa129` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa13` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa130` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa131` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa132` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa133` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa134` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa135` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa136` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa137` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa138` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa139` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa14` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa140` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa141` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa142` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa143` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa144` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa145` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa146` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa147` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa148` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa149` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa15` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa150` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa151` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa152` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa153` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa154` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa155` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa156` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa157` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa158` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa159` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa16` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa160` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa161` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa162` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa163` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa164` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa165` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa166` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa167` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa168` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa169` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa17` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa170` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa171` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa172` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa173` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa174` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa175` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa176` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa177` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa178` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa179` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa18` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa180` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa181` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa182` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa183` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa184` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa185` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa186` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa187` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa188` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa189` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa19` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa190` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa191` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa192` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa193` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa194` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa195` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa196` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa197` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa198` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa199` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa20` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa200` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa201` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa202` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa203` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa204` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa205` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa206` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa207` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa208` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa209` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa21` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa210` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa211` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa212` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa213` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa214` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa215` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa216` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa217` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa218` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa219` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa22` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa220` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa221` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa222` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa223` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa224` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa225` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa226` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa227` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa228` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa229` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa23` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa230` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa231` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa232` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa233` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa234` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa235` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa236` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa237` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa238` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa239` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa24` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa240` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa241` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa242` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa243` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa244` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa245` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa246` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa247` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa248` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa249` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa25` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa250` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa251` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa252` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa253` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa254` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa255` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa256` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa257` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa258` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa259` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa26` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa260` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa261` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa262` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa263` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa264` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa265` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa266` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa267` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa268` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa269` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa27` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa270` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa271` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa272` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa273` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa274` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa275` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa276` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa277` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa278` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa279` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa28` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa280` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa281` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa282` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa283` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa284` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa285` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa286` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa287` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa288` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa289` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa29` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa290` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa291` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa292` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa293` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa294` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa295` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa296` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa297` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa298` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa299` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa3` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa30` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa300` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa301` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa302` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa303` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa304` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa305` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa306` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa307` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa308` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa309` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa31` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa310` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa311` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa312` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa313` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa314` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa315` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa316` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa317` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa318` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa319` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa32` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa320` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa321` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa322` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa323` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa324` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa325` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa326` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa327` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa328` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa329` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa33` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa330` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa331` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa332` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa333` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa334` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa335` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa336` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa337` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa338` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa339` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa34` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa340` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa341` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa342` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa343` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa344` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa345` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa346` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa347` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa348` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa349` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa35` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa350` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa351` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa352` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa353` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa354` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa355` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa356` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa357` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa358` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa359` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa36` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa360` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa361` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa362` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa363` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa364` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa365` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa366` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa367` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa368` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa369` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa37` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa370` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa371` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa372` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa373` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa374` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa375` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa376` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa377` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa378` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa379` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa38` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa380` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa381` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa382` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa383` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa384` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa385` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa386` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa387` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa388` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa389` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa39` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa390` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa391` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa392` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa393` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa394` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa395` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa396` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa397` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa398` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa399` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa40` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa400` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa401` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa402` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa403` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa404` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa405` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa406` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa407` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa408` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa409` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa41` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa410` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa411` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa412` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa413` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa414` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa415` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa416` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa417` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa418` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa419` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa42` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa420` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa421` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa422` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa423` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa424` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa425` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa426` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa427` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa428` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa429` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa43` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa430` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa431` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa432` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa433` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa434` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa435` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa436` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa437` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa438` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa439` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa44` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa440` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa441` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa442` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa443` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa444` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa445` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa446` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa447` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa448` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa449` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa45` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa450` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa451` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa452` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa453` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa454` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa455` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa456` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa457` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa458` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa459` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa46` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa460` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa461` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa462` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa463` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa464` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa465` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa466` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa467` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa468` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa469` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa47` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa470` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa471` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa472` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa473` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa474` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa475` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa476` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa477` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa478` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa479` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa48` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa480` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa481` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa482` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa483` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa484` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa485` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa486` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa487` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa488` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa489` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa49` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa490` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa491` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa492` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa493` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa494` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa495` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa496` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa497` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa498` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa499` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa5` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa50` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa500` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa501` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa502` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa503` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa504` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa505` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa506` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa507` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa508` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa509` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa51` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa510` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa511` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa512` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa513` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa514` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa515` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa516` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa517` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa518` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa519` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa52` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa520` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa521` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa522` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa523` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa524` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa525` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa526` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa527` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa528` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa529` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa53` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa530` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa531` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa532` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa533` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa534` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa535` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa536` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa537` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa538` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa539` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa54` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa540` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa541` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa542` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa543` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa544` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa545` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa546` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa547` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa548` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa549` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa55` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa550` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa56` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa57` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa58` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa59` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa6` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa60` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa61` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa62` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa63` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa64` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa65` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa66` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa67` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa68` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa69` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa7` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa70` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa71` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa72` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa73` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa74` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa75` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa76` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa77` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa78` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa79` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa8` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa80` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa81` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa82` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa83` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa84` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa85` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa86` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa87` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa88` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa89` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa90` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa91` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa92` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa93` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa94` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa95` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa96` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa97` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa98` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa99` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
diff --git a/mysql-test/suite/innodb_plugin/r/innodb_bug56632.result b/mysql-test/suite/innodb_plugin/r/innodb_bug56632.result
new file mode 100644
index 00000000000..1b0428e32e8
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug56632.result
@@ -0,0 +1,294 @@
+SET storage_engine=InnoDB;
+SET GLOBAL innodb_file_format=`Barracuda`;
+SET GLOBAL innodb_file_per_table=ON;
+SET SESSION innodb_strict_mode = ON;
+# Test 1) CREATE with ROW_FORMAT & KEY_BLOCK_SIZE, ALTER with neither
+DROP TABLE IF EXISTS bug56632;
+Warnings:
+Note 1051 Unknown table 'bug56632'
+CREATE TABLE bug56632 ( i INT ) ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=1;
+ERROR HY000: Can't create table 'test.bug56632' (errno: 1478)
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE.
+Error 1005 Can't create table 'test.bug56632' (errno: 1478)
+# Test 2) CREATE with ROW_FORMAT, ALTER with KEY_BLOCK_SIZE
+DROP TABLE IF EXISTS bug56632;
+Warnings:
+Note 1051 Unknown table 'bug56632'
+CREATE TABLE bug56632 ( i INT ) ROW_FORMAT=COMPACT;
+SHOW WARNINGS;
+Level Code Message
+SHOW CREATE TABLE bug56632;
+Table Create Table
+bug56632 CREATE TABLE `bug56632` (
+ `i` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 'bug56632';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+bug56632 Compact row_format=COMPACT
+ALTER TABLE bug56632 KEY_BLOCK_SIZE=1;
+SHOW WARNINGS;
+Level Code Message
+SHOW CREATE TABLE bug56632;
+Table Create Table
+bug56632 CREATE TABLE `bug56632` (
+ `i` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=1
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 'bug56632';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+bug56632 Compressed row_format=COMPACT key_block_size=1
+# Test 3) CREATE with KEY_BLOCK_SIZE, ALTER with ROW_FORMAT
+DROP TABLE IF EXISTS bug56632;
+CREATE TABLE bug56632 ( i INT ) KEY_BLOCK_SIZE=1;
+SHOW WARNINGS;
+Level Code Message
+SHOW CREATE TABLE bug56632;
+Table Create Table
+bug56632 CREATE TABLE `bug56632` (
+ `i` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=1
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 'bug56632';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+bug56632 Compressed key_block_size=1
+ALTER TABLE bug56632 ROW_FORMAT=COMPACT;
+SHOW CREATE TABLE bug56632;
+Table Create Table
+bug56632 CREATE TABLE `bug56632` (
+ `i` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=1
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 'bug56632';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+bug56632 Compressed key_block_size=1
+# Test 4) CREATE with neither, ALTER with ROW_FORMAT & KEY_BLOCK_SIZE
+DROP TABLE IF EXISTS bug56632;
+CREATE TABLE bug56632 ( i INT );
+SHOW WARNINGS;
+Level Code Message
+SHOW CREATE TABLE bug56632;
+Table Create Table
+bug56632 CREATE TABLE `bug56632` (
+ `i` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 'bug56632';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+bug56632 Compact
+ALTER TABLE bug56632 ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=1;
+SHOW CREATE TABLE bug56632;
+Table Create Table
+bug56632 CREATE TABLE `bug56632` (
+ `i` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 'bug56632';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+bug56632 Compact
+# Test 5) CREATE with KEY_BLOCK_SIZE=3 (invalid).
+DROP TABLE IF EXISTS bug56632;
+CREATE TABLE bug56632 ( i INT ) KEY_BLOCK_SIZE=3;
+ERROR HY000: Can't create table 'test.bug56632' (errno: 1478)
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: invalid KEY_BLOCK_SIZE = 3. Valid values are [1, 2, 4, 8, 16]
+Error 1005 Can't create table 'test.bug56632' (errno: 1478)
+SET SESSION innodb_strict_mode = OFF;
+# Test 6) CREATE with ROW_FORMAT & KEY_BLOCK_SIZE, ALTER with neither
+DROP TABLE IF EXISTS bug56632;
+Warnings:
+Note 1051 Unknown table 'bug56632'
+CREATE TABLE bug56632 ( i INT ) ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=1;
+Warnings:
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
+SHOW CREATE TABLE bug56632;
+Table Create Table
+bug56632 CREATE TABLE `bug56632` (
+ `i` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=1
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 'bug56632';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+bug56632 Compact row_format=COMPACT key_block_size=1
+ALTER TABLE bug56632 ADD COLUMN f1 INT;
+Warnings:
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
+SHOW CREATE TABLE bug56632;
+Table Create Table
+bug56632 CREATE TABLE `bug56632` (
+ `i` int(11) DEFAULT NULL,
+ `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=1
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 'bug56632';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+bug56632 Compact row_format=COMPACT key_block_size=1
+# Test 7) CREATE with ROW_FORMAT, ALTER with KEY_BLOCK_SIZE
+DROP TABLE IF EXISTS bug56632;
+CREATE TABLE bug56632 ( i INT ) ROW_FORMAT=COMPACT;
+SHOW WARNINGS;
+Level Code Message
+SHOW CREATE TABLE bug56632;
+Table Create Table
+bug56632 CREATE TABLE `bug56632` (
+ `i` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 'bug56632';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+bug56632 Compact row_format=COMPACT
+ALTER TABLE bug56632 KEY_BLOCK_SIZE=1;
+SHOW WARNINGS;
+Level Code Message
+SHOW CREATE TABLE bug56632;
+Table Create Table
+bug56632 CREATE TABLE `bug56632` (
+ `i` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=1
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 'bug56632';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+bug56632 Compressed row_format=COMPACT key_block_size=1
+# Test 8) CREATE with KEY_BLOCK_SIZE, ALTER with ROW_FORMAT
+DROP TABLE IF EXISTS bug56632;
+CREATE TABLE bug56632 ( i INT ) KEY_BLOCK_SIZE=1;
+SHOW WARNINGS;
+Level Code Message
+SHOW CREATE TABLE bug56632;
+Table Create Table
+bug56632 CREATE TABLE `bug56632` (
+ `i` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=1
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 'bug56632';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+bug56632 Compressed key_block_size=1
+ALTER TABLE bug56632 ROW_FORMAT=COMPACT;
+Warnings:
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
+SHOW CREATE TABLE bug56632;
+Table Create Table
+bug56632 CREATE TABLE `bug56632` (
+ `i` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=1
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 'bug56632';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+bug56632 Compact row_format=COMPACT key_block_size=1
+# Test 9) CREATE with neither, ALTER with ROW_FORMAT & KEY_BLOCK_SIZE
+DROP TABLE IF EXISTS bug56632;
+CREATE TABLE bug56632 ( i INT );
+SHOW WARNINGS;
+Level Code Message
+SHOW CREATE TABLE bug56632;
+Table Create Table
+bug56632 CREATE TABLE `bug56632` (
+ `i` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 'bug56632';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+bug56632 Compact
+ALTER TABLE bug56632 ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=1;
+Warnings:
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
+SHOW CREATE TABLE bug56632;
+Table Create Table
+bug56632 CREATE TABLE `bug56632` (
+ `i` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=1
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 'bug56632';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+bug56632 Compact row_format=COMPACT key_block_size=1
+# Test 10) CREATE with KEY_BLOCK_SIZE=3 (invalid), ALTER with neither.
+DROP TABLE IF EXISTS bug56632;
+CREATE TABLE bug56632 ( i INT ) KEY_BLOCK_SIZE=3;
+Warnings:
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=3.
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=3.
+SHOW CREATE TABLE bug56632;
+Table Create Table
+bug56632 CREATE TABLE `bug56632` (
+ `i` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=3
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 'bug56632';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+bug56632 Compact key_block_size=3
+ALTER TABLE bug56632 ADD COLUMN f1 INT;
+Warnings:
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=3.
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=3.
+SHOW CREATE TABLE bug56632;
+Table Create Table
+bug56632 CREATE TABLE `bug56632` (
+ `i` int(11) DEFAULT NULL,
+ `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=3
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 'bug56632';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+bug56632 Compact key_block_size=3
+# Test 11) CREATE with KEY_BLOCK_SIZE=3 (invalid), ALTER with ROW_FORMAT=COMPACT.
+DROP TABLE IF EXISTS bug56632;
+CREATE TABLE bug56632 ( i INT ) KEY_BLOCK_SIZE=3;
+Warnings:
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=3.
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=3.
+SHOW CREATE TABLE bug56632;
+Table Create Table
+bug56632 CREATE TABLE `bug56632` (
+ `i` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=3
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 'bug56632';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+bug56632 Compact key_block_size=3
+ALTER TABLE bug56632 ROW_FORMAT=COMPACT;
+Warnings:
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=3.
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=3.
+SHOW CREATE TABLE bug56632;
+Table Create Table
+bug56632 CREATE TABLE `bug56632` (
+ `i` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=3
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 'bug56632';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+bug56632 Compact row_format=COMPACT key_block_size=3
+# Test 12) CREATE with KEY_BLOCK_SIZE=3 (invalid), ALTER with KEY_BLOCK_SIZE=1.
+DROP TABLE IF EXISTS bug56632;
+CREATE TABLE bug56632 ( i INT ) KEY_BLOCK_SIZE=3;
+Warnings:
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=3.
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=3.
+SHOW CREATE TABLE bug56632;
+Table Create Table
+bug56632 CREATE TABLE `bug56632` (
+ `i` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=3
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 'bug56632';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+bug56632 Compact key_block_size=3
+ALTER TABLE bug56632 KEY_BLOCK_SIZE=1;
+SHOW WARNINGS;
+Level Code Message
+SHOW CREATE TABLE bug56632;
+Table Create Table
+bug56632 CREATE TABLE `bug56632` (
+ `i` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=1
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 'bug56632';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+bug56632 Compressed key_block_size=1
+# Cleanup
+DROP TABLE IF EXISTS bug56632;
diff --git a/mysql-test/suite/innodb_plugin/r/innodb_bug56680.result b/mysql-test/suite/innodb_plugin/r/innodb_bug56680.result
new file mode 100644
index 00000000000..5e798b69167
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug56680.result
@@ -0,0 +1,109 @@
+SET GLOBAL tx_isolation='REPEATABLE-READ';
+SET GLOBAL innodb_file_format=Barracuda;
+SET GLOBAL innodb_file_per_table=on;
+CREATE TABLE bug56680(
+a INT AUTO_INCREMENT PRIMARY KEY,
+b CHAR(1),
+c INT,
+INDEX(b))
+ENGINE=InnoDB;
+INSERT INTO bug56680 VALUES(0,'x',1);
+BEGIN;
+SELECT b FROM bug56680;
+b
+x
+BEGIN;
+UPDATE bug56680 SET b='X';
+SELECT b FROM bug56680;
+b
+x
+SELECT * FROM bug56680;
+a b c
+1 x 1
+ROLLBACK;
+SELECT b FROM bug56680;
+b
+x
+SET GLOBAL tx_isolation='READ-UNCOMMITTED';
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+BEGIN;
+SELECT b FROM bug56680 LIMIT 2;
+b
+x
+x
+BEGIN;
+DELETE FROM bug56680 WHERE a=1;
+INSERT INTO bug56680 VALUES(1,'X',1);
+SELECT b FROM bug56680 LIMIT 3;
+b
+X
+x
+x
+SELECT b FROM bug56680 LIMIT 2;
+b
+x
+x
+CHECK TABLE bug56680;
+Table Op Msg_type Msg_text
+test.bug56680 check status OK
+ROLLBACK;
+SELECT b FROM bug56680 LIMIT 2;
+b
+x
+x
+CHECK TABLE bug56680;
+Table Op Msg_type Msg_text
+test.bug56680 check status OK
+SELECT b FROM bug56680 LIMIT 2;
+b
+x
+x
+CREATE TABLE bug56680_2(
+a INT AUTO_INCREMENT PRIMARY KEY,
+b VARCHAR(2) CHARSET latin1 COLLATE latin1_german2_ci,
+c INT,
+INDEX(b))
+ENGINE=InnoDB;
+INSERT INTO bug56680_2 SELECT 0,_latin1 0xdf,c FROM bug56680;
+BEGIN;
+SELECT HEX(b) FROM bug56680_2 LIMIT 2;
+HEX(b)
+DF
+DF
+DELETE FROM bug56680_2 WHERE a=1;
+INSERT INTO bug56680_2 VALUES(1,'SS',1);
+SELECT HEX(b) FROM bug56680_2 LIMIT 3;
+HEX(b)
+5353
+DF
+DF
+CHECK TABLE bug56680_2;
+Table Op Msg_type Msg_text
+test.bug56680_2 check status OK
+ALTER TABLE bug56680_2 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
+SELECT HEX(b) FROM bug56680_2 LIMIT 2;
+HEX(b)
+5353
+DF
+DELETE FROM bug56680_2 WHERE a=1;
+INSERT INTO bug56680_2 VALUES(1,_latin1 0xdf,1);
+SELECT HEX(b) FROM bug56680_2 LIMIT 3;
+HEX(b)
+DF
+DF
+DF
+CHECK TABLE bug56680_2;
+Table Op Msg_type Msg_text
+test.bug56680_2 check status OK
+DROP TABLE bug56680_2;
+DROP TABLE bug56680;
diff --git a/mysql-test/suite/innodb_plugin/r/innodb_bug56716.result b/mysql-test/suite/innodb_plugin/r/innodb_bug56716.result
new file mode 100644
index 00000000000..50d83e8d87a
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug56716.result
@@ -0,0 +1,4 @@
+CREATE TABLE bug56716 (a INT PRIMARY KEY,b INT,c INT,INDEX(b)) ENGINE=InnoDB;
+SELECT * FROM bug56716 WHERE b<=42 ORDER BY b DESC FOR UPDATE;
+a b c
+DROP TABLE bug56716;
diff --git a/mysql-test/suite/innodb_plugin/r/innodb_bug56947.result b/mysql-test/suite/innodb_plugin/r/innodb_bug56947.result
new file mode 100644
index 00000000000..42101a46a5b
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug56947.result
@@ -0,0 +1,6 @@
+create table bug56947(a int not null) engine = innodb;
+CREATE TABLE `bug56947#1`(a int) ENGINE=InnoDB;
+alter table bug56947 add unique index (a);
+ERROR HY000: Table 'test.bug56947#1' already exists
+drop table `bug56947#1`;
+drop table bug56947;
diff --git a/mysql-test/suite/innodb_plugin/r/innodb_bug57252.result b/mysql-test/suite/innodb_plugin/r/innodb_bug57252.result
new file mode 100644
index 00000000000..efa50c742e0
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug57252.result
@@ -0,0 +1,6 @@
+cardinality
+10
+Table Op Msg_type Msg_text
+test.bug57252 analyze status OK
+cardinality
+10
diff --git a/mysql-test/suite/innodb_plugin/r/innodb_bug57255.result b/mysql-test/suite/innodb_plugin/r/innodb_bug57255.result
new file mode 100644
index 00000000000..d61a0d42ba3
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug57255.result
@@ -0,0 +1,10 @@
+create table A(id int not null primary key) engine=innodb;
+create table B(id int not null auto_increment primary key, f1 int not null, foreign key(f1) references A(id) on delete cascade) engine=innodb;
+create table C(id int not null auto_increment primary key, f1 int not null, foreign key(f1) references B(id) on delete cascade) engine=innodb;
+insert into A values(1), (2);
+DELETE FROM A where id = 1;
+DELETE FROM C where f1 = 2;
+DELETE FROM A where id = 1;
+DROP TABLE C;
+DROP TABLE B;
+DROP TABLE A;
diff --git a/mysql-test/suite/innodb_plugin/r/innodb_mysql.result b/mysql-test/suite/innodb_plugin/r/innodb_mysql.result
index 53e979c350f..1aee85b5288 100644
--- a/mysql-test/suite/innodb_plugin/r/innodb_mysql.result
+++ b/mysql-test/suite/innodb_plugin/r/innodb_mysql.result
@@ -1594,7 +1594,17 @@ TRUNCATE t1;
INSERT INTO t1 VALUES (1,'init');
CREATE PROCEDURE p1()
BEGIN
+# retry the UPDATE in case it times out the lock before con1 has time
+# to COMMIT.
+DECLARE do_retry INT DEFAULT 0;
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET do_retry = 1;
+retry_loop:LOOP
UPDATE t1 SET b = CONCAT(b, '+con2') WHERE a = 1;
+IF do_retry = 0 THEN
+LEAVE retry_loop;
+END IF;
+SET do_retry = 0;
+END LOOP;
INSERT INTO t2 VALUES ();
END|
BEGIN;
@@ -2390,4 +2400,14 @@ a
2
UPDATE t1,t2 SET t1.a = t1.a + 100 WHERE t1.a = 1;
DROP TABLE t1,t2;
+#
+# Bug#54606 innodb fast alter table + pack_keys=0
+# prevents adding new indexes
+#
+CREATE TABLE t1 (a INT, b CHAR(9), c INT, key(b))
+ENGINE=InnoDB
+PACK_KEYS=0;
+CREATE INDEX a ON t1 (a);
+CREATE INDEX c on t1 (c);
+DROP TABLE t1;
End of 5.1 tests
diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug38231.test b/mysql-test/suite/innodb_plugin/t/innodb_bug38231.test
index be588474bc1..23d8061c9da 100644
--- a/mysql-test/suite/innodb_plugin/t/innodb_bug38231.test
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug38231.test
@@ -72,6 +72,11 @@ UNLOCK TABLES;
# clean up
-- connection con2
+#
+# We may get a timeout error here if the tables are locked in a different
+# order than expected. This is ok as the purpose of this patch is to ensure
+# we don't get a crash in the previous unlock tables.
+-- error 0, 1205
-- reap
UNLOCK TABLES;
diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug53756-master.opt b/mysql-test/suite/innodb_plugin/t/innodb_bug53756-master.opt
new file mode 100644
index 00000000000..425fda95086
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug53756-master.opt
@@ -0,0 +1 @@
+--skip-stack-trace --skip-core-file
diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug53756.test b/mysql-test/suite/innodb_plugin/t/innodb_bug53756.test
new file mode 100644
index 00000000000..8c48550a64d
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug53756.test
@@ -0,0 +1,184 @@
+# This is the test case for bug #53756. Alter table operation could
+# leave a deleted record for the temp table (later renamed to the altered
+# table) in the SYS_TABLES secondary index, we should ignore this row and
+# find the first non-deleted row for the specified table_id when load table
+# metadata in the function dict_load_table_on_id() during crash recovery.
+
+#
+# innobackup needs to connect to the server. Not supported in embedded.
+--source include/not_embedded.inc
+#
+# This test case needs to crash the server. Needs a debug server.
+--source include/have_debug.inc
+#
+# Don't test this under valgrind, memory leaks will occur.
+--source include/not_valgrind.inc
+#
+# This test case needs InnoDB.
+-- source include/have_innodb_plugin.inc
+
+#
+# Precautionary clean up.
+#
+--disable_warnings
+DROP TABLE IF EXISTS bug_53756 ;
+--enable_warnings
+
+#
+# Create test data.
+#
+CREATE TABLE bug_53756 (pk INT, c1 INT) ENGINE=InnoDB;
+ALTER TABLE bug_53756 ADD PRIMARY KEY (pk);
+INSERT INTO bug_53756 VALUES(1, 11), (2, 22), (3, 33), (4, 44);
+
+--echo
+--echo # Select a less restrictive isolation level.
+# Don't use user variables. They won't survive server crash.
+--let $global_isolation= `SELECT @@global.tx_isolation`
+--let $session_isolation= `SELECT @@session.tx_isolation`
+SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+COMMIT;
+
+--echo
+--echo # Start a transaction in the default connection for isolation.
+START TRANSACTION;
+SELECT @@tx_isolation;
+SELECT * FROM bug_53756;
+
+--echo
+--echo # connection con1 deletes row 1
+--connect (con1,localhost,root,,)
+START TRANSACTION;
+SELECT @@tx_isolation;
+DELETE FROM bug_53756 WHERE pk=1;
+
+--echo
+--echo # connection con2 deletes row 2
+--connect (con2,localhost,root,,)
+START TRANSACTION;
+SELECT @@tx_isolation;
+DELETE FROM bug_53756 WHERE pk=2;
+
+--echo
+--echo # connection con3 updates row 3
+--connect (con3,localhost,root,,)
+START TRANSACTION;
+SELECT @@tx_isolation;
+UPDATE bug_53756 SET c1=77 WHERE pk=3;
+
+--echo
+--echo # connection con4 updates row 4
+--connect (con4,localhost,root,,)
+START TRANSACTION;
+SELECT @@tx_isolation;
+UPDATE bug_53756 SET c1=88 WHERE pk=4;
+
+--echo
+--echo # connection con5 inserts row 5
+--connect (con5,localhost,root,,)
+START TRANSACTION;
+SELECT @@tx_isolation;
+INSERT INTO bug_53756 VALUES(5, 55);
+
+--echo
+--echo # connection con6 inserts row 6
+--connect (con6,localhost,root,,)
+START TRANSACTION;
+SELECT @@tx_isolation;
+INSERT INTO bug_53756 VALUES(6, 66);
+
+--echo
+--echo # connection con1 commits.
+--connection con1
+COMMIT;
+
+--echo
+--echo # connection con3 commits.
+--connection con3
+COMMIT;
+
+--echo
+--echo # connection con4 rolls back.
+--connection con4
+ROLLBACK;
+
+--echo
+--echo # connection con6 rolls back.
+--connection con6
+ROLLBACK;
+
+--echo
+--echo # The connections 2 and 5 stay open.
+
+--echo
+--echo # connection default selects resulting data.
+--echo # Delete of row 1 was committed.
+--echo # Update of row 3 was committed.
+--echo # Due to isolation level read committed, these should be included.
+--echo # All other changes should not be included.
+--connection default
+SELECT * FROM bug_53756;
+
+--echo
+--echo # connection default
+--connection default
+--echo #
+--echo # Crash server.
+#
+# Write file to make mysql-test-run.pl expect the "crash", but don't start
+# it until it's told to
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+#
+START TRANSACTION;
+INSERT INTO bug_53756 VALUES (666,666);
+#
+# Request a crash on next execution of commit.
+SET SESSION debug="+d,crash_commit_before";
+#
+# Execute the statement that causes the crash.
+--error 2013
+COMMIT;
+--echo
+--echo #
+--echo # disconnect con1, con2, con3, con4, con5, con6.
+--disconnect con1
+--disconnect con2
+--disconnect con3
+--disconnect con4
+--disconnect con5
+--disconnect con6
+--echo #
+--echo # Restart server.
+#
+# Write file to make mysql-test-run.pl start up the server again
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+#
+# Turn on reconnect
+--enable_reconnect
+#
+# Call script that will poll the server waiting for it to be back online again
+--source include/wait_until_connected_again.inc
+#
+# Turn off reconnect again
+--disable_reconnect
+--echo
+
+--echo #
+--echo # Select recovered data.
+--echo # Delete of row 1 was committed.
+--echo # Update of row 3 was committed.
+--echo # These should be included.
+--echo # All other changes should not be included.
+--echo # Delete of row 2 and insert of row 5 should be rolled back
+SELECT * FROM bug_53756;
+
+--echo
+--echo # Clean up.
+DROP TABLE bug_53756;
+
+--disable_query_log
+eval SET GLOBAL tx_isolation= '$global_isolation';
+eval SET SESSION tx_isolation= '$session_isolation';
+--enable_query_log
+
diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug56143.test b/mysql-test/suite/innodb_plugin/t/innodb_bug56143.test
new file mode 100644
index 00000000000..7c7472303db
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug56143.test
@@ -0,0 +1,581 @@
+#
+# Bug#56143 too many foreign keys causes output of show create table to become invalid
+# http://bugs.mysql.com/56143
+#
+
+-- source include/have_innodb_plugin.inc
+
+-- disable_query_log
+-- disable_result_log
+
+SET foreign_key_checks=0;
+
+DROP TABLE IF EXISTS bug56143_1;
+DROP TABLE IF EXISTS bug56143_2;
+
+CREATE TABLE bug56143_1 (a INT, KEY(a)) ENGINE=INNODB;
+
+CREATE TABLE `bug56143_2` (
+ `a` int(11) DEFAULT NULL,
+ KEY `a` (`a`),
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa10` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa100` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa101` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa102` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa103` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa104` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa105` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa106` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa107` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa108` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa109` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa11` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa110` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa111` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa112` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa113` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa114` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa115` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa116` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa117` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa118` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa119` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa12` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa120` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa121` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa122` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa123` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa124` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa125` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa126` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa127` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa128` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa129` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa13` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa130` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa131` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa132` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa133` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa134` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa135` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa136` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa137` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa138` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa139` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa14` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa140` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa141` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa142` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa143` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa144` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa145` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa146` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa147` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa148` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa149` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa15` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa150` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa151` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa152` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa153` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa154` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa155` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa156` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa157` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa158` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa159` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa16` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa160` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa161` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa162` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa163` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa164` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa165` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa166` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa167` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa168` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa169` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa17` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa170` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa171` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa172` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa173` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa174` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa175` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa176` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa177` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa178` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa179` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa18` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa180` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa181` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa182` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa183` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa184` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa185` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa186` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa187` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa188` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa189` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa19` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa190` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa191` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa192` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa193` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa194` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa195` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa196` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa197` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa198` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa199` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa20` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa200` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa201` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa202` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa203` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa204` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa205` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa206` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa207` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa208` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa209` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa21` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa210` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa211` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa212` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa213` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa214` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa215` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa216` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa217` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa218` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa219` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa22` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa220` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa221` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa222` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa223` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa224` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa225` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa226` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa227` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa228` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa229` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa23` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa230` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa231` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa232` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa233` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa234` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa235` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa236` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa237` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa238` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa239` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa24` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa240` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa241` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa242` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa243` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa244` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa245` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa246` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa247` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa248` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa249` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa25` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa250` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa251` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa252` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa253` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa254` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa255` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa256` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa257` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa258` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa259` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa26` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa260` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa261` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa262` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa263` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa264` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa265` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa266` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa267` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa268` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa269` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa27` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa270` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa271` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa272` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa273` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa274` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa275` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa276` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa277` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa278` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa279` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa28` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa280` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa281` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa282` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa283` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa284` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa285` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa286` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa287` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa288` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa289` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa29` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa290` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa291` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa292` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa293` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa294` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa295` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa296` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa297` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa298` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa299` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa3` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa30` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa300` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa301` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa302` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa303` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa304` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa305` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa306` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa307` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa308` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa309` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa31` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa310` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa311` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa312` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa313` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa314` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa315` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa316` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa317` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa318` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa319` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa32` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa320` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa321` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa322` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa323` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa324` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa325` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa326` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa327` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa328` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa329` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa33` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa330` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa331` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa332` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa333` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa334` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa335` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa336` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa337` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa338` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa339` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa34` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa340` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa341` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa342` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa343` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa344` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa345` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa346` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa347` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa348` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa349` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa35` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa350` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa351` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa352` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa353` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa354` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa355` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa356` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa357` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa358` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa359` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa36` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa360` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa361` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa362` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa363` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa364` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa365` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa366` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa367` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa368` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa369` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa37` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa370` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa371` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa372` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa373` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa374` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa375` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa376` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa377` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa378` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa379` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa38` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa380` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa381` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa382` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa383` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa384` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa385` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa386` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa387` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa388` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa389` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa39` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa390` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa391` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa392` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa393` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa394` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa395` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa396` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa397` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa398` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa399` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa40` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa400` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa401` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa402` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa403` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa404` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa405` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa406` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa407` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa408` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa409` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa41` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa410` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa411` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa412` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa413` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa414` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa415` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa416` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa417` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa418` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa419` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa42` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa420` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa421` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa422` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa423` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa424` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa425` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa426` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa427` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa428` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa429` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa43` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa430` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa431` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa432` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa433` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa434` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa435` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa436` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa437` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa438` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa439` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa44` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa440` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa441` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa442` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa443` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa444` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa445` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa446` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa447` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa448` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa449` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa45` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa450` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa451` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa452` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa453` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa454` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa455` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa456` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa457` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa458` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa459` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa46` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa460` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa461` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa462` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa463` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa464` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa465` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa466` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa467` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa468` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa469` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa47` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa470` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa471` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa472` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa473` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa474` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa475` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa476` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa477` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa478` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa479` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa48` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa480` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa481` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa482` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa483` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa484` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa485` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa486` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa487` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa488` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa489` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa49` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa490` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa491` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa492` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa493` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa494` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa495` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa496` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa497` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa498` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa499` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa5` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa50` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa500` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa501` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa502` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa503` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa504` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa505` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa506` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa507` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa508` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa509` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa51` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa510` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa511` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa512` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa513` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa514` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa515` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa516` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa517` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa518` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa519` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa52` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa520` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa521` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa522` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa523` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa524` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa525` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa526` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa527` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa528` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa529` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa53` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa530` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa531` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa532` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa533` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa534` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa535` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa536` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa537` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa538` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa539` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa54` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa540` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa541` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa542` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa543` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa544` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa545` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa546` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa547` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa548` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa549` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa55` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa550` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa56` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa57` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa58` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa59` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa6` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa60` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa61` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa62` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa63` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa64` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa65` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa66` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa67` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa68` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa69` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa7` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa70` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa71` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa72` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa73` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa74` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa75` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa76` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa77` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa78` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa79` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa8` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa80` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa81` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa82` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa83` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa84` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa85` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa86` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa87` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa88` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa89` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa90` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa91` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa92` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa93` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa94` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa95` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa96` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa97` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa98` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa99` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL
+) ENGINE=InnoDB;
+
+-- enable_query_log
+-- enable_result_log
+
+SHOW CREATE TABLE bug56143_2;
+
+-- disable_query_log
+-- disable_result_log
+DROP TABLE bug56143_1;
+DROP TABLE bug56143_2;
diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug56632.test b/mysql-test/suite/innodb_plugin/t/innodb_bug56632.test
new file mode 100755
index 00000000000..7f1c41cddfa
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug56632.test
@@ -0,0 +1,216 @@
+#
+# Bug#56632: ALTER TABLE implicitly changes ROW_FORMAT to COMPRESSED
+# http://bugs.mysql.com/56632
+#
+# Innodb automatically uses compressed mode when the KEY_BLOCK_SIZE
+# parameter is used, except if the ROW_FORMAT is also specified, in
+# which case the KEY_BLOCK_SIZE is ignored and a warning is shown.
+# But Innodb was getting confused when neither of those parameters
+# was used on the ALTER statement after they were both used on the
+# CREATE.
+#
+# This will test the results of all 4 combinations of these two
+# parameters of the CREATE and ALTER.
+#
+# Tests 1-5 use INNODB_STRICT_MODE=1 which returns an error
+# if there is anything wrong with the statement.
+#
+# 1) CREATE with ROW_FORMAT=COMPACT & KEY_BLOCK_SIZE=1, ALTER with neither.
+# Result; CREATE; fails with error ER_CANT_CREATE_TABLE
+# 2) CREATE with ROW_FORMAT=COMPACT, ALTER with KEY_BLOCK_SIZE=1
+# Result; CREATE succeeds,
+# ALTER quietly converts ROW_FORMAT to compressed.
+# 3) CREATE with KEY_BLOCK_SIZE=1, ALTER with ROW_FORMAT=COMPACT
+# Result; CREATE quietly converts ROW_FORMAT to compressed,
+# ALTER fails with error ER_CANT_CREATE_TABLE.
+# 4) CREATE with neither, ALTER with ROW_FORMAT=COMPACT & KEY_BLOCK_SIZE=1
+# Result; CREATE succeeds,
+# ALTER; fails with error ER_CANT_CREATE_TABLE
+# 5) CREATE with KEY_BLOCK_SIZE=3 (invalid), ALTER with neither.
+# Result; CREATE; fails with error ER_CANT_CREATE_TABLE
+#
+# Tests 6-11 use INNODB_STRICT_MODE=0 which automatically makes
+# adjustments if the prameters are incompatible.
+#
+# 6) CREATE with ROW_FORMAT=COMPACT & KEY_BLOCK_SIZE=1, ALTER with neither.
+# Result; CREATE succeeds, warns that KEY_BLOCK_SIZE is ignored.
+# ALTER succeeds, no warnings.
+# 7) CREATE with ROW_FORMAT=COMPACT, ALTER with KEY_BLOCK_SIZE=1
+# Result; CREATE succeeds,
+# ALTER quietly converts ROW_FORMAT to compressed.
+# 8) CREATE with KEY_BLOCK_SIZE=1, ALTER with ROW_FORMAT=COMPACT
+# Result; CREATE quietly converts ROW_FORMAT to compressed,
+# ALTER succeeds, warns that KEY_BLOCK_SIZE is ignored.
+# 9) CREATE with neither, ALTER with ROW_FORMAT=COMPACT & KEY_BLOCK_SIZE=1
+# Result; CREATE succeeds,
+# ALTER succeeds, warns that KEY_BLOCK_SIZE is ignored.
+# 10) CREATE with KEY_BLOCK_SIZE=3 (invalid), ALTER with neither.
+# Result; CREATE succeeds, warns that KEY_BLOCK_SIZE=3 is ignored.
+# ALTER succeeds, warns that KEY_BLOCK_SIZE=3 is ignored.
+# 11) CREATE with KEY_BLOCK_SIZE=3 (invalid), ALTER with ROW_FORMAT=COMPACT.
+# Result; CREATE succeeds, warns that KEY_BLOCK_SIZE=3 is ignored.
+# ALTER succeeds, warns that KEY_BLOCK_SIZE=3 is ignored.
+# 12) CREATE with KEY_BLOCK_SIZE=3 (invalid), ALTER with KEY_BLOCK_SIZE=1.
+# Result; CREATE succeeds, warns that KEY_BLOCK_SIZE=3 is ignored.
+# ALTER succeeds, quietly converts ROW_FORMAT to compressed.
+
+-- source include/have_innodb_plugin.inc
+
+SET storage_engine=InnoDB;
+
+--disable_query_log
+# These values can change during the test
+LET $innodb_file_format_orig=`select @@innodb_file_format`;
+LET $innodb_file_format_check_orig=`select @@innodb_file_format_check`;
+LET $innodb_file_per_table_orig=`select @@innodb_file_per_table`;
+LET $innodb_strict_mode_orig=`select @@session.innodb_strict_mode`;
+--enable_query_log
+
+SET GLOBAL innodb_file_format=`Barracuda`;
+SET GLOBAL innodb_file_per_table=ON;
+
+# Innodb strict mode will cause an error on the CREATE or ALTER when;
+# 1. both ROW_FORMAT=COMPACT and KEY_BLOCK_SIZE=1,
+# 2. KEY_BLOCK_SIZE is not a valid number (0,1,2,4,8,16).
+# With innodb_strict_mode = OFF, These errors are corrected
+# and just a warning is returned.
+SET SESSION innodb_strict_mode = ON;
+
+--echo # Test 1) CREATE with ROW_FORMAT & KEY_BLOCK_SIZE, ALTER with neither
+DROP TABLE IF EXISTS bug56632;
+--error ER_CANT_CREATE_TABLE
+CREATE TABLE bug56632 ( i INT ) ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=1;
+SHOW WARNINGS;
+
+--echo # Test 2) CREATE with ROW_FORMAT, ALTER with KEY_BLOCK_SIZE
+DROP TABLE IF EXISTS bug56632;
+CREATE TABLE bug56632 ( i INT ) ROW_FORMAT=COMPACT;
+SHOW WARNINGS;
+SHOW CREATE TABLE bug56632;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 'bug56632';
+ALTER TABLE bug56632 KEY_BLOCK_SIZE=1;
+SHOW WARNINGS;
+SHOW CREATE TABLE bug56632;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 'bug56632';
+
+--echo # Test 3) CREATE with KEY_BLOCK_SIZE, ALTER with ROW_FORMAT
+DROP TABLE IF EXISTS bug56632;
+CREATE TABLE bug56632 ( i INT ) KEY_BLOCK_SIZE=1;
+SHOW WARNINGS;
+SHOW CREATE TABLE bug56632;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 'bug56632';
+--disable_result_log
+--error ER_CANT_CREATE_TABLE
+ALTER TABLE bug56632 ROW_FORMAT=COMPACT;
+--enable_result_log
+SHOW CREATE TABLE bug56632;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 'bug56632';
+
+--echo # Test 4) CREATE with neither, ALTER with ROW_FORMAT & KEY_BLOCK_SIZE
+DROP TABLE IF EXISTS bug56632;
+CREATE TABLE bug56632 ( i INT );
+SHOW WARNINGS;
+SHOW CREATE TABLE bug56632;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 'bug56632';
+--disable_result_log
+--error ER_CANT_CREATE_TABLE
+ALTER TABLE bug56632 ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=1;
+--enable_result_log
+SHOW CREATE TABLE bug56632;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 'bug56632';
+
+--echo # Test 5) CREATE with KEY_BLOCK_SIZE=3 (invalid).
+DROP TABLE IF EXISTS bug56632;
+--error ER_CANT_CREATE_TABLE
+CREATE TABLE bug56632 ( i INT ) KEY_BLOCK_SIZE=3;
+SHOW WARNINGS;
+
+SET SESSION innodb_strict_mode = OFF;
+
+--echo # Test 6) CREATE with ROW_FORMAT & KEY_BLOCK_SIZE, ALTER with neither
+DROP TABLE IF EXISTS bug56632;
+CREATE TABLE bug56632 ( i INT ) ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=1;
+SHOW WARNINGS;
+SHOW CREATE TABLE bug56632;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 'bug56632';
+ALTER TABLE bug56632 ADD COLUMN f1 INT;
+SHOW WARNINGS;
+SHOW CREATE TABLE bug56632;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 'bug56632';
+
+--echo # Test 7) CREATE with ROW_FORMAT, ALTER with KEY_BLOCK_SIZE
+DROP TABLE IF EXISTS bug56632;
+CREATE TABLE bug56632 ( i INT ) ROW_FORMAT=COMPACT;
+SHOW WARNINGS;
+SHOW CREATE TABLE bug56632;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 'bug56632';
+ALTER TABLE bug56632 KEY_BLOCK_SIZE=1;
+SHOW WARNINGS;
+SHOW CREATE TABLE bug56632;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 'bug56632';
+
+--echo # Test 8) CREATE with KEY_BLOCK_SIZE, ALTER with ROW_FORMAT
+DROP TABLE IF EXISTS bug56632;
+CREATE TABLE bug56632 ( i INT ) KEY_BLOCK_SIZE=1;
+SHOW WARNINGS;
+SHOW CREATE TABLE bug56632;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 'bug56632';
+ALTER TABLE bug56632 ROW_FORMAT=COMPACT;
+SHOW WARNINGS;
+SHOW CREATE TABLE bug56632;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 'bug56632';
+
+--echo # Test 9) CREATE with neither, ALTER with ROW_FORMAT & KEY_BLOCK_SIZE
+DROP TABLE IF EXISTS bug56632;
+CREATE TABLE bug56632 ( i INT );
+SHOW WARNINGS;
+SHOW CREATE TABLE bug56632;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 'bug56632';
+ALTER TABLE bug56632 ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=1;
+SHOW WARNINGS;
+SHOW CREATE TABLE bug56632;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 'bug56632';
+
+--echo # Test 10) CREATE with KEY_BLOCK_SIZE=3 (invalid), ALTER with neither.
+DROP TABLE IF EXISTS bug56632;
+CREATE TABLE bug56632 ( i INT ) KEY_BLOCK_SIZE=3;
+SHOW WARNINGS;
+SHOW CREATE TABLE bug56632;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 'bug56632';
+ALTER TABLE bug56632 ADD COLUMN f1 INT;
+SHOW WARNINGS;
+SHOW CREATE TABLE bug56632;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 'bug56632';
+
+--echo # Test 11) CREATE with KEY_BLOCK_SIZE=3 (invalid), ALTER with ROW_FORMAT=COMPACT.
+DROP TABLE IF EXISTS bug56632;
+CREATE TABLE bug56632 ( i INT ) KEY_BLOCK_SIZE=3;
+SHOW WARNINGS;
+SHOW CREATE TABLE bug56632;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 'bug56632';
+ALTER TABLE bug56632 ROW_FORMAT=COMPACT;
+SHOW WARNINGS;
+SHOW CREATE TABLE bug56632;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 'bug56632';
+
+--echo # Test 12) CREATE with KEY_BLOCK_SIZE=3 (invalid), ALTER with KEY_BLOCK_SIZE=1.
+DROP TABLE IF EXISTS bug56632;
+CREATE TABLE bug56632 ( i INT ) KEY_BLOCK_SIZE=3;
+SHOW WARNINGS;
+SHOW CREATE TABLE bug56632;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 'bug56632';
+ALTER TABLE bug56632 KEY_BLOCK_SIZE=1;
+SHOW WARNINGS;
+SHOW CREATE TABLE bug56632;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 'bug56632';
+
+--echo # Cleanup
+DROP TABLE IF EXISTS bug56632;
+
+--disable_query_log
+EVAL SET GLOBAL innodb_file_per_table=$innodb_file_per_table_orig;
+EVAL SET GLOBAL innodb_file_format=$innodb_file_format_orig;
+EVAL SET GLOBAL innodb_file_format_check=$innodb_file_format_check_orig;
+EVAL SET SESSION innodb_strict_mode=$innodb_strict_mode_orig;
+--enable_query_log
+
diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug56680.test b/mysql-test/suite/innodb_plugin/t/innodb_bug56680.test
new file mode 100644
index 00000000000..e30e2b8fd96
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug56680.test
@@ -0,0 +1,143 @@
+#
+# Bug #56680 InnoDB may return wrong results from a case-insensitive index
+#
+-- source include/have_innodb_plugin.inc
+-- source include/not_valgrind.inc
+
+-- disable_query_log
+SET @tx_isolation_orig = @@tx_isolation;
+SET @innodb_file_per_table_orig = @@innodb_file_per_table;
+SET @innodb_file_format_orig = @@innodb_file_format;
+SET @innodb_file_format_check_orig = @@innodb_file_format_check;
+# The flag innodb_change_buffering_debug is only available in debug builds.
+# It instructs InnoDB to try to evict pages from the buffer pool when
+# change buffering is possible, so that the change buffer will be used
+# whenever possible.
+-- error 0,ER_UNKNOWN_SYSTEM_VARIABLE
+SET @innodb_change_buffering_debug_orig = @@innodb_change_buffering_debug;
+-- error 0,ER_UNKNOWN_SYSTEM_VARIABLE
+SET GLOBAL innodb_change_buffering_debug = 1;
+-- enable_query_log
+SET GLOBAL tx_isolation='REPEATABLE-READ';
+SET GLOBAL innodb_file_format=Barracuda;
+SET GLOBAL innodb_file_per_table=on;
+
+CREATE TABLE bug56680(
+ a INT AUTO_INCREMENT PRIMARY KEY,
+ b CHAR(1),
+ c INT,
+ INDEX(b))
+ENGINE=InnoDB;
+
+INSERT INTO bug56680 VALUES(0,'x',1);
+BEGIN;
+SELECT b FROM bug56680;
+
+connect (con1,localhost,root,,);
+connection con1;
+BEGIN;
+UPDATE bug56680 SET b='X';
+
+connection default;
+# This should return the last committed value 'x', but would return 'X'
+# due to a bug in row_search_for_mysql().
+SELECT b FROM bug56680;
+# This would always return the last committed value 'x'.
+SELECT * FROM bug56680;
+
+connection con1;
+ROLLBACK;
+disconnect con1;
+
+connection default;
+
+SELECT b FROM bug56680;
+
+# For the rest of this test, use the READ UNCOMMITTED isolation level
+# to see what exists in the secondary index.
+SET GLOBAL tx_isolation='READ-UNCOMMITTED';
+
+# Create enough rows for the table, so that the insert buffer will be
+# used for modifying the secondary index page. There must be multiple
+# index pages, because changes to the root page are never buffered.
+
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+
+BEGIN;
+SELECT b FROM bug56680 LIMIT 2;
+
+connect (con1,localhost,root,,);
+connection con1;
+BEGIN;
+DELETE FROM bug56680 WHERE a=1;
+# This should be buffered, if innodb_change_buffering_debug = 1 is in effect.
+INSERT INTO bug56680 VALUES(1,'X',1);
+
+# This should force an insert buffer merge, and return 'X' in the first row.
+SELECT b FROM bug56680 LIMIT 3;
+
+connection default;
+SELECT b FROM bug56680 LIMIT 2;
+CHECK TABLE bug56680;
+
+connection con1;
+ROLLBACK;
+SELECT b FROM bug56680 LIMIT 2;
+CHECK TABLE bug56680;
+
+connection default;
+disconnect con1;
+
+SELECT b FROM bug56680 LIMIT 2;
+
+CREATE TABLE bug56680_2(
+ a INT AUTO_INCREMENT PRIMARY KEY,
+ b VARCHAR(2) CHARSET latin1 COLLATE latin1_german2_ci,
+ c INT,
+ INDEX(b))
+ENGINE=InnoDB;
+
+INSERT INTO bug56680_2 SELECT 0,_latin1 0xdf,c FROM bug56680;
+
+BEGIN;
+SELECT HEX(b) FROM bug56680_2 LIMIT 2;
+DELETE FROM bug56680_2 WHERE a=1;
+# This should be buffered, if innodb_change_buffering_debug = 1 is in effect.
+INSERT INTO bug56680_2 VALUES(1,'SS',1);
+
+# This should force an insert buffer merge, and return 'SS' in the first row.
+SELECT HEX(b) FROM bug56680_2 LIMIT 3;
+CHECK TABLE bug56680_2;
+
+# Test this with compressed tables.
+ALTER TABLE bug56680_2 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
+
+SELECT HEX(b) FROM bug56680_2 LIMIT 2;
+DELETE FROM bug56680_2 WHERE a=1;
+# This should be buffered, if innodb_change_buffering_debug = 1 is in effect.
+INSERT INTO bug56680_2 VALUES(1,_latin1 0xdf,1);
+
+# This should force an insert buffer merge, and return 0xdf in the first row.
+SELECT HEX(b) FROM bug56680_2 LIMIT 3;
+CHECK TABLE bug56680_2;
+
+DROP TABLE bug56680_2;
+DROP TABLE bug56680;
+
+-- disable_query_log
+SET GLOBAL tx_isolation = @tx_isolation_orig;
+SET GLOBAL innodb_file_per_table = @innodb_file_per_table_orig;
+SET GLOBAL innodb_file_format = @innodb_file_format_orig;
+SET GLOBAL innodb_file_format_check = @innodb_file_format_check_orig;
+-- error 0, ER_UNKNOWN_SYSTEM_VARIABLE
+SET GLOBAL innodb_change_buffering_debug = @innodb_change_buffering_debug_orig;
diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug56716.test b/mysql-test/suite/innodb_plugin/t/innodb_bug56716.test
new file mode 100644
index 00000000000..24e90f5acc5
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug56716.test
@@ -0,0 +1,10 @@
+#
+# Bug #56716 InnoDB locks a record gap without locking the table
+#
+-- source include/have_innodb_plugin.inc
+
+CREATE TABLE bug56716 (a INT PRIMARY KEY,b INT,c INT,INDEX(b)) ENGINE=InnoDB;
+
+SELECT * FROM bug56716 WHERE b<=42 ORDER BY b DESC FOR UPDATE;
+
+DROP TABLE bug56716;
diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug56947.test b/mysql-test/suite/innodb_plugin/t/innodb_bug56947.test
new file mode 100644
index 00000000000..88544387567
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug56947.test
@@ -0,0 +1,11 @@
+#
+# Bug #56947 valgrind reports a memory leak in innodb-plugin.innodb-index
+#
+-- source include/have_innodb_plugin.inc
+
+create table bug56947(a int not null) engine = innodb;
+CREATE TABLE `bug56947#1`(a int) ENGINE=InnoDB;
+--error 156
+alter table bug56947 add unique index (a);
+drop table `bug56947#1`;
+drop table bug56947;
diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug57252.test b/mysql-test/suite/innodb_plugin/t/innodb_bug57252.test
new file mode 100644
index 00000000000..d66cf79ef41
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug57252.test
@@ -0,0 +1,46 @@
+#
+# Bug#57252 disabling innobase_stats_on_metadata disables ANALYZE
+# http://bugs.mysql.com/57252
+#
+
+-- source include/have_innodb_plugin.inc
+
+-- disable_query_log
+-- disable_result_log
+
+SET @innodb_stats_on_metadata_orig = @@innodb_stats_on_metadata;
+
+CREATE TABLE bug57252 (a INT, KEY akey (a)) ENGINE=INNODB;
+
+BEGIN;
+let $i = 10;
+while ($i) {
+ eval INSERT INTO bug57252 VALUES ($i);
+ dec $i;
+}
+COMMIT;
+
+-- enable_result_log
+
+SET GLOBAL innodb_stats_on_metadata=0;
+
+# this calls ::info() without HA_STATUS_CONST and so
+# index->stat_n_diff_key_vals[] is not copied to the mysql-visible
+# rec_per_key
+SELECT cardinality FROM information_schema.statistics
+WHERE table_name='bug57252' AND index_name='akey';
+
+# this calls ::info() with HA_STATUS_CONST and so
+# index->stat_n_diff_key_vals[] is copied to the mysql-visible
+# rec_per_key at the end; when the bug is present dict_update_statistics()
+# is not called beforehand and so index->stat_n_diff_key_vals[] contains
+# an outdated data and thus we get an outdated data in the result when the
+# bug is present
+ANALYZE TABLE bug57252;
+
+SELECT cardinality FROM information_schema.statistics
+WHERE table_name='bug57252' AND index_name='akey';
+
+DROP TABLE bug57252;
+
+SET GLOBAL innodb_stats_on_metadata = @innodb_stats_on_metadata_orig;
diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug57255.test b/mysql-test/suite/innodb_plugin/t/innodb_bug57255.test
new file mode 100644
index 00000000000..e5056d3e23c
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug57255.test
@@ -0,0 +1,38 @@
+# Test Bug #57255. Cascade deletes that affect different rows should not
+# result in DB_FOREIGN_EXCEED_MAX_CASCADE error
+
+--source include/have_innodb_plugin.inc
+
+create table A(id int not null primary key) engine=innodb;
+
+create table B(id int not null auto_increment primary key, f1 int not null, foreign key(f1) references A(id) on delete cascade) engine=innodb;
+
+create table C(id int not null auto_increment primary key, f1 int not null, foreign key(f1) references B(id) on delete cascade) engine=innodb;
+
+insert into A values(1), (2);
+
+--disable_query_log
+begin;
+let $i=257;
+while ($i)
+{
+insert into B(f1) values(1);
+dec $i;
+}
+let $i=486;
+while ($i)
+{
+insert into C(f1) values(2);
+dec $i;
+}
+commit;
+--enable_query_log
+
+# Following Deletes should not report error
+DELETE FROM A where id = 1;
+DELETE FROM C where f1 = 2;
+DELETE FROM A where id = 1;
+
+DROP TABLE C;
+DROP TABLE B;
+DROP TABLE A;
diff --git a/mysql-test/suite/innodb_plugin/t/innodb_mysql.test b/mysql-test/suite/innodb_plugin/t/innodb_mysql.test
index 5adaba43050..4855d9e2055 100644
--- a/mysql-test/suite/innodb_plugin/t/innodb_mysql.test
+++ b/mysql-test/suite/innodb_plugin/t/innodb_mysql.test
@@ -634,4 +634,18 @@ UPDATE t1,t2 SET t1.a = t1.a + 100 WHERE t1.a = 1;
DROP TABLE t1,t2;
+--echo #
+--echo # Bug#54606 innodb fast alter table + pack_keys=0
+--echo # prevents adding new indexes
+--echo #
+
+CREATE TABLE t1 (a INT, b CHAR(9), c INT, key(b))
+ ENGINE=InnoDB
+ PACK_KEYS=0;
+CREATE INDEX a ON t1 (a);
+CREATE INDEX c on t1 (c);
+
+DROP TABLE t1;
+
+
--echo End of 5.1 tests
diff --git a/mysql-test/suite/maria/r/maria.result b/mysql-test/suite/maria/r/maria.result
index e7f40ca10ed..3f9a4b636d1 100644
--- a/mysql-test/suite/maria/r/maria.result
+++ b/mysql-test/suite/maria/r/maria.result
@@ -1,6 +1,6 @@
select * from INFORMATION_SCHEMA.ENGINES where ENGINE="ARIA";
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
-Aria YES Crash-safe tables with MyISAM heritage YES NO NO
+Aria YES Crash-safe tables with MyISAM heritage NO NO NO
set global storage_engine=aria;
set session storage_engine=aria;
set global aria_page_checksum=0;
@@ -2624,3 +2624,19 @@ KEY (v3)
INSERT INTO t1 ( f1 , f2 , f3 , f4 ) SELECT f1 , f4 , f1 , f4 FROM t1;
DELETE FROM t1;
drop table t1;
+create table t1 (a int not null primary key, b blob) engine=maria transactional=1;
+insert into t1 values(1,repeat('a',8000));
+insert into t1 values(2,repeat('b',8000));
+insert into t1 values(3,repeat('c',8000));
+flush tables;
+delete from t1 where a>1;
+insert into t1 values(1,repeat('d',8000*3));
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+flush tables;
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+repair table t1 extended;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+drop table t1;
diff --git a/mysql-test/suite/maria/r/maria3.result b/mysql-test/suite/maria/r/maria3.result
index 2311669640b..490059587ad 100644
--- a/mysql-test/suite/maria/r/maria3.result
+++ b/mysql-test/suite/maria/r/maria3.result
@@ -1,6 +1,6 @@
select * from INFORMATION_SCHEMA.ENGINES where ENGINE="ARIA";
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
-Aria YES Crash-safe tables with MyISAM heritage YES NO NO
+Aria YES Crash-safe tables with MyISAM heritage NO NO NO
set global storage_engine=aria;
set session storage_engine=aria;
set global aria_page_checksum=0;
diff --git a/mysql-test/suite/maria/r/ps_maria.result b/mysql-test/suite/maria/r/ps_maria.result
index 30f7edb8a99..04c14f9c1e4 100644
--- a/mysql-test/suite/maria/r/ps_maria.result
+++ b/mysql-test/suite/maria/r/ps_maria.result
@@ -1929,26 +1929,26 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 128 30 63
def @arg12 246 83 6 Y 128 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 250 16777215 10 Y 128 31 63
+def @arg14 250 16777215 19 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 8 Y 128 31 63
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
-def @arg20 251 16777216 1 Y 0 31 8
-def @arg21 251 16777216 10 Y 0 31 8
-def @arg22 251 16777216 30 Y 0 31 8
-def @arg23 251 16777216 8 Y 128 31 63
-def @arg24 251 16777216 8 Y 0 31 8
-def @arg25 251 16777216 4 Y 128 31 63
-def @arg26 251 16777216 4 Y 0 31 8
-def @arg27 251 16777216 10 Y 128 31 63
-def @arg28 251 16777216 10 Y 0 31 8
-def @arg29 251 16777216 8 Y 128 31 63
-def @arg30 251 16777216 8 Y 0 31 8
-def @arg31 251 16777216 3 Y 0 31 8
-def @arg32 251 16777216 6 Y 0 31 8
+def @arg20 250 16777215 1 Y 0 31 8
+def @arg21 250 16777215 10 Y 0 31 8
+def @arg22 250 16777215 30 Y 0 31 8
+def @arg23 250 16777215 8 Y 128 31 63
+def @arg24 250 16777215 8 Y 0 31 8
+def @arg25 250 16777215 4 Y 128 31 63
+def @arg26 250 16777215 4 Y 0 31 8
+def @arg27 250 16777215 10 Y 128 31 63
+def @arg28 250 16777215 10 Y 0 31 8
+def @arg29 250 16777215 8 Y 128 31 63
+def @arg30 250 16777215 8 Y 0 31 8
+def @arg31 250 16777215 3 Y 0 31 8
+def @arg32 250 16777215 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
@@ -1976,26 +1976,26 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 128 30 63
def @arg12 246 83 0 Y 128 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 250 16777215 0 Y 128 31 63
+def @arg14 250 16777215 0 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 0 Y 128 31 63
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
-def @arg20 251 16777216 0 Y 0 31 8
-def @arg21 251 16777216 0 Y 0 31 8
-def @arg22 251 16777216 0 Y 0 31 8
-def @arg23 251 16777216 0 Y 128 31 63
-def @arg24 251 16777216 0 Y 0 31 8
-def @arg25 251 16777216 0 Y 128 31 63
-def @arg26 251 16777216 0 Y 0 31 8
-def @arg27 251 16777216 0 Y 128 31 63
-def @arg28 251 16777216 0 Y 0 31 8
-def @arg29 251 16777216 0 Y 128 31 63
-def @arg30 251 16777216 0 Y 0 31 8
-def @arg31 251 16777216 0 Y 0 31 8
-def @arg32 251 16777216 0 Y 0 31 8
+def @arg20 250 16777215 0 Y 0 31 8
+def @arg21 250 16777215 0 Y 0 31 8
+def @arg22 250 16777215 0 Y 0 31 8
+def @arg23 250 16777215 0 Y 128 31 63
+def @arg24 250 16777215 0 Y 0 31 8
+def @arg25 250 16777215 0 Y 128 31 63
+def @arg26 250 16777215 0 Y 0 31 8
+def @arg27 250 16777215 0 Y 128 31 63
+def @arg28 250 16777215 0 Y 0 31 8
+def @arg29 250 16777215 0 Y 128 31 63
+def @arg30 250 16777215 0 Y 0 31 8
+def @arg31 250 16777215 0 Y 0 31 8
+def @arg32 250 16777215 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select
@@ -2026,26 +2026,26 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 128 30 63
def @arg12 246 83 6 Y 128 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 250 16777215 10 Y 128 31 63
+def @arg14 250 16777215 19 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 8 Y 128 31 63
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
-def @arg20 251 16777216 1 Y 0 31 8
-def @arg21 251 16777216 10 Y 0 31 8
-def @arg22 251 16777216 30 Y 0 31 8
-def @arg23 251 16777216 8 Y 128 31 63
-def @arg24 251 16777216 8 Y 0 31 8
-def @arg25 251 16777216 4 Y 128 31 63
-def @arg26 251 16777216 4 Y 0 31 8
-def @arg27 251 16777216 10 Y 128 31 63
-def @arg28 251 16777216 10 Y 0 31 8
-def @arg29 251 16777216 8 Y 128 31 63
-def @arg30 251 16777216 8 Y 0 31 8
-def @arg31 251 16777216 3 Y 0 31 8
-def @arg32 251 16777216 6 Y 0 31 8
+def @arg20 250 16777215 1 Y 0 31 8
+def @arg21 250 16777215 10 Y 0 31 8
+def @arg22 250 16777215 30 Y 0 31 8
+def @arg23 250 16777215 8 Y 128 31 63
+def @arg24 250 16777215 8 Y 0 31 8
+def @arg25 250 16777215 4 Y 128 31 63
+def @arg26 250 16777215 4 Y 0 31 8
+def @arg27 250 16777215 10 Y 128 31 63
+def @arg28 250 16777215 10 Y 0 31 8
+def @arg29 250 16777215 8 Y 128 31 63
+def @arg30 250 16777215 8 Y 0 31 8
+def @arg31 250 16777215 3 Y 0 31 8
+def @arg32 250 16777215 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
set @my_key= 0 ;
@@ -2066,26 +2066,26 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 128 30 63
def @arg12 246 83 0 Y 128 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 250 16777215 0 Y 128 31 63
+def @arg14 250 16777215 0 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 0 Y 128 31 63
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
-def @arg20 251 16777216 0 Y 0 31 8
-def @arg21 251 16777216 0 Y 0 31 8
-def @arg22 251 16777216 0 Y 0 31 8
-def @arg23 251 16777216 0 Y 128 31 63
-def @arg24 251 16777216 0 Y 0 31 8
-def @arg25 251 16777216 0 Y 128 31 63
-def @arg26 251 16777216 0 Y 0 31 8
-def @arg27 251 16777216 0 Y 128 31 63
-def @arg28 251 16777216 0 Y 0 31 8
-def @arg29 251 16777216 0 Y 128 31 63
-def @arg30 251 16777216 0 Y 0 31 8
-def @arg31 251 16777216 0 Y 0 31 8
-def @arg32 251 16777216 0 Y 0 31 8
+def @arg20 250 16777215 0 Y 0 31 8
+def @arg21 250 16777215 0 Y 0 31 8
+def @arg22 250 16777215 0 Y 0 31 8
+def @arg23 250 16777215 0 Y 128 31 63
+def @arg24 250 16777215 0 Y 0 31 8
+def @arg25 250 16777215 0 Y 128 31 63
+def @arg26 250 16777215 0 Y 0 31 8
+def @arg27 250 16777215 0 Y 128 31 63
+def @arg28 250 16777215 0 Y 0 31 8
+def @arg29 250 16777215 0 Y 128 31 63
+def @arg30 250 16777215 0 Y 0 31 8
+def @arg31 250 16777215 0 Y 0 31 8
+def @arg32 250 16777215 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select ? := c1 from t9 where c1= 1" ;
@@ -2114,26 +2114,26 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 128 30 63
def @arg12 246 83 6 Y 128 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 250 16777215 10 Y 128 31 63
+def @arg14 250 16777215 19 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 8 Y 128 31 63
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
-def @arg20 251 16777216 1 Y 0 31 8
-def @arg21 251 16777216 10 Y 0 31 8
-def @arg22 251 16777216 30 Y 0 31 8
-def @arg23 251 16777216 8 Y 128 31 63
-def @arg24 251 16777216 8 Y 0 31 8
-def @arg25 251 16777216 4 Y 128 31 63
-def @arg26 251 16777216 4 Y 0 31 8
-def @arg27 251 16777216 10 Y 128 31 63
-def @arg28 251 16777216 10 Y 0 31 8
-def @arg29 251 16777216 8 Y 128 31 63
-def @arg30 251 16777216 8 Y 0 31 8
-def @arg31 251 16777216 3 Y 0 31 8
-def @arg32 251 16777216 6 Y 0 31 8
+def @arg20 250 16777215 1 Y 0 31 8
+def @arg21 250 16777215 10 Y 0 31 8
+def @arg22 250 16777215 30 Y 0 31 8
+def @arg23 250 16777215 8 Y 128 31 63
+def @arg24 250 16777215 8 Y 0 31 8
+def @arg25 250 16777215 4 Y 128 31 63
+def @arg26 250 16777215 4 Y 0 31 8
+def @arg27 250 16777215 10 Y 128 31 63
+def @arg28 250 16777215 10 Y 0 31 8
+def @arg29 250 16777215 8 Y 128 31 63
+def @arg30 250 16777215 8 Y 0 31 8
+def @arg31 250 16777215 3 Y 0 31 8
+def @arg32 250 16777215 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
@@ -2158,26 +2158,26 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 128 30 63
def @arg12 246 83 0 Y 128 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 250 16777215 0 Y 128 31 63
+def @arg14 250 16777215 0 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 0 Y 128 31 63
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
-def @arg20 251 16777216 0 Y 0 31 8
-def @arg21 251 16777216 0 Y 0 31 8
-def @arg22 251 16777216 0 Y 0 31 8
-def @arg23 251 16777216 0 Y 128 31 63
-def @arg24 251 16777216 0 Y 0 31 8
-def @arg25 251 16777216 0 Y 128 31 63
-def @arg26 251 16777216 0 Y 0 31 8
-def @arg27 251 16777216 0 Y 128 31 63
-def @arg28 251 16777216 0 Y 0 31 8
-def @arg29 251 16777216 0 Y 128 31 63
-def @arg30 251 16777216 0 Y 0 31 8
-def @arg31 251 16777216 0 Y 0 31 8
-def @arg32 251 16777216 0 Y 0 31 8
+def @arg20 250 16777215 0 Y 0 31 8
+def @arg21 250 16777215 0 Y 0 31 8
+def @arg22 250 16777215 0 Y 0 31 8
+def @arg23 250 16777215 0 Y 128 31 63
+def @arg24 250 16777215 0 Y 0 31 8
+def @arg25 250 16777215 0 Y 128 31 63
+def @arg26 250 16777215 0 Y 0 31 8
+def @arg27 250 16777215 0 Y 128 31 63
+def @arg28 250 16777215 0 Y 0 31 8
+def @arg29 250 16777215 0 Y 128 31 63
+def @arg30 250 16777215 0 Y 0 31 8
+def @arg31 250 16777215 0 Y 0 31 8
+def @arg32 250 16777215 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
@@ -2204,26 +2204,26 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 128 30 63
def @arg12 246 83 6 Y 128 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 250 16777215 10 Y 128 31 63
+def @arg14 250 16777215 19 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 8 Y 128 31 63
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
-def @arg20 251 16777216 1 Y 0 31 8
-def @arg21 251 16777216 10 Y 0 31 8
-def @arg22 251 16777216 30 Y 0 31 8
-def @arg23 251 16777216 8 Y 128 31 63
-def @arg24 251 16777216 8 Y 0 31 8
-def @arg25 251 16777216 4 Y 128 31 63
-def @arg26 251 16777216 4 Y 0 31 8
-def @arg27 251 16777216 10 Y 128 31 63
-def @arg28 251 16777216 10 Y 0 31 8
-def @arg29 251 16777216 8 Y 128 31 63
-def @arg30 251 16777216 8 Y 0 31 8
-def @arg31 251 16777216 3 Y 0 31 8
-def @arg32 251 16777216 6 Y 0 31 8
+def @arg20 250 16777215 1 Y 0 31 8
+def @arg21 250 16777215 10 Y 0 31 8
+def @arg22 250 16777215 30 Y 0 31 8
+def @arg23 250 16777215 8 Y 128 31 63
+def @arg24 250 16777215 8 Y 0 31 8
+def @arg25 250 16777215 4 Y 128 31 63
+def @arg26 250 16777215 4 Y 0 31 8
+def @arg27 250 16777215 10 Y 128 31 63
+def @arg28 250 16777215 10 Y 0 31 8
+def @arg29 250 16777215 8 Y 128 31 63
+def @arg30 250 16777215 8 Y 0 31 8
+def @arg31 250 16777215 3 Y 0 31 8
+def @arg32 250 16777215 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
set @my_key= 0 ;
@@ -2242,26 +2242,26 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 128 30 63
def @arg12 246 83 0 Y 128 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 250 16777215 0 Y 128 31 63
+def @arg14 250 16777215 0 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 0 Y 128 31 63
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
-def @arg20 251 16777216 0 Y 0 31 8
-def @arg21 251 16777216 0 Y 0 31 8
-def @arg22 251 16777216 0 Y 0 31 8
-def @arg23 251 16777216 0 Y 128 31 63
-def @arg24 251 16777216 0 Y 0 31 8
-def @arg25 251 16777216 0 Y 128 31 63
-def @arg26 251 16777216 0 Y 0 31 8
-def @arg27 251 16777216 0 Y 128 31 63
-def @arg28 251 16777216 0 Y 0 31 8
-def @arg29 251 16777216 0 Y 128 31 63
-def @arg30 251 16777216 0 Y 0 31 8
-def @arg31 251 16777216 0 Y 0 31 8
-def @arg32 251 16777216 0 Y 0 31 8
+def @arg20 250 16777215 0 Y 0 31 8
+def @arg21 250 16777215 0 Y 0 31 8
+def @arg22 250 16777215 0 Y 0 31 8
+def @arg23 250 16777215 0 Y 128 31 63
+def @arg24 250 16777215 0 Y 0 31 8
+def @arg25 250 16777215 0 Y 128 31 63
+def @arg26 250 16777215 0 Y 0 31 8
+def @arg27 250 16777215 0 Y 128 31 63
+def @arg28 250 16777215 0 Y 0 31 8
+def @arg29 250 16777215 0 Y 128 31 63
+def @arg30 250 16777215 0 Y 0 31 8
+def @arg31 250 16777215 0 Y 0 31 8
+def @arg32 250 16777215 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select c1 into ? from t9 where c1= 1" ;
diff --git a/mysql-test/suite/maria/t/maria-recovery-rtree-ft.test b/mysql-test/suite/maria/t/maria-recovery-rtree-ft.test
index a943185d12f..01ab5740258 100644
--- a/mysql-test/suite/maria/t/maria-recovery-rtree-ft.test
+++ b/mysql-test/suite/maria/t/maria-recovery-rtree-ft.test
@@ -6,6 +6,7 @@
# Binary must be compiled with debug for crash to occur
--source include/have_debug.inc
--source include/have_maria.inc
+--source include/long_test.inc
set global aria_log_file_size=4294967295;
let $MARIA_LOG=.;
diff --git a/mysql-test/suite/maria/t/maria.test b/mysql-test/suite/maria/t/maria.test
index ccbe2c99037..71d9dcec643 100644
--- a/mysql-test/suite/maria/t/maria.test
+++ b/mysql-test/suite/maria/t/maria.test
@@ -1911,6 +1911,24 @@ DELETE FROM t1;
drop table t1;
#
+# Test of problem where REPAIR finds old deleted rows.
+#
+
+create table t1 (a int not null primary key, b blob) engine=maria transactional=1;
+insert into t1 values(1,repeat('a',8000));
+insert into t1 values(2,repeat('b',8000));
+insert into t1 values(3,repeat('c',8000));
+flush tables;
+delete from t1 where a>1;
+--error 1062
+insert into t1 values(1,repeat('d',8000*3));
+flush tables;
+check table t1;
+# This failed by finding 2 extra rows.
+repair table t1 extended;
+drop table t1;
+
+#
# End of test
#
# Set defaults back
diff --git a/mysql-test/suite/ndb/r/ps_7ndb.result b/mysql-test/suite/ndb/r/ps_7ndb.result
index 6a6b0129548..b94e5d7cba3 100644
--- a/mysql-test/suite/ndb/r/ps_7ndb.result
+++ b/mysql-test/suite/ndb/r/ps_7ndb.result
@@ -1912,26 +1912,26 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 128 30 63
def @arg12 246 83 6 Y 128 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 250 16777215 10 Y 128 31 63
+def @arg14 250 16777215 19 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 8 Y 128 31 63
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
-def @arg20 251 16777216 1 Y 0 31 8
-def @arg21 251 16777216 10 Y 0 31 8
-def @arg22 251 16777216 30 Y 0 31 8
-def @arg23 251 16777216 8 Y 128 31 63
-def @arg24 251 16777216 8 Y 0 31 8
-def @arg25 251 16777216 4 Y 128 31 63
-def @arg26 251 16777216 4 Y 0 31 8
-def @arg27 251 16777216 10 Y 128 31 63
-def @arg28 251 16777216 10 Y 0 31 8
-def @arg29 251 16777216 8 Y 128 31 63
-def @arg30 251 16777216 8 Y 0 31 8
-def @arg31 251 16777216 3 Y 0 31 8
-def @arg32 251 16777216 6 Y 0 31 8
+def @arg20 250 16777215 1 Y 0 31 8
+def @arg21 250 16777215 10 Y 0 31 8
+def @arg22 250 16777215 30 Y 0 31 8
+def @arg23 250 16777215 8 Y 128 31 63
+def @arg24 250 16777215 8 Y 0 31 8
+def @arg25 250 16777215 4 Y 128 31 63
+def @arg26 250 16777215 4 Y 0 31 8
+def @arg27 250 16777215 10 Y 128 31 63
+def @arg28 250 16777215 10 Y 0 31 8
+def @arg29 250 16777215 8 Y 128 31 63
+def @arg30 250 16777215 8 Y 0 31 8
+def @arg31 250 16777215 3 Y 0 31 8
+def @arg32 250 16777215 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4,
@@ -1959,26 +1959,26 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 128 30 63
def @arg12 246 83 0 Y 128 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 250 16777215 0 Y 128 31 63
+def @arg14 250 16777215 0 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 0 Y 128 31 63
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
-def @arg20 251 16777216 0 Y 0 31 8
-def @arg21 251 16777216 0 Y 0 31 8
-def @arg22 251 16777216 0 Y 0 31 8
-def @arg23 251 16777216 0 Y 128 31 63
-def @arg24 251 16777216 0 Y 0 31 8
-def @arg25 251 16777216 0 Y 128 31 63
-def @arg26 251 16777216 0 Y 0 31 8
-def @arg27 251 16777216 0 Y 128 31 63
-def @arg28 251 16777216 0 Y 0 31 8
-def @arg29 251 16777216 0 Y 128 31 63
-def @arg30 251 16777216 0 Y 0 31 8
-def @arg31 251 16777216 0 Y 0 31 8
-def @arg32 251 16777216 0 Y 0 31 8
+def @arg20 250 16777215 0 Y 0 31 8
+def @arg21 250 16777215 0 Y 0 31 8
+def @arg22 250 16777215 0 Y 0 31 8
+def @arg23 250 16777215 0 Y 128 31 63
+def @arg24 250 16777215 0 Y 0 31 8
+def @arg25 250 16777215 0 Y 128 31 63
+def @arg26 250 16777215 0 Y 0 31 8
+def @arg27 250 16777215 0 Y 128 31 63
+def @arg28 250 16777215 0 Y 0 31 8
+def @arg29 250 16777215 0 Y 128 31 63
+def @arg30 250 16777215 0 Y 0 31 8
+def @arg31 250 16777215 0 Y 0 31 8
+def @arg32 250 16777215 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select
@@ -2009,26 +2009,26 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 128 30 63
def @arg12 246 83 6 Y 128 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 250 16777215 10 Y 128 31 63
+def @arg14 250 16777215 19 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 8 Y 128 31 63
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
-def @arg20 251 16777216 1 Y 0 31 8
-def @arg21 251 16777216 10 Y 0 31 8
-def @arg22 251 16777216 30 Y 0 31 8
-def @arg23 251 16777216 8 Y 128 31 63
-def @arg24 251 16777216 8 Y 0 31 8
-def @arg25 251 16777216 4 Y 128 31 63
-def @arg26 251 16777216 4 Y 0 31 8
-def @arg27 251 16777216 10 Y 128 31 63
-def @arg28 251 16777216 10 Y 0 31 8
-def @arg29 251 16777216 8 Y 128 31 63
-def @arg30 251 16777216 8 Y 0 31 8
-def @arg31 251 16777216 3 Y 0 31 8
-def @arg32 251 16777216 6 Y 0 31 8
+def @arg20 250 16777215 1 Y 0 31 8
+def @arg21 250 16777215 10 Y 0 31 8
+def @arg22 250 16777215 30 Y 0 31 8
+def @arg23 250 16777215 8 Y 128 31 63
+def @arg24 250 16777215 8 Y 0 31 8
+def @arg25 250 16777215 4 Y 128 31 63
+def @arg26 250 16777215 4 Y 0 31 8
+def @arg27 250 16777215 10 Y 128 31 63
+def @arg28 250 16777215 10 Y 0 31 8
+def @arg29 250 16777215 8 Y 128 31 63
+def @arg30 250 16777215 8 Y 0 31 8
+def @arg31 250 16777215 3 Y 0 31 8
+def @arg32 250 16777215 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
set @my_key= 0 ;
@@ -2049,26 +2049,26 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 128 30 63
def @arg12 246 83 0 Y 128 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 250 16777215 0 Y 128 31 63
+def @arg14 250 16777215 0 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 0 Y 128 31 63
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
-def @arg20 251 16777216 0 Y 0 31 8
-def @arg21 251 16777216 0 Y 0 31 8
-def @arg22 251 16777216 0 Y 0 31 8
-def @arg23 251 16777216 0 Y 128 31 63
-def @arg24 251 16777216 0 Y 0 31 8
-def @arg25 251 16777216 0 Y 128 31 63
-def @arg26 251 16777216 0 Y 0 31 8
-def @arg27 251 16777216 0 Y 128 31 63
-def @arg28 251 16777216 0 Y 0 31 8
-def @arg29 251 16777216 0 Y 128 31 63
-def @arg30 251 16777216 0 Y 0 31 8
-def @arg31 251 16777216 0 Y 0 31 8
-def @arg32 251 16777216 0 Y 0 31 8
+def @arg20 250 16777215 0 Y 0 31 8
+def @arg21 250 16777215 0 Y 0 31 8
+def @arg22 250 16777215 0 Y 0 31 8
+def @arg23 250 16777215 0 Y 128 31 63
+def @arg24 250 16777215 0 Y 0 31 8
+def @arg25 250 16777215 0 Y 128 31 63
+def @arg26 250 16777215 0 Y 0 31 8
+def @arg27 250 16777215 0 Y 128 31 63
+def @arg28 250 16777215 0 Y 0 31 8
+def @arg29 250 16777215 0 Y 128 31 63
+def @arg30 250 16777215 0 Y 0 31 8
+def @arg31 250 16777215 0 Y 0 31 8
+def @arg32 250 16777215 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select ? := c1 from t9 where c1= 1" ;
@@ -2097,26 +2097,26 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 128 30 63
def @arg12 246 83 6 Y 128 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 250 16777215 10 Y 128 31 63
+def @arg14 250 16777215 19 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 8 Y 128 31 63
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
-def @arg20 251 16777216 1 Y 0 31 8
-def @arg21 251 16777216 10 Y 0 31 8
-def @arg22 251 16777216 30 Y 0 31 8
-def @arg23 251 16777216 8 Y 128 31 63
-def @arg24 251 16777216 8 Y 0 31 8
-def @arg25 251 16777216 4 Y 128 31 63
-def @arg26 251 16777216 4 Y 0 31 8
-def @arg27 251 16777216 10 Y 128 31 63
-def @arg28 251 16777216 10 Y 0 31 8
-def @arg29 251 16777216 8 Y 128 31 63
-def @arg30 251 16777216 8 Y 0 31 8
-def @arg31 251 16777216 3 Y 0 31 8
-def @arg32 251 16777216 6 Y 0 31 8
+def @arg20 250 16777215 1 Y 0 31 8
+def @arg21 250 16777215 10 Y 0 31 8
+def @arg22 250 16777215 30 Y 0 31 8
+def @arg23 250 16777215 8 Y 128 31 63
+def @arg24 250 16777215 8 Y 0 31 8
+def @arg25 250 16777215 4 Y 128 31 63
+def @arg26 250 16777215 4 Y 0 31 8
+def @arg27 250 16777215 10 Y 128 31 63
+def @arg28 250 16777215 10 Y 0 31 8
+def @arg29 250 16777215 8 Y 128 31 63
+def @arg30 250 16777215 8 Y 0 31 8
+def @arg31 250 16777215 3 Y 0 31 8
+def @arg32 250 16777215 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
@@ -2141,26 +2141,26 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 128 30 63
def @arg12 246 83 0 Y 128 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 250 16777215 0 Y 128 31 63
+def @arg14 250 16777215 0 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 0 Y 128 31 63
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
-def @arg20 251 16777216 0 Y 0 31 8
-def @arg21 251 16777216 0 Y 0 31 8
-def @arg22 251 16777216 0 Y 0 31 8
-def @arg23 251 16777216 0 Y 128 31 63
-def @arg24 251 16777216 0 Y 0 31 8
-def @arg25 251 16777216 0 Y 128 31 63
-def @arg26 251 16777216 0 Y 0 31 8
-def @arg27 251 16777216 0 Y 128 31 63
-def @arg28 251 16777216 0 Y 0 31 8
-def @arg29 251 16777216 0 Y 128 31 63
-def @arg30 251 16777216 0 Y 0 31 8
-def @arg31 251 16777216 0 Y 0 31 8
-def @arg32 251 16777216 0 Y 0 31 8
+def @arg20 250 16777215 0 Y 0 31 8
+def @arg21 250 16777215 0 Y 0 31 8
+def @arg22 250 16777215 0 Y 0 31 8
+def @arg23 250 16777215 0 Y 128 31 63
+def @arg24 250 16777215 0 Y 0 31 8
+def @arg25 250 16777215 0 Y 128 31 63
+def @arg26 250 16777215 0 Y 0 31 8
+def @arg27 250 16777215 0 Y 128 31 63
+def @arg28 250 16777215 0 Y 0 31 8
+def @arg29 250 16777215 0 Y 128 31 63
+def @arg30 250 16777215 0 Y 0 31 8
+def @arg31 250 16777215 0 Y 0 31 8
+def @arg32 250 16777215 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
@@ -2187,26 +2187,26 @@ def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
def @arg11 246 83 6 Y 128 30 63
def @arg12 246 83 6 Y 128 30 63
-def @arg13 251 16777216 10 Y 128 31 63
-def @arg14 251 16777216 19 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 8 Y 128 31 63
+def @arg13 250 16777215 10 Y 128 31 63
+def @arg14 250 16777215 19 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 8 Y 128 31 63
def @arg17 8 20 4 Y 32928 0 63
def @arg18 8 20 1 Y 32896 0 63
def @arg19 8 20 1 Y 32896 0 63
-def @arg20 251 16777216 1 Y 0 31 8
-def @arg21 251 16777216 10 Y 0 31 8
-def @arg22 251 16777216 30 Y 0 31 8
-def @arg23 251 16777216 8 Y 128 31 63
-def @arg24 251 16777216 8 Y 0 31 8
-def @arg25 251 16777216 4 Y 128 31 63
-def @arg26 251 16777216 4 Y 0 31 8
-def @arg27 251 16777216 10 Y 128 31 63
-def @arg28 251 16777216 10 Y 0 31 8
-def @arg29 251 16777216 8 Y 128 31 63
-def @arg30 251 16777216 8 Y 0 31 8
-def @arg31 251 16777216 3 Y 0 31 8
-def @arg32 251 16777216 6 Y 0 31 8
+def @arg20 250 16777215 1 Y 0 31 8
+def @arg21 250 16777215 10 Y 0 31 8
+def @arg22 250 16777215 30 Y 0 31 8
+def @arg23 250 16777215 8 Y 128 31 63
+def @arg24 250 16777215 8 Y 0 31 8
+def @arg25 250 16777215 4 Y 128 31 63
+def @arg26 250 16777215 4 Y 0 31 8
+def @arg27 250 16777215 10 Y 128 31 63
+def @arg28 250 16777215 10 Y 0 31 8
+def @arg29 250 16777215 8 Y 128 31 63
+def @arg30 250 16777215 8 Y 0 31 8
+def @arg31 250 16777215 3 Y 0 31 8
+def @arg32 250 16777215 6 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
set @my_key= 0 ;
@@ -2225,26 +2225,26 @@ def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
def @arg11 246 83 0 Y 128 30 63
def @arg12 246 83 0 Y 128 30 63
-def @arg13 251 16777216 0 Y 128 31 63
-def @arg14 251 16777216 0 Y 128 31 63
-def @arg15 251 16777216 19 Y 128 31 63
-def @arg16 251 16777216 0 Y 128 31 63
+def @arg13 250 16777215 0 Y 128 31 63
+def @arg14 250 16777215 0 Y 128 31 63
+def @arg15 250 16777215 19 Y 128 31 63
+def @arg16 250 16777215 0 Y 128 31 63
def @arg17 8 20 0 Y 32928 0 63
def @arg18 8 20 0 Y 32896 0 63
def @arg19 8 20 0 Y 32896 0 63
-def @arg20 251 16777216 0 Y 0 31 8
-def @arg21 251 16777216 0 Y 0 31 8
-def @arg22 251 16777216 0 Y 0 31 8
-def @arg23 251 16777216 0 Y 128 31 63
-def @arg24 251 16777216 0 Y 0 31 8
-def @arg25 251 16777216 0 Y 128 31 63
-def @arg26 251 16777216 0 Y 0 31 8
-def @arg27 251 16777216 0 Y 128 31 63
-def @arg28 251 16777216 0 Y 0 31 8
-def @arg29 251 16777216 0 Y 128 31 63
-def @arg30 251 16777216 0 Y 0 31 8
-def @arg31 251 16777216 0 Y 0 31 8
-def @arg32 251 16777216 0 Y 0 31 8
+def @arg20 250 16777215 0 Y 0 31 8
+def @arg21 250 16777215 0 Y 0 31 8
+def @arg22 250 16777215 0 Y 0 31 8
+def @arg23 250 16777215 0 Y 128 31 63
+def @arg24 250 16777215 0 Y 0 31 8
+def @arg25 250 16777215 0 Y 128 31 63
+def @arg26 250 16777215 0 Y 0 31 8
+def @arg27 250 16777215 0 Y 128 31 63
+def @arg28 250 16777215 0 Y 0 31 8
+def @arg29 250 16777215 0 Y 128 31 63
+def @arg30 250 16777215 0 Y 0 31 8
+def @arg31 250 16777215 0 Y 0 31 8
+def @arg32 250 16777215 0 Y 0 31 8
@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32
0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
prepare stmt1 from "select c1 into ? from t9 where c1= 1" ;
diff --git a/mysql-test/suite/parts/r/partition_alter3_innodb.result b/mysql-test/suite/parts/r/partition_alter3_innodb.result
index cb104d4be54..7825a2350b0 100644
--- a/mysql-test/suite/parts/r/partition_alter3_innodb.result
+++ b/mysql-test/suite/parts/r/partition_alter3_innodb.result
@@ -141,7 +141,7 @@ t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 part1 ALL NULL NULL NULL NULL 20 Using where
+1 SIMPLE t1 part1 ALL NULL NULL NULL NULL 7 Using where
# check read single success: 1
# check read all success: 1
# check read row by row success: 1
@@ -165,7 +165,7 @@ t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where
+1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 Using where
# check read single success: 1
# check read all success: 1
# check read row by row success: 1
@@ -190,7 +190,7 @@ t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where
+1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 3 Using where
# check read single success: 1
# check read all success: 1
# check read row by row success: 1
@@ -226,7 +226,7 @@ t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p6 ALL NULL NULL NULL NULL 20 Using where
+1 SIMPLE t1 p6 ALL NULL NULL NULL NULL 3 Using where
# check read single success: 1
# check read all success: 1
# check read row by row success: 1
@@ -248,7 +248,7 @@ t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 20 Using where
+1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 4 Using where
# check read single success: 1
# check read all success: 1
# check read row by row success: 1
@@ -269,7 +269,7 @@ t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where
+1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 4 Using where
# check read single success: 1
# check read all success: 1
# check read row by row success: 1
@@ -289,7 +289,7 @@ t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where
+1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 Using where
# check read single success: 1
# check read all success: 1
# check read row by row success: 1
@@ -308,7 +308,7 @@ t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 part1 ALL NULL NULL NULL NULL 20 Using where
+1 SIMPLE t1 part1 ALL NULL NULL NULL NULL 7 Using where
# check read single success: 1
# check read all success: 1
# check read row by row success: 1
@@ -326,7 +326,7 @@ t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where
+1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 10 Using where
# check read single success: 1
# check read all success: 1
# check read row by row success: 1
@@ -452,7 +452,7 @@ t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 20 Using where
+1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 7 Using where
# check read single success: 1
# check read all success: 1
# check read row by row success: 1
@@ -476,7 +476,7 @@ t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 20 Using where
+1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 5 Using where
# check read single success: 1
# check read all success: 1
# check read row by row success: 1
@@ -504,7 +504,7 @@ t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p6 ALL NULL NULL NULL NULL 20 Using where
+1 SIMPLE t1 p6 ALL NULL NULL NULL NULL 3 Using where
# check read single success: 1
# check read all success: 1
# check read row by row success: 1
@@ -538,7 +538,7 @@ t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where
+1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 4 Using where
# check read single success: 1
# check read all success: 1
# check read row by row success: 1
@@ -563,7 +563,7 @@ t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 20 Using where
+1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 3 Using where
# check read single success: 1
# check read all success: 1
# check read row by row success: 1
@@ -587,7 +587,7 @@ t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 23 Using where
+1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 10 Using where
# check read single success: 1
# check read all success: 1
# check read row by row success: 1
@@ -610,7 +610,7 @@ t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 20 Using where
+1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 5 Using where
# check read single success: 1
# check read all success: 1
# check read row by row success: 1
@@ -632,7 +632,7 @@ t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 20 Using where
+1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 7 Using where
# check read single success: 1
# check read all success: 1
# check read row by row success: 1
@@ -653,7 +653,7 @@ t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where
+1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 10 Using where
# check read single success: 1
# check read all success: 1
# check read row by row success: 1
diff --git a/mysql-test/suite/parts/r/partition_alter3_myisam.result b/mysql-test/suite/parts/r/partition_alter3_myisam.result
index 374b108b57e..a5dec48e85c 100644
--- a/mysql-test/suite/parts/r/partition_alter3_myisam.result
+++ b/mysql-test/suite/parts/r/partition_alter3_myisam.result
@@ -155,7 +155,7 @@ t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 part1 ALL NULL NULL NULL NULL 20 Using where
+1 SIMPLE t1 part1 ALL NULL NULL NULL NULL 7 Using where
# check read single success: 1
# check read all success: 1
# check read row by row success: 1
@@ -187,7 +187,7 @@ t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where
+1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 Using where
# check read single success: 1
# check read all success: 1
# check read row by row success: 1
@@ -228,7 +228,7 @@ t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where
+1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 3 Using where
# check read single success: 1
# check read all success: 1
# check read row by row success: 1
@@ -278,7 +278,7 @@ t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p6 ALL NULL NULL NULL NULL 20 Using where
+1 SIMPLE t1 p6 ALL NULL NULL NULL NULL 3 Using where
# check read single success: 1
# check read all success: 1
# check read row by row success: 1
@@ -312,7 +312,7 @@ t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 20 Using where
+1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 4 Using where
# check read single success: 1
# check read all success: 1
# check read row by row success: 1
@@ -343,7 +343,7 @@ t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where
+1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 4 Using where
# check read single success: 1
# check read all success: 1
# check read row by row success: 1
@@ -371,7 +371,7 @@ t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where
+1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 Using where
# check read single success: 1
# check read all success: 1
# check read row by row success: 1
@@ -396,7 +396,7 @@ t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 part1 ALL NULL NULL NULL NULL 20 Using where
+1 SIMPLE t1 part1 ALL NULL NULL NULL NULL 7 Using where
# check read single success: 1
# check read all success: 1
# check read row by row success: 1
@@ -418,7 +418,7 @@ t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where
+1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 10 Using where
# check read single success: 1
# check read all success: 1
# check read row by row success: 1
@@ -552,7 +552,7 @@ t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 20 Using where
+1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 7 Using where
# check read single success: 1
# check read all success: 1
# check read row by row success: 1
@@ -584,7 +584,7 @@ t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 20 Using where
+1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 5 Using where
# check read single success: 1
# check read all success: 1
# check read row by row success: 1
@@ -628,7 +628,7 @@ t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p6 ALL NULL NULL NULL NULL 20 Using where
+1 SIMPLE t1 p6 ALL NULL NULL NULL NULL 3 Using where
# check read single success: 1
# check read all success: 1
# check read row by row success: 1
@@ -676,7 +676,7 @@ t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where
+1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 4 Using where
# check read single success: 1
# check read all success: 1
# check read row by row success: 1
@@ -713,7 +713,7 @@ t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 20 Using where
+1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 3 Using where
# check read single success: 1
# check read all success: 1
# check read row by row success: 1
@@ -747,7 +747,7 @@ t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 20 Using where
+1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 10 Using where
# check read single success: 1
# check read all success: 1
# check read row by row success: 1
@@ -778,7 +778,7 @@ t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 20 Using where
+1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 5 Using where
# check read single success: 1
# check read all success: 1
# check read row by row success: 1
@@ -806,7 +806,7 @@ t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 20 Using where
+1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 7 Using where
# check read single success: 1
# check read all success: 1
# check read row by row success: 1
@@ -831,7 +831,7 @@ t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 Using where
+1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 10 Using where
# check read single success: 1
# check read all success: 1
# check read row by row success: 1
diff --git a/mysql-test/suite/parts/t/partition_alter2_1_myisam.test b/mysql-test/suite/parts/t/partition_alter2_1_myisam.test
index 1c89a82b960..11ec9b51f7c 100644
--- a/mysql-test/suite/parts/t/partition_alter2_1_myisam.test
+++ b/mysql-test/suite/parts/t/partition_alter2_1_myisam.test
@@ -22,6 +22,8 @@
# any of the variables.
#
+--source include/long_test.inc
+
#------------------------------------------------------------------------------#
# General not engine specific settings and requirements
diff --git a/mysql-test/suite/parts/t/partition_alter2_2_myisam.test b/mysql-test/suite/parts/t/partition_alter2_2_myisam.test
index c9b22ed8595..8fbb943a48d 100644
--- a/mysql-test/suite/parts/t/partition_alter2_2_myisam.test
+++ b/mysql-test/suite/parts/t/partition_alter2_2_myisam.test
@@ -22,6 +22,8 @@
# any of the variables.
#
+--source include/long_test.inc
+
#------------------------------------------------------------------------------#
# General not engine specific settings and requirements
diff --git a/mysql-test/suite/parts/t/partition_basic_innodb.test b/mysql-test/suite/parts/t/partition_basic_innodb.test
index 2fa94cbde21..8240257f087 100644
--- a/mysql-test/suite/parts/t/partition_basic_innodb.test
+++ b/mysql-test/suite/parts/t/partition_basic_innodb.test
@@ -22,6 +22,8 @@
# any of the variables.
#
+--source include/long_test.inc
+
#------------------------------------------------------------------------------#
# General not engine specific settings and requirements
diff --git a/mysql-test/suite/parts/t/partition_decimal_myisam.test b/mysql-test/suite/parts/t/partition_decimal_myisam.test
index 49fc64cbd37..9808dc878f8 100644
--- a/mysql-test/suite/parts/t/partition_decimal_myisam.test
+++ b/mysql-test/suite/parts/t/partition_decimal_myisam.test
@@ -22,6 +22,8 @@
# any of the variables.
#
+--source include/long_test.inc
+
#------------------------------------------------------------------------------#
# General not engine specific settings and requirements
diff --git a/mysql-test/suite/parts/t/partition_float_myisam.test b/mysql-test/suite/parts/t/partition_float_myisam.test
index 51e0f1f5a21..f15e6ad3636 100644
--- a/mysql-test/suite/parts/t/partition_float_myisam.test
+++ b/mysql-test/suite/parts/t/partition_float_myisam.test
@@ -22,6 +22,8 @@
# any of the variables.
#
+--source include/long_test.inc
+
#------------------------------------------------------------------------------#
# General not engine specific settings and requirements
diff --git a/mysql-test/suite/parts/t/partition_int_myisam.test b/mysql-test/suite/parts/t/partition_int_myisam.test
index b0ede4995e8..5f29b575244 100644
--- a/mysql-test/suite/parts/t/partition_int_myisam.test
+++ b/mysql-test/suite/parts/t/partition_int_myisam.test
@@ -22,6 +22,8 @@
# any of the variables.
#
+--source include/long_test.inc
+
#------------------------------------------------------------------------------#
# General not engine specific settings and requirements
diff --git a/mysql-test/suite/pbxt/r/partition_hash.result b/mysql-test/suite/pbxt/r/partition_hash.result
index c32c27bf9c6..9a82a36d902 100644
--- a/mysql-test/suite/pbxt/r/partition_hash.result
+++ b/mysql-test/suite/pbxt/r/partition_hash.result
@@ -57,25 +57,25 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0,p1,p2,p3 ALL NULL NULL NULL NULL 9 Using where
explain partitions select * from t1 where a is null or (a >= 5 and a <= 7);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0,p2,p3 ALL NULL NULL NULL NULL 9 Using where
+1 SIMPLE t1 p0,p2,p3 ALL NULL NULL NULL NULL 7 Using where
explain partitions select * from t1 where a is null;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 9 Using where
+1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 3 Using where
explain partitions select * from t1 where a is not null;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0,p1,p2,p3 ALL NULL NULL NULL NULL 9 Using where
explain partitions select * from t1 where a >= 1 and a < 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 9 Using where
+1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 5 Using where
explain partitions select * from t1 where a >= 3 and a <= 5;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p1,p2 ALL NULL NULL NULL NULL 9 Using where
+1 SIMPLE t1 p1,p2 ALL NULL NULL NULL NULL 4 Using where
explain partitions select * from t1 where a > 2 and a < 4;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p1 ALL NULL NULL NULL NULL 9 Using where
+1 SIMPLE t1 p1 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t1 where a > 3 and a <= 6;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p2,p3 ALL NULL NULL NULL NULL 9 Using where
+1 SIMPLE t1 p2,p3 ALL NULL NULL NULL NULL 4 Using where
explain partitions select * from t1 where a > 5;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0,p1,p2,p3 ALL NULL NULL NULL NULL 9 Using where
diff --git a/mysql-test/suite/pbxt/r/partition_pruning.result b/mysql-test/suite/pbxt/r/partition_pruning.result
index 49fa43916aa..fc17fe37a36 100644
--- a/mysql-test/suite/pbxt/r/partition_pruning.result
+++ b/mysql-test/suite/pbxt/r/partition_pruning.result
@@ -14,7 +14,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p1 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t1 where a=2;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 3 Using where
+1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t1 where a=1 or a=2;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 3 Using where
@@ -31,7 +31,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t2 p0,p1 ALL NULL NULL NULL NULL 3 Using where
explain partitions select * from t2 where a=1 and b=1;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 p0 ALL NULL NULL NULL NULL 3 Using where
+1 SIMPLE t2 p0 ALL NULL NULL NULL NULL 2 Using where
create table t3 (
a int
)
@@ -42,16 +42,16 @@ partition p1 values less than (20)
insert into t3 values (5),(15);
explain partitions select * from t3 where a=11;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t3 p1 ALL NULL NULL NULL NULL 1 Using where
+1 SIMPLE t3 p1 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t3 where a=10;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t3 p1 ALL NULL NULL NULL NULL 1 Using where
+1 SIMPLE t3 p1 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t3 where a=20;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t3 ALL NULL NULL NULL NULL 1 Using where
+1 SIMPLE t3 ALL NULL NULL NULL NULL 0 Using where
explain partitions select * from t3 where a=30;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t3 ALL NULL NULL NULL NULL 1 Using where
+1 SIMPLE t3 ALL NULL NULL NULL NULL 0 Using where
create table t4 (a int not null, b int not null) partition by LIST (a+b) (
partition p0 values in (12),
partition p1 values in (14)
@@ -59,11 +59,11 @@ partition p1 values in (14)
insert into t4 values (10,2), (10,4);
explain partitions select * from t4 where (a=10 and b=1) or (a=10 and b=2);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 p0 ALL NULL NULL NULL NULL 1 Using where
+1 SIMPLE t4 p0 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t4
where (a=10 and b=1) or (a=10 and b=2) or (a=10 and b = 3);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 p0 ALL NULL NULL NULL NULL 1 Using where
+1 SIMPLE t4 p0 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t4 where (a=10 and b=2) or (a=10 and b=3)
or (a=10 and b = 4);
id select_type table partitions type possible_keys key key_len ref rows Extra
@@ -89,25 +89,25 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
explain partitions select * from t5
where (a=10 and b=1) or (a=10 and b=2) or (a=10 and b = 3);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t5 p0_p0sp0,p0_p0sp1 ALL NULL NULL NULL NULL 4 Using where
+1 SIMPLE t5 p0_p0sp0,p0_p0sp1 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t5 where (a=10 and b=2) or (a=10 and b=3)
or (a=10 and b = 4);
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t5 p0_p0sp0,p0_p0sp1,p1_p1sp0,p1_p1sp1 ALL NULL NULL NULL NULL 4 Using where
explain partitions select * from t5 where (c=1 and d=1);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t5 p0_p0sp0,p1_p1sp0 ALL NULL NULL NULL NULL 4 Using where
+1 SIMPLE t5 p0_p0sp0,p1_p1sp0 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t5 where (c=2 and d=1);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t5 p0_p0sp1,p1_p1sp1 ALL NULL NULL NULL NULL 4 Using where
+1 SIMPLE t5 p0_p0sp1,p1_p1sp1 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t5 where (a=10 and b=2 and c=1 and d=1) or
(c=2 and d=1);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t5 p0_p0sp0,p0_p0sp1,p1_p1sp1 ALL NULL NULL NULL NULL 4 Using where
+1 SIMPLE t5 p0_p0sp0,p0_p0sp1,p1_p1sp1 ALL NULL NULL NULL NULL 3 Using where
explain partitions select * from t5 where (a=10 and b=2 and c=1 and d=1) or
(b=2 and c=2 and d=1);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t5 p0_p0sp0,p0_p0sp1,p1_p1sp1 ALL NULL NULL NULL NULL 4 Using where
+1 SIMPLE t5 p0_p0sp0,p0_p0sp1,p1_p1sp1 ALL NULL NULL NULL NULL 3 Using where
create table t6 (a int not null) partition by LIST(a) (
partition p1 values in (1),
partition p3 values in (3),
@@ -121,34 +121,34 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t6 ALL NULL NULL NULL NULL 0 Using where
explain partitions select * from t6 where a <= 1;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t6 p1 ALL NULL NULL NULL NULL 1 Using where
+1 SIMPLE t6 p1 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t6 where a > 9;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t6 ALL NULL NULL NULL NULL 1 Using where
+1 SIMPLE t6 ALL NULL NULL NULL NULL 0 Using where
explain partitions select * from t6 where a >= 9;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t6 p9 ALL NULL NULL NULL NULL 1 Using where
+1 SIMPLE t6 p9 ALL NULL NULL NULL NULL 0 Using where
explain partitions select * from t6 where a > 0 and a < 5;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t6 p1,p3 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t6 where a > 5 and a < 12;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t6 p7,p9 ALL NULL NULL NULL NULL 2 Using where
+1 SIMPLE t6 p7,p9 ALL NULL NULL NULL NULL 0 Using where
explain partitions select * from t6 where a > 3 and a < 8 ;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t6 p5,p7 ALL NULL NULL NULL NULL 3 Using where
+1 SIMPLE t6 p5,p7 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t6 where a >= 0 and a <= 5;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t6 p1,p3,p5 ALL NULL NULL NULL NULL 3 Using where
explain partitions select * from t6 where a >= 5 and a <= 12;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t6 p5,p7,p9 ALL NULL NULL NULL NULL 3 Using where
+1 SIMPLE t6 p5,p7,p9 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t6 where a >= 3 and a <= 8;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t6 p3,p5,p7 ALL NULL NULL NULL NULL 3 Using where
+1 SIMPLE t6 p3,p5,p7 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t6 where a > 3 and a < 5;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t6 ALL NULL NULL NULL NULL 3 Using where
+1 SIMPLE t6 ALL NULL NULL NULL NULL 0 Using where
drop table t6;
create table t6 (a int unsigned not null) partition by LIST(a) (
partition p1 values in (1),
@@ -163,34 +163,34 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t6 ALL NULL NULL NULL NULL 0 Using where
explain partitions select * from t6 where a <= 1;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t6 p1 ALL NULL NULL NULL NULL 1 Using where
+1 SIMPLE t6 p1 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t6 where a > 9;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t6 ALL NULL NULL NULL NULL 1 Using where
+1 SIMPLE t6 ALL NULL NULL NULL NULL 0 Using where
explain partitions select * from t6 where a >= 9;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t6 p9 ALL NULL NULL NULL NULL 1 Using where
+1 SIMPLE t6 p9 ALL NULL NULL NULL NULL 0 Using where
explain partitions select * from t6 where a > 0 and a < 5;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t6 p1,p3 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t6 where a > 5 and a < 12;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t6 p7,p9 ALL NULL NULL NULL NULL 2 Using where
+1 SIMPLE t6 p7,p9 ALL NULL NULL NULL NULL 0 Using where
explain partitions select * from t6 where a > 3 and a < 8 ;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t6 p5,p7 ALL NULL NULL NULL NULL 3 Using where
+1 SIMPLE t6 p5,p7 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t6 where a >= 0 and a <= 5;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t6 p1,p3,p5 ALL NULL NULL NULL NULL 3 Using where
explain partitions select * from t6 where a >= 5 and a <= 12;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t6 p5,p7,p9 ALL NULL NULL NULL NULL 3 Using where
+1 SIMPLE t6 p5,p7,p9 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t6 where a >= 3 and a <= 8;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t6 p3,p5,p7 ALL NULL NULL NULL NULL 3 Using where
+1 SIMPLE t6 p3,p5,p7 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t6 where a > 3 and a < 5;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t6 ALL NULL NULL NULL NULL 3 Using where
+1 SIMPLE t6 ALL NULL NULL NULL NULL 0 Using where
create table t7 (a int not null) partition by RANGE(a) (
partition p10 values less than (10),
partition p30 values less than (30),
@@ -207,25 +207,25 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t7 p10 ALL NULL NULL NULL NULL 0 Using where
explain partitions select * from t7 where a <= 10;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t7 p10,p30 ALL NULL NULL NULL NULL 1 Using where
+1 SIMPLE t7 p10,p30 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t7 where a = 10;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t7 p30 ALL NULL NULL NULL NULL 1 Using where
+1 SIMPLE t7 p30 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t7 where a < 90;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t7 p10,p30,p50,p70,p90 ALL NULL NULL NULL NULL 3 Using where
explain partitions select * from t7 where a = 90;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t7 ALL NULL NULL NULL NULL 3 Using where
+1 SIMPLE t7 ALL NULL NULL NULL NULL 0 Using where
explain partitions select * from t7 where a > 90;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t7 ALL NULL NULL NULL NULL 3 Using where
+1 SIMPLE t7 ALL NULL NULL NULL NULL 0 Using where
explain partitions select * from t7 where a >= 90;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t7 ALL NULL NULL NULL NULL 3 Using where
+1 SIMPLE t7 ALL NULL NULL NULL NULL 0 Using where
explain partitions select * from t7 where a > 11 and a < 29;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t7 p30 ALL NULL NULL NULL NULL 3 Using where
+1 SIMPLE t7 p30 ALL NULL NULL NULL NULL 2 Using where
drop table t7;
create table t7 (a int unsigned not null) partition by RANGE(a) (
partition p10 values less than (10),
@@ -243,25 +243,25 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t7 p10 ALL NULL NULL NULL NULL 0 Using where
explain partitions select * from t7 where a <= 10;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t7 p10,p30 ALL NULL NULL NULL NULL 1 Using where
+1 SIMPLE t7 p10,p30 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t7 where a = 10;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t7 p30 ALL NULL NULL NULL NULL 1 Using where
+1 SIMPLE t7 p30 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t7 where a < 90;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t7 p10,p30,p50,p70,p90 ALL NULL NULL NULL NULL 3 Using where
explain partitions select * from t7 where a = 90;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t7 ALL NULL NULL NULL NULL 3 Using where
+1 SIMPLE t7 ALL NULL NULL NULL NULL 0 Using where
explain partitions select * from t7 where a > 90;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t7 ALL NULL NULL NULL NULL 3 Using where
+1 SIMPLE t7 ALL NULL NULL NULL NULL 0 Using where
explain partitions select * from t7 where a >= 90;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t7 ALL NULL NULL NULL NULL 3 Using where
+1 SIMPLE t7 ALL NULL NULL NULL NULL 0 Using where
explain partitions select * from t7 where a > 11 and a < 29;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t7 p30 ALL NULL NULL NULL NULL 3 Using where
+1 SIMPLE t7 p30 ALL NULL NULL NULL NULL 2 Using where
create table t8 (a date not null) partition by RANGE(YEAR(a)) (
partition p0 values less than (1980),
partition p1 values less than (1990),
@@ -270,7 +270,7 @@ partition p2 values less than (2000)
insert into t8 values ('1985-05-05'),('1995-05-05');
explain partitions select * from t8 where a < '1980-02-02';
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t8 p0,p1 ALL NULL NULL NULL NULL 1 Using where
+1 SIMPLE t8 p0,p1 ALL NULL NULL NULL NULL 2 Using where
create table t9 (a date not null) partition by RANGE(TO_DAYS(a)) (
partition p0 values less than (732299), -- 2004-12-19
partition p1 values less than (732468), -- 2005-06-06
@@ -295,13 +295,13 @@ partition p2 values less than (9)
insert into t1 values (1),(2),(3);
explain partitions select * from t1 where a1 > 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p1,p2 ALL NULL NULL NULL NULL 1 Using where
+1 SIMPLE t1 p1,p2 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t1 where a1 >= 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p1,p2 ALL NULL NULL NULL NULL 1 Using where
+1 SIMPLE t1 p1,p2 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t1 where a1 < 3 and a1 > 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 1 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 0 Using where
drop table t1;
create table t3 (a int, b int)
partition by list(a) subpartition by hash(b) subpartitions 4 (
@@ -325,7 +325,7 @@ create table t1 (a int) partition by hash(a) partitions 2;
insert into t1 values (1),(2);
explain partitions select * from t1 where a is null;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 1 Using where
+1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t1 where a is not null;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 2 Using where
@@ -342,20 +342,20 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
explain partitions
select * from t1 X, t1 Y where X.a = Y.a and (X.a=1 or X.a=2);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE X p1,p2 ALL a NULL NULL NULL 4 Using where
+1 SIMPLE X p1,p2 ALL a NULL NULL NULL 2 Using where
1 SIMPLE Y p1,p2 ref a a 4 test.X.a 1
drop table t1;
create table t1 (a int) partition by hash(a) partitions 20;
insert into t1 values (1),(2),(3);
explain partitions select * from t1 where a > 1 and a < 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p2 ALL NULL NULL NULL NULL 1 Using where
+1 SIMPLE t1 p2 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t1 where a >= 1 and a < 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p1,p2 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t1 where a > 1 and a <= 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p2,p3 ALL NULL NULL NULL NULL 3 Using where
+1 SIMPLE t1 p2,p3 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t1 where a >= 1 and a <= 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p1,p2,p3 ALL NULL NULL NULL NULL 3 Using where
@@ -371,10 +371,10 @@ partition p3 values in (3)
insert into t1 values (1,1),(2,2),(3,3);
explain partitions select * from t1 where b > 1 and b < 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0_p0sp2,p1_p1sp2,p2_p2sp2,p3_p3sp2 ALL NULL NULL NULL NULL 1 Using where
+1 SIMPLE t1 p0_p0sp2,p1_p1sp2,p2_p2sp2,p3_p3sp2 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t1 where b > 1 and b < 3 and (a =1 or a =2);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p1_p1sp2,p2_p2sp2 ALL NULL NULL NULL NULL 1 Using where
+1 SIMPLE t1 p1_p1sp2,p2_p2sp2 ALL NULL NULL NULL NULL 2 Using where
drop table t1;
create table t1 (a int) partition by list(a) (
partition p0 values in (1,2),
@@ -445,22 +445,22 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t2 p0,p1,p2,p3,p4 ALL NULL NULL NULL NULL 1010
explain partitions select * from t2 where a < 801 and a > 200;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 p1,p2,p3,p4 ALL NULL NULL NULL NULL 1010 Using where
+1 SIMPLE t2 p1,p2,p3,p4 ALL NULL NULL NULL NULL 800 Using where
explain partitions select * from t2 where a < 801 and a > 800;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 p4 ALL NULL NULL NULL NULL 1010 Using where
+1 SIMPLE t2 p4 ALL NULL NULL NULL NULL 200 Using where
explain partitions select * from t2 where a > 600;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 p3,p4 ALL NULL NULL NULL NULL 1010 Using where
+1 SIMPLE t2 p3,p4 ALL NULL NULL NULL NULL 400 Using where
explain partitions select * from t2 where a > 600 and b = 1;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 p3,p4 ALL NULL NULL NULL NULL 1010 Using where
+1 SIMPLE t2 p3,p4 ALL NULL NULL NULL NULL 400 Using where
explain partitions select * from t2 where a > 600 and b = 4;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 p3,p4 ALL NULL NULL NULL NULL 1010 Using where
+1 SIMPLE t2 p3,p4 ALL NULL NULL NULL NULL 400 Using where
explain partitions select * from t2 where a > 600 and b = 5;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 p3,p4 ALL NULL NULL NULL NULL 1010 Using where
+1 SIMPLE t2 p3,p4 ALL NULL NULL NULL NULL 400 Using where
explain partitions select * from t2 where b = 5;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t2 p0,p1,p2,p3,p4 ALL NULL NULL NULL NULL 1010 Using where
@@ -515,19 +515,19 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t2 p0,p1,p2,p3,p4 ALL NULL NULL NULL NULL 910
explain partitions select * from t2 where a = 101;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 p0 ALL NULL NULL NULL NULL 910 Using where
+1 SIMPLE t2 p0 ALL NULL NULL NULL NULL 110 Using where
explain partitions select * from t2 where a = 550;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 p2 ALL NULL NULL NULL NULL 910 Using where
+1 SIMPLE t2 p2 ALL NULL NULL NULL NULL 200 Using where
explain partitions select * from t2 where a = 833;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 p4 ALL NULL NULL NULL NULL 910 Using where
+1 SIMPLE t2 p4 ALL NULL NULL NULL NULL 200 Using where
explain partitions select * from t2 where (a = 100 OR a = 900);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 p0,p4 ALL NULL NULL NULL NULL 910 Using where
+1 SIMPLE t2 p0,p4 ALL NULL NULL NULL NULL 310 Using where
explain partitions select * from t2 where (a > 100 AND a < 600);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 p0,p1,p2 ALL NULL NULL NULL NULL 910 Using where
+1 SIMPLE t2 p0,p1,p2 ALL NULL NULL NULL NULL 510 Using where
analyze table t2;
Table Op Msg_type Msg_text
test.t2 analyze status OK
@@ -692,7 +692,7 @@ f_int1
NULL
explain partitions select * from t1 where f_int1 is null;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 part4_part4sp0 ALL NULL NULL NULL NULL 1 Using where
+1 SIMPLE t1 part4_part4sp0 ALL NULL NULL NULL NULL 2 Using where
drop table t1;
create table t1 (a int not null, b int not null)
partition by list(a)
@@ -721,10 +721,10 @@ insert into t1 values (1,1),(1,2),(1,3),(1,4),
(2,1),(2,2),(2,3),(2,4), (NULL,1);
explain partitions select * from t1 where a IS NULL AND (b=1 OR b=2);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 pn_pnsp0,pn_pnsp1 ALL NULL NULL NULL NULL 1 Using where
+1 SIMPLE t1 pn_pnsp0,pn_pnsp1 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t1 where (a IS NULL or a < 1) AND (b=1 OR b=2);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 pn_pnsp0,pn_pnsp1 ALL NULL NULL NULL NULL 1 Using where
+1 SIMPLE t1 pn_pnsp0,pn_pnsp1 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t1 where (a IS NULL or a < 2) AND (b=1 OR b=2);
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0_p0sp0,p0_p0sp1,pn_pnsp0,pn_pnsp1 ALL NULL NULL NULL NULL 5 Using where
@@ -753,7 +753,7 @@ count(*)
1
explain partitions select count(*) from t1 where s1 < 0 or s1 is null;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p3 ALL NULL NULL NULL NULL 1 Using where
+1 SIMPLE t1 p3 ALL NULL NULL NULL NULL 2 Using where
drop table t1;
create table t1 (a char(32) primary key)
partition by key()
@@ -812,24 +812,24 @@ insert into t1 values (18446744073709551000+1);
insert into t1 values (18446744073709551614-1);
explain partitions select * from t1 where a < 10;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 1 Using where
+1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t1
where a >= 18446744073709551000-1 and a <= 18446744073709551000+1;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p3,p4 ALL NULL NULL NULL NULL 4 Using where
+1 SIMPLE t1 p3,p4 ALL NULL NULL NULL NULL 3 Using where
explain partitions select * from t1
where a between 18446744073709551001 and 18446744073709551002;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 4 Using where
+1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t1 where a = 18446744073709551000;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 4 Using where
+1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t1 where a = 18446744073709551613;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 4 Using where
+1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 2 Using where
explain partitions select * from t1 where a = 18446744073709551614;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 0 Using where
drop table t1;
create table t1 (a int)
partition by range(a) (
@@ -853,34 +853,34 @@ 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 4 Using where
+1 SIMPLE t1 p2 ALL NULL NULL NULL NULL 2 Using where
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 4 Using where
+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 t1 ALL NULL NULL NULL NULL 4 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 0 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 ALL NULL NULL NULL NULL 4 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 0 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 t1 p2 ALL NULL NULL NULL NULL 4 Using where
+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 4 Using where
+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 4 Using where
+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 4 Using where
+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 6 Using where
+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 6 Using where
+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) (
@@ -898,7 +898,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
explain partitions select * from t1 where
a > 0xFFFFFFFFFFFFFFEC and a < 0xFFFFFFFFFFFFFFEE;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 0 Using where
explain partitions select * from t1 where a>=0 and a <= 0xFFFFFFFFFFFFFFFF;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p1,p2,p3,p4 ALL NULL NULL NULL NULL 8 Using where
diff --git a/mysql-test/suite/pbxt/r/partition_range.result b/mysql-test/suite/pbxt/r/partition_range.result
index 4f41c667a5d..a8c4e36cbc2 100644
--- a/mysql-test/suite/pbxt/r/partition_range.result
+++ b/mysql-test/suite/pbxt/r/partition_range.result
@@ -21,19 +21,19 @@ select * from t1 where a > 1;
a
explain partitions select * from t1 where a is null;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 pnull ALL NULL NULL NULL NULL 3 Using where
+1 SIMPLE t1 pnull ALL NULL NULL NULL NULL 2 Using where
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,p1 ALL NULL NULL NULL NULL 3 Using where
+1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 2 Using where
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 pnull ALL NULL NULL NULL NULL 3 Using where
+1 SIMPLE t1 pnull ALL NULL NULL NULL NULL 2 Using where
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 pnull,p0 ALL NULL NULL NULL NULL 3 Using where
+1 SIMPLE t1 pnull,p0 ALL NULL NULL NULL NULL 2 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 ALL NULL NULL NULL NULL 3 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 0 Using where
drop table t1;
create table t1 (a int unsigned, b int unsigned)
partition by range (a)
@@ -63,19 +63,19 @@ select * from t1 where a > 1;
a b
explain partitions select * from t1 where a is null;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 pnull_pnullsp0,pnull_pnullsp1 ALL NULL NULL NULL NULL 6 Using where
+1 SIMPLE t1 pnull_pnullsp0,pnull_pnullsp1 ALL NULL NULL NULL NULL 2 Using where
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_p0sp0,p0_p0sp1,p1_p1sp0,p1_p1sp1 ALL NULL NULL NULL NULL 6 Using where
+1 SIMPLE t1 p0_p0sp0,p0_p0sp1,p1_p1sp0,p1_p1sp1 ALL NULL NULL NULL NULL 4 Using where
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 pnull_pnullsp0,pnull_pnullsp1 ALL NULL NULL NULL NULL 6 Using where
+1 SIMPLE t1 pnull_pnullsp0,pnull_pnullsp1 ALL NULL NULL NULL NULL 2 Using where
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 pnull_pnullsp0,pnull_pnullsp1,p0_p0sp0,p0_p0sp1 ALL NULL NULL NULL NULL 6 Using where
+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 ALL NULL NULL NULL NULL 6 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 0 Using where
drop table t1;
CREATE TABLE t1 (
a int not null,
diff --git a/mysql-test/suite/pbxt/r/select.result b/mysql-test/suite/pbxt/r/select.result
index 2409f2fa3b3..c06dd06ea3e 100644
--- a/mysql-test/suite/pbxt/r/select.result
+++ b/mysql-test/suite/pbxt/r/select.result
@@ -3447,9 +3447,7 @@ insert into t2 select A.a, B.a, C.a, C.a from t1 A, t1 B, t1 C;
analyze table t2;
Table Op Msg_type Msg_text
test.t2 analyze status OK
-select 'In next EXPLAIN, B.rows must be exactly 10:' Z;
-Z
-In next EXPLAIN, B.rows must be exactly 10:
+In next EXPLAIN, B.rows must be exactly 10 (when using MyISAM):
explain select * from t2 A, t2 B where A.a=5 and A.b=5 and A.C<5
and B.a=5 and B.b=A.e and (B.b =1 or B.b = 3 or B.b=5);
id select_type table type possible_keys key key_len ref rows Extra
diff --git a/mysql-test/suite/pbxt/r/subselect.result b/mysql-test/suite/pbxt/r/subselect.result
index 69f8e2534f7..ebe74e442a2 100644
--- a/mysql-test/suite/pbxt/r/subselect.result
+++ b/mysql-test/suite/pbxt/r/subselect.result
@@ -922,7 +922,7 @@ select a, (select a,b,c from t1 where t1.a=t2.a) = ROW(a,2,'a'),(select c from t
a (select a,b,c from t1 where t1.a=t2.a) = ROW(a,2,'a') (select c from t1 where a=t2.a)
1 1 a
2 0 b
-NULL 0 NULL
+NULL NULL NULL
select a, (select a,b,c from t1 where t1.a=t2.a) = ROW(a,3,'b'),(select c from t1 where a=t2.a) from t2;
a (select a,b,c from t1 where t1.a=t2.a) = ROW(a,3,'b') (select c from t1 where a=t2.a)
1 0 a
@@ -932,7 +932,7 @@ select a, (select a,b,c from t1 where t1.a=t2.a) = ROW(a,4,'c'),(select c from t
a (select a,b,c from t1 where t1.a=t2.a) = ROW(a,4,'c') (select c from t1 where a=t2.a)
1 0 a
2 0 b
-NULL 0 NULL
+NULL NULL NULL
drop table t1,t2;
create table t1 (a int, b real, c varchar(10));
insert into t1 values (1, 1, 'a'), (2,2,'b'), (NULL, 2, 'b');
diff --git a/mysql-test/suite/pbxt/t/select.test b/mysql-test/suite/pbxt/t/select.test
index 014f88b0e1b..7074f4ac364 100644
--- a/mysql-test/suite/pbxt/t/select.test
+++ b/mysql-test/suite/pbxt/t/select.test
@@ -2910,8 +2910,9 @@ insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t2 (a int, b int, c int, e int, primary key(a,b,c));
insert into t2 select A.a, B.a, C.a, C.a from t1 A, t1 B, t1 C;
analyze table t2;
-select 'In next EXPLAIN, B.rows must be exactly 10:' Z;
+-- echo In next EXPLAIN, B.rows must be exactly 10 (when using MyISAM):
+# We mask out the 'rows' column because it may differ from run to run
--replace_column 9 #
explain select * from t2 A, t2 B where A.a=5 and A.b=5 and A.C<5
and B.a=5 and B.b=A.e and (B.b =1 or B.b = 3 or B.b=5);
diff --git a/mysql-test/suite/percona/percona_innodb_buffer_pool_shm-master.opt b/mysql-test/suite/percona/percona_innodb_buffer_pool_shm-master.opt
deleted file mode 100644
index 5974ef6e2be..00000000000
--- a/mysql-test/suite/percona/percona_innodb_buffer_pool_shm-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb_buffer_pool_shm_key=123456
diff --git a/mysql-test/suite/percona/percona_innodb_buffer_pool_shm.result b/mysql-test/suite/percona/percona_innodb_buffer_pool_shm.result
deleted file mode 100644
index 08ece8fb9a9..00000000000
--- a/mysql-test/suite/percona/percona_innodb_buffer_pool_shm.result
+++ /dev/null
@@ -1,6 +0,0 @@
-show variables like 'innodb_buffer_pool_shm%';
-Variable_name Value
-innodb_buffer_pool_shm_key 123456
-show variables like 'innodb_buffer_pool_shm%';
-Variable_name Value
-innodb_buffer_pool_shm_key 123456
diff --git a/mysql-test/suite/percona/percona_innodb_buffer_pool_shm.test b/mysql-test/suite/percona/percona_innodb_buffer_pool_shm.test
deleted file mode 100644
index 7b81bb8d54b..00000000000
--- a/mysql-test/suite/percona/percona_innodb_buffer_pool_shm.test
+++ /dev/null
@@ -1,18 +0,0 @@
---source include/have_innodb.inc
-show variables like 'innodb_buffer_pool_shm%';
-
-#clean shutdown (restart_mysqld.inc is not clean if over 10 sec...)
---write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-wait
-EOF
-shutdown_server 120;
---append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-restart
-EOF
---enable_reconnect
---source include/wait_until_connected_again.inc
---disable_reconnect
-
-show variables like 'innodb_buffer_pool_shm%';
---sleep 1
---system ipcrm -M 123456
diff --git a/mysql-test/suite/percona/percona_log_connection_error.result b/mysql-test/suite/percona/percona_log_connection_error.result
deleted file mode 100644
index 3c6c67f770c..00000000000
--- a/mysql-test/suite/percona/percona_log_connection_error.result
+++ /dev/null
@@ -1,15 +0,0 @@
-SET @old_max_connections = @@max_connections;
-SET @old_log_warnings = @@log_warnings;
-SET GLOBAL max_connections=2;
-SET GLOBAL LOG_WARNINGS = 0;
-connect(localhost,root,,test,port,socket);
-ERROR HY000: Too many connections
-SET GLOBAL LOG_WARNINGS = 1;
-connect(localhost,root,,test,port,socket);
-ERROR HY000: Too many connections
-SET GLOBAL LOG_WARNINGS = 0;
-connect(localhost,root,,test,port,socket);
-ERROR HY000: Too many connections
-SET GLOBAL max_connections = @old_max_connections;
-SET GLOBAL log_warnings = @old_log_warnings;
-1
diff --git a/mysql-test/suite/percona/percona_log_connection_error.test b/mysql-test/suite/percona/percona_log_connection_error.test
deleted file mode 100644
index 57cd652bd24..00000000000
--- a/mysql-test/suite/percona/percona_log_connection_error.test
+++ /dev/null
@@ -1,52 +0,0 @@
---source include/not_embedded.inc
-
-connect (main,localhost,root,,);
-connection main;
-SET @old_max_connections = @@max_connections;
-SET @old_log_warnings = @@log_warnings;
-SET GLOBAL max_connections=2;
-let $port=`SELECT Variable_value FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE Variable_name LIKE 'port'`;
-let $socket=`SELECT Variable_value FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE Variable_name LIKE 'socket'`;
-
-SET GLOBAL LOG_WARNINGS = 0;
---connect (conn0,localhost,root,,)
-connection conn0;
-replace_result $port port $socket socket;
---error 1040
---connect(conn1,localhost,root,,)
-disconnect conn0;
-SLEEP 0.1; # tsarev: hack, but i don't know (and didn't find) how right
-
-connection main;
-SET GLOBAL LOG_WARNINGS = 1;
---connect (conn1,localhost,root,,)
-replace_result $port port $socket socket;
---error 1040
---connect (conn0,localhost,root,,)
-disconnect conn1;
-SLEEP 0.1; # tsarev: hack, but i don't know (and didn't find) how right
-
-connection main;
-SET GLOBAL LOG_WARNINGS = 0;
---connect (conn0,localhost,root,,)
-replace_result $port port $socket socket;
---error 1040
---connect(conn1,localhost,root,,)
-disconnect conn0;
-SLEEP 0.1; # tsarev: hack, but i don't know (and didn't find) how right
-
-connection main;
-SET GLOBAL max_connections = @old_max_connections;
-SET GLOBAL log_warnings = @old_log_warnings;
-let $log_error_= `SELECT @@GLOBAL.log_error`;
-if(!`select LENGTH('$log_error_')`)
-{
- # MySQL Server on windows is started with --console and thus
- # does not know the location of its .err log, use default location
- let $log_error_ = $MYSQLTEST_VARDIR/log/mysqld.1.err;
-}
-# Assign env variable LOG_ERROR
-let LOG_ERROR=$log_error_;
-
-let cmd=cat $log_error | grep "Too many connections" | wc -l;
-exec $cmd;
diff --git a/mysql-test/suite/percona/percona_query_response_time-replication.result b/mysql-test/suite/percona/percona_query_response_time-replication.result
deleted file mode 100644
index df5c73812df..00000000000
--- a/mysql-test/suite/percona/percona_query_response_time-replication.result
+++ /dev/null
@@ -1,60 +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;
-DROP TABLE IF EXISTS t;
-CREATE TABLE t(id INT);
-SELECT * from t;
-id
-SELECT * from t;
-id
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1;
-Warnings:
-Warning 1292 Truncated incorrect query_response_time_range_base value: '1'
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 2
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 10
-FLUSH QUERY_RESPONSE_TIME;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=ON;
-INSERT INTO t VALUES(0);
-SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
-0
-INSERT INTO t VALUES(1);
-SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
-0
-SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
-2
-SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
-3
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 2;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 2
-FLUSH QUERY_RESPONSE_TIME;
-INSERT INTO t VALUES(0);
-SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
-0
-INSERT INTO t VALUES(1);
-SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
-0
-SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
-2
-SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count)
-3
-DROP TABLE IF EXISTS t;
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=OFF;
diff --git a/mysql-test/suite/percona/percona_query_response_time-replication.test b/mysql-test/suite/percona/percona_query_response_time-replication.test
deleted file mode 100644
index 4f674c2fd19..00000000000
--- a/mysql-test/suite/percona/percona_query_response_time-replication.test
+++ /dev/null
@@ -1,52 +0,0 @@
---source include/master-slave.inc
-
-connection master;
--- disable_warnings
-DROP TABLE IF EXISTS t;
--- enable_warnings
-CREATE TABLE t(id INT);
-SELECT * from t;
-
-sync_slave_with_master;
-
-connection slave;
-SELECT * from t;
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-source include/percona_query_response_time_flush.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=ON;
-
-connection master;
-INSERT INTO t VALUES(0);
-SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-INSERT INTO t VALUES(1);
-SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-sync_slave_with_master;
-
-connection slave;
-SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 2;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-source include/percona_query_response_time_flush.inc;
-
-connection master;
-INSERT INTO t VALUES(0);
-SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-INSERT INTO t VALUES(1);
-SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-sync_slave_with_master;
-
-connection slave;
-SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-
-connection master;
-DROP TABLE IF EXISTS t;
-sync_slave_with_master;
-connection slave;
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=OFF;
diff --git a/mysql-test/suite/percona/percona_query_response_time-stored.result b/mysql-test/suite/percona/percona_query_response_time-stored.result
deleted file mode 100644
index df51f2bfd58..00000000000
--- a/mysql-test/suite/percona/percona_query_response_time-stored.result
+++ /dev/null
@@ -1,316 +0,0 @@
-CREATE FUNCTION test_f()
-RETURNS CHAR(30) DETERMINISTIC
-BEGIN
-DECLARE first VARCHAR(5);
-DECLARE second VARCHAR(5);
-DECLARE result VARCHAR(20);
-SELECT SLEEP(1.11) INTO first;
-SET first= 'Hello';
-SET second=', ';
-SET result= CONCAT(first,second);
-SET result= CONCAT(result,'world!');
-RETURN result;
-END/
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1;
-Warnings:
-Warning 1292 Truncated incorrect query_response_time_range_base value: '1'
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 2
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 2;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 2
-FLUSH QUERY_RESPONSE_TIME;
-SELECT d.count,
-(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
-(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
-FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
-count query_count query_total not_zero_region_count region_count
-SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-region_count
-44
-SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time
- 0.000001
- 0.000003
- 0.000007
- 0.000015
- 0.000030
- 0.000061
- 0.000122
- 0.000244
- 0.000488
- 0.000976
- 0.001953
- 0.003906
- 0.007812
- 0.015625
- 0.031250
- 0.062500
- 0.125000
- 0.250000
- 0.500000
- 1.000000
- 2.000000
- 4.000000
- 8.000000
- 16.000000
- 32.000000
- 64.000000
- 128.000000
- 256.000000
- 512.000000
- 1024.000000
- 2048.000000
- 4096.000000
- 8192.000000
- 16384.000000
- 32768.000000
- 65536.000000
- 131072.000000
- 262144.000000
- 524288.000000
- 1048576.00000
- 2097152.00000
- 4194304.00000
- 8388608.00000
-TOO LONG
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-SELECT test_f();
-test_f()
-Hello, world!
-SELECT test_f();
-test_f()
-Hello, world!
-SELECT test_f();
-test_f()
-Hello, world!
-SELECT test_f();
-test_f()
-Hello, world!
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-SELECT d.count,
-(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
-(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
-FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
-count query_count query_total not_zero_region_count region_count
-1 5 4 2 44
-4 5 4 2 44
-SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-region_count
-44
-SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time
- 0.000001
- 0.000003
- 0.000007
- 0.000015
- 0.000030
- 0.000061
- 0.000122
- 0.000244
- 0.000488
- 0.000976
- 0.001953
- 0.003906
- 0.007812
- 0.015625
- 0.031250
- 0.062500
- 0.125000
- 0.250000
- 0.500000
- 1.000000
- 2.000000
- 4.000000
- 8.000000
- 16.000000
- 32.000000
- 64.000000
- 128.000000
- 256.000000
- 512.000000
- 1024.000000
- 2048.000000
- 4096.000000
- 8192.000000
- 16384.000000
- 32768.000000
- 65536.000000
- 131072.000000
- 262144.000000
- 524288.000000
- 1048576.00000
- 2097152.00000
- 4194304.00000
- 8388608.00000
-TOO LONG
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 2
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 10
-FLUSH QUERY_RESPONSE_TIME;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-SELECT test_f();
-test_f()
-Hello, world!
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-SELECT d.count,
-(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
-(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
-FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
-count query_count query_total not_zero_region_count region_count
-1 2 1 2 14
-1 2 1 2 14
-SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-region_count
-14
-SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time
- 0.000001
- 0.000010
- 0.000100
- 0.001000
- 0.010000
- 0.100000
- 1.000000
- 10.000000
- 100.000000
- 1000.000000
- 10000.000000
- 100000.000000
- 1000000.00000
-TOO LONG
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 10
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 7;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 7
-FLUSH QUERY_RESPONSE_TIME;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-SELECT test_f();
-test_f()
-Hello, world!
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-SELECT d.count,
-(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
-(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
-FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
-count query_count query_total not_zero_region_count region_count
-1 2 1 2 17
-1 2 1 2 17
-SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-region_count
-17
-SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time
- 0.000001
- 0.000008
- 0.000059
- 0.000416
- 0.002915
- 0.020408
- 0.142857
- 1.000000
- 7.000000
- 49.000000
- 343.000000
- 2401.000000
- 16807.000000
- 117649.000000
- 823543.000000
- 5764801.00000
-TOO LONG
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 7
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 156;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 156
-FLUSH QUERY_RESPONSE_TIME;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-SELECT test_f();
-test_f()
-Hello, world!
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-SELECT d.count,
-(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
-(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
-FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
-count query_count query_total not_zero_region_count region_count
-1 2 1 2 7
-1 2 1 2 7
-SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-region_count
-7
-SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time
- 0.000041
- 0.006410
- 1.000000
- 156.000000
- 24336.000000
- 3796416.00000
-TOO LONG
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 156
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1000;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 1000
-FLUSH QUERY_RESPONSE_TIME;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-SELECT test_f();
-test_f()
-Hello, world!
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-SELECT d.count,
-(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
-(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
-FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
-count query_count query_total not_zero_region_count region_count
-1 2 1 2 6
-1 2 1 2 6
-SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-region_count
-6
-SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time
- 0.000001
- 0.001000
- 1.000000
- 1000.000000
- 1000000.00000
-TOO LONG
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 1000
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1001;
-Warnings:
-Warning 1292 Truncated incorrect query_response_time_range_base value: '1001'
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 1000
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE =10;
-DROP FUNCTION test_f;
diff --git a/mysql-test/suite/percona/percona_query_response_time-stored.test b/mysql-test/suite/percona/percona_query_response_time-stored.test
deleted file mode 100644
index f761dd7d01c..00000000000
--- a/mysql-test/suite/percona/percona_query_response_time-stored.test
+++ /dev/null
@@ -1,87 +0,0 @@
-source include/have_innodb.inc;
-
-delimiter /;
-CREATE FUNCTION test_f()
-RETURNS CHAR(30) DETERMINISTIC
-BEGIN
- DECLARE first VARCHAR(5);
- DECLARE second VARCHAR(5);
- DECLARE result VARCHAR(20);
- SELECT SLEEP(1.11) INTO first;
- SET first= 'Hello';
- SET second=', ';
- SET result= CONCAT(first,second);
- SET result= CONCAT(result,'world!');
- RETURN result;
-END/
-delimiter ;/
-
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 2;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-
-source include/percona_query_response_time_flush.inc;
-source include/percona_query_response_time_show.inc;
-
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-SELECT test_f();
-SELECT test_f();
-SELECT test_f();
-SELECT test_f();
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-
-source include/percona_query_response_time_show.inc;
-
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-
-source include/percona_query_response_time_flush.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-SELECT test_f();
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-
-source include/percona_query_response_time_show.inc;
-
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 7;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-
-source include/percona_query_response_time_flush.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-SELECT test_f();
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-
-source include/percona_query_response_time_show.inc;
-
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 156;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-
-source include/percona_query_response_time_flush.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-SELECT test_f();
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-
-source include/percona_query_response_time_show.inc;
-
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1000;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-
-source include/percona_query_response_time_flush.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-SELECT test_f();
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-
-source include/percona_query_response_time_show.inc;
-
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1001;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE =10;
-
-DROP FUNCTION test_f; \ No newline at end of file
diff --git a/mysql-test/suite/percona/percona_query_response_time.result b/mysql-test/suite/percona/percona_query_response_time.result
deleted file mode 100644
index 54657b6ca06..00000000000
--- a/mysql-test/suite/percona/percona_query_response_time.result
+++ /dev/null
@@ -1,570 +0,0 @@
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1;
-Warnings:
-Warning 1292 Truncated incorrect query_response_time_range_base value: '1'
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 2
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 2;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 2
-FLUSH QUERY_RESPONSE_TIME;
-SELECT d.count,
-(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
-(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
-FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
-count query_count query_total not_zero_region_count region_count
-SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-region_count
-44
-SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time
- 0.000001
- 0.000003
- 0.000007
- 0.000015
- 0.000030
- 0.000061
- 0.000122
- 0.000244
- 0.000488
- 0.000976
- 0.001953
- 0.003906
- 0.007812
- 0.015625
- 0.031250
- 0.062500
- 0.125000
- 0.250000
- 0.500000
- 1.000000
- 2.000000
- 4.000000
- 8.000000
- 16.000000
- 32.000000
- 64.000000
- 128.000000
- 256.000000
- 512.000000
- 1024.000000
- 2048.000000
- 4096.000000
- 8192.000000
- 16384.000000
- 32768.000000
- 65536.000000
- 131072.000000
- 262144.000000
- 524288.000000
- 1048576.00000
- 2097152.00000
- 4194304.00000
- 8388608.00000
-TOO LONG
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-SELECT SLEEP(0.31);
-SLEEP(0.31)
-0
-SELECT SLEEP(0.32);
-SLEEP(0.32)
-0
-SELECT SLEEP(0.33);
-SLEEP(0.33)
-0
-SELECT SLEEP(0.34);
-SLEEP(0.34)
-0
-SELECT SLEEP(0.35);
-SLEEP(0.35)
-0
-SELECT SLEEP(0.36);
-SLEEP(0.36)
-0
-SELECT SLEEP(0.37);
-SLEEP(0.37)
-0
-SELECT SLEEP(0.38);
-SLEEP(0.38)
-0
-SELECT SLEEP(0.39);
-SLEEP(0.39)
-0
-SELECT SLEEP(0.40);
-SLEEP(0.40)
-0
-SELECT SLEEP(1.1);
-SLEEP(1.1)
-0
-SELECT SLEEP(1.2);
-SLEEP(1.2)
-0
-SELECT SLEEP(1.3);
-SLEEP(1.3)
-0
-SELECT SLEEP(1.5);
-SLEEP(1.5)
-0
-SELECT SLEEP(1.4);
-SLEEP(1.4)
-0
-SELECT SLEEP(0.5);
-SLEEP(0.5)
-0
-SELECT SLEEP(2.1);
-SLEEP(2.1)
-0
-SELECT SLEEP(2.3);
-SLEEP(2.3)
-0
-SELECT SLEEP(2.5);
-SLEEP(2.5)
-0
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-SELECT d.count,
-(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
-(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
-FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
-count query_count query_total not_zero_region_count region_count
-1 20 15 5 44
-10 20 15 5 44
-1 20 15 5 44
-5 20 15 5 44
-3 20 15 5 44
-SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-region_count
-44
-SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time
- 0.000001
- 0.000003
- 0.000007
- 0.000015
- 0.000030
- 0.000061
- 0.000122
- 0.000244
- 0.000488
- 0.000976
- 0.001953
- 0.003906
- 0.007812
- 0.015625
- 0.031250
- 0.062500
- 0.125000
- 0.250000
- 0.500000
- 1.000000
- 2.000000
- 4.000000
- 8.000000
- 16.000000
- 32.000000
- 64.000000
- 128.000000
- 256.000000
- 512.000000
- 1024.000000
- 2048.000000
- 4096.000000
- 8192.000000
- 16384.000000
- 32768.000000
- 65536.000000
- 131072.000000
- 262144.000000
- 524288.000000
- 1048576.00000
- 2097152.00000
- 4194304.00000
- 8388608.00000
-TOO LONG
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 2
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 10
-FLUSH QUERY_RESPONSE_TIME;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-SELECT SLEEP(0.31);
-SLEEP(0.31)
-0
-SELECT SLEEP(0.32);
-SLEEP(0.32)
-0
-SELECT SLEEP(0.33);
-SLEEP(0.33)
-0
-SELECT SLEEP(0.34);
-SLEEP(0.34)
-0
-SELECT SLEEP(0.35);
-SLEEP(0.35)
-0
-SELECT SLEEP(0.36);
-SLEEP(0.36)
-0
-SELECT SLEEP(0.37);
-SLEEP(0.37)
-0
-SELECT SLEEP(0.38);
-SLEEP(0.38)
-0
-SELECT SLEEP(0.39);
-SLEEP(0.39)
-0
-SELECT SLEEP(0.40);
-SLEEP(0.40)
-0
-SELECT SLEEP(1.1);
-SLEEP(1.1)
-0
-SELECT SLEEP(1.2);
-SLEEP(1.2)
-0
-SELECT SLEEP(1.3);
-SLEEP(1.3)
-0
-SELECT SLEEP(1.5);
-SLEEP(1.5)
-0
-SELECT SLEEP(1.4);
-SLEEP(1.4)
-0
-SELECT SLEEP(0.5);
-SLEEP(0.5)
-0
-SELECT SLEEP(2.1);
-SLEEP(2.1)
-0
-SELECT SLEEP(2.3);
-SLEEP(2.3)
-0
-SELECT SLEEP(2.5);
-SLEEP(2.5)
-0
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-SELECT d.count,
-(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
-(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
-FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
-count query_count query_total not_zero_region_count region_count
-1 20 17 3 14
-11 20 17 3 14
-8 20 17 3 14
-SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-region_count
-14
-SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time
- 0.000001
- 0.000010
- 0.000100
- 0.001000
- 0.010000
- 0.100000
- 1.000000
- 10.000000
- 100.000000
- 1000.000000
- 10000.000000
- 100000.000000
- 1000000.00000
-TOO LONG
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 10
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 7;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 7
-FLUSH QUERY_RESPONSE_TIME;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-SELECT SLEEP(0.31);
-SLEEP(0.31)
-0
-SELECT SLEEP(0.32);
-SLEEP(0.32)
-0
-SELECT SLEEP(0.33);
-SLEEP(0.33)
-0
-SELECT SLEEP(0.34);
-SLEEP(0.34)
-0
-SELECT SLEEP(0.35);
-SLEEP(0.35)
-0
-SELECT SLEEP(0.36);
-SLEEP(0.36)
-0
-SELECT SLEEP(0.37);
-SLEEP(0.37)
-0
-SELECT SLEEP(0.38);
-SLEEP(0.38)
-0
-SELECT SLEEP(0.39);
-SLEEP(0.39)
-0
-SELECT SLEEP(0.40);
-SLEEP(0.40)
-0
-SELECT SLEEP(1.1);
-SLEEP(1.1)
-0
-SELECT SLEEP(1.2);
-SLEEP(1.2)
-0
-SELECT SLEEP(1.3);
-SLEEP(1.3)
-0
-SELECT SLEEP(1.5);
-SLEEP(1.5)
-0
-SELECT SLEEP(1.4);
-SLEEP(1.4)
-0
-SELECT SLEEP(0.5);
-SLEEP(0.5)
-0
-SELECT SLEEP(2.1);
-SLEEP(2.1)
-0
-SELECT SLEEP(2.3);
-SLEEP(2.3)
-0
-SELECT SLEEP(2.5);
-SLEEP(2.5)
-0
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-SELECT d.count,
-(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
-(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
-FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
-count query_count query_total not_zero_region_count region_count
-1 20 17 3 17
-11 20 17 3 17
-8 20 17 3 17
-SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-region_count
-17
-SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time
- 0.000001
- 0.000008
- 0.000059
- 0.000416
- 0.002915
- 0.020408
- 0.142857
- 1.000000
- 7.000000
- 49.000000
- 343.000000
- 2401.000000
- 16807.000000
- 117649.000000
- 823543.000000
- 5764801.00000
-TOO LONG
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 7
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 156;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 156
-FLUSH QUERY_RESPONSE_TIME;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-SELECT SLEEP(0.31);
-SLEEP(0.31)
-0
-SELECT SLEEP(0.32);
-SLEEP(0.32)
-0
-SELECT SLEEP(0.33);
-SLEEP(0.33)
-0
-SELECT SLEEP(0.34);
-SLEEP(0.34)
-0
-SELECT SLEEP(0.35);
-SLEEP(0.35)
-0
-SELECT SLEEP(0.36);
-SLEEP(0.36)
-0
-SELECT SLEEP(0.37);
-SLEEP(0.37)
-0
-SELECT SLEEP(0.38);
-SLEEP(0.38)
-0
-SELECT SLEEP(0.39);
-SLEEP(0.39)
-0
-SELECT SLEEP(0.40);
-SLEEP(0.40)
-0
-SELECT SLEEP(1.1);
-SLEEP(1.1)
-0
-SELECT SLEEP(1.2);
-SLEEP(1.2)
-0
-SELECT SLEEP(1.3);
-SLEEP(1.3)
-0
-SELECT SLEEP(1.5);
-SLEEP(1.5)
-0
-SELECT SLEEP(1.4);
-SLEEP(1.4)
-0
-SELECT SLEEP(0.5);
-SLEEP(0.5)
-0
-SELECT SLEEP(2.1);
-SLEEP(2.1)
-0
-SELECT SLEEP(2.3);
-SLEEP(2.3)
-0
-SELECT SLEEP(2.5);
-SLEEP(2.5)
-0
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-SELECT d.count,
-(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
-(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
-FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
-count query_count query_total not_zero_region_count region_count
-1 20 17 3 7
-11 20 17 3 7
-8 20 17 3 7
-SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-region_count
-7
-SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time
- 0.000041
- 0.006410
- 1.000000
- 156.000000
- 24336.000000
- 3796416.00000
-TOO LONG
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 156
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1000;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 1000
-FLUSH QUERY_RESPONSE_TIME;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-SELECT SLEEP(0.31);
-SLEEP(0.31)
-0
-SELECT SLEEP(0.32);
-SLEEP(0.32)
-0
-SELECT SLEEP(0.33);
-SLEEP(0.33)
-0
-SELECT SLEEP(0.34);
-SLEEP(0.34)
-0
-SELECT SLEEP(0.35);
-SLEEP(0.35)
-0
-SELECT SLEEP(0.36);
-SLEEP(0.36)
-0
-SELECT SLEEP(0.37);
-SLEEP(0.37)
-0
-SELECT SLEEP(0.38);
-SLEEP(0.38)
-0
-SELECT SLEEP(0.39);
-SLEEP(0.39)
-0
-SELECT SLEEP(0.40);
-SLEEP(0.40)
-0
-SELECT SLEEP(1.1);
-SLEEP(1.1)
-0
-SELECT SLEEP(1.2);
-SLEEP(1.2)
-0
-SELECT SLEEP(1.3);
-SLEEP(1.3)
-0
-SELECT SLEEP(1.5);
-SLEEP(1.5)
-0
-SELECT SLEEP(1.4);
-SLEEP(1.4)
-0
-SELECT SLEEP(0.5);
-SLEEP(0.5)
-0
-SELECT SLEEP(2.1);
-SLEEP(2.1)
-0
-SELECT SLEEP(2.3);
-SLEEP(2.3)
-0
-SELECT SLEEP(2.5);
-SLEEP(2.5)
-0
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-SELECT d.count,
-(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count,
-(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count,
-(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count
-FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0;
-count query_count query_total not_zero_region_count region_count
-1 20 17 3 6
-11 20 17 3 6
-8 20 17 3 6
-SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-region_count
-6
-SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME;
-time
- 0.000001
- 0.001000
- 1.000000
- 1000.000000
- 1000000.00000
-TOO LONG
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 1000
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1001;
-Warnings:
-Warning 1292 Truncated incorrect query_response_time_range_base value: '1001'
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-Variable_name Value
-query_response_time_range_base 1000
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE =10;
diff --git a/mysql-test/suite/percona/percona_query_response_time.test b/mysql-test/suite/percona/percona_query_response_time.test
deleted file mode 100644
index a58cafc8d01..00000000000
--- a/mysql-test/suite/percona/percona_query_response_time.test
+++ /dev/null
@@ -1,65 +0,0 @@
-source include/have_innodb.inc;
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 2;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-
-source include/percona_query_response_time_flush.inc;
-source include/percona_query_response_time_show.inc;
-
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-source include/percona_query_response_time_sleep.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-
-source include/percona_query_response_time_show.inc;
-
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-
-source include/percona_query_response_time_flush.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-source include/percona_query_response_time_sleep.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-
-source include/percona_query_response_time_show.inc;
-
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 7;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-
-source include/percona_query_response_time_flush.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-source include/percona_query_response_time_sleep.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-
-source include/percona_query_response_time_show.inc;
-
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 156;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-
-source include/percona_query_response_time_flush.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-source include/percona_query_response_time_sleep.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-
-source include/percona_query_response_time_show.inc;
-
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1000;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-
-source include/percona_query_response_time_flush.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=1;
-source include/percona_query_response_time_sleep.inc;
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-
-source include/percona_query_response_time_show.inc;
-
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1001;
-SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE';
-
-SET GLOBAL ENABLE_QUERY_RESPONSE_TIME_STATS=0;
-SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE =10;
diff --git a/mysql-test/suite/percona/percona_server_variables.result b/mysql-test/suite/percona/percona_server_variables.result
index cb2af0d3d0e..6533829cfd9 100644
--- a/mysql-test/suite/percona/percona_server_variables.result
+++ b/mysql-test/suite/percona/percona_server_variables.result
@@ -36,12 +36,10 @@ delayed_insert_limit Value
delayed_insert_timeout Value
delayed_queue_size Value
div_precision_increment Value
-enable_query_response_time_stats Value
engine_condition_pushdown Value
error_count Value
event_scheduler Value
expire_logs_days Value
-fast_index_creation Value
flush Value
flush_time Value
foreign_key_checks Value
@@ -80,8 +78,6 @@ innodb_additional_mem_pool_size Value
innodb_auto_lru_dump Value
innodb_autoextend_increment Value
innodb_autoinc_lock_mode Value
-innodb_buffer_pool_shm_checksum Value
-innodb_buffer_pool_shm_key Value
innodb_buffer_pool_size Value
innodb_change_buffering Value
innodb_checkpoint_age_target Value
@@ -250,7 +246,6 @@ query_cache_strip_comments Value
query_cache_type Value
query_cache_wlock_invalidate Value
query_prealloc_size Value
-query_response_time_range_base Value
rand_seed1 Value
rand_seed2 Value
range_alloc_block_size Value
diff --git a/mysql-test/suite/percona/percona_slow_query_log-log_slow_verbosity.result b/mysql-test/suite/percona/percona_slow_query_log-log_slow_verbosity.result
deleted file mode 100644
index ff42937fa4a..00000000000
--- a/mysql-test/suite/percona/percona_slow_query_log-log_slow_verbosity.result
+++ /dev/null
@@ -1,9 +0,0 @@
-SELECT sleep(2);
-sleep(2)
-0
-set log_slow_verbosity=innodb;
-SELECT sleep(2);
-sleep(2)
-0
-cat MYSQLD_DATADIR/percona_slow_query_log-log_slow_verbosity.log | grep -c "No InnoDB statistics available for this query"
-1
diff --git a/mysql-test/suite/percona/percona_slow_query_log-log_slow_verbosity.test b/mysql-test/suite/percona/percona_slow_query_log-log_slow_verbosity.test
deleted file mode 100644
index d1dc324fced..00000000000
--- a/mysql-test/suite/percona/percona_slow_query_log-log_slow_verbosity.test
+++ /dev/null
@@ -1,15 +0,0 @@
--- source include/not_windows.inc
-
-source include/have_innodb.inc;
-
-SELECT sleep(2);
-
-set log_slow_verbosity=innodb;
-
-SELECT sleep(2);
-
-let $MYSQLD_DATADIR= `select @@datadir`;
-let $cmd = cat $MYSQLD_DATADIR/percona_slow_query_log-log_slow_verbosity.log | grep -c "No InnoDB statistics available for this query";
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-exec echo '$cmd';
-exec $cmd;
diff --git a/mysql-test/suite/percona/percona_slow_query_log-long_query_time.result b/mysql-test/suite/percona/percona_slow_query_log-long_query_time.result
deleted file mode 100644
index 03f8745ca62..00000000000
--- a/mysql-test/suite/percona/percona_slow_query_log-long_query_time.result
+++ /dev/null
@@ -1,21 +0,0 @@
-SELECT sleep(1);
-sleep(1)
-0
-SELECT sleep(6);
-sleep(6)
-0
-SELECT sleep(10);
-sleep(10)
-0
-set long_query_time=8;
-SELECT sleep(1);
-sleep(1)
-0
-SELECT sleep(6);
-sleep(6)
-0
-SELECT sleep(12);
-sleep(12)
-0
-cat MYSQLD_DATADIR/percona_slow_query_log-long_query_time.log | grep -c Query_time
-3
diff --git a/mysql-test/suite/percona/percona_slow_query_log-long_query_time.test b/mysql-test/suite/percona/percona_slow_query_log-long_query_time.test
deleted file mode 100644
index 4161690e2ef..00000000000
--- a/mysql-test/suite/percona/percona_slow_query_log-long_query_time.test
+++ /dev/null
@@ -1,18 +0,0 @@
-source include/not_windows.inc;
-source include/have_innodb.inc;
-
-SELECT sleep(1);
-SELECT sleep(6);
-SELECT sleep(10);
-
-set long_query_time=8;
-
-SELECT sleep(1);
-SELECT sleep(6);
-SELECT sleep(12);
-
-let $MYSQLD_DATADIR= `select @@datadir`;
-let $cmd = cat $MYSQLD_DATADIR/percona_slow_query_log-long_query_time.log | grep -c Query_time;
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-exec echo '$cmd';
-exec $cmd;
diff --git a/mysql-test/suite/percona/percona_slow_query_log-microseconds_in_slow_query_log.result b/mysql-test/suite/percona/percona_slow_query_log-microseconds_in_slow_query_log.result
deleted file mode 100644
index fbfc954481e..00000000000
--- a/mysql-test/suite/percona/percona_slow_query_log-microseconds_in_slow_query_log.result
+++ /dev/null
@@ -1,12 +0,0 @@
-SELECT sleep(2);
-sleep(2)
-0
-set global slow_query_log_microseconds_timestamp=ON;
-SELECT sleep(2);
-sleep(2)
-0
-set global slow_query_log_microseconds_timestamp=OFF;
-cat MYSQLD_DATADIR/percona_slow_query_log-microseconds_in_slow_query_log.log | grep -E -c '# Time: [0-9]+[ ]+[0-9]+:[0-\9]+:[0-9]+.[0-9]+'
-1
-cat MYSQLD_DATADIR/percona_slow_query_log-microseconds_in_slow_query_log.log | grep -E -c '# Time: [0-9]+[ ]+[0-9]+:[0-\9]+:[0-9]+'
-2
diff --git a/mysql-test/suite/percona/percona_slow_query_log-microseconds_in_slow_query_log.test b/mysql-test/suite/percona/percona_slow_query_log-microseconds_in_slow_query_log.test
deleted file mode 100644
index bceada68d79..00000000000
--- a/mysql-test/suite/percona/percona_slow_query_log-microseconds_in_slow_query_log.test
+++ /dev/null
@@ -1,21 +0,0 @@
-source include/not_windows.inc;
-source include/have_innodb.inc;
-
-SELECT sleep(2);
-
-set global slow_query_log_microseconds_timestamp=ON;
-
-SELECT sleep(2);
-
-set global slow_query_log_microseconds_timestamp=OFF;
-
-let $MYSQLD_DATADIR= `select @@datadir`;
-let $cmd = cat $MYSQLD_DATADIR/percona_slow_query_log-microseconds_in_slow_query_log.log | grep -E -c '# Time: [0-9]+[ ]+[0-9]+:[0-\9]+:[0-9]+.[0-9]+';
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-exec echo "$cmd";
-exec $cmd;
-
-let $cmd = cat $MYSQLD_DATADIR/percona_slow_query_log-microseconds_in_slow_query_log.log | grep -E -c '# Time: [0-9]+[ ]+[0-9]+:[0-\9]+:[0-9]+';
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-exec echo "$cmd";
-exec $cmd;
diff --git a/mysql-test/suite/percona/percona_slow_query_log-use_global_long_query_time-master.opt b/mysql-test/suite/percona/percona_slow_query_log-use_global_long_query_time-master.opt
deleted file mode 100644
index e2f3b6f2041..00000000000
--- a/mysql-test/suite/percona/percona_slow_query_log-use_global_long_query_time-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---slow-query-log-file=percona_slow_query_log-use_global_long_query_time.log --long-query-time=2 \ No newline at end of file
diff --git a/mysql-test/suite/percona/percona_sql_no_fcache.result b/mysql-test/suite/percona/percona_sql_no_fcache.result
deleted file mode 100644
index bc1413fb96d..00000000000
--- a/mysql-test/suite/percona/percona_sql_no_fcache.result
+++ /dev/null
@@ -1,12 +0,0 @@
-drop table if exists t1;
-create table t (a int not null);
-insert into t values (1),(2),(3);
-SELECT SQL_NO_FCACHE SLEEP(0);
-SLEEP(0)
-0
-SELECT /*!40001 SQL_NO_CACHE */ /*!50084 SQL_NO_FCACHE */ * FROM t;
-a
-1
-2
-3
-DROP TABLE t;
diff --git a/mysql-test/suite/percona/percona_sql_no_fcache.test b/mysql-test/suite/percona/percona_sql_no_fcache.test
deleted file mode 100644
index da0c2ecef7d..00000000000
--- a/mysql-test/suite/percona/percona_sql_no_fcache.test
+++ /dev/null
@@ -1,11 +0,0 @@
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-create table t (a int not null);
-insert into t values (1),(2),(3);
-
-SELECT SQL_NO_FCACHE SLEEP(0);
-SELECT /*!40001 SQL_NO_CACHE */ /*!50084 SQL_NO_FCACHE */ * FROM t;
-
-DROP TABLE t; \ No newline at end of file
diff --git a/mysql-test/include/percona_query_cache_with_comments.inc b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments.inc
index bed87bd4c22..bed87bd4c22 100644
--- a/mysql-test/include/percona_query_cache_with_comments.inc
+++ b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments.inc
diff --git a/mysql-test/suite/percona/percona_query_cache_with_comments.inc.backup b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments.inc.backup
index 4b5b31e9239..4b5b31e9239 100644
--- a/mysql-test/suite/percona/percona_query_cache_with_comments.inc.backup
+++ b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments.inc.backup
diff --git a/mysql-test/suite/percona/percona_query_cache_with_comments.result b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments.result
index 169fdf80fef..169fdf80fef 100644
--- a/mysql-test/suite/percona/percona_query_cache_with_comments.result
+++ b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments.result
diff --git a/mysql-test/suite/percona/percona_query_cache_with_comments.test b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments.test
index 0190f54d104..0b93441f364 100644
--- a/mysql-test/suite/percona/percona_query_cache_with_comments.test
+++ b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments.test
@@ -1,3 +1,4 @@
+--disable_ps_protocol
set global query_cache_strip_comments=ON;
-- source include/percona_query_cache_with_comments_begin.inc
-- source include/percona_query_cache_with_comments.inc
diff --git a/mysql-test/include/percona_query_cache_with_comments_begin.inc b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_begin.inc
index 38bfce20263..38bfce20263 100644
--- a/mysql-test/include/percona_query_cache_with_comments_begin.inc
+++ b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_begin.inc
diff --git a/mysql-test/include/percona_query_cache_with_comments_clear.inc b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_clear.inc
index 728a19a3c97..728a19a3c97 100644
--- a/mysql-test/include/percona_query_cache_with_comments_clear.inc
+++ b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_clear.inc
diff --git a/mysql-test/suite/percona/percona_query_cache_with_comments_crash.result b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_crash.result
index 32bd3645ec4..32bd3645ec4 100644
--- a/mysql-test/suite/percona/percona_query_cache_with_comments_crash.result
+++ b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_crash.result
diff --git a/mysql-test/suite/percona/percona_query_cache_with_comments_crash.test b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_crash.test
index e125c75c3de..e125c75c3de 100644
--- a/mysql-test/suite/percona/percona_query_cache_with_comments_crash.test
+++ b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_crash.test
diff --git a/mysql-test/suite/percona/percona_query_cache_with_comments_disable.result b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_disable.result
index a13a44d9a1c..a13a44d9a1c 100644
--- a/mysql-test/suite/percona/percona_query_cache_with_comments_disable.result
+++ b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_disable.result
diff --git a/mysql-test/suite/percona/percona_query_cache_with_comments_disable.test b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_disable.test
index ad59ac3566c..ad59ac3566c 100644
--- a/mysql-test/suite/percona/percona_query_cache_with_comments_disable.test
+++ b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_disable.test
diff --git a/mysql-test/include/percona_query_cache_with_comments_end.inc b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_end.inc
index d5356359d7e..d5356359d7e 100644
--- a/mysql-test/include/percona_query_cache_with_comments_end.inc
+++ b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_end.inc
diff --git a/mysql-test/include/percona_query_cache_with_comments_eval.inc b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_eval.inc
index a409786d554..a409786d554 100644
--- a/mysql-test/include/percona_query_cache_with_comments_eval.inc
+++ b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_eval.inc
diff --git a/mysql-test/suite/percona/percona_query_cache_with_comments_prepared_statements.result b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_prepared_statements.result
index 9b28b7f0b62..9b28b7f0b62 100644
--- a/mysql-test/suite/percona/percona_query_cache_with_comments_prepared_statements.result
+++ b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_prepared_statements.result
diff --git a/mysql-test/suite/percona/percona_query_cache_with_comments_prepared_statements.test b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_prepared_statements.test
index 78cb7220aff..78cb7220aff 100644
--- a/mysql-test/suite/percona/percona_query_cache_with_comments_prepared_statements.test
+++ b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_prepared_statements.test
diff --git a/mysql-test/include/percona_query_cache_with_comments_show.inc b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_show.inc
index 71aa5211cfd..71aa5211cfd 100644
--- a/mysql-test/include/percona_query_cache_with_comments_show.inc
+++ b/mysql-test/suite/percona/query_cache_enhance.patch/percona_query_cache_with_comments_show.inc
diff --git a/mysql-test/suite/percona/percona_status_wait_query_cache_mutex.result b/mysql-test/suite/percona/query_cache_enhance.patch/percona_status_wait_query_cache_mutex.result
index 348dcef4d30..348dcef4d30 100644
--- a/mysql-test/suite/percona/percona_status_wait_query_cache_mutex.result
+++ b/mysql-test/suite/percona/query_cache_enhance.patch/percona_status_wait_query_cache_mutex.result
diff --git a/mysql-test/suite/percona/percona_status_wait_query_cache_mutex.test b/mysql-test/suite/percona/query_cache_enhance.patch/percona_status_wait_query_cache_mutex.test
index 64a9fe7db71..64a9fe7db71 100644
--- a/mysql-test/suite/percona/percona_status_wait_query_cache_mutex.test
+++ b/mysql-test/suite/percona/query_cache_enhance.patch/percona_status_wait_query_cache_mutex.test
diff --git a/mysql-test/suite/percona/percona_slow_query_log-control_global_slow-master.opt b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-control_global_slow-master.opt
index 91dd41305cd..91dd41305cd 100644
--- a/mysql-test/suite/percona/percona_slow_query_log-control_global_slow-master.opt
+++ b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-control_global_slow-master.opt
diff --git a/mysql-test/suite/percona/percona_slow_query_log-control_global_slow.result b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-control_global_slow.result
index bc6ce100b35..15463408878 100644
--- a/mysql-test/suite/percona/percona_slow_query_log-control_global_slow.result
+++ b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-control_global_slow.result
@@ -8,5 +8,5 @@ sleep(2)
0
set global use_global_log_slow_control=none;
set global log_slow_verbosity=microtime;
-cat MYSQLD_DATADIR/percona_slow_query_log-control_global_slow.log | grep -c "No InnoDB statistics available for this query"
+cat var/mysqld.1/data/percona_slow_query_log-control_global_slow.log | grep "No InnoDB statistics available for this query" | wc -l
1
diff --git a/mysql-test/suite/percona/percona_slow_query_log-control_global_slow.test b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-control_global_slow.test
index 1c3dc937937..bfe49d09563 100644
--- a/mysql-test/suite/percona/percona_slow_query_log-control_global_slow.test
+++ b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-control_global_slow.test
@@ -1,5 +1,3 @@
---source include/not_windows.inc
-
source include/have_innodb.inc;
SELECT sleep(2);
set global log_slow_verbosity=innodb;
@@ -7,8 +5,6 @@ set global use_global_log_slow_control="log_slow_verbosity,long_query_time";
SELECT sleep(2);
set global use_global_log_slow_control=none;
set global log_slow_verbosity=microtime;
-let $MYSQLD_DATADIR= `select @@datadir`;
-let $cmd = cat $MYSQLD_DATADIR/percona_slow_query_log-control_global_slow.log | grep -c "No InnoDB statistics available for this query";
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-exec echo '$cmd';
+let $cmd = cat var/mysqld.1/data/percona_slow_query_log-control_global_slow.log | grep "No InnoDB statistics available for this query" | wc -l;
+echo $cmd;
exec $cmd;
diff --git a/mysql-test/suite/percona/percona_slow_query_log-log_slow_filter-master.opt b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_filter-master.opt
index cb93f7abf05..cb93f7abf05 100644
--- a/mysql-test/suite/percona/percona_slow_query_log-log_slow_filter-master.opt
+++ b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_filter-master.opt
diff --git a/mysql-test/suite/percona/percona_slow_query_log-log_slow_filter.result b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_filter.result
index 9c8f69745a7..07c90fa05a3 100644
--- a/mysql-test/suite/percona/percona_slow_query_log-log_slow_filter.result
+++ b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_filter.result
@@ -21,5 +21,5 @@ SELECT sleep(2);
sleep(2)
0
drop table if exists t;
-cat MYSQLD_DATADIR/percona_slow_query_log-log_slow_filter.log | grep -c Query_time
+cat var/mysqld.1/data/percona_slow_query_log-log_slow_filter.log | grep Query_time | wc -l
2
diff --git a/mysql-test/suite/percona/percona_slow_query_log-log_slow_filter.test b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_filter.test
index 44646de530a..bd903e88050 100644
--- a/mysql-test/suite/percona/percona_slow_query_log-log_slow_filter.test
+++ b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_filter.test
@@ -1,5 +1,3 @@
--- source include/not_windows.inc
-
source include/have_innodb.inc;
SET GLOBAL SLOW_QUERY_LOG=OFF;
@@ -28,8 +26,6 @@ SELECT sleep(2);
drop table if exists t;
--enable_warnings
-let $MYSQLD_DATADIR= `select @@datadir`;
-let $cmd = cat $MYSQLD_DATADIR/percona_slow_query_log-log_slow_filter.log | grep -c Query_time;
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-exec echo '$cmd';
+let $cmd = cat var/mysqld.1/data/percona_slow_query_log-log_slow_filter.log | grep Query_time | wc -l;
+echo $cmd;
exec $cmd;
diff --git a/mysql-test/suite/percona/percona_slow_query_log-log_slow_verbosity-master.opt b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_verbosity-master.opt
index 8d21f40a34f..8d21f40a34f 100644
--- a/mysql-test/suite/percona/percona_slow_query_log-log_slow_verbosity-master.opt
+++ b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_verbosity-master.opt
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_verbosity.result b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_verbosity.result
new file mode 100644
index 00000000000..75f842f22a0
--- /dev/null
+++ b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_verbosity.result
@@ -0,0 +1,9 @@
+SELECT sleep(2);
+sleep(2)
+0
+set log_slow_verbosity=innodb;
+SELECT sleep(2);
+sleep(2)
+0
+cat var/mysqld.1/data/percona_slow_query_log-log_slow_verbosity.log | grep "No InnoDB statistics available for this query" | wc -l
+1
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_verbosity.test b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_verbosity.test
new file mode 100644
index 00000000000..56d14e33513
--- /dev/null
+++ b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-log_slow_verbosity.test
@@ -0,0 +1,11 @@
+source include/have_innodb.inc;
+
+SELECT sleep(2);
+
+set log_slow_verbosity=innodb;
+
+SELECT sleep(2);
+
+let $cmd = cat var/mysqld.1/data/percona_slow_query_log-log_slow_verbosity.log | grep "No InnoDB statistics available for this query" | wc -l;
+echo $cmd;
+exec $cmd;
diff --git a/mysql-test/suite/percona/percona_slow_query_log-long_query_time-master.opt b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-long_query_time-master.opt
index 5cbb82d1261..473323e0bd9 100644
--- a/mysql-test/suite/percona/percona_slow_query_log-long_query_time-master.opt
+++ b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-long_query_time-master.opt
@@ -1 +1 @@
---slow-query-log-file=percona_slow_query_log-long_query_time.log --long-query-time=3
+--slow-query-log-file=percona_slow_query_log-long_query_time.log --long-query-time=2 \ No newline at end of file
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-long_query_time.result b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-long_query_time.result
new file mode 100644
index 00000000000..ed934610211
--- /dev/null
+++ b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-long_query_time.result
@@ -0,0 +1,22 @@
+SELECT sleep(1);
+sleep(1)
+0
+SELECT sleep(3);
+sleep(3)
+0
+SELECT sleep(5);
+sleep(5)
+0
+set long_query_time=4;
+SELECT sleep(1);
+sleep(1)
+0
+SELECT sleep(3);
+sleep(3)
+0
+SELECT sleep(5);
+sleep(5)
+0
+set long_query_time=2;
+cat var/mysqld.1/data/percona_slow_query_log-long_query_time.log | grep Query_time | wc -l
+3
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-long_query_time.test b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-long_query_time.test
new file mode 100644
index 00000000000..9954ef4ee40
--- /dev/null
+++ b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-long_query_time.test
@@ -0,0 +1,17 @@
+source include/have_innodb.inc;
+
+SELECT sleep(1);
+SELECT sleep(3);
+SELECT sleep(5);
+
+set long_query_time=4;
+
+SELECT sleep(1);
+SELECT sleep(3);
+SELECT sleep(5);
+
+set long_query_time=2;
+
+let $cmd = cat var/mysqld.1/data/percona_slow_query_log-long_query_time.log | grep Query_time | wc -l;
+echo $cmd;
+exec $cmd;
diff --git a/mysql-test/suite/percona/percona_slow_query_log-microseconds_in_slow_query_log-master.opt b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-microseconds_in_slow_extended-master.opt
index 6433539d3d1..6433539d3d1 100644
--- a/mysql-test/suite/percona/percona_slow_query_log-microseconds_in_slow_query_log-master.opt
+++ b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-microseconds_in_slow_extended-master.opt
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-microseconds_in_slow_extended.result b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-microseconds_in_slow_extended.result
new file mode 100644
index 00000000000..3cdab58aad0
--- /dev/null
+++ b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-microseconds_in_slow_extended.result
@@ -0,0 +1,12 @@
+SELECT sleep(2);
+sleep(2)
+0
+set global slow_query_log_microseconds_timestamp=ON;
+SELECT sleep(2);
+sleep(2)
+0
+set global slow_query_log_microseconds_timestamp=OFF;
+cat var/mysqld.1/data/percona_slow_query_log-microseconds_in_slow_query_log.log | grep -E '# Time: [0-9]+[ ]+[0-9]+:[0-\9]+:[0-9]+.[0-9]+' | wc -l
+1
+cat var/mysqld.1/data/percona_slow_query_log-microseconds_in_slow_query_log.log | grep -E '# Time: [0-9]+[ ]+[0-9]+:[0-\9]+:[0-9]+' | wc -l
+2
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-microseconds_in_slow_extended.test b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-microseconds_in_slow_extended.test
new file mode 100644
index 00000000000..18eb6830405
--- /dev/null
+++ b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-microseconds_in_slow_extended.test
@@ -0,0 +1,17 @@
+source include/have_innodb.inc;
+
+SELECT sleep(2);
+
+set global slow_query_log_microseconds_timestamp=ON;
+
+SELECT sleep(2);
+
+set global slow_query_log_microseconds_timestamp=OFF;
+
+let $cmd = cat var/mysqld.1/data/percona_slow_query_log-microseconds_in_slow_query_log.log | grep -E '# Time: [0-9]+[ ]+[0-9]+:[0-\9]+:[0-9]+.[0-9]+' | wc -l;
+echo $cmd;
+exec $cmd;
+
+let $cmd = cat var/mysqld.1/data/percona_slow_query_log-microseconds_in_slow_query_log.log | grep -E '# Time: [0-9]+[ ]+[0-9]+:[0-\9]+:[0-9]+' | wc -l;
+echo $cmd;
+exec $cmd;
diff --git a/mysql-test/suite/percona/percona_slow_query_log-min_examined_row_limit-master.opt b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-min_examined_row_limit-master.opt
index 6f82556fb0c..6f82556fb0c 100644
--- a/mysql-test/suite/percona/percona_slow_query_log-min_examined_row_limit-master.opt
+++ b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-min_examined_row_limit-master.opt
diff --git a/mysql-test/suite/percona/percona_slow_query_log-min_examined_row_limit.result b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-min_examined_row_limit.result
index 32698a59837..bf5a2131826 100644
--- a/mysql-test/suite/percona/percona_slow_query_log-min_examined_row_limit.result
+++ b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-min_examined_row_limit.result
@@ -21,5 +21,5 @@ SELECT sleep(2);
sleep(2)
0
drop table if exists t;
-cat MYSQLD_DATADIR/percona_slow_query_log-min_examined_row_limit.log | grep -c Query_time
+cat var/mysqld.1/data/percona_slow_query_log-min_examined_row_limit.log | grep Query_time | wc -l
2
diff --git a/mysql-test/suite/percona/percona_slow_query_log-min_examined_row_limit.test b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-min_examined_row_limit.test
index 61276423b4d..83edb1c366f 100644
--- a/mysql-test/suite/percona/percona_slow_query_log-min_examined_row_limit.test
+++ b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-min_examined_row_limit.test
@@ -1,4 +1,3 @@
-source include/not_windows.inc;
source include/have_innodb.inc;
SET GLOBAL SLOW_QUERY_LOG=OFF;
@@ -27,8 +26,6 @@ SELECT sleep(2);
drop table if exists t;
--enable_warnings
-let $MYSQLD_DATADIR= `select @@datadir`;
-let $cmd = cat $MYSQLD_DATADIR/percona_slow_query_log-min_examined_row_limit.log | grep -c Query_time;
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-exec echo '$cmd';
+let $cmd = cat var/mysqld.1/data/percona_slow_query_log-min_examined_row_limit.log | grep Query_time | wc -l;
+echo $cmd;
exec $cmd;
diff --git a/mysql-test/suite/percona/percona_slave_innodb_stats-master.opt b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_innodb_stats-master.opt
index 286a9c4484d..286a9c4484d 100644
--- a/mysql-test/suite/percona/percona_slave_innodb_stats-master.opt
+++ b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_innodb_stats-master.opt
diff --git a/mysql-test/suite/percona/percona_slave_innodb_stats-slave.opt b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_innodb_stats-slave.opt
index 286a9c4484d..286a9c4484d 100644
--- a/mysql-test/suite/percona/percona_slave_innodb_stats-slave.opt
+++ b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_innodb_stats-slave.opt
diff --git a/mysql-test/suite/percona/percona_slave_innodb_stats.result b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_innodb_stats.result
index c2406bdfd85..c2406bdfd85 100644
--- a/mysql-test/suite/percona/percona_slave_innodb_stats.result
+++ b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_innodb_stats.result
diff --git a/mysql-test/suite/percona/percona_slave_innodb_stats.test b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_innodb_stats.test
index defcd1fc406..247a7028772 100644
--- a/mysql-test/suite/percona/percona_slave_innodb_stats.test
+++ b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_innodb_stats.test
@@ -1,5 +1,6 @@
-source include/have_innodb.inc;
-source include/master-slave.inc;
+-- source include/have_binlog_format_mixed_or_statement.inc
+-- source include/have_innodb.inc
+-- source include/master-slave.inc
connection master;
-- disable_warnings
diff --git a/mysql-test/suite/percona/percona_log_slow_slave_statements-and-use_global_long_query_time-master.opt b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements-and-use_global_long_query_time-master.opt
index d600400af08..d600400af08 100644
--- a/mysql-test/suite/percona/percona_log_slow_slave_statements-and-use_global_long_query_time-master.opt
+++ b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements-and-use_global_long_query_time-master.opt
diff --git a/mysql-test/suite/percona/percona_log_slow_slave_statements-and-use_global_long_query_time-slave.opt b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements-and-use_global_long_query_time-slave.opt
index c79e637317b..c79e637317b 100644
--- a/mysql-test/suite/percona/percona_log_slow_slave_statements-and-use_global_long_query_time-slave.opt
+++ b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements-and-use_global_long_query_time-slave.opt
diff --git a/mysql-test/suite/percona/percona_log_slow_slave_statements-and-use_global_long_query_time.result b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements-and-use_global_long_query_time.result
index c17e7a3f508..8aed50caba2 100644
--- a/mysql-test/suite/percona/percona_log_slow_slave_statements-and-use_global_long_query_time.result
+++ b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements-and-use_global_long_query_time.result
@@ -11,8 +11,6 @@ CREATE TABLE t(id INT);
# Start slave replication
START SLAVE;
INSERT INTO t VALUES (1);
-# Read information about master binlog
-# Sync(1) slave thread
# Read and change log_slow_slave_statements to ON on slave
show variables like 'log_slow_slave_statements';
Variable_name Value
@@ -22,14 +20,10 @@ show variables like 'log_slow_slave_statements';
Variable_name Value
log_slow_slave_statements ON
INSERT INTO t VALUES (2);
-# Read information about master binlog
-# Sync slave(2) thread
# Restart slave
STOP SLAVE;
START SLAVE;
INSERT INTO t VALUES (3);
-# Read information about master binlog
-# Sync(3) slave thread
show variables like 'long_query_time';
Variable_name Value
long_query_time 1.000000
@@ -50,8 +44,6 @@ show global variables like 'use_global_long_query_time';
Variable_name Value
use_global_long_query_time OFF
INSERT INTO t VALUES (4);
-# Read information about master binlog
-# Sync slave(4) thread
show variables like 'long_query_time';
Variable_name Value
long_query_time 1.000000
@@ -72,8 +64,6 @@ show global variables like 'use_global_long_query_time';
Variable_name Value
use_global_long_query_time ON
INSERT INTO t VALUES (5);
-# Read information about master binlog
-# Sync slave(5) thread
show variables like 'long_query_time';
Variable_name Value
long_query_time 0.000000
@@ -99,5 +89,3 @@ set global use_global_long_query_time=0;
1
set global log_slow_slave_statements=OFF;
DROP TABLE t;
-# Read information about master binlog
-# Sync slave(6) thread
diff --git a/mysql-test/suite/percona/percona_log_slow_slave_statements-and-use_global_long_query_time.test b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements-and-use_global_long_query_time.test
index 8d4bb1e091c..6b7d2750e68 100644
--- a/mysql-test/suite/percona/percona_log_slow_slave_statements-and-use_global_long_query_time.test
+++ b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements-and-use_global_long_query_time.test
@@ -1,5 +1,4 @@
--- source include/not_windows.inc
-
+-- source include/have_binlog_format_mixed_or_statement.inc
-- echo # Activate master-slave replication
-- source include/master-slave.inc
@@ -21,14 +20,8 @@ START SLAVE;
#-- echo # Make insert(1) on master
connection master;
INSERT INTO t VALUES (1);
--- echo # Read information about master binlog
-let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
-let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-
--- echo # Sync(1) slave thread
+sync_slave_with_master;
connection slave;
-let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
-
-- echo # Read and change log_slow_slave_statements to ON on slave
show variables like 'log_slow_slave_statements';
set global log_slow_slave_statements=ON;
@@ -37,13 +30,8 @@ show variables like 'log_slow_slave_statements';
#-- echo # Make insert(2) on master
connection master;
INSERT INTO t VALUES (2);
--- echo # Read information about master binlog
-let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
-let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-
--- echo # Sync slave(2) thread
+sync_slave_with_master;
connection slave;
-let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
-- echo # Restart slave
STOP SLAVE;
-- source include/wait_for_slave_to_stop.inc
@@ -53,13 +41,8 @@ START SLAVE;
#-- echo # Make insert(3) on master
connection master;
INSERT INTO t VALUES (3);
--- echo # Read information about master binlog
-let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
-let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-
--- echo # Sync(3) slave thread
+sync_slave_with_master;
connection slave;
-let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
show variables like 'long_query_time';
show global variables like 'long_query_time';
show global variables like 'use_global_long_query_time';
@@ -71,13 +54,8 @@ show global variables like 'use_global_long_query_time';
#-- echo # Make insert(4) on master
connection master;
INSERT INTO t VALUES (4);
--- echo # Read information about master binlog
-let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
-let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-
--- echo # Sync slave(4) thread
+sync_slave_with_master;
connection slave;
-let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
show variables like 'long_query_time';
show global variables like 'long_query_time';
show global variables like 'use_global_long_query_time';
@@ -88,16 +66,9 @@ show global variables like 'use_global_long_query_time';
#-- echo # Make insert(5) on master
connection master;
-let $MASTER_DATADIR= `select @@datadir`;
INSERT INTO t VALUES (5);
--- echo # Read information about master binlog
-let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
-let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-
--- echo # Sync slave(5) thread
+sync_slave_with_master;
connection slave;
-let $SLAVE_DATADIR= `select @@datadir`;
-let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
show variables like 'long_query_time';
show global variables like 'long_query_time';
show global variables like 'use_global_long_query_time';
@@ -107,7 +78,7 @@ set global use_global_long_query_time=0;
-- echo # Analyse master slow_query_log
let $i=5;
let $k=1;
-let $cmd=cat ./$MASTER_DATADIR/percona_log_slow_slave_statements-master.log | grep;
+let $cmd=cat ./var/mysqld.1/data/percona_log_slow_slave_statements-master.log | grep;
while($i)
{
let $current_cmd = $cmd "INSERT INTO t VALUES ($k)" | wc -l;
@@ -119,7 +90,7 @@ while($i)
-- echo # Analyse slave slow_query_log
let $i=5;
let $k=1;
-let $cmd=cat $SLAVE_DATADIR/percona_log_slow_slave_statements-slave.log | grep;
+let $cmd=cat ./var/mysqld.2/data/percona_log_slow_slave_statements-slave.log | grep;
while($i)
{
let $current_cmd = $cmd "INSERT INTO t VALUES ($k)" | wc -l;
@@ -132,10 +103,5 @@ set global log_slow_slave_statements=OFF;
connection master;
DROP TABLE t;
--- echo # Read information about master binlog
-let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
-let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-
--- echo # Sync slave(6) thread
+sync_slave_with_master;
connection slave;
-let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
diff --git a/mysql-test/suite/percona/percona_log_slow_slave_statements-master.opt b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements-master.opt
index dd94fd90a57..dd94fd90a57 100644
--- a/mysql-test/suite/percona/percona_log_slow_slave_statements-master.opt
+++ b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements-master.opt
diff --git a/mysql-test/suite/percona/percona_log_slow_slave_statements-slave.opt b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements-slave.opt
index e276b0bcfc8..e276b0bcfc8 100644
--- a/mysql-test/suite/percona/percona_log_slow_slave_statements-slave.opt
+++ b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements-slave.opt
diff --git a/mysql-test/suite/percona/percona_log_slow_slave_statements.result b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements.result
index e3bf3e92c94..e3bf3e92c94 100644
--- a/mysql-test/suite/percona/percona_log_slow_slave_statements.result
+++ b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements.result
diff --git a/mysql-test/suite/percona/percona_log_slow_slave_statements.test b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements.test
index 8c9c594e41c..bb6e1c5f28a 100644
--- a/mysql-test/suite/percona/percona_log_slow_slave_statements.test
+++ b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-slave_statements.test
@@ -1,5 +1,4 @@
--- source include/not_windows.inc
-
+-- source include/have_binlog_format_mixed_or_statement.inc
-- echo # Activate master-slave replication
-- source include/master-slave.inc
@@ -114,7 +113,6 @@ START SLAVE;
#-- echo # Make insert(7) on master
connection master;
-let $MASTER_DATADIR= `select @@datadir`;
INSERT INTO t VALUES (7);
-- echo # Read information about master binlog
let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1);
@@ -122,16 +120,15 @@ let $binlog_position = query_get_value(SHOW MASTER STATUS,Position,1);
-- echo # Sync slave(7) thread
connection slave;
-let $SLAVE_DATADIR= `select @@datadir`;
let $sync_result = `SELECT MASTER_POS_WAIT('$binlog_file',$binlog_position)`;
-- echo # Analyse master slow_query_log
let $i=7;
let $k=1;
-let $cmd=cat $MASTER_DATADIR/percona_log_slow_slave_statements-master.log | grep -c;
+let $cmd=cat ./var/mysqld.1/data/percona_log_slow_slave_statements-master.log | grep;
while($i)
{
- let $current_cmd = $cmd "INSERT INTO t VALUES ($k)";
+ let $current_cmd = $cmd "INSERT INTO t VALUES ($k)" | wc -l;
exec $current_cmd;
dec $i;
inc $k;
@@ -140,10 +137,10 @@ while($i)
-- echo # Analyse slave slow_query_log
let $i=7;
let $k=1;
-let $cmd=cat $SLAVE_DATADIR/percona_log_slow_slave_statements-slave.log | grep -c;
+let $cmd=cat ./var/mysqld.2/data/percona_log_slow_slave_statements-slave.log | grep;
while($i)
{
- let $current_cmd = $cmd "INSERT INTO t VALUES ($k)";
+ let $current_cmd = $cmd "INSERT INTO t VALUES ($k)" | wc -l;
exec $current_cmd;
dec $i;
inc $k;
diff --git a/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-use_global_long_query_time-master.opt b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-use_global_long_query_time-master.opt
new file mode 100644
index 00000000000..f2dbf2253f4
--- /dev/null
+++ b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-use_global_long_query_time-master.opt
@@ -0,0 +1 @@
+--slow-query-log-file=percona_slow_query_log-use_global_long_query_time.log --long-query-time=2 --use_global_log_slow_control=long_query_time --use_global_long_query_time=1 \ No newline at end of file
diff --git a/mysql-test/suite/percona/percona_slow_query_log-use_global_long_query_time.result b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-use_global_long_query_time.result
index e294525fdd2..e04762db9d1 100644
--- a/mysql-test/suite/percona/percona_slow_query_log-use_global_long_query_time.result
+++ b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-use_global_long_query_time.result
@@ -20,7 +20,7 @@ sleep(5)
0
set global long_query_time=2;
set global use_global_long_query_time=0;
-cat MYSQLD_DATADIR/percona_slow_query_log-use_global_long_query_time.log | grep -c Query_time
+cat var/mysqld.1/data/percona_slow_query_log-use_global_long_query_time.log | grep Query_time | wc -l
3
show global variables like 'use_global_log_slow_control';
Variable_name Value
@@ -56,4 +56,4 @@ use_global_log_slow_control log_slow_filter
show global variables like 'use_global_long_query_time';
Variable_name Value
use_global_long_query_time OFF
-set global use_global_log_slow_control = none;
+set global use_global_log_slow_control = long_query_time;
diff --git a/mysql-test/suite/percona/percona_slow_query_log-use_global_long_query_time.test b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-use_global_long_query_time.test
index da627ae72b0..3582b13a3e9 100644
--- a/mysql-test/suite/percona/percona_slow_query_log-use_global_long_query_time.test
+++ b/mysql-test/suite/percona/slow_extended.patch/percona_slow_extended-use_global_long_query_time.test
@@ -1,4 +1,3 @@
-source include/not_windows.inc;
source include/have_innodb.inc;
SELECT sleep(1);
@@ -15,10 +14,8 @@ SELECT sleep(5);
set global long_query_time=2;
set global use_global_long_query_time=0;
-let $MYSQLD_DATADIR= `select @@datadir`;
-let $cmd = cat $MYSQLD_DATADIR/percona_slow_query_log-use_global_long_query_time.log | grep -c Query_time;
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-exec echo '$cmd';
+let $cmd = cat var/mysqld.1/data/percona_slow_query_log-use_global_long_query_time.log | grep Query_time | wc -l;
+echo $cmd;
exec $cmd;
show global variables like 'use_global_log_slow_control';
@@ -40,4 +37,4 @@ set global use_global_long_query_time = OFF;
show global variables like 'use_global_log_slow_control';
show global variables like 'use_global_long_query_time';
-set global use_global_log_slow_control = none;
+set global use_global_log_slow_control = long_query_time;
diff --git a/mysql-test/suite/percona/slow_extended.patch/show_slave_status_nolock.patch/percona_show_slave_status_nolock.result b/mysql-test/suite/percona/slow_extended.patch/show_slave_status_nolock.patch/percona_show_slave_status_nolock.result
new file mode 100644
index 00000000000..aa1717f9a18
--- /dev/null
+++ b/mysql-test/suite/percona/slow_extended.patch/show_slave_status_nolock.patch/percona_show_slave_status_nolock.result
@@ -0,0 +1,23 @@
+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;
+DROP TABLE IF EXISTS t;
+CREATE TABLE t(id INT);
+INSERT INTO t SELECT SLEEP(5);
+STOP SLAVE;
+select count(*) from t;
+count(*)
+0
+SHOW SLAVE STATUS NOLOCK;
+Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error
+ host user port 1 master-bin.000001 276 slave-relay-bin.000003 422 master-bin.000001 No No 0 0 276 577 None 0 No NULL No 0 0
+select count(*) from t;
+count(*)
+0
+START SLAVE;
+Warnings:
+Note 1592 Statement may not be safe to log in statement format.
+DROP TABLE t;
diff --git a/mysql-test/suite/percona/slow_extended.patch/show_slave_status_nolock.patch/percona_show_slave_status_nolock.test b/mysql-test/suite/percona/slow_extended.patch/show_slave_status_nolock.patch/percona_show_slave_status_nolock.test
new file mode 100644
index 00000000000..03531db3b12
--- /dev/null
+++ b/mysql-test/suite/percona/slow_extended.patch/show_slave_status_nolock.patch/percona_show_slave_status_nolock.test
@@ -0,0 +1,28 @@
+--source include/master-slave.inc
+
+connection master;
+-- disable_warnings
+DROP TABLE IF EXISTS t;
+-- enable_warnings
+CREATE TABLE t(id INT);
+sync_slave_with_master;
+connection master;
+send INSERT INTO t SELECT SLEEP(5);
+sleep 1;
+connection slave;
+send STOP SLAVE;
+connection slave1;
+select count(*) from t;
+replace_column 2 host 3 user 4 port;
+SHOW SLAVE STATUS NOLOCK;
+select count(*) from t;
+
+connection slave;
+reap;
+--source include/wait_for_slave_to_stop.inc
+START SLAVE;
+--source include/wait_for_slave_to_start.inc
+connection master;
+reap;
+DROP TABLE t;
+sync_slave_with_master;
diff --git a/mysql-test/suite/rpl/r/rpl_alter.result b/mysql-test/suite/rpl/r/rpl_alter.result
index 6ef5ce3462a..cedb6854239 100644
--- a/mysql-test/suite/rpl/r/rpl_alter.result
+++ b/mysql-test/suite/rpl/r/rpl_alter.result
@@ -19,3 +19,23 @@ select * from mysqltest.t3;
n
45
drop database mysqltest;
+
+# BUG#56226 Table map set to 0 after altering MyISAM table
+
+SET SESSION binlog_format='ROW';
+USE test;
+CREATE TABLE t1 (a INT, b INT) ENGINE MyISAM;
+CREATE TABLE t2 (a VARCHAR(255), b VARCHAR(255)) ENGINE MyISAM;
+CREATE TRIGGER trg_t1ai
+AFTER INSERT ON t1 FOR EACH ROW
+BEGIN
+INSERT INTO t2 (a) VALUES (NEW.a);
+END;//
+ALTER TABLE t1 CHANGE b c INT;
+ALTER TABLE t2 CHANGE b c VARCHAR(255);
+
+INSERT INTO t1 (a) VALUES(2);
+Comparing tables master:test.t1 and slave:test.t1
+Comparing tables master:test.t2 and slave:test.t2
+
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/rpl/r/rpl_auto_increment.result b/mysql-test/suite/rpl/r/rpl_auto_increment.result
index 831e9b5c8b5..9fcd9bbd54c 100644
--- a/mysql-test/suite/rpl/r/rpl_auto_increment.result
+++ b/mysql-test/suite/rpl/r/rpl_auto_increment.result
@@ -312,3 +312,32 @@ Comparing tables master:test.t2 and slave:test.t2
DROP TABLE t1;
DROP TABLE t2;
SET SQL_MODE='';
+CREATE TABLE t1(s VARCHAR(10)) ENGINE=myisam;
+CREATE TABLE t_ignored1(id INT AUTO_INCREMENT PRIMARY KEY) ENGINE=myisam;
+CREATE TABLE test.slave_only(id INT AUTO_INCREMENT PRIMARY KEY) ENGINE=myisam;
+INSERT INTO slave_only VALUES(NULL);
+CREATE TRIGGER t1_update AFTER UPDATE ON t1 FOR EACH ROW INSERT INTO slave_only VALUES(NULL);
+INSERT INTO t_ignored1 VALUES(NULL);
+INSERT INTO t1 VALUES('s');
+UPDATE t1 SET s='s1';
+SELECT * FROM t1;
+s
+s1
+CREATE TABLE t_ignored2(id INT AUTO_INCREMENT PRIMARY KEY) ENGINE=myisam;
+STOP SLAVE;
+SET GLOBAL sql_slave_skip_counter = 2;
+START SLAVE;
+INSERT INTO t_ignored2 VALUES(NULL);
+UPDATE t1 SET s='s2';
+SELECT * FROM t1;
+s
+s2
+SHOW TABLES LIKE 't\_ignored_';
+Tables_in_test (t\_ignored_)
+t_ignored2
+SELECT * FROM t_ignored2;
+id
+DROP TABLE slave_only;
+DROP TABLE t1;
+DROP TABLE t_ignored1;
+DROP TABLE t_ignored2;
diff --git a/mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result b/mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result
index 3bf33044d75..f826136e81e 100644
--- a/mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result
+++ b/mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result
@@ -139,14 +139,14 @@ show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; INSERT INTO db1.t1 VALUES(20)
-master-bin.000001 # Query # # SAVEPOINT has_comment
+master-bin.000001 # Query # # SAVEPOINT `has_comment`
master-bin.000001 # Query # # use `db1`; INSERT INTO db1.t1 VALUES(30)
master-bin.000001 # Query # # use `db1`; INSERT INTO db1.t2 VALUES("in savepoint has_comment")
-master-bin.000001 # Query # # SAVEPOINT mixed_cases
+master-bin.000001 # Query # # SAVEPOINT `mixed_cases`
master-bin.000001 # Query # # use `db1`; INSERT INTO db1.t2 VALUES("in savepoint mixed_cases")
master-bin.000001 # Query # # use `db1`; INSERT INTO db1.t1 VALUES(40)
-master-bin.000001 # Query # # ROLLBACK TO mixed_cases
-master-bin.000001 # Query # # ROLLBACK TO has_comment
+master-bin.000001 # Query # # ROLLBACK TO `mixed_cases`
+master-bin.000001 # Query # # ROLLBACK TO `has_comment`
master-bin.000001 # Query # # use `db1`; INSERT INTO db1.t2 VALUES("after rollback to")
master-bin.000001 # Query # # use `db1`; INSERT INTO db1.t1 VALUES(50)
master-bin.000001 # Xid # # COMMIT /* XID */
diff --git a/mysql-test/suite/rpl/r/rpl_binlog_max_cache_size.result b/mysql-test/suite/rpl/r/rpl_binlog_max_cache_size.result
index 0e3f83d0aa5..f9e492db6bc 100644
--- a/mysql-test/suite/rpl/r/rpl_binlog_max_cache_size.result
+++ b/mysql-test/suite/rpl/r/rpl_binlog_max_cache_size.result
@@ -4,6 +4,8 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
+SET GLOBAL max_binlog_cache_size = 4096;
+SET GLOBAL binlog_cache_size = 4096;
CREATE TABLE t1(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb;
CREATE TABLE t2(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=MyIsam;
CREATE TABLE t3(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb;
@@ -15,11 +17,14 @@ Got one of the listed errors
*** Single statement on non-transactional table ***
*** After WL#2687 the difference between STATEMENT/MIXED and ROW will not exist. ***
Got one of the listed errors
+--source include/wait_for_slave_sql_error_and_skip.inc
+include/start_slave.inc
*** Single statement on both transactional and non-transactional tables. ***
*** After WL#2687 we will be able to change the order of the tables. ***
Got one of the listed errors
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
-START SLAVE SQL_THREAD;
+--source include/wait_for_slave_sql_error_and_skip.inc
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
+include/start_slave.inc
TRUNCATE TABLE t1;
TRUNCATE TABLE t2;
TRUNCATE TABLE t3;
@@ -116,6 +121,37 @@ COMMIT;
BEGIN;
Got one of the listed errors
COMMIT;
+--source include/wait_for_slave_sql_error_and_skip.inc
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
+include/start_slave.inc
+########################################################################
+# 8 - Bug#55375(Regression Bug) Transaction bigger than
+# max_binlog_cache_size crashes slave
+########################################################################
+SET GLOBAL max_binlog_cache_size = 4096;
+SET GLOBAL binlog_cache_size = 4096;
+include/stop_slave.inc
+include/start_slave.inc
+CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage.*");
+CALL mtr.add_suppression("Writing one row to the row-based binary log failed.*");
+TRUNCATE t1;
+SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE;
+SET GLOBAL binlog_cache_size= ORIGINAL_VALUE;
+BEGIN;
+Repeat statement 'INSERT INTO t1 VALUES($n, repeat("a", 32))' 128 times
+COMMIT;
+SELECT count(*) FROM t1;
+count(*)
+0
+show binlog events in 'slave-bin.000001' from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE;
+SET GLOBAL binlog_cache_size= ORIGINAL_VALUE;
+include/stop_slave.inc
+include/start_slave.inc
+SELECT count(*) FROM t1;
+count(*)
+128
########################################################################################
# CLEAN
########################################################################################
@@ -126,10 +162,3 @@ DROP TABLE IF EXISTS t4;
DROP TABLE IF EXISTS t5;
DROP TABLE IF EXISTS t6;
DROP PROCEDURE p1;
-DROP TABLE t1;
-DROP TABLE t2;
-DROP TABLE t3;
-DROP TABLE IF EXISTS t4;
-DROP TABLE IF EXISTS t5;
-DROP TABLE IF EXISTS t6;
-DROP PROCEDURE p1;
diff --git a/mysql-test/suite/rpl/r/rpl_do_grant.result b/mysql-test/suite/rpl/r/rpl_do_grant.result
index 45c5bcf7ba0..74f61125735 100644
--- a/mysql-test/suite/rpl/r/rpl_do_grant.result
+++ b/mysql-test/suite/rpl/r/rpl_do_grant.result
@@ -261,4 +261,27 @@ Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; grant all on *.* to foo@"1.2.3.4"
master-bin.000001 # Query # # use `test`; revoke all privileges, grant option from "foo"
DROP USER foo@"1.2.3.4";
+
+# Bug#27606 GRANT statement should be replicated with DEFINER information
+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;
+GRANT SELECT, INSERT ON mysql.user TO user_bug27606@localhost;
+SELECT Grantor FROM mysql.tables_priv WHERE User='user_bug27606';
+Grantor
+root@localhost
+SELECT Grantor FROM mysql.tables_priv WHERE User='user_bug27606';
+Grantor
+root@localhost
+REVOKE SELECT ON mysql.user FROM user_bug27606@localhost;
+SELECT Grantor FROM mysql.tables_priv WHERE User='user_bug27606';
+Grantor
+root@localhost
+SELECT Grantor FROM mysql.tables_priv WHERE User='user_bug27606';
+Grantor
+root@localhost
+DROP USER user_bug27606@localhost;
"End of test"
diff --git a/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result b/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result
index 7fc940f25e0..d076a24e1f0 100644
--- a/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result
+++ b/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result
@@ -997,7 +997,7 @@ master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES (3, 'before
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES (5, 'before savepoint s2')
-master-bin.000001 # Query # # SAVEPOINT s2
+master-bin.000001 # Query # # SAVEPOINT `s2`
master-bin.000001 # Query # # use `test_rpl`; INSERT INTO t1 VALUES (6, 'after savepoint s2')
master-bin.000001 # Table_map # # table_id: # (test_rpl.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
diff --git a/mysql-test/suite/rpl/r/rpl_stop_slave.result b/mysql-test/suite/rpl/r/rpl_stop_slave.result
new file mode 100644
index 00000000000..4e16e8264f6
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_stop_slave.result
@@ -0,0 +1,131 @@
+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;
+
+# BUG#56118 STOP SLAVE does not wait till trx with CREATE TMP TABLE ends
+#
+# If a temporary table is created or dropped, the transaction should be
+# regarded similarly that a non-transactional table is modified. So
+# STOP SLAVE should wait until the transaction has finished.
+CREATE TABLE t1(c1 INT) ENGINE=InnoDB;
+CREATE TABLE t2(c1 INT) ENGINE=InnoDB;
+SET DEBUG_SYNC= 'RESET';
+include/stop_slave.inc
+
+# Suspend the INSERT statement in current transaction on SQL thread.
+# It guarantees that SQL thread is applying the transaction when
+# STOP SLAVE command launchs.
+SET GLOBAL debug= 'd,after_mysql_insert';
+include/start_slave.inc
+
+# CREATE TEMPORARY TABLE with InnoDB engine
+# -----------------------------------------
+
+[ On Master ]
+BEGIN;
+DELETE FROM t1;
+CREATE TEMPORARY TABLE tt1(c1 INT) ENGINE = InnoDB;
+INSERT INTO t1 VALUES (1);
+DROP TEMPORARY TABLE tt1;
+COMMIT;
+
+[ On Slave ]
+STOP SLAVE SQL_THREAD;
+
+[ On Slave1 ]
+# To resume slave SQL thread
+SET DEBUG_SYNC= 'now SIGNAL signal.continue';
+SET DEBUG_SYNC= 'now WAIT_FOR signal.continued';
+SET DEBUG_SYNC= 'RESET';
+
+[ On Slave ]
+# Slave should stop after the transaction has committed.
+# So t1 on master is same to t1 on slave.
+Comparing tables master:test.t1 and slave:test.t1
+START SLAVE SQL_THREAD;
+
+# CREATE TEMPORARY TABLE with MyISAM engine
+# -----------------------------------------
+
+[ On Master ]
+BEGIN;
+DELETE FROM t1;
+CREATE TEMPORARY TABLE tt1(c1 INT) ENGINE = MyISAM;
+INSERT INTO t1 VALUES (1);
+DROP TEMPORARY TABLE tt1;
+COMMIT;
+
+[ On Slave ]
+STOP SLAVE SQL_THREAD;
+
+[ On Slave1 ]
+# To resume slave SQL thread
+SET DEBUG_SYNC= 'now SIGNAL signal.continue';
+SET DEBUG_SYNC= 'now WAIT_FOR signal.continued';
+SET DEBUG_SYNC= 'RESET';
+
+[ On Slave ]
+# Slave should stop after the transaction has committed.
+# So t1 on master is same to t1 on slave.
+Comparing tables master:test.t1 and slave:test.t1
+START SLAVE SQL_THREAD;
+
+# CREATE TEMPORARY TABLE ... SELECT with InnoDB engine
+# ----------------------------------------------------
+
+[ On Master ]
+BEGIN;
+DELETE FROM t1;
+CREATE TEMPORARY TABLE tt1(c1 INT) ENGINE = InnoDB
+SELECT c1 FROM t2;
+INSERT INTO t1 VALUES (1);
+DROP TEMPORARY TABLE tt1;
+COMMIT;
+
+[ On Slave ]
+STOP SLAVE SQL_THREAD;
+
+[ On Slave1 ]
+# To resume slave SQL thread
+SET DEBUG_SYNC= 'now SIGNAL signal.continue';
+SET DEBUG_SYNC= 'now WAIT_FOR signal.continued';
+SET DEBUG_SYNC= 'RESET';
+
+[ On Slave ]
+# Slave should stop after the transaction has committed.
+# So t1 on master is same to t1 on slave.
+Comparing tables master:test.t1 and slave:test.t1
+START SLAVE SQL_THREAD;
+
+# CREATE TEMPORARY TABLE ... SELECT with MyISAM engine
+# ----------------------------------------------------
+
+[ On Master ]
+BEGIN;
+DELETE FROM t1;
+CREATE TEMPORARY TABLE tt1(c1 INT) ENGINE = MyISAM
+SELECT 1 AS c1;
+INSERT INTO t1 VALUES (1);
+DROP TEMPORARY TABLE tt1;
+COMMIT;
+
+[ On Slave ]
+STOP SLAVE SQL_THREAD;
+
+[ On Slave1 ]
+# To resume slave SQL thread
+SET DEBUG_SYNC= 'now SIGNAL signal.continue';
+SET DEBUG_SYNC= 'now WAIT_FOR signal.continued';
+SET DEBUG_SYNC= 'RESET';
+
+[ On Slave ]
+# Slave should stop after the transaction has committed.
+# So t1 on master is same to t1 on slave.
+Comparing tables master:test.t1 and slave:test.t1
+START SLAVE SQL_THREAD;
+# Test end
+SET GLOBAL debug= '$debug_save';
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result b/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result
index 3a31a206b1e..32c6748f5cb 100644
--- a/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result
+++ b/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result
@@ -69,3 +69,47 @@ slave-bin.000001 # Query # # COMMIT
slave-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `t2_tmp` /* generated by server */
slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (2)
slave-bin.000001 # Query # # use `test`; DROP TABLE t3, t1
+
+# Bug#55478 Row events wrongly apply on the temporary table of the same name
+# ==========================================================================
+# The statement should be binlogged
+CREATE TEMPORARY TABLE t1(c1 INT) ENGINE=InnoDB;
+
+# Case 1: CREATE TABLE t1 ... SELECT
+# ----------------------------------
+
+# The statement generates row events on t1. And the rows events should
+# be inserted into the base table on slave.
+CREATE TABLE t1 ENGINE=MyISAM SELECT rand();
+show binlog events in 'master-bin.000001' from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test`; CREATE TABLE `t1` (
+ `rand()` double NOT NULL DEFAULT '0'
+) 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 # Query # # COMMIT
+
+# Case 2: DROP TEMPORARY TABLE in a transacation(happens only on 5.5+)
+# --------------------------------------------------------------------
+
+BEGIN;
+DROP TEMPORARY TABLE t1;
+# The statement will binlogged after 'DROP TEMPORARY TABLE t1'
+INSERT INTO t1 VALUES(1);
+# The rows event will binlogged after 'INSERT INTO t1 VALUES(1)'
+INSERT INTO t1 VALUES(uuid()+0);
+COMMIT;
+show binlog events in 'master-bin.000001' from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `t1` /* generated by server */
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES(1)
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+# Compare the base table.
+Comparing tables master:test.t1 and slave:test.t1
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/rpl/t/disabled.def b/mysql-test/suite/rpl/t/disabled.def
index 5b150288935..ef77c54e067 100644
--- a/mysql-test/suite/rpl/t/disabled.def
+++ b/mysql-test/suite/rpl/t/disabled.def
@@ -11,4 +11,3 @@
##############################################################################
rpl_row_create_table : Bug#51574 Feb 27 2010 andrei failed different way than earlier with bug#45576
-rpl_log_pos : BUG#55675 Sep 10 2010 27 2010 alfranio rpl.rpl_log_pos fails sporadically with error binlog truncated in the middle
diff --git a/mysql-test/suite/rpl/t/rpl_alter.test b/mysql-test/suite/rpl/t/rpl_alter.test
index 576376a0264..bc42476244a 100644
--- a/mysql-test/suite/rpl/t/rpl_alter.test
+++ b/mysql-test/suite/rpl/t/rpl_alter.test
@@ -10,15 +10,62 @@ insert into mysqltest.t1 values (1,2);
create table mysqltest.t2 (n int);
insert into mysqltest.t2 values (45);
rename table mysqltest.t2 to mysqltest.t3, mysqltest.t1 to mysqltest.t2;
-save_master_pos;
-connection slave;
-sync_with_master;
+
+sync_slave_with_master;
select * from mysqltest.t2;
select * from mysqltest.t3;
+
connection master;
drop database mysqltest;
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
+
+--echo
+--echo # BUG#56226 Table map set to 0 after altering MyISAM table
+--echo
+connection master;
+SET SESSION binlog_format='ROW';
+USE test;
+
+CREATE TABLE t1 (a INT, b INT) ENGINE MyISAM;
+CREATE TABLE t2 (a VARCHAR(255), b VARCHAR(255)) ENGINE MyISAM;
+
+--delimiter //
+CREATE TRIGGER trg_t1ai
+ AFTER INSERT ON t1 FOR EACH ROW
+BEGIN
+ INSERT INTO t2 (a) VALUES (NEW.a);
+END;//
+--delimiter ;
+
+ALTER TABLE t1 CHANGE b c INT;
+ALTER TABLE t2 CHANGE b c VARCHAR(255);
+let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
+let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+
+--echo
+INSERT INTO t1 (a) VALUES(2);
+let _info= query_get_value(SHOW BINLOG EVENTS IN '$binlog_file' FROM $binlog_start, Info, 2);
+# Table map id should not be 0.
+if (`SELECT 'table_id: 0 (test.t1)' = '$_info'`)
+{
+ --echo test.t1's table map id is 0;
+ --die test.t1's table map id is 0;
+}
+let _info= query_get_value(SHOW BINLOG EVENTS IN '$binlog_file' FROM $binlog_start, Info, 3);
+if (`SELECT 'table_id: 0 (test.t2)' = '$_info'`)
+{
+ --echo test.t2's table map id is 0;
+ --die test.t2's table map id is 0;
+}
+
+let diff_table= test.t1;
+source include/rpl_diff_tables.inc;
+let diff_table= test.t2;
+source include/rpl_diff_tables.inc;
+
+--echo
+connection master;
+DROP TABLE t1, t2;
+source include/master-slave-end.inc;
# End of 4.1 tests
diff --git a/mysql-test/suite/rpl/t/rpl_auto_increment-slave.opt b/mysql-test/suite/rpl/t/rpl_auto_increment-slave.opt
new file mode 100644
index 00000000000..79ed6f96a4a
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_auto_increment-slave.opt
@@ -0,0 +1 @@
+--replicate-ignore-table=test.t_ignored1
diff --git a/mysql-test/suite/rpl/t/rpl_binlog_max_cache_size-master.opt b/mysql-test/suite/rpl/t/rpl_binlog_max_cache_size-master.opt
deleted file mode 100644
index 45631525481..00000000000
--- a/mysql-test/suite/rpl/t/rpl_binlog_max_cache_size-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---binlog_cache_size=4096 --max_binlog_cache_size=7680
diff --git a/mysql-test/suite/rpl/t/rpl_binlog_max_cache_size.test b/mysql-test/suite/rpl/t/rpl_binlog_max_cache_size.test
index e1f1f8c54bb..9dca61d8f75 100644
--- a/mysql-test/suite/rpl/t/rpl_binlog_max_cache_size.test
+++ b/mysql-test/suite/rpl/t/rpl_binlog_max_cache_size.test
@@ -30,6 +30,16 @@
--source include/not_embedded.inc
--source include/not_windows.inc
+let $old_max_binlog_cache_size= query_get_value(SHOW VARIABLES LIKE "max_binlog_cache_size", Value, 1);
+let $old_binlog_cache_size= query_get_value(SHOW VARIABLES LIKE "binlog_cache_size", Value, 1);
+
+SET GLOBAL max_binlog_cache_size = 4096;
+# Becuase of bug#55377, we have to set binlog_cache_size until the bug is
+# fixed.
+SET GLOBAL binlog_cache_size = 4096;
+disconnect master;
+connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
+
CREATE TABLE t1(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb;
CREATE TABLE t2(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=MyIsam;
CREATE TABLE t3(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb;
@@ -57,25 +67,23 @@ if (`SELECT @@binlog_format = 'STATEMENT' || @@binlog_format = 'MIXED'`)
{
eval INSERT INTO t2 (a, data) VALUES (2,
CONCAT($data, $data, $data, $data, $data, $data));
+ # Below code fakes the result of 'ROW' mode.
--echo Got one of the listed errors
+ --echo --source include/wait_for_slave_sql_error_and_skip.inc
+ --echo include/start_slave.inc
}
if (`SELECT @@binlog_format = 'ROW'`)
{
--error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
eval INSERT INTO t2 (a, data) VALUES (2,
CONCAT($data, $data, $data, $data, $data, $data));
-
- connection slave;
- --source include/wait_for_slave_sql_to_stop.inc
- SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
- START SLAVE SQL_THREAD;
- --source include/wait_for_slave_sql_to_start.inc
+ # Incident event
+ --let $slave_sql_errno=1590
+ --source include/wait_for_slave_sql_error_and_skip.inc
}
--enable_warnings
--enable_query_log
-connection master;
-
--disable_query_log
eval INSERT INTO t1 (a, data) VALUES (3, $data);
eval INSERT INTO t1 (a, data) VALUES (4, $data);
@@ -93,11 +101,9 @@ eval UPDATE t2, t1 SET t2.data = CONCAT($data, $data, $data, $data),
t1.data = CONCAT($data, $data, $data, $data);
--enable_query_log
-connection slave;
---source include/wait_for_slave_sql_to_stop.inc
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
-START SLAVE SQL_THREAD;
---source include/wait_for_slave_sql_to_start.inc
+# Incident event
+--let $slave_sql_errno=1590
+--source include/wait_for_slave_sql_error_and_skip.inc
#--echo ########################################################################################
#--echo # 2 - BEGIN - IMPLICIT COMMIT by DDL
@@ -368,8 +374,70 @@ BEGIN;
--enable_query_log
COMMIT;
+# Incident event
+--let $slave_sql_errno=1590
+--source include/wait_for_slave_sql_error_and_skip.inc
+
+sync_slave_with_master;
+
+--echo ########################################################################
+--echo # 8 - Bug#55375(Regression Bug) Transaction bigger than
+--echo # max_binlog_cache_size crashes slave
+--echo ########################################################################
+
+SET GLOBAL max_binlog_cache_size = 4096;
+SET GLOBAL binlog_cache_size = 4096;
+
+source include/stop_slave.inc;
+source include/start_slave.inc;
+CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage.*");
+CALL mtr.add_suppression("Writing one row to the row-based binary log failed.*");
+
+connection master;
+TRUNCATE t1;
+
+sync_slave_with_master;
+--let binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1)
+--let binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
+
+connection master;
+--replace_result $old_max_binlog_cache_size ORIGINAL_VALUE
+--eval SET GLOBAL max_binlog_cache_size= $old_max_binlog_cache_size
+--replace_result $old_binlog_cache_size ORIGINAL_VALUE
+--eval SET GLOBAL binlog_cache_size= $old_binlog_cache_size
+disconnect master;
+connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
+
+--let $n=128
+BEGIN;
+--disable_query_log
+--echo Repeat statement 'INSERT INTO t1 VALUES(\$n, repeat("a", 32))' $n times
+while ($n)
+{
+ --eval INSERT INTO t1 VALUES ($n, repeat("a", 32))
+ --dec $n
+}
+--enable_query_log
+COMMIT;
+
connection slave;
---source include/wait_for_slave_sql_to_stop.inc
+--let $slave_sql_errno= 1197
+source include/wait_for_slave_sql_error.inc;
+
+SELECT count(*) FROM t1;
+source include/show_binlog_events.inc;
+
+--replace_result $old_max_binlog_cache_size ORIGINAL_VALUE
+--eval SET GLOBAL max_binlog_cache_size= $old_max_binlog_cache_size
+--replace_result $old_binlog_cache_size ORIGINAL_VALUE
+--eval SET GLOBAL binlog_cache_size= $old_binlog_cache_size
+
+source include/stop_slave.inc;
+source include/start_slave.inc;
+
+connection master;
+sync_slave_with_master;
+SELECT count(*) FROM t1;
--echo ########################################################################################
--echo # CLEAN
@@ -384,12 +452,5 @@ DROP TABLE IF EXISTS t4;
DROP TABLE IF EXISTS t5;
DROP TABLE IF EXISTS t6;
DROP PROCEDURE p1;
-connection slave;
-DROP TABLE t1;
-DROP TABLE t2;
-DROP TABLE t3;
-DROP TABLE IF EXISTS t4;
-DROP TABLE IF EXISTS t5;
-DROP TABLE IF EXISTS t6;
-DROP PROCEDURE p1;
--enable_warnings
+source include/master-slave-end.inc;
diff --git a/mysql-test/suite/rpl/t/rpl_deadlock_innodb.test b/mysql-test/suite/rpl/t/rpl_deadlock_innodb.test
index ee907f81b22..169ccbf7f18 100644
--- a/mysql-test/suite/rpl/t/rpl_deadlock_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_deadlock_innodb.test
@@ -7,5 +7,6 @@
########################################################
-- source include/not_ndb_default.inc
-- source include/have_innodb.inc
+-- source include/long_test.inc
let $engine_type=innodb;
-- source extra/rpl_tests/rpl_deadlock.test
diff --git a/mysql-test/suite/rpl/t/rpl_do_grant.test b/mysql-test/suite/rpl/t/rpl_do_grant.test
index 457095f8fa6..bbc78bfbe9a 100644
--- a/mysql-test/suite/rpl/t/rpl_do_grant.test
+++ b/mysql-test/suite/rpl/t/rpl_do_grant.test
@@ -362,4 +362,25 @@ revoke all privileges, grant option from "foo";
DROP USER foo@"1.2.3.4";
-- sync_slave_with_master
+--echo
+--echo # Bug#27606 GRANT statement should be replicated with DEFINER information
+--connection master
+--source include/master-slave-reset.inc
+--connection master
+GRANT SELECT, INSERT ON mysql.user TO user_bug27606@localhost;
+
+SELECT Grantor FROM mysql.tables_priv WHERE User='user_bug27606';
+sync_slave_with_master;
+SELECT Grantor FROM mysql.tables_priv WHERE User='user_bug27606';
+
+--connection master
+REVOKE SELECT ON mysql.user FROM user_bug27606@localhost;
+SELECT Grantor FROM mysql.tables_priv WHERE User='user_bug27606';
+sync_slave_with_master;
+SELECT Grantor FROM mysql.tables_priv WHERE User='user_bug27606';
+
+--connection master
+DROP USER user_bug27606@localhost;
+
+--source include/master-slave-end.inc
--echo "End of test"
diff --git a/mysql-test/suite/rpl/t/rpl_killed_ddl.test b/mysql-test/suite/rpl/t/rpl_killed_ddl.test
index acf592f84ee..21ac1af3f06 100644
--- a/mysql-test/suite/rpl/t/rpl_killed_ddl.test
+++ b/mysql-test/suite/rpl/t/rpl_killed_ddl.test
@@ -122,7 +122,7 @@ echo [on master];
# This will block the execution of a statement at the DBUG_SYNC_POINT
# with given lock name
-if (`SELECT '$debug_lock' != ''`)
+if ($debug_lock)
{
disable_query_log;
disable_result_log;
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp003.test b/mysql-test/suite/rpl/t/rpl_row_sp003.test
index ab49174ddfa..8ed47232ba9 100644
--- a/mysql-test/suite/rpl/t/rpl_row_sp003.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp003.test
@@ -10,6 +10,7 @@
-- source include/have_binlog_format_row.inc
# Slow test, don't run during staging part
-- source include/not_staging.inc
+--source include/long_test.inc
-- source include/master-slave.inc
let $engine_type=INNODB;
diff --git a/mysql-test/suite/rpl/t/rpl_row_tbl_metadata.test b/mysql-test/suite/rpl/t/rpl_row_tbl_metadata.test
index be5ebb661ca..d854aa64dc5 100644
--- a/mysql-test/suite/rpl/t/rpl_row_tbl_metadata.test
+++ b/mysql-test/suite/rpl/t/rpl_row_tbl_metadata.test
@@ -205,7 +205,7 @@ DROP TABLE `t1`;
-- echo === Using mysqlbinlog to detect failure. Before the patch mysqlbinlog would find a corrupted event, thence would fail.
--- let $MYSQLD_DATADIR= `SELECT @@datadir`;
+-- let $MYSQLD_DATADIR= `SELECT @@datadir`
-- exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug42749.binlog
-- remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug42749.binlog
@@ -330,7 +330,7 @@ while($ntables)
-- echo ### assertion: check that binlog is not corrupt. Using mysqlbinlog to
-- echo ### detect failure. Before the patch mysqlbinlog would find
-- echo ### a corrupted event, thence would fail.
--- let $MYSQLD_DATADIR= `SELECT @@datadir`;
+-- let $MYSQLD_DATADIR= `SELECT @@datadir`
-- exec $MYSQL_BINLOG -v --hex $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug50018.binlog
## clean up
diff --git a/mysql-test/suite/rpl/t/rpl_stop_slave.test b/mysql-test/suite/rpl/t/rpl_stop_slave.test
new file mode 100644
index 00000000000..e44cf3e94b7
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_stop_slave.test
@@ -0,0 +1,60 @@
+source include/master-slave.inc;
+source include/have_innodb.inc;
+source include/have_debug.inc;
+source include/have_debug_sync.inc;
+source include/have_binlog_format_mixed_or_statement.inc;
+
+--echo
+--echo # BUG#56118 STOP SLAVE does not wait till trx with CREATE TMP TABLE ends
+--echo #
+--echo # If a temporary table is created or dropped, the transaction should be
+--echo # regarded similarly that a non-transactional table is modified. So
+--echo # STOP SLAVE should wait until the transaction has finished.
+
+CREATE TABLE t1(c1 INT) ENGINE=InnoDB;
+CREATE TABLE t2(c1 INT) ENGINE=InnoDB;
+
+sync_slave_with_master;
+SET DEBUG_SYNC= 'RESET';
+source include/stop_slave.inc;
+
+--echo
+--echo # Suspend the INSERT statement in current transaction on SQL thread.
+--echo # It guarantees that SQL thread is applying the transaction when
+--echo # STOP SLAVE command launchs.
+let $debug_save= `SELECT @@GLOBAL.debug`;
+SET GLOBAL debug= 'd,after_mysql_insert';
+source include/start_slave.inc;
+
+--echo
+--echo # CREATE TEMPORARY TABLE with InnoDB engine
+--echo # -----------------------------------------
+let $tmp_table_stm= CREATE TEMPORARY TABLE tt1(c1 INT) ENGINE = InnoDB;
+source extra/rpl_tests/rpl_stop_slave.test;
+
+--echo
+--echo # CREATE TEMPORARY TABLE with MyISAM engine
+--echo # -----------------------------------------
+let $tmp_table_stm= CREATE TEMPORARY TABLE tt1(c1 INT) ENGINE = MyISAM;
+source extra/rpl_tests/rpl_stop_slave.test;
+
+--echo
+--echo # CREATE TEMPORARY TABLE ... SELECT with InnoDB engine
+--echo # ----------------------------------------------------
+let $tmp_table_stm= CREATE TEMPORARY TABLE tt1(c1 INT) ENGINE = InnoDB
+ SELECT c1 FROM t2;
+source extra/rpl_tests/rpl_stop_slave.test;
+
+--echo
+--echo # CREATE TEMPORARY TABLE ... SELECT with MyISAM engine
+--echo # ----------------------------------------------------
+let $tmp_table_stm= CREATE TEMPORARY TABLE tt1(c1 INT) ENGINE = MyISAM
+ SELECT 1 AS c1;
+source extra/rpl_tests/rpl_stop_slave.test;
+
+--echo # Test end
+SET GLOBAL debug= '$debug_save';
+
+connection master;
+DROP TABLE t1, t2;
+source include/master-slave-end.inc;
diff --git a/mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test b/mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test
index e19c3019aa1..82537a06e89 100644
--- a/mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test
+++ b/mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test
@@ -11,6 +11,7 @@
source include/master-slave.inc;
source include/have_binlog_format_mixed.inc;
+source include/have_innodb.inc;
--echo ==== Initialize ====
@@ -146,3 +147,55 @@ DROP TABLE t3, t1;
-- sync_slave_with_master
-- source include/show_binlog_events.inc
+
+--echo
+--echo # Bug#55478 Row events wrongly apply on the temporary table of the same name
+--echo # ==========================================================================
+connection master;
+
+let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
+let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+
+--echo # The statement should be binlogged
+CREATE TEMPORARY TABLE t1(c1 INT) ENGINE=InnoDB;
+
+--echo
+--echo # Case 1: CREATE TABLE t1 ... SELECT
+--echo # ----------------------------------
+let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
+let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+
+--echo
+--echo # The statement generates row events on t1. And the rows events should
+--echo # be inserted into the base table on slave.
+CREATE TABLE t1 ENGINE=MyISAM SELECT rand();
+
+source include/show_binlog_events.inc;
+let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
+let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+
+--echo
+--echo # Case 2: DROP TEMPORARY TABLE in a transacation(happens only on 5.5+)
+--echo # --------------------------------------------------------------------
+--echo
+
+BEGIN;
+DROP TEMPORARY TABLE t1;
+
+--echo # The statement will binlogged after 'DROP TEMPORARY TABLE t1'
+INSERT INTO t1 VALUES(1);
+
+--echo # The rows event will binlogged after 'INSERT INTO t1 VALUES(1)'
+INSERT INTO t1 VALUES(uuid()+0);
+COMMIT;
+
+source include/show_binlog_events.inc;
+
+--echo # Compare the base table.
+let diff_table= test.t1;
+source include/rpl_diff_tables.inc;
+
+--echo
+connection master;
+DROP TABLE t1;
+source include/master-slave-end.inc;
diff --git a/mysql-test/suite/sys_vars/t/secure_file_priv.test b/mysql-test/suite/sys_vars/t/secure_file_priv.test
index 7a534e7d6e4..3e2a4fa467a 100644
--- a/mysql-test/suite/sys_vars/t/secure_file_priv.test
+++ b/mysql-test/suite/sys_vars/t/secure_file_priv.test
@@ -9,7 +9,7 @@ SHOW VARIABLES LIKE 'secure_file_priv';
# Doing this in a portable manner is difficult but we should be able to
# count on the depth of the directory hierarchy used. Three steps up from
# the datadir is the 'mysql_test' directory.
---let $PROTECTED_FILE=`SELECT concat(@@datadir,'/../../../bug50373.txt')`;
+--let $PROTECTED_FILE=`SELECT concat(@@datadir,'/../../../bug50373.txt')`
--eval SELECT * FROM t1 INTO OUTFILE '$PROTECTED_FILE';
DELETE FROM t1;
--eval LOAD DATA INFILE '$PROTECTED_FILE' INTO TABLE t1;
diff --git a/mysql-test/suite/vcol/inc/vcol_unsupported_storage_engines.inc b/mysql-test/suite/vcol/inc/vcol_unsupported_storage_engines.inc
index 681ed77fb3c..4ec98ebf3f4 100644
--- a/mysql-test/suite/vcol/inc/vcol_unsupported_storage_engines.inc
+++ b/mysql-test/suite/vcol/inc/vcol_unsupported_storage_engines.inc
@@ -13,9 +13,9 @@
# Change: Syntax changed
################################################################################
---error ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN
+--error ER_UNSUPPORTED_ENGINE_FOR_VIRTUAL_COLUMNS
create table t1 (a int, b int as (a+1));
-create table t1 (a int);
---error ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN
+create table t1 (a int not null);
+--error ER_UNSUPPORTED_ENGINE_FOR_VIRTUAL_COLUMNS
alter table t1 add column b int as (a+1);
drop table t1;
diff --git a/mysql-test/suite/vcol/r/vcol_archive.result b/mysql-test/suite/vcol/r/vcol_archive.result
index 83fb78a5592..5ed2f3768ca 100644
--- a/mysql-test/suite/vcol/r/vcol_archive.result
+++ b/mysql-test/suite/vcol/r/vcol_archive.result
@@ -1,7 +1,7 @@
SET @@session.storage_engine = 'archive';
create table t1 (a int, b int as (a+1));
-ERROR HY000: 'Specified storage engine' is not yet supported for computed columns
-create table t1 (a int);
+ERROR HY000: ARCHIVE storage engine does not support computed columns
+create table t1 (a int not null);
alter table t1 add column b int as (a+1);
-ERROR HY000: 'Specified storage engine' is not yet supported for computed columns
+ERROR HY000: ARCHIVE storage engine does not support computed columns
drop table t1;
diff --git a/mysql-test/suite/vcol/r/vcol_blackhole.result b/mysql-test/suite/vcol/r/vcol_blackhole.result
index 15e7505aebb..2d33937a2f1 100644
--- a/mysql-test/suite/vcol/r/vcol_blackhole.result
+++ b/mysql-test/suite/vcol/r/vcol_blackhole.result
@@ -1,7 +1,7 @@
SET @@session.storage_engine = 'blackhole';
create table t1 (a int, b int as (a+1));
-ERROR HY000: 'Specified storage engine' is not yet supported for computed columns
-create table t1 (a int);
+ERROR HY000: BLACKHOLE storage engine does not support computed columns
+create table t1 (a int not null);
alter table t1 add column b int as (a+1);
-ERROR HY000: 'Specified storage engine' is not yet supported for computed columns
+ERROR HY000: BLACKHOLE storage engine does not support computed columns
drop table t1;
diff --git a/mysql-test/suite/vcol/r/vcol_csv.result b/mysql-test/suite/vcol/r/vcol_csv.result
index 97977505696..920e614c0b1 100644
--- a/mysql-test/suite/vcol/r/vcol_csv.result
+++ b/mysql-test/suite/vcol/r/vcol_csv.result
@@ -1,7 +1,7 @@
SET @@session.storage_engine = 'CSV';
create table t1 (a int, b int as (a+1));
-ERROR HY000: 'Specified storage engine' is not yet supported for computed columns
+ERROR HY000: CSV storage engine does not support computed columns
create table t1 (a int not null);
alter table t1 add column b int as (a+1);
-ERROR HY000: 'Specified storage engine' is not yet supported for computed columns
+ERROR HY000: CSV storage engine does not support computed columns
drop table t1;
diff --git a/mysql-test/suite/vcol/r/vcol_memory.result b/mysql-test/suite/vcol/r/vcol_memory.result
index 30b6bd4a4bf..4503c51e39a 100644
--- a/mysql-test/suite/vcol/r/vcol_memory.result
+++ b/mysql-test/suite/vcol/r/vcol_memory.result
@@ -1,7 +1,7 @@
SET @@session.storage_engine = 'memory';
create table t1 (a int, b int as (a+1));
-ERROR HY000: 'Specified storage engine' is not yet supported for computed columns
-create table t1 (a int);
+ERROR HY000: MEMORY storage engine does not support computed columns
+create table t1 (a int not null);
alter table t1 add column b int as (a+1);
-ERROR HY000: 'Specified storage engine' is not yet supported for computed columns
+ERROR HY000: MEMORY storage engine does not support computed columns
drop table t1;
diff --git a/mysql-test/suite/vcol/r/vcol_merge.result b/mysql-test/suite/vcol/r/vcol_merge.result
index 03a1e151c2e..4b5ed838c3a 100644
--- a/mysql-test/suite/vcol/r/vcol_merge.result
+++ b/mysql-test/suite/vcol/r/vcol_merge.result
@@ -4,5 +4,5 @@ create table t2 (a int, b int as (a % 10));
insert into t1 values (1,default);
insert into t2 values (2,default);
create table t3 (a int, b int as (a % 10)) engine=MERGE UNION=(t1,t2);
-ERROR HY000: 'Specified storage engine' is not yet supported for computed columns
+ERROR HY000: MRG_MYISAM storage engine does not support computed columns
drop table t1,t2;
diff --git a/mysql-test/suite/vcol/r/vcol_non_stored_columns_innodb.result b/mysql-test/suite/vcol/r/vcol_non_stored_columns_innodb.result
index c638ced4f41..0379a71922d 100644
--- a/mysql-test/suite/vcol/r/vcol_non_stored_columns_innodb.result
+++ b/mysql-test/suite/vcol/r/vcol_non_stored_columns_innodb.result
@@ -76,7 +76,7 @@ drop table t1;
# Case 7. ALTER. Modify virtual stored -> virtual non-stored
create table t1 (a int, b int as (a % 2) persistent);
alter table t1 modify b int as (a % 2);
-ERROR HY000: 'Changing the STORED status' is not yet supported for computed columns
+ERROR HY000: This is not yet supported for computed columns
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -87,7 +87,7 @@ drop table t1;
# Case 8. ALTER. Modify virtual non-stored -> virtual stored
create table t1 (a int, b int as (a % 2));
alter table t1 modify b int as (a % 2) persistent;
-ERROR HY000: 'Changing the STORED status' is not yet supported for computed columns
+ERROR HY000: This is not yet supported for computed columns
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
diff --git a/mysql-test/suite/vcol/r/vcol_non_stored_columns_myisam.result b/mysql-test/suite/vcol/r/vcol_non_stored_columns_myisam.result
index be42b8b76c4..de9a962ac2c 100644
--- a/mysql-test/suite/vcol/r/vcol_non_stored_columns_myisam.result
+++ b/mysql-test/suite/vcol/r/vcol_non_stored_columns_myisam.result
@@ -76,7 +76,7 @@ drop table t1;
# Case 7. ALTER. Modify virtual stored -> virtual non-stored
create table t1 (a int, b int as (a % 2) persistent);
alter table t1 modify b int as (a % 2);
-ERROR HY000: 'Changing the STORED status' is not yet supported for computed columns
+ERROR HY000: This is not yet supported for computed columns
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -87,7 +87,7 @@ drop table t1;
# Case 8. ALTER. Modify virtual non-stored -> virtual stored
create table t1 (a int, b int as (a % 2));
alter table t1 modify b int as (a % 2) persistent;
-ERROR HY000: 'Changing the STORED status' is not yet supported for computed columns
+ERROR HY000: This is not yet supported for computed columns
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
diff --git a/mysql-test/suite/vcol/t/rpl_vcol.test b/mysql-test/suite/vcol/t/rpl_vcol.test
index 2ac31f5ba35..df07b3aed2d 100644
--- a/mysql-test/suite/vcol/t/rpl_vcol.test
+++ b/mysql-test/suite/vcol/t/rpl_vcol.test
@@ -27,7 +27,7 @@
##### Storage engine to be tested
# Set the session storage engine
---source include/have_innodb.inc
+--source include/have_xtradb.inc
SET @@session.storage_engine = 'InnoDB';
#------------------------------------------------------------------------------#
diff --git a/mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_innodb.test b/mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_innodb.test
index 516e121a2aa..baefddc0fd1 100644
--- a/mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_innodb.test
+++ b/mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_innodb.test
@@ -32,7 +32,7 @@
##### Storage engine to be tested
# Set the session storage engine
---source include/have_innodb.inc
+--source include/have_xtradb.inc
eval SET @@session.storage_engine = 'InnoDB';
let $skip_full_text_checks = 1;
diff --git a/mysql-test/suite/vcol/t/vcol_column_def_options_innodb.test b/mysql-test/suite/vcol/t/vcol_column_def_options_innodb.test
index 38baa2b3024..e11618163cc 100644
--- a/mysql-test/suite/vcol/t/vcol_column_def_options_innodb.test
+++ b/mysql-test/suite/vcol/t/vcol_column_def_options_innodb.test
@@ -33,7 +33,7 @@
##### Storage engine to be tested
# Set the session storage engine
---source include/have_innodb.inc
+--source include/have_xtradb.inc
eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs
diff --git a/mysql-test/suite/vcol/t/vcol_csv.test b/mysql-test/suite/vcol/t/vcol_csv.test
index b8342e24e07..75ddf819818 100644
--- a/mysql-test/suite/vcol/t/vcol_csv.test
+++ b/mysql-test/suite/vcol/t/vcol_csv.test
@@ -41,13 +41,7 @@ SET @@session.storage_engine = 'CSV';
# Execute the tests to be applied to all storage engines
#------------------------------------------------------------------------------#
-# Execute storage engine specific tests
---error ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN
-create table t1 (a int, b int as (a+1));
-create table t1 (a int not null);
---error ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN
-alter table t1 add column b int as (a+1);
-drop table t1;
+--source suite/vcol/inc/vcol_unsupported_storage_engines.inc
#------------------------------------------------------------------------------#
# Cleanup
diff --git a/mysql-test/suite/vcol/t/vcol_handler_innodb.test b/mysql-test/suite/vcol/t/vcol_handler_innodb.test
index bf443c6bbd3..1a50aeaaa86 100644
--- a/mysql-test/suite/vcol/t/vcol_handler_innodb.test
+++ b/mysql-test/suite/vcol/t/vcol_handler_innodb.test
@@ -33,7 +33,7 @@
##### Storage engine to be tested
# Set the session storage engine
---source include/have_innodb.inc
+--source include/have_xtradb.inc
eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs
diff --git a/mysql-test/suite/vcol/t/vcol_ins_upd_innodb.test b/mysql-test/suite/vcol/t/vcol_ins_upd_innodb.test
index 5d9ac12e930..3b83c7f4565 100644
--- a/mysql-test/suite/vcol/t/vcol_ins_upd_innodb.test
+++ b/mysql-test/suite/vcol/t/vcol_ins_upd_innodb.test
@@ -33,7 +33,7 @@
##### Storage engine to be tested
# Set the session storage engine
---source include/have_innodb.inc
+--source include/have_xtradb.inc
eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs
diff --git a/mysql-test/suite/vcol/t/vcol_keys_innodb.test b/mysql-test/suite/vcol/t/vcol_keys_innodb.test
index e408672ac07..d44d2f701cf 100644
--- a/mysql-test/suite/vcol/t/vcol_keys_innodb.test
+++ b/mysql-test/suite/vcol/t/vcol_keys_innodb.test
@@ -33,7 +33,7 @@
##### Storage engine to be tested
# Set the session storage engine
---source include/have_innodb.inc
+--source include/have_xtradb.inc
eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs
diff --git a/mysql-test/suite/vcol/t/vcol_merge.test b/mysql-test/suite/vcol/t/vcol_merge.test
index 7ba72441bf5..a1d3c628c8e 100644
--- a/mysql-test/suite/vcol/t/vcol_merge.test
+++ b/mysql-test/suite/vcol/t/vcol_merge.test
@@ -48,7 +48,7 @@ create table t1 (a int, b int as (a % 10));
create table t2 (a int, b int as (a % 10));
insert into t1 values (1,default);
insert into t2 values (2,default);
---error ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN
+--error ER_UNSUPPORTED_ENGINE_FOR_VIRTUAL_COLUMNS
create table t3 (a int, b int as (a % 10)) engine=MERGE UNION=(t1,t2);
drop table t1,t2;
diff --git a/mysql-test/suite/vcol/t/vcol_non_stored_columns_innodb.test b/mysql-test/suite/vcol/t/vcol_non_stored_columns_innodb.test
index 88ed6157294..42834d5c0bb 100644
--- a/mysql-test/suite/vcol/t/vcol_non_stored_columns_innodb.test
+++ b/mysql-test/suite/vcol/t/vcol_non_stored_columns_innodb.test
@@ -35,7 +35,7 @@
##### Storage engine to be tested
# Set the session storage engine
---source include/have_innodb.inc
+--source include/have_xtradb.inc
eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs
diff --git a/mysql-test/suite/vcol/t/vcol_partition_innodb.test b/mysql-test/suite/vcol/t/vcol_partition_innodb.test
index 01230120ef9..47f1581fc96 100644
--- a/mysql-test/suite/vcol/t/vcol_partition_innodb.test
+++ b/mysql-test/suite/vcol/t/vcol_partition_innodb.test
@@ -34,7 +34,7 @@
##### Storage engine to be tested
# Set the session storage engine
---source include/have_innodb.inc
+--source include/have_xtradb.inc
eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs
diff --git a/mysql-test/suite/vcol/t/vcol_select_innodb.test b/mysql-test/suite/vcol/t/vcol_select_innodb.test
index 314aecb75b9..787f5fe77a7 100644
--- a/mysql-test/suite/vcol/t/vcol_select_innodb.test
+++ b/mysql-test/suite/vcol/t/vcol_select_innodb.test
@@ -33,7 +33,7 @@
##### Storage engine to be tested
# Set the session storage engine
---source include/have_innodb.inc
+--source include/have_xtradb.inc
eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs
diff --git a/mysql-test/suite/vcol/t/vcol_supported_sql_funcs_innodb.test b/mysql-test/suite/vcol/t/vcol_supported_sql_funcs_innodb.test
index 53826a460a7..32e2600c2fc 100644
--- a/mysql-test/suite/vcol/t/vcol_supported_sql_funcs_innodb.test
+++ b/mysql-test/suite/vcol/t/vcol_supported_sql_funcs_innodb.test
@@ -32,7 +32,7 @@
##### Storage engine to be tested
# Set the session storage engine
---source include/have_innodb.inc
+--source include/have_xtradb.inc
SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs
diff --git a/mysql-test/suite/vcol/t/vcol_trigger_sp_innodb.test b/mysql-test/suite/vcol/t/vcol_trigger_sp_innodb.test
index 5a36fb1c06d..57655d6d3fe 100644
--- a/mysql-test/suite/vcol/t/vcol_trigger_sp_innodb.test
+++ b/mysql-test/suite/vcol/t/vcol_trigger_sp_innodb.test
@@ -34,7 +34,7 @@
##### Storage engine to be tested
# Set the session storage engine
---source include/have_innodb.inc
+--source include/have_xtradb.inc
eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs
diff --git a/mysql-test/suite/vcol/t/vcol_view_innodb.test b/mysql-test/suite/vcol/t/vcol_view_innodb.test
index 01fced8e4c3..322fb122436 100644
--- a/mysql-test/suite/vcol/t/vcol_view_innodb.test
+++ b/mysql-test/suite/vcol/t/vcol_view_innodb.test
@@ -33,7 +33,7 @@
##### Storage engine to be tested
# Set the session storage engine
---source include/have_innodb.inc
+--source include/have_xtradb.inc
eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs
diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test
index 7478c7dcdce..c966b51d861 100644
--- a/mysql-test/t/archive.test
+++ b/mysql-test/t/archive.test
@@ -1630,6 +1630,11 @@ SET @@join_buffer_size= @save_join_buffer_size;
# BUG#47012 archive tables are not upgradeable, and server crashes on any access
#
let $MYSQLD_DATADIR= `SELECT @@datadir`;
+
+# Remove files to handle possible restart of test
+flush tables;
+remove_files_wildcard $MYSQLD_DATADIR/test t1.*;
+
copy_file std_data/bug47012.frm $MYSQLD_DATADIR/test/t1.frm;
copy_file std_data/bug47012.ARZ $MYSQLD_DATADIR/test/t1.ARZ;
copy_file std_data/bug47012.ARM $MYSQLD_DATADIR/test/t1.ARM;
diff --git a/mysql-test/t/connect.test b/mysql-test/t/connect.test
index a8c8b659c3c..8fbdd709364 100644
--- a/mysql-test/t/connect.test
+++ b/mysql-test/t/connect.test
@@ -352,6 +352,19 @@ connection pcon4;
select user(), current_user();
disconnect pcon4;
+#
+# lpbug#683112 Maria 5.2 incorrectly reports "(using password: NO)"
+# even when password is specified
+#
+# test "access denied" error for nonexisting user with and without a password
+#
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(pcon5,localhost,mysqltest_nouser,newpw,,$MASTER_MYPORT,);
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(pcon5,localhost,mysqltest_nouser,,,$MASTER_MYPORT,);
+
connection default;
DROP USER mysqltest_up1@'%';
DROP USER mysqltest_up2@'%';
diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test
index 2d90969202c..352ace03102 100644
--- a/mysql-test/t/ctype_utf8.test
+++ b/mysql-test/t/ctype_utf8.test
@@ -1475,3 +1475,23 @@ SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) from t1 GROUP BY b;
DROP TABLE t1;
--echo End of 5.0 tests
+
+
+#
+# Bug #57272: crash in rpad() when using utf8
+#
+SELECT LENGTH(RPAD(0.0115E88, 61297, _utf8'ÑÑÑŽÑ'));
+SELECT LENGTH(RPAD(0.0115E88, 61297, _utf8'йцуÑ'));
+SELECT HEX(RPAD(0x20, 2, _utf8 0xD18F));
+SELECT HEX(RPAD(0x20, 4, _utf8 0xD18F));
+SELECT HEX(LPAD(0x20, 2, _utf8 0xD18F));
+SELECT HEX(LPAD(0x20, 4, _utf8 0xD18F));
+
+SELECT HEX(RPAD(_utf8 0xD18F, 3, 0x20));
+SELECT HEX(LPAD(_utf8 0xD18F, 3, 0x20));
+
+SELECT HEX(INSERT(_utf8 0xD18F, 2, 1, 0x20));
+SELECT HEX(INSERT(_utf8 0xD18FD18E, 2, 1, 0x20));
+
+
+--echo End of 5.1 tests
diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def
index 1de9d1c9847..f76058abae4 100644
--- a/mysql-test/t/disabled.def
+++ b/mysql-test/t/disabled.def
@@ -15,3 +15,5 @@ partition_innodb_plugin : Bug#53307 2010-04-30 VasilDimov valgrind warnings
main.mysqlhotcopy_myisam : bug#54129 2010-06-04 Horst
main.mysqlhotcopy_archive: bug#54129 2010-06-04 Horst
main.events_time_zone : Test is not predictable as it depends on precise timing.
+main.mysqlhotcopy_myisam : Bug#56817 2010-10-21 anitha mysqlhotcopy* fails
+main.mysqlhotcopy_archive: Bug#56817 2010-10-21 anitha mysqlhotcopy* fails
diff --git a/mysql-test/t/explain.test b/mysql-test/t/explain.test
index b635a1b2968..c6c30b58341 100644
--- a/mysql-test/t/explain.test
+++ b/mysql-test/t/explain.test
@@ -228,4 +228,40 @@ EXPLAIN SELECT c1 FROM t1 WHERE c2 = 1 AND c4 = 1 AND c5 = 1;
DROP TABLE t1;
+--echo #
+--echo # Bug#56814 Explain + subselect + fulltext crashes server
+--echo #
+
+CREATE TABLE t1(f1 VARCHAR(6) NOT NULL,
+FULLTEXT KEY(f1),UNIQUE(f1));
+INSERT INTO t1 VALUES ('test');
+
+EXPLAIN SELECT 1 FROM t1
+WHERE 1 > ALL((SELECT 1 FROM t1 JOIN t1 a ON (MATCH(t1.f1) AGAINST (""))
+WHERE t1.f1 GROUP BY t1.f1));
+
+PREPARE stmt FROM
+'EXPLAIN SELECT 1 FROM t1
+ WHERE 1 > ALL((SELECT 1 FROM t1 RIGHT OUTER JOIN t1 a
+ ON (MATCH(t1.f1) AGAINST (""))
+ WHERE t1.f1 GROUP BY t1.f1))';
+
+EXECUTE stmt;
+EXECUTE stmt;
+
+DEALLOCATE PREPARE stmt;
+
+PREPARE stmt FROM
+'EXPLAIN SELECT 1 FROM t1
+ WHERE 1 > ALL((SELECT 1 FROM t1 JOIN t1 a
+ ON (MATCH(t1.f1) AGAINST (""))
+ WHERE t1.f1 GROUP BY t1.f1))';
+
+EXECUTE stmt;
+EXECUTE stmt;
+
+DEALLOCATE PREPARE stmt;
+
+DROP TABLE t1;
+
--echo End of 5.1 tests.
diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test
index 71a7f3bbc62..7af9d3706e6 100644
--- a/mysql-test/t/fulltext.test
+++ b/mysql-test/t/fulltext.test
@@ -597,4 +597,40 @@ REPAIR TABLE t1;
SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size;
DROP TABLE t1;
+--echo #
+--echo # Bug#54484 explain + prepared statement: crash and Got error -1 from storage engine
+--echo #
+
+CREATE TABLE t1(f1 VARCHAR(6) NOT NULL, FULLTEXT KEY(f1), UNIQUE(f1));
+INSERT INTO t1 VALUES ('test');
+
+SELECT 1 FROM t1 WHERE 1 >
+ ALL((SELECT 1 FROM t1 JOIN t1 a
+ ON (MATCH(t1.f1) against (""))
+ WHERE t1.f1 GROUP BY t1.f1)) xor f1;
+
+PREPARE stmt FROM
+'SELECT 1 FROM t1 WHERE 1 >
+ ALL((SELECT 1 FROM t1 RIGHT OUTER JOIN t1 a
+ ON (MATCH(t1.f1) against (""))
+ WHERE t1.f1 GROUP BY t1.f1)) xor f1';
+
+EXECUTE stmt;
+EXECUTE stmt;
+
+DEALLOCATE PREPARE stmt;
+
+PREPARE stmt FROM
+'SELECT 1 FROM t1 WHERE 1 >
+ ALL((SELECT 1 FROM t1 JOIN t1 a
+ ON (MATCH(t1.f1) against (""))
+ WHERE t1.f1 GROUP BY t1.f1))';
+
+EXECUTE stmt;
+EXECUTE stmt;
+
+DEALLOCATE PREPARE stmt;
+
+DROP TABLE t1;
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test
index 926c1f92855..a7072362759 100644
--- a/mysql-test/t/func_gconcat.test
+++ b/mysql-test/t/func_gconcat.test
@@ -734,4 +734,16 @@ EXECUTE stmt;
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
+--echo #
+--echo # Bug#57194 group_concat cause crash and/or invalid memory reads with type errors
+--echo #
+
+CREATE TABLE t1(f1 int);
+INSERT INTO t1 values (0),(0);
+--disable_ps_protocol
+--error ER_ILLEGAL_VALUE_FOR_TYPE
+SELECT POLYGON((SELECT 1 FROM (SELECT 1 IN (GROUP_CONCAT(t1.f1)) FROM t1, t1 t GROUP BY t.f1 ) d));
+--enable_ps_protocol
+DROP TABLE t1;
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test
index 91fdce8addb..b0c92c9d6ab 100644
--- a/mysql-test/t/func_math.test
+++ b/mysql-test/t/func_math.test
@@ -308,5 +308,11 @@ SELECT RAND(i) FROM t1;
DROP TABLE t1;
--echo #
+--echo # Bug#57477 SIGFPE when dividing a huge number a negative number
+--echo #
+SELECT -9999999999999999991 DIV -1;
+SELECT -9223372036854775808 DIV -1;
+SELECT -9223372036854775808 MOD -1;
+SELECT -9223372036854775808999 MOD -1;
--echo End of 5.1 tests
diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test
index 363221f38d8..2a72578aca7 100644
--- a/mysql-test/t/func_misc.test
+++ b/mysql-test/t/func_misc.test
@@ -291,4 +291,12 @@ SELECT DISTINCT GREATEST(a, (SELECT b FROM t1 LIMIT 1)) FROM t1 UNION SELECT 1;
DROP TABLE t1;
+
+#
+# Bug #57283: inet_ntoa() crashes
+#
+SELECT INET_NTOA(0);
+SELECT '1' IN ('1', INET_NTOA(0));
+
+
--echo End of tests
diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test
index 65e987dfa24..97c4aaf71b6 100644
--- a/mysql-test/t/grant.test
+++ b/mysql-test/t/grant.test
@@ -1550,5 +1550,15 @@ DROP TABLE db2.t1;
DROP DATABASE db1;
DROP DATABASE db2;
+--echo #
+--echo # Bug #36742
+--echo #
+grant usage on Foo.* to myuser@Localhost identified by 'foo';
+grant select on Foo.* to myuser@localhost;
+select host,user from mysql.user where User='myuser';
+revoke select on Foo.* from myuser@localhost;
+delete from mysql.user where User='myuser';
+flush privileges;
+
# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/grant3.test b/mysql-test/t/grant3.test
index 437fc9a278f..d24b2de17eb 100644
--- a/mysql-test/t/grant3.test
+++ b/mysql-test/t/grant3.test
@@ -64,6 +64,7 @@ SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser' order by 1,2;
DROP USER CUser@localhost;
+--error ER_CANNOT_USER
DROP USER CUser@LOCALHOST;
#### table grants
@@ -88,6 +89,7 @@ SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2;
DROP USER CUser@localhost;
+--error ER_CANNOT_USER
DROP USER CUser@LOCALHOST;
### column grants
@@ -112,6 +114,7 @@ SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2;
DROP USER CUser@localhost;
+--error ER_CANNOT_USER
DROP USER CUser@LOCALHOST;
drop table t1;
@@ -131,6 +134,7 @@ flush privileges;
SELECT user, host FROM mysql.user where user = 'CUser2' order by 1,2;
SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser2' order by 1,2;
+--error ER_NONEXISTING_GRANT
REVOKE SELECT ON test.* FROM 'CUser2'@'localhost';
flush privileges;
@@ -138,6 +142,7 @@ SELECT user, host FROM mysql.user where user = 'CUser2' order by 1,2;
SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser2' order by 1,2;
DROP USER CUser2@localhost;
+--error ER_CANNOT_USER
DROP USER CUser2@LOCALHOST;
diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test
index bfef611d686..394eb8d7c68 100644
--- a/mysql-test/t/group_by.test
+++ b/mysql-test/t/group_by.test
@@ -1252,5 +1252,16 @@ SELECT SUBSTRING(a,1,10), LENGTH(a) FROM t1 GROUP BY a;
SELECT SUBSTRING(a,1,10), LENGTH(a) FROM t1 GROUP BY a;
DROP TABLE t1;
+--echo #
+--echo # Bug#57688 Assertion `!table || (!table->write_set || bitmap_is_set(table->write_set, field
+--echo #
+
+CREATE TABLE t1(f1 INT NOT NULL);
+INSERT INTO t1 VALUES (16777214),(0);
+
+SELECT COUNT(*) FROM t1 LEFT JOIN t1 t2
+ON 1 WHERE t2.f1 > 1 GROUP BY t2.f1;
+
+DROP TABLE t1;
--echo # End of 5.1 tests
diff --git a/mysql-test/t/handler_innodb.test b/mysql-test/t/handler_innodb.test
deleted file mode 100644
index 02982716f78..00000000000
--- a/mysql-test/t/handler_innodb.test
+++ /dev/null
@@ -1,20 +0,0 @@
-# t/handler_innodb.test
-#
-# test of HANDLER ...
-#
-# Last update:
-# 2006-07-31 ML test refactored (MySQL 5.1)
-# code of t/handler.test and t/innodb_handler.test united
-# main testing code put into include/handler.inc
-# rename t/innodb_handler.test to t/handler_innodb.test
-#
-
-# should work in embedded server after mysqltest is fixed
---source include/not_embedded.inc
-
---source include/have_innodb.inc
-let $engine_type= InnoDB;
-let $other_engine_type= MEMORY;
-let $other_handler_engine_type= MyISAM;
-
---source include/handler.inc
diff --git a/mysql-test/t/index_merge_innodb.test b/mysql-test/t/index_merge_innodb.test
index e68f414e0bc..04f8c5a659b 100644
--- a/mysql-test/t/index_merge_innodb.test
+++ b/mysql-test/t/index_merge_innodb.test
@@ -64,12 +64,14 @@ INSERT INTO t1 VALUES (1000000, 0, 0);
SET SESSION sort_buffer_size = 1024*36;
+# We have to use FORCE INDEX here as Innodb gives inconsistent estimates
+# which causes different query plans.
EXPLAIN
SELECT COUNT(*) FROM
- (SELECT * FROM t1
+ (SELECT * FROM t1 FORCE INDEX(primary,idx)
WHERE a BETWEEN 2 AND 7 OR pk=1000000) AS t;
SELECT COUNT(*) FROM
- (SELECT * FROM t1
+ (SELECT * FROM t1 FORCE INDEX(primary,idx)
WHERE a BETWEEN 2 AND 7 OR pk=1000000) AS t;
--replace_column 9 #
diff --git a/mysql-test/t/information_schema_all_engines-master.opt b/mysql-test/t/information_schema_all_engines-master.opt
index 959cf74c816..9104e73e554 100644
--- a/mysql-test/t/information_schema_all_engines-master.opt
+++ b/mysql-test/t/information_schema_all_engines-master.opt
@@ -1 +1 @@
---skip-safemalloc
+--loose-skip-safemalloc --loose-mutex-deadlock-detector=0
diff --git a/mysql-test/t/join_outer.test b/mysql-test/t/join_outer.test
index 6d1ef15337f..c8fa2a35538 100644
--- a/mysql-test/t/join_outer.test
+++ b/mysql-test/t/join_outer.test
@@ -1,3 +1,5 @@
+--source include/long_test.inc
+
#
# test of left outer join
#
@@ -1073,4 +1075,32 @@ show status like "handler_read%";
drop table t1,t2,t3;
+--echo # Bug#57688 Assertion `!table || (!table->write_set || bitmap_is_set(table->write_set, field
+--echo #
+
+CREATE TABLE t1 (f1 INT NOT NULL, PRIMARY KEY (f1));
+CREATE TABLE t2 (f1 INT NOT NULL, f2 INT NOT NULL, PRIMARY KEY (f1, f2));
+
+INSERT INTO t1 VALUES (4);
+INSERT INTO t2 VALUES (3, 3);
+INSERT INTO t2 VALUES (7, 7);
+
+EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t2.f1 = t1.f1
+WHERE t1.f1 = 4
+GROUP BY t2.f1, t2.f2;
+
+SELECT * FROM t1 LEFT JOIN t2 ON t2.f1 = t1.f1
+WHERE t1.f1 = 4
+GROUP BY t2.f1, t2.f2;
+
+EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t2.f1 = t1.f1
+WHERE t1.f1 = 4 AND t2.f1 IS NOT NULL AND t2.f2 IS NOT NULL
+GROUP BY t2.f1, t2.f2;
+
+SELECT * FROM t1 LEFT JOIN t2 ON t2.f1 = t1.f1
+WHERE t1.f1 = 4 AND t2.f1 IS NOT NULL AND t2.f2 IS NOT NULL
+GROUP BY t2.f1, t2.f2;
+
+DROP TABLE t1,t2;
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/lock_multi.test b/mysql-test/t/lock_multi.test
index 4df1a0f3478..742a83f7bad 100644
--- a/mysql-test/t/lock_multi.test
+++ b/mysql-test/t/lock_multi.test
@@ -484,22 +484,6 @@ unlock tables;
connection default;
drop table t1;
-#
-# Bug#25856 HANDLER table OPEN in one connection lock DROP TABLE in another one
-#
---disable_warnings
-drop table if exists t1;
---enable_warnings
-create table t1 (a int) ENGINE=MEMORY;
---echo --> client 2
-connection locker;
---error ER_ILLEGAL_HA
-handler t1 open;
---echo --> client 1
-connection default;
-drop table t1;
-
-
# Disconnect sessions used in many subtests above
disconnect locker;
disconnect reader;
diff --git a/mysql-test/t/lowercase_table4-master.opt b/mysql-test/t/lowercase_table4-master.opt
new file mode 100755
index 00000000000..c0a1981fa7c
--- /dev/null
+++ b/mysql-test/t/lowercase_table4-master.opt
@@ -0,0 +1 @@
+--lower-case-table-names=2
diff --git a/mysql-test/t/lowercase_table4.test b/mysql-test/t/lowercase_table4.test
new file mode 100755
index 00000000000..93956047145
--- /dev/null
+++ b/mysql-test/t/lowercase_table4.test
@@ -0,0 +1,56 @@
+--source include/have_case_insensitive_file_system.inc
+--source include/have_innodb.inc
+
+--echo #
+--echo # Bug#46941 crash with lower_case_table_names=2 and
+--echo # foreign data dictionary confusion
+--echo #
+
+CREATE DATABASE XY;
+USE XY;
+
+#
+# Logs are disabled, since the number of creates tables
+# and subsequent select statements may vary between
+# versions
+#
+--disable_query_log
+--disable_result_log
+
+let $tcs = `SELECT @@table_open_cache + 1`;
+
+let $i = $tcs;
+
+while ($i)
+{
+ eval CREATE TABLE XY.T_$i (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL, d INT,
+ primary key(a, b), unique(b)) ENGINE=InnoDB;
+ dec $i;
+}
+
+eval ALTER TABLE XY.T_$tcs ADD INDEX I1 (c, b),
+ ADD CONSTRAINT C1 FOREIGN KEY (c, b) REFERENCES XY.T_1 (a, b);
+
+eval ALTER TABLE XY.T_$tcs ADD INDEX I2 (b),
+ ADD CONSTRAINT C2 FOREIGN KEY (b) REFERENCES XY.T_1(a);
+
+let $i = $tcs;
+while ($i)
+{
+ eval SELECT * FROM XY.T_$i LIMIT 1;
+ dec $i;
+}
+
+DROP DATABASE XY;
+CREATE DATABASE XY;
+USE XY;
+eval CREATE TABLE XY.T_$tcs (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL, d INT,
+ PRIMARY KEY(a, b), UNIQUE(b)) ENGINE=InnoDB;
+#
+# The bug causes this SELECT to err
+eval SELECT * FROM XY.T_$tcs LIMIT 1;
+
+--enable_query_log
+--enable_result_log
+DROP DATABASE XY;
+
diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test
index 4e0ca615f99..0b34f9fdbac 100644
--- a/mysql-test/t/merge.test
+++ b/mysql-test/t/merge.test
@@ -1736,6 +1736,84 @@ t2 WHERE b SOUNDS LIKE e AND d = 1;
DROP TABLE t2, t1;
+--echo #
+--echo # Bug#46339 - crash on REPAIR TABLE merge table USE_FRM
+--echo #
+--disable_warnings
+DROP TABLE IF EXISTS m1, t1;
+--enable_warnings
+#
+# Test derived from a proposal of Shane Bester.
+#
+CREATE TABLE t1 (c1 INT) ENGINE=MYISAM;
+CREATE TABLE m1 (c1 INT) ENGINE=MRG_MyISAM UNION=(t1) INSERT_METHOD=LAST;
+#
+# REPAIR ... USE_FRM with LOCK TABLES.
+#
+LOCK TABLE m1 READ;
+REPAIR TABLE m1 USE_FRM;
+UNLOCK TABLES;
+#
+# REPAIR ... USE_FRM without LOCK TABLES.
+#
+# This statement crashed the server (Bug#46339).
+#
+REPAIR TABLE m1 USE_FRM;
+#
+DROP TABLE m1,t1;
+#
+# Test derived from a proposal of Matthias Leich.
+#
+# Base table is missing.
+#
+CREATE TABLE m1 (f1 BIGINT) ENGINE=MRG_MyISAM UNION(t1);
+#
+# This statement crashed the server (Bug#46339).
+#
+REPAIR TABLE m1 USE_FRM;
+#
+# Create base table.
+#
+CREATE TABLE t1 (f1 BIGINT) ENGINE = MyISAM;
+#
+# This statement crashed the server (Bug#46339).
+#
+REPAIR TABLE m1 USE_FRM;
+#
+# Normal repair as reference.
+#
+REPAIR TABLE m1;
+#
+# Cleanup.
+#
+DROP TABLE m1, t1;
+#
+# Same with temporary tables.
+#
+# Base table is missing.
+#
+CREATE TEMPORARY TABLE m1 (f1 BIGINT) ENGINE=MRG_MyISAM UNION(t1);
+#
+# This statement crashed the server (Bug#46339).
+#
+REPAIR TABLE m1 USE_FRM;
+#
+# Create base table.
+#
+CREATE TEMPORARY TABLE t1 (f1 BIGINT) ENGINE=MyISAM;
+#
+# This statement crashed the server (Bug#46339).
+#
+REPAIR TABLE m1 USE_FRM;
+#
+# Normal repair as reference.
+#
+REPAIR TABLE m1;
+#
+# Cleanup.
+#
+DROP TABLE m1, t1;
+
--echo End of 5.1 tests
--disable_result_log
diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test
index 87e952dd069..d405e4e5e3a 100644
--- a/mysql-test/t/multi_update.test
+++ b/mysql-test/t/multi_update.test
@@ -655,5 +655,26 @@ SET SESSION sql_safe_updates = 1;
UPDATE IGNORE t1, t1 t1a SET t1.a = 1 WHERE t1a.a = 1;
DROP TABLE t1;
+--echo #
+--echo # Bug#54543: update ignore with incorrect subquery leads to assertion
+--echo # failure: inited==INDEX
+--echo #
+SET SESSION sql_safe_updates = 0;
+CREATE TABLE t1 ( a INT );
+INSERT INTO t1 VALUES (1), (2);
+
+CREATE TABLE t2 ( a INT );
+INSERT INTO t2 VALUES (1), (2);
+
+CREATE TABLE t3 ( a INT );
+INSERT INTO t3 VALUES (1), (2);
+
+--echo # Should not crash
+UPDATE IGNORE
+ ( SELECT ( SELECT COUNT(*) FROM t1 GROUP BY a, @v ) a FROM t2 ) x, t3
+SET t3.a = 0;
+
+DROP TABLE t1, t2, t3;
+SET SESSION sql_safe_updates = DEFAULT;
--echo end of tests
diff --git a/mysql-test/t/multi_update2.test b/mysql-test/t/multi_update2.test
index 9c5078efb6f..a0f17fabec4 100644
--- a/mysql-test/t/multi_update2.test
+++ b/mysql-test/t/multi_update2.test
@@ -1,3 +1,5 @@
+--source include/long_test.inc
+
#
# Test of update statement that uses many tables.
#
diff --git a/mysql-test/t/mysqlbinlog-innodb.test b/mysql-test/t/mysqlbinlog-innodb.test
new file mode 100644
index 00000000000..49702e8db38
--- /dev/null
+++ b/mysql-test/t/mysqlbinlog-innodb.test
@@ -0,0 +1,31 @@
+-- source include/have_binlog_format_statement.inc
+-- source include/have_log_bin.inc
+-- source include/have_innodb.inc
+
+#
+# MBug#702303: Spurious `use` statements in output from mysqlbinlog --rewrite-db="a->b"
+#
+let $MYSQLD_DATADIR= `select @@datadir`;
+SET TIMESTAMP=1000000000;
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb;
+CREATE DATABASE test2;
+
+RESET MASTER;
+USE test2;
+BEGIN;
+USE test;
+INSERT INTO t1 VALUES (1);
+USE test2;
+COMMIT;
+BEGIN;
+USE test;
+INSERT INTO t1 VALUES (2);
+USE test2;
+COMMIT;
+USE test;
+SELECT * FROM t1 ORDER BY a;
+FLUSH LOGS;
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 --short-form
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 --short-form --rewrite-db="test->foo" --rewrite-db="test2->bar"
+DROP DATABASE test2;
+DROP TABLE t1;
diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test
index 707f6db99c4..760391f5bab 100644
--- a/mysql-test/t/mysqltest.test
+++ b/mysql-test/t/mysqltest.test
@@ -339,7 +339,7 @@ eval select $mysql_errno as "after_!errno_masked_error" ;
--exec illegal_command
--cat_file does_not_exist
--perl
- exit(1);
+ exit(2);
EOF
# ----------------------------------------------------------------------------
@@ -502,6 +502,32 @@ remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql;
--error 1
--exec echo "--disable_query_log;" | $MYSQL_TEST 2>&1
+#
+# Extra text after ``
+#
+# Cannot use exec echo here as ` may or may not need to be escaped
+--write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql
+let $x= `select 1` BOO ;
+EOF
+--error 1
+--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1
+remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql;
+--write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql
+--let $x= `select 1`;
+EOF
+--error 1
+--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1
+remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql;
+--write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql
+# Missing ; in next line should be detected and cause failure
+let $x= `select 1`
+let $x= 2;
+echo $x;
+EOF
+--error 1
+--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1
+remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql;
+
# Allow trailing # comment
--sleep 1 # Wait for insert delayed to be executed.
@@ -709,6 +735,16 @@ echo banana = $cat;
let $cat=ba\\\$cat\\\$cat;
echo Not a banana: $cat;
+# Bug #55413 would cause this to fail
+let $escape= with\`some\"escaped\'quotes;
+echo $escape;
+
+--let $escape= with\`some\"escaped\'quotes
+echo $escape;
+
+# This only works with "--let" syntax
+--let $tick= single'tick`backtick
+echo $tick;
# Test illegal uses of let
@@ -1439,19 +1475,6 @@ eval select "$long_rep" as x;
# Repeat connect/disconnect
--write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql
-let $i=100;
-while ($i)
-{
- connect (test_con1,localhost,root,,);
- disconnect test_con1;
- dec $i;
-}
-EOF
---exec echo "source $MYSQLTEST_VARDIR/tmp/mysqltest.sql; echo OK; exit;" | $MYSQL_TEST 2>&1
-remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql;
-
-# Repeat connect/disconnect
---write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql
let $i=200;
while ($i)
{
@@ -1459,9 +1482,8 @@ while ($i)
disconnect test_con1;
dec $i;
}
+echo 200 connects succeeded;
EOF
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
---error 1
--exec echo "source $MYSQLTEST_VARDIR/tmp/mysqltest.sql;" | $MYSQL_TEST 2>&1
remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql;
@@ -1502,6 +1524,22 @@ show tables;
disconnect con2;
connection default;
+# Test enable_connect_log
+--enable_connect_log
+connect (con1,localhost,root,,);
+connection default;
+connection con1;
+--disable_query_log
+# These should not be logged
+connect (con2,localhost,root,,*NO-ONE*);
+connection con2;
+disconnect con2;
+connection con1;
+--enable_query_log
+disconnect con1;
+connection default;
+--disable_connect_log
+
# ----------------------------------------------------------------------------
# Test mysqltest arguments
# ----------------------------------------------------------------------------
diff --git a/mysql-test/t/openssl_1.test b/mysql-test/t/openssl_1.test
index 8ca70258bc0..8051dd0e866 100644
--- a/mysql-test/t/openssl_1.test
+++ b/mysql-test/t/openssl_1.test
@@ -73,6 +73,8 @@ drop table t1;
# a different cacert
#
--exec echo "this query should not execute;" > $MYSQLTEST_VARDIR/tmp/test.sql
+# Handle that openssl gives different error messages from YaSSL.
+--replace_regex /error:00000005:lib\(0\):func\(0\):DH lib/ASN: bad other signature confirmation/
--error 1
--exec $MYSQL_TEST --ssl-ca=$MYSQL_TEST_DIR/std_data/untrusted-cacert.pem --max-connect-retries=1 < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1
@@ -80,6 +82,7 @@ drop table t1;
# Test that we can't open connection to server if we are using
# a blank ca
#
+--replace_regex /error:00000005:lib\(0\):func\(0\):DH lib/ASN: bad other signature confirmation/
--error 1
--exec $MYSQL_TEST --ssl-ca= --max-connect-retries=1 < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1
@@ -87,6 +90,7 @@ drop table t1;
# Test that we can't open connection to server if we are using
# a nonexistent ca file
#
+--replace_regex /error:00000005:lib\(0\):func\(0\):DH lib/ASN: bad other signature confirmation/
--error 1
--exec $MYSQL_TEST --ssl-ca=nonexisting_file.pem --max-connect-retries=1 < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1
diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test
index de380e09e8a..0bacd785808 100644
--- a/mysql-test/t/order_by.test
+++ b/mysql-test/t/order_by.test
@@ -1469,4 +1469,29 @@ SELECT * FROM t1 FORCE INDEX FOR JOIN (a), t2 WHERE t1.a < 2 ORDER BY t1.a;
DROP TABLE t1, t2;
+--echo #
+--echo # Bug #50394: Regression in EXPLAIN with index scan, LIMIT, GROUP BY and
+--echo # ORDER BY computed col
+--echo #
+CREATE TABLE t1 ( a INT NOT NULL, b INT NOT NULL, KEY( a, b ) );
+
+INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5);
+INSERT INTO t1 SELECT a + 5, b + 5 FROM t1;
+
+CREATE TABLE t2( a INT PRIMARY KEY, b INT );
+
+INSERT INTO t2 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5);
+INSERT INTO t2 SELECT a + 5, b + 5 FROM t2;
+
+EXPLAIN
+SELECT count(*) AS c, t1.a
+FROM t1 JOIN t2 ON t1.b = t2.a
+WHERE t2.b = 1
+GROUP BY t1.a
+ORDER by c
+LIMIT 2;
+
+DROP TABLE t1, t2;
+
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test
index e6e000ec916..e0e3f2af396 100644
--- a/mysql-test/t/partition.test
+++ b/mysql-test/t/partition.test
@@ -14,6 +14,55 @@
drop table if exists t1, t2;
--enable_warnings
+--echo #
+--echo # Bug#57113: ha_partition::extra(ha_extra_function):
+--echo # Assertion `m_extra_cache' failed
+CREATE TABLE t1
+(id INT NOT NULL PRIMARY KEY,
+ name VARCHAR(16) NOT NULL,
+ year YEAR,
+ INDEX name (name(8))
+)
+PARTITION BY HASH(id) PARTITIONS 2;
+
+INSERT INTO t1 VALUES ( 1, 'FooBar', '1924' );
+
+CREATE TABLE t2 (id INT);
+
+INSERT INTO t2 VALUES (1),(2);
+
+UPDATE t1, t2 SET t1.year = '1955' WHERE t1.name = 'FooBar';
+
+DROP TABLE t1, t2;
+
+
+--echo #
+--echo # Bug#55458: Partitioned MyISAM table gets crashed by multi-table update
+--echo #
+CREATE TABLE t1 (
+ `id` int NOT NULL,
+ `user_num` int DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM CHARSET=latin1;
+INSERT INTO t1 VALUES (1,8601);
+INSERT INTO t1 VALUES (2,8601);
+INSERT INTO t1 VALUES (3,8601);
+INSERT INTO t1 VALUES (4,8601);
+CREATE TABLE t2 (
+ `id` int(11) NOT NULL,
+ `user_num` int DEFAULT NULL,
+ `name` varchar(64) NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM CHARSET=latin1
+PARTITION BY HASH (id)
+PARTITIONS 2;
+INSERT INTO t2 VALUES (1,8601,'John');
+INSERT INTO t2 VALUES (2,8601,'JS');
+INSERT INTO t2 VALUES (3,8601,'John S');
+
+UPDATE t1, t2 SET t2.name = 'John Smith' WHERE t1.user_num = t2.user_num;
+
+DROP TABLE t1, t2;
#
# Bug#48276: can't add column if subpartition exists
CREATE TABLE t1 (a INT, b INT)
diff --git a/mysql-test/t/partition_binlog_stmt.test b/mysql-test/t/partition_binlog_stmt.test
new file mode 100644
index 00000000000..cc57222dc3c
--- /dev/null
+++ b/mysql-test/t/partition_binlog_stmt.test
@@ -0,0 +1,27 @@
+--source include/have_partition.inc
+--source include/have_binlog_format_statement.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+--echo #
+--echo # Bug#51851: Server with SBR locks mutex twice on LOAD DATA into
+--echo # partitioned MyISAM table
+--write_file $MYSQLTEST_VARDIR/tmp/init_file.txt
+abcd
+EOF
+
+CREATE TABLE t1
+(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ name TINYBLOB NOT NULL,
+ modified TIMESTAMP DEFAULT '0000-00-00 00:00:00',
+ INDEX namelocs (name(255))) ENGINE = MyISAM
+PARTITION BY HASH(id) PARTITIONS 2;
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval LOAD DATA LOCAL INFILE '$MYSQLTEST_VARDIR/tmp/init_file.txt'
+INTO TABLE t1 (name);
+
+--remove_file $MYSQLTEST_VARDIR/tmp/init_file.txt
+DROP TABLE t1;
diff --git a/mysql-test/t/partition_error.test b/mysql-test/t/partition_error.test
index 434392c2e28..d3f10628254 100644
--- a/mysql-test/t/partition_error.test
+++ b/mysql-test/t/partition_error.test
@@ -1252,4 +1252,18 @@ PARTITION pmax VALUES LESS THAN MAXVALUE);
DROP TABLE old;
+--echo #
+--echo # Bug #56709: Memory leaks at running the 5.1 test suite
+--echo #
+
+CREATE TABLE t1 (a TIMESTAMP NOT NULL PRIMARY KEY);
+
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+ALTER TABLE t1
+PARTITION BY RANGE (EXTRACT(DAY FROM a)) (
+PARTITION p VALUES LESS THAN (18),
+PARTITION pmax VALUES LESS THAN MAXVALUE);
+
+DROP TABLE t1;
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/partition_innodb.test b/mysql-test/t/partition_innodb.test
index 0a32e6104b3..835a73fd961 100644
--- a/mysql-test/t/partition_innodb.test
+++ b/mysql-test/t/partition_innodb.test
@@ -8,6 +8,30 @@ drop table if exists t1, t2;
let $MYSQLD_DATADIR= `SELECT @@datadir`;
--echo #
+--echo # Bug#56287: crash when using Partition datetime in sub in query
+--echo #
+CREATE TABLE t1
+(c1 bigint(20) unsigned NOT NULL AUTO_INCREMENT,
+ c2 varchar(40) not null default '',
+ c3 datetime not NULL,
+ PRIMARY KEY (c1,c3),
+ KEY partidx(c3))
+ENGINE=InnoDB
+PARTITION BY RANGE (TO_DAYS(c3))
+(PARTITION p200912 VALUES LESS THAN (to_days('2010-01-01')),
+ PARTITION p201103 VALUES LESS THAN (to_days('2011-04-01')),
+ PARTITION p201912 VALUES LESS THAN MAXVALUE);
+
+insert into t1(c2,c3) values ("Test row",'2010-01-01 00:00:00');
+
+SELECT PARTITION_NAME, TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME = 't1' AND TABLE_SCHEMA = 'test';
+SELECT count(*) FROM t1 p where c3 in
+(select c3 from t1 t where t.c3 < date '2011-04-26 19:19:44'
+ and t.c3 > date '2011-04-26 19:18:44') ;
+
+DROP TABLE t1;
+
+--echo #
--echo # Bug#51830: Incorrect partition pruning on range partition (regression)
--echo #
CREATE TABLE t1 (a INT NOT NULL)
@@ -401,3 +425,16 @@ connection default;
SELECT * FROM t1;
COMMIT;
DROP TABLE t1;
+
+#
+# Bug #55146 Assertion `m_part_spec.start_part == m_part_spec.end_part' in index_read_idx_map
+#
+
+CREATE TABLE t1 (i1 int NOT NULL primary key, f1 int) ENGINE = InnoDB
+ PARTITION BY HASH(i1) PARTITIONS 2;
+
+INSERT INTO t1 VALUES (1,1), (2,2);
+
+SELECT * FROM t1 WHERE i1 = ( SELECT i1 FROM t1 WHERE f1=0 LIMIT 1 );
+
+DROP TABLE t1;
diff --git a/mysql-test/t/partition_innodb_semi_consistent.test b/mysql-test/t/partition_innodb_semi_consistent.test
index 2711d79f194..9d3e2570256 100644
--- a/mysql-test/t/partition_innodb_semi_consistent.test
+++ b/mysql-test/t/partition_innodb_semi_consistent.test
@@ -117,7 +117,17 @@ INSERT INTO t1 VALUES (1,'init');
DELIMITER |;
CREATE PROCEDURE p1()
BEGIN
- UPDATE t1 SET b = CONCAT(b, '+con2') WHERE a = 1;
+ # retry the UPDATE in case it times out the lock before con1 has time
+ # to COMMIT.
+ DECLARE do_retry INT DEFAULT 0;
+ DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET do_retry = 1;
+ retry_loop:LOOP
+ UPDATE t1 SET b = CONCAT(b, '+con2') WHERE a = 1;
+ IF do_retry = 0 THEN
+ LEAVE retry_loop;
+ END IF;
+ SET do_retry = 0;
+ END LOOP;
INSERT INTO t2 VALUES ();
END|
DELIMITER ;|
diff --git a/mysql-test/t/partition_pruning.test b/mysql-test/t/partition_pruning.test
index 358832496e5..db544d4643f 100644
--- a/mysql-test/t/partition_pruning.test
+++ b/mysql-test/t/partition_pruning.test
@@ -9,6 +9,30 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
--enable_warnings
--echo #
+--echo # Bug#53806: Wrong estimates for range query in partitioned MyISAM table
+--echo # Bug#46754: 'rows' field doesn't reflect partition pruning
+--echo #
+CREATE TABLE t1 (a INT PRIMARY KEY)
+PARTITION BY RANGE (a) (
+PARTITION p0 VALUES LESS THAN (1),
+PARTITION p1 VALUES LESS THAN (2),
+PARTITION p2 VALUES LESS THAN (3),
+PARTITION p3 VALUES LESS THAN (4),
+PARTITION p4 VALUES LESS THAN (5),
+PARTITION p5 VALUES LESS THAN (6),
+PARTITION max VALUES LESS THAN MAXVALUE);
+
+INSERT INTO t1 VALUES (-1),(0),(1),(2),(3),(4),(5),(6),(7),(8);
+
+--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 11 #
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= 1;
+--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 11 #
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < 7;
+--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 11 #
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= 1;
+DROP TABLE t1;
+
+--echo #
--echo # Bug#49742: Partition Pruning not working correctly for RANGE
--echo #
CREATE TABLE t1 (a INT PRIMARY KEY)
diff --git a/mysql-test/t/pool_of_threads.test b/mysql-test/t/pool_of_threads.test
index e71b16e1f89..530038cee91 100644
--- a/mysql-test/t/pool_of_threads.test
+++ b/mysql-test/t/pool_of_threads.test
@@ -4,6 +4,7 @@
-- source include/have_pool_of_threads.inc
# Slow test, don't run during staging part
-- source include/not_staging.inc
+-- source include/long_test.inc
-- source include/common-tests.inc
diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test
index 4390b70e9e9..9b3f3e750e1 100644
--- a/mysql-test/t/ps.test
+++ b/mysql-test/t/ps.test
@@ -3079,4 +3079,26 @@ EXECUTE stmt;
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
+--echo #
+--echo # Bug#54494 crash with explain extended and prepared statements
+--echo #
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (1),(2);
+PREPARE stmt FROM 'EXPLAIN EXTENDED SELECT 1 FROM t1 RIGHT JOIN t1 t2 ON 1';
+EXECUTE stmt;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+DROP TABLE t1;
+
+--echo #
+--echo # Bug#54488 crash when using explain and prepared statements with subqueries
+--echo #
+CREATE TABLE t1(f1 INT);
+INSERT INTO t1 VALUES (1),(1);
+PREPARE stmt FROM 'EXPLAIN SELECT 1 FROM t1 WHERE (SELECT (SELECT 1 FROM t1 GROUP BY f1))';
+EXECUTE stmt;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+DROP TABLE t1;
+
--echo End of 5.1 tests.
diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test
index de8467b509d..24487db826a 100644
--- a/mysql-test/t/query_cache.test
+++ b/mysql-test/t/query_cache.test
@@ -1,4 +1,5 @@
-- source include/have_query_cache.inc
+-- source include/long_test.inc
#
# Tests with query cache
diff --git a/mysql-test/t/row.test b/mysql-test/t/row.test
index cec44078279..fb49ce23644 100644
--- a/mysql-test/t/row.test
+++ b/mysql-test/t/row.test
@@ -266,3 +266,22 @@ SELECT 1 FROM t1 WHERE ROW(a, b) >=
ROW('1', (SELECT 1 FROM t1 WHERE a > 1234));
--enable_warnings
DROP TABLE t1;
+
+--echo #
+--echo # Bug #54190: Comparison to row subquery produces incorrect result
+--echo #
+
+SELECT ROW(1,2) = (SELECT 1,2 FROM DUAL WHERE 1 = 0);
+SELECT ROW(1,2) = (SELECT 1,3 FROM DUAL WHERE 1 = 0);
+
+CREATE TABLE t1 (i INT);
+INSERT INTO t1 () VALUES (1), (2), (3);
+
+SELECT ROW(1,2) = (SELECT 1,2 FROM t1 WHERE 1 = 0);
+SELECT ROW(1,2) = (SELECT 1,3 FROM t1 WHERE 1 = 0);
+SELECT i FROM t1 WHERE ROW(1,2) = (SELECT 1,2 FROM DUAL WHERE 1 = 0);
+SELECT i FROM t1 WHERE ROW(1,2) = (SELECT 1,3 FROM DUAL WHERE 1 = 0);
+
+DROP TABLE t1;
+
+--echo End of 5.1 tests
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test
index 89be351312d..9bacaaaf6ec 100644
--- a/mysql-test/t/subselect.test
+++ b/mysql-test/t/subselect.test
@@ -3735,4 +3735,43 @@ SELECT * FROM t2 UNION SELECT * FROM t2
DROP TABLE t1,t2;
--enable_result_log
+--echo # LP BUG#675248 - select->prep_where references on freed memory
+
+CREATE TABLE t1 (a int, b int);
+insert into t1 values (1,1),(0,0);
+
+CREATE TABLE t2 (c int);
+insert into t2 values (1),(2);
+
+prepare stmt1 from "select sum(a),(select sum(c) from t2 where table1.b) as sub
+from t1 as table1 group by sub";
+
+execute stmt1;
+
+deallocate prepare stmt1;
+
+prepare stmt1 from "select sum(a),(select sum(c) from t2 having table1.b) as sub
+from t1 as table1";
+
+execute stmt1;
+
+deallocate prepare stmt1;
+
+drop table t1,t2;
+
+--echo #
+--echo # Bug LP#693935/#58727: Assertion failure with
+--echo # a single row subquery returning more than one row
+--echo #
+
+create table t1 (a char(1) charset utf8);
+insert into t1 values ('a'), ('b');
+create table t2 (a binary(1));
+insert into t2 values ('x'), ('y');
+
+-- error ER_SUBQUERY_NO_1_ROW
+select * from t2 where a=(select a from t1) and a='x';
+
+drop table t1,t2;
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/subselect4.test b/mysql-test/t/subselect4.test
index 304714b83ae..41edd7f1216 100644
--- a/mysql-test/t/subselect4.test
+++ b/mysql-test/t/subselect4.test
@@ -98,6 +98,68 @@ CREATE VIEW v1 AS SELECT 1 LIKE ( 1 IN ( SELECT 1 ) );
CREATE VIEW v2 AS SELECT 1 LIKE '%' ESCAPE ( 1 IN ( SELECT 1 ) );
DROP VIEW v1, v2;
+--echo #
+--echo # Bug#51070: Query with a NOT IN subquery predicate returns a wrong
+--echo # result set
+--echo #
+CREATE TABLE t1 ( a INT, b INT );
+INSERT INTO t1 VALUES ( 1, NULL ), ( 2, NULL );
+
+CREATE TABLE t2 ( c INT, d INT );
+INSERT INTO t2 VALUES ( NULL, 3 ), ( NULL, 4 );
+
+CREATE TABLE t3 ( e INT, f INT );
+INSERT INTO t3 VALUES ( NULL, NULL ), ( NULL, NULL );
+
+CREATE TABLE t4 ( a INT );
+INSERT INTO t4 VALUES (1), (2), (3);
+
+CREATE TABLE t5 ( a INT );
+INSERT INTO t5 VALUES (NULL), (2);
+
+--replace_column 1 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x 10 x
+EXPLAIN
+SELECT * FROM t1 WHERE ( a, b ) NOT IN ( SELECT c, d FROM t2 );
+SELECT * FROM t1 WHERE ( a, b ) NOT IN ( SELECT c, d FROM t2 );
+
+EXPLAIN
+SELECT * FROM t1 WHERE ( a, b ) NOT IN ( SELECT c, d FROM t2 ) IS NULL;
+SELECT * FROM t1 WHERE ( a, b ) NOT IN ( SELECT c, d FROM t2 ) IS NULL;
+SELECT * FROM t1 WHERE ( a, b ) IN ( SELECT c, d FROM t2 ) IS NULL;
+SELECT * FROM t1 WHERE ( a, b ) NOT IN ( SELECT c, d FROM t2 ) IS UNKNOWN;
+SELECT * FROM t1 WHERE (( a, b ) NOT IN ( SELECT c, d FROM t2 )) IS UNKNOWN;
+
+SELECT * FROM t1 WHERE 1 = 1 AND ( a, b ) NOT IN ( SELECT c, d FROM t2 );
+
+--replace_column 1 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x 10 x
+EXPLAIN
+SELECT * FROM t1 WHERE ( a, b ) NOT IN ( SELECT e, f FROM t3 );
+SELECT * FROM t1 WHERE ( a, b ) NOT IN ( SELECT e, f FROM t3 );
+
+--replace_column 1 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x 10 x
+EXPLAIN
+SELECT * FROM t2 WHERE ( c, d ) NOT IN ( SELECT a, b FROM t1 );
+SELECT * FROM t2 WHERE ( c, d ) NOT IN ( SELECT a, b FROM t1 );
+
+--replace_column 1 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x 10 x
+EXPLAIN
+SELECT * FROM t3 WHERE ( e, f ) NOT IN ( SELECT c, d FROM t2 );
+SELECT * FROM t3 WHERE ( e, f ) NOT IN ( SELECT c, d FROM t2 );
+
+--replace_column 1 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x 10 x
+EXPLAIN
+SELECT * FROM t2 WHERE ( c, d ) NOT IN ( SELECT e, f FROM t3 );
+SELECT * FROM t2 WHERE ( c, d ) NOT IN ( SELECT e, f FROM t3 );
+
+SELECT * FROM t1 WHERE ( a, b ) NOT IN
+ ( SELECT c, d FROM t2 WHERE c = 1 AND c <> 1 );
+
+SELECT * FROM t1 WHERE b NOT IN ( SELECT c FROM t2 WHERE c = 1 );
+
+SELECT * FROM t1 WHERE NULL NOT IN ( SELECT c FROM t2 WHERE c = 1 AND c <> 1 );
+
+DROP TABLE t1, t2, t3, t4, t5;
+
--echo #
--echo # End of 5.1 tests.
--echo #
diff --git a/mysql-test/t/table_elim.test b/mysql-test/t/table_elim.test
index 7ad69d5bf37..5576362b396 100644
--- a/mysql-test/t/table_elim.test
+++ b/mysql-test/t/table_elim.test
@@ -467,3 +467,35 @@ HAVING
field4 != 6;
drop table t0,t1,t2,t3,t4,t5,t6;
+
+--echo #
+--echo # BUG#675118: Elimination of a table results in an invalid execution plan
+--echo #
+CREATE TABLE t1 (f1 int(11), PRIMARY KEY (f1)) ;
+
+CREATE TABLE t2 (f4 varchar(1024), KEY (f4)) ;
+INSERT IGNORE INTO t2 VALUES ('xcddwntkbxyorzdv'),
+ ('cnxxcddwntkbxyor'),('r'),('r'), ('did'),('I'),('when'),
+ ('hczkfqjeggivdvac'),('e'),('okay'),('up');
+
+CREATE TABLE t3 (f4 varchar(1024), f1 int(11), f2 int(11)) ;
+INSERT IGNORE INTO t3 VALUES ('f','4','0'),('n','5','-996540416');
+
+CREATE TABLE t4 (f1 int(11), f3 varchar(10)) ;
+INSERT IGNORE INTO t4 VALUES ('8','n'),('9','nwzcerzsgx'),('10','c');
+
+CREATE TABLE t5 (f5 int(11), KEY (f5)) ;
+
+EXPLAIN
+SELECT t3.f2
+FROM t2
+LEFT JOIN t3
+LEFT JOIN t4
+LEFT JOIN t1 ON t4.f1 = t1.f1
+JOIN t5 ON t4.f3 ON t3.f1 = t5.f5 ON t2.f4 = t3.f4
+WHERE t3.f2 ;
+--echo # ^^ The above must not produce a QEP of t3,t5,t2,t4
+--echo # as that violates the "no interleaving of outer join nests" rule.
+
+DROP TABLE t1,t2,t3,t4,t5;
+
diff --git a/mysql-test/t/trigger_notembedded.test b/mysql-test/t/trigger_notembedded.test
index 1dee1db0a3a..f595f195dcc 100644
--- a/mysql-test/t/trigger_notembedded.test
+++ b/mysql-test/t/trigger_notembedded.test
@@ -1005,4 +1005,52 @@ disconnect con1;
DROP USER 'no_rights'@'localhost';
DROP DATABASE db1;
+#
+# Bug#55421 Protocol::end_statement(): Assertion `0' on multi-table UPDATE IGNORE
+# To reproduce a crash we need to provoke a trigger execution with
+# the following conditions:
+# - active SELECT statement during trigger execution
+# (i.e. LEX::current_select != NULL);
+# - IGNORE option (i.e. LEX::current_select->no_error == TRUE);
+--disable_warnings
+DROP DATABASE IF EXISTS mysqltest_db1;
+--enable_warnings
+
+CREATE DATABASE mysqltest_db1;
+USE mysqltest_db1;
+
+GRANT ALL ON mysqltest_db1.* TO mysqltest_u1@localhost;
+
+--connect(con1,localhost,mysqltest_u1,,mysqltest_db1)
+
+CREATE TABLE t1 (
+ a1 int,
+ a2 int
+);
+INSERT INTO t1 VALUES (1, 20);
+
+CREATE TRIGGER mysqltest_db1.upd_t1
+BEFORE UPDATE ON t1 FOR EACH ROW SET new.a2 = 200;
+
+CREATE TABLE t2 (
+ a1 int
+);
+
+INSERT INTO t2 VALUES (2);
+
+--connection default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+UPDATE IGNORE t1, t2 SET t1.a1 = 2, t2.a1 = 3 WHERE t1.a1 = 1 AND t2.a1 = 2;
+# Cleanup
+
+DROP DATABASE mysqltest_db1;
+DROP USER mysqltest_u1@localhost;
+
+--disconnect con1
+--connection default
+USE test;
+
--echo End of 5.1 tests.
diff --git a/mysql-test/t/type_timestamp.test b/mysql-test/t/type_timestamp.test
index e8374e0ebfc..602f6f089c2 100644
--- a/mysql-test/t/type_timestamp.test
+++ b/mysql-test/t/type_timestamp.test
@@ -357,3 +357,20 @@ SELECT f1,f2-f3 FROM t1;
DROP TABLE t1;
--echo End of 5.0 tests
+
+--echo #
+--echo # Bug #55779: select does not work properly in mysql server
+--echo # Version "5.1.42 SUSE MySQL RPM"
+--echo #
+
+CREATE TABLE t1 (a TIMESTAMP, KEY (a));
+
+INSERT INTO t1 VALUES ('2000-01-01 00:00:00'), ('2000-01-01 00:00:00'),
+ ('2000-01-01 00:00:01'), ('2000-01-01 00:00:01');
+
+SELECT a FROM t1 WHERE a >= 20000101000000;
+SELECT a FROM t1 WHERE a >= '20000101000000';
+
+DROP TABLE t1;
+
+--echo End of 5.1 tests
diff --git a/mysql-test/t/variables_debug.test b/mysql-test/t/variables_debug.test
index 12f5d2e6ca5..e6f1bbddc2a 100644
--- a/mysql-test/t/variables_debug.test
+++ b/mysql-test/t/variables_debug.test
@@ -25,4 +25,17 @@ SELECT @@global.debug;
SET GLOBAL debug=@old_debug;
+--echo #
+--echo # Bug #56709: Memory leaks at running the 5.1 test suite
+--echo #
+
+SET @old_local_debug = @@debug;
+
+SET @@debug='d,foo';
+SELECT @@debug;
+SET @@debug='';
+SELECT @@debug;
+
+SET @@debug = @old_local_debug;
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/wait_timeout.test b/mysql-test/t/wait_timeout.test
index 6947e346675..eb86cf17ebb 100644
--- a/mysql-test/t/wait_timeout.test
+++ b/mysql-test/t/wait_timeout.test
@@ -53,7 +53,7 @@ while (!`select @aborted_clients`)
dec $retries;
if (!$retries)
{
- Failed to detect that client has been aborted;
+ die Failed to detect that client has been aborted;
}
}
--enable_query_log
@@ -108,7 +108,7 @@ while (!`select @aborted_clients`)
dec $retries;
if (!$retries)
{
- Failed to detect that client has been aborted;
+ die Failed to detect that client has been aborted;
}
}
--enable_query_log
diff --git a/mysql-test/valgrind.supp b/mysql-test/valgrind.supp
index 1919b79461d..e07625ad49a 100644
--- a/mysql-test/valgrind.supp
+++ b/mysql-test/valgrind.supp
@@ -546,6 +546,19 @@
fun:_dl_signal_error
}
+{
+ dlsym memory loss from plugin
+ Memcheck:Leak
+ obj:/lib*/ld-*.so
+ obj:/lib*/ld-*.so
+ obj:/lib*/ld-*.so
+ obj:/lib*/libc-*.so
+ obj:/lib*/libdl-*.so
+ obj:/lib*/ld-*.so
+ obj:/lib*/libdl-*.so
+ fun:dlsym
+}
+
#
# Reading wrong addresses on SuSe Linux 10.3 32 bit
#
diff --git a/mysys/CMakeLists.txt b/mysys/CMakeLists.txt
index bf0c6551a11..7cbd34ef1af 100644
--- a/mysys/CMakeLists.txt
+++ b/mysys/CMakeLists.txt
@@ -13,7 +13,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
# Only the server link with this library, the client libraries and the client
# executables all link with recompiles of source found in the "mysys" directory.
diff --git a/mysys/Makefile.am b/mysys/Makefile.am
index 95358883f4e..515791be7f1 100644
--- a/mysys/Makefile.am
+++ b/mysys/Makefile.am
@@ -19,10 +19,11 @@ MYSQLBASEdir= $(prefix)
INCLUDES = @ZLIB_INCLUDES@ -I$(top_builddir)/include \
-I$(top_srcdir)/include -I$(srcdir)
pkglib_LIBRARIES = libmysys.a
+noinst_LTLIBRARIES = libmysys.la
LDADD = libmysys.a $(top_builddir)/strings/libmystrings.a $(top_builddir)/dbug/libdbug.a
noinst_HEADERS = mysys_priv.h my_static.h my_handler_errors.h \
my_safehash.h
-libmysys_a_SOURCES = my_init.c my_getwd.c mf_getdate.c my_mmap.c \
+libmysys_la_SOURCES = my_init.c my_getwd.c mf_getdate.c my_mmap.c \
mf_path.c mf_loadpath.c my_file.c \
my_open.c my_create.c my_dup.c my_seek.c my_read.c \
my_pread.c my_write.c my_getpagesize.c \
@@ -57,19 +58,22 @@ libmysys_a_SOURCES = my_init.c my_getwd.c mf_getdate.c my_mmap.c \
my_memmem.c stacktrace.c \
my_windac.c my_access.c base64.c my_libwrap.c \
wqueue.c
+libmysys_la_LDFLAGS = $(AM_LDFLAGS) @WRAPLIBS@
+libmysys_la_LIBADD = $(ZLIB_LIBS)
if NEED_THREAD
# mf_keycache is used only in the server, so it is safe to leave the file
# out of the non-threaded library.
# In fact, it will currently not compile without thread support.
-libmysys_a_SOURCES += mf_keycache.c mf_keycaches.c
+libmysys_la_SOURCES += thr_alarm.c thr_lock.c thr_mutex.c thr_rwlock.c \
+ my_pthread.c my_thr_init.c waiting_threads.c \
+ mf_keycache.c mf_keycaches.c
endif
EXTRA_DIST = thr_alarm.c thr_lock.c my_pthread.c my_thr_init.c \
thr_mutex.c thr_rwlock.c waiting_threads.c \
CMakeLists.txt mf_soundex.c \
my_conio.c my_wincond.c my_winthread.c
-libmysys_a_LIBADD = @THREAD_LOBJECTS@
# test_dir_DEPENDENCIES= $(LIBRARIES)
# testhash_DEPENDENCIES= $(LIBRARIES)
# test_charset_DEPENDENCIES= $(LIBRARIES)
@@ -83,8 +87,6 @@ DEFS = -DDEFAULT_BASEDIR='"$(prefix)"' \
-DDEFAULT_SYSCONFDIR='"$(sysconfdir)"' \
@DEFS@
-libmysys_a_DEPENDENCIES= @THREAD_LOBJECTS@
-
# I hope this always does the right thing. Otherwise this is only test programs
FLAGS=$(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) @NOINST_LDFLAGS@
@@ -95,6 +97,10 @@ CLEANFILES = test_bitmap$(EXEEXT) test_priority_queue$(EXEEXT) \
testhash$(EXEEXT) test_gethwaddr$(EXEEXT) \
test_base64$(EXEEXT) test_thr_mutex$(EXEEXT)
+libmysys_a_SOURCES=
+libmysys.a: libmysys.la
+ $(CP) .libs/libmysys.a $@
+
#
# The CP .. RM stuff is to avoid problems with some compilers (like alpha ccc)
# which automaticly removes the object files you use to compile a final program
diff --git a/mysys/charset.c b/mysys/charset.c
index 153ef8b7e2c..7b72f1f5ae3 100644
--- a/mysys/charset.c
+++ b/mysys/charset.c
@@ -199,6 +199,7 @@ static my_bool simple_cs_is_full(CHARSET_INFO *cs)
}
+#if defined(HAVE_UCA_COLLATIONS) && (defined(HAVE_CHARSET_ucs2) || defined(HAVE_CHARSET_utf8))
static void
copy_uca_collation(struct charset_info_st *to, CHARSET_INFO *from)
{
@@ -212,6 +213,7 @@ copy_uca_collation(struct charset_info_st *to, CHARSET_INFO *from)
to->state|= MY_CS_AVAILABLE | MY_CS_LOADED |
MY_CS_STRNXFRM | MY_CS_UNICODE;
}
+#endif
static int add_collation(struct charset_info_st *cs)
diff --git a/mysys/my_gethostbyname.c b/mysys/my_gethostbyname.c
index abd388302be..12cf90271dd 100644
--- a/mysys/my_gethostbyname.c
+++ b/mysys/my_gethostbyname.c
@@ -91,12 +91,11 @@ extern pthread_mutex_t LOCK_gethostbyname_r;
is finished with the structure.
*/
-struct hostent *
-my_gethostbyname_r(const char *name,
- struct hostent *result __attribute__((unused)),
- char *buffer __attribute__((unused)),
- int buflen __attribute__((unused)),
- int *h_errnop)
+struct hostent *my_gethostbyname_r(const char *name,
+ struct hostent *res __attribute__((unused)),
+ char *buffer __attribute__((unused)),
+ int buflen __attribute__((unused)),
+ int *h_errnop)
{
struct hostent *hp;
pthread_mutex_lock(&LOCK_gethostbyname_r);
diff --git a/mysys/my_gethwaddr.c b/mysys/my_gethwaddr.c
index 00e0e90f1e4..90908bd1c0d 100644
--- a/mysys/my_gethwaddr.c
+++ b/mysys/my_gethwaddr.c
@@ -21,18 +21,6 @@
#ifndef MAIN
-#if defined(__FreeBSD__) || defined(__linux__)
-static my_bool memcpy_and_test(uchar *to, uchar *from, uint len)
-{
- uint i, res=1;
-
- for (i=0; i < len; i++)
- if ((*to++= *from++))
- res=0;
- return res;
-}
-#endif /* FreeBSD || linux */
-
#ifdef __FreeBSD__
#include <net/ethernet.h>
@@ -44,10 +32,11 @@ static my_bool memcpy_and_test(uchar *to, uchar *from, uint len)
my_bool my_gethwaddr(uchar *to)
{
size_t len;
- uchar *buf, *next, *end, *addr;
+ char *buf, *next, *end;
struct if_msghdr *ifm;
struct sockaddr_dl *sdl;
int res=1, mib[6]={CTL_NET, AF_ROUTE, 0, AF_LINK, NET_RT_IFLIST, 0};
+ char zero_array[ETHER_ADDR_LEN] = {0};
if (sysctl(mib, 6, NULL, &len, NULL, 0) == -1)
goto err;
@@ -63,9 +52,9 @@ my_bool my_gethwaddr(uchar *to)
ifm = (struct if_msghdr *)next;
if (ifm->ifm_type == RTM_IFINFO)
{
- sdl = (struct sockaddr_dl *)(ifm + 1);
- addr=LLADDR(sdl);
- res=memcpy_and_test(to, addr, ETHER_ADDR_LEN);
+ sdl= (struct sockaddr_dl *)(ifm + 1);
+ memcpy(to, LLADDR(sdl), ETHER_ADDR_LEN);
+ res= memcmp(to, zero_array, ETHER_ADDR_LEN) ? 0 : 1;
}
}
@@ -81,8 +70,9 @@ err:
my_bool my_gethwaddr(uchar *to)
{
- int fd, res=1;
+ int fd, res= 1;
struct ifreq ifr;
+ char zero_array[ETHER_ADDR_LEN] = {0};
fd = socket(AF_INET, SOCK_DGRAM, 0);
if (fd < 0)
@@ -91,9 +81,13 @@ my_bool my_gethwaddr(uchar *to)
bzero(&ifr, sizeof(ifr));
strnmov(ifr.ifr_name, "eth0", sizeof(ifr.ifr_name) - 1);
- do {
+ do
+ {
if (ioctl(fd, SIOCGIFHWADDR, &ifr) >= 0)
- res=memcpy_and_test(to, (uchar *)&ifr.ifr_hwaddr.sa_data, ETHER_ADDR_LEN);
+ {
+ memcpy(to, &ifr.ifr_hwaddr.sa_data, ETHER_ADDR_LEN);
+ res= memcmp(to, zero_array, ETHER_ADDR_LEN) ? 0 : 1;
+ }
} while (res && (errno == 0 || errno == ENODEV) && ifr.ifr_name[3]++ < '6');
close(fd);
diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c
index db6ccd230f2..5d0703f09a8 100644
--- a/mysys/my_getopt.c
+++ b/mysys/my_getopt.c
@@ -112,7 +112,7 @@ int handle_options(int *argc, char ***argv,
const struct my_option *longopts,
my_get_one_option get_one_option)
{
- uint opt_found, argvpos= 0, length;
+ uint UNINIT_VAR(opt_found), argvpos= 0, length;
my_bool end_of_options= 0, must_be_var, set_maximum_value,
option_is_loose;
char **pos, **pos_end, *optend, *opt_str, key_name[FN_REFLEN];
@@ -121,7 +121,6 @@ int handle_options(int *argc, char ***argv,
void *value;
int error, i;
- LINT_INIT(opt_found);
/* handle_options() assumes arg0 (program name) always exists */
DBUG_ASSERT(argc && *argc >= 1);
DBUG_ASSERT(argv && *argv);
diff --git a/mysys/my_redel.c b/mysys/my_redel.c
index cf0986a7821..2de989a2854 100644
--- a/mysys/my_redel.c
+++ b/mysys/my_redel.c
@@ -40,7 +40,8 @@ struct utimbuf {
#define REDEL_EXT ".BAK"
-int my_redel(const char *org_name, const char *tmp_name, myf MyFlags)
+int my_redel(const char *org_name, const char *tmp_name,
+ time_t backup_time_stamp, myf MyFlags)
{
int error=1;
DBUG_ENTER("my_redel");
@@ -51,13 +52,9 @@ int my_redel(const char *org_name, const char *tmp_name, myf MyFlags)
goto end;
if (MyFlags & MY_REDEL_MAKE_BACKUP)
{
- char name_buff[FN_REFLEN+20];
- char ext[20];
- ext[0]='-';
- get_date(ext+1,2+4,(time_t) 0);
- strmov(strend(ext),REDEL_EXT);
- if (my_rename(org_name, fn_format(name_buff, org_name, "", ext, 2),
- MyFlags))
+ char name_buff[FN_REFLEN + MY_BACKUP_NAME_EXTRA_LENGTH];
+ my_create_backup_name(name_buff, org_name, backup_time_stamp);
+ if (my_rename(org_name, name_buff, MyFlags))
goto end;
}
else if (my_delete_allow_opened(org_name, MyFlags))
@@ -149,3 +146,23 @@ int my_copystat(const char *from, const char *to, int MyFlags)
#endif
return 0;
} /* my_copystat */
+
+
+/**
+ Create a backup file name.
+ @fn my_create_backup_name()
+ @param to Store new file name here
+ @param from Original name
+
+ @info
+ The backup name is made by adding -YYMMDDHHMMSS.BAK to the file name
+*/
+
+void my_create_backup_name(char *to, const char *from, time_t backup_start)
+{
+ char ext[MY_BACKUP_NAME_EXTRA_LENGTH+1];
+ ext[0]='-';
+ get_date(ext+1, GETDATE_SHORT_DATE | GETDATE_HHMMSSTIME, backup_start);
+ strmov(strend(ext),REDEL_EXT);
+ strmov(strmov(to, from), ext);
+}
diff --git a/mysys/my_symlink.c b/mysys/my_symlink.c
index 33f45a882e1..164533ad765 100644
--- a/mysys/my_symlink.c
+++ b/mysys/my_symlink.c
@@ -113,7 +113,6 @@ int my_is_symlink(const char *filename __attribute__((unused)))
#endif
}
-
/*
Resolve all symbolic links in path
'to' may be equal to 'filename'
@@ -150,7 +149,21 @@ int my_realpath(char *to, const char *filename,
}
DBUG_RETURN(result);
#else
+#ifdef _WIN32
+ int ret= GetFullPathName(filename,FN_REFLEN, to, NULL);
+ if (ret == 0 || ret > FN_REFLEN)
+ {
+ if (ret > FN_REFLEN)
+ my_errno= ENAMETOOLONG;
+ else
+ my_errno= EACCES;
+ if (MyFlags & MY_WME)
+ my_error(EE_REALPATH, MYF(0), filename, my_errno);
+ return -1;
+ }
+#else
my_load_path(to, filename, NullS);
+#endif
return 0;
#endif
}
diff --git a/mysys/my_sync.c b/mysys/my_sync.c
index a2b615a8661..dae20b0163e 100644
--- a/mysys/my_sync.c
+++ b/mysys/my_sync.c
@@ -64,7 +64,7 @@ int my_sync(File fd, myf my_flags)
/* Some file systems don't support F_FULLFSYNC and fail above: */
DBUG_PRINT("info",("fcntl(F_FULLFSYNC) failed, falling back"));
#endif
-#if defined(HAVE_FDATASYNC)
+#if defined(HAVE_FDATASYNC) && HAVE_DECL_FDATASYNC
res= fdatasync(fd);
#elif defined(HAVE_FSYNC)
res= fsync(fd);
@@ -97,6 +97,7 @@ int my_sync(File fd, myf my_flags)
static const char cur_dir_name[]= {FN_CURLIB, 0};
+
/*
Force directory information to disk.
@@ -108,6 +109,7 @@ static const char cur_dir_name[]= {FN_CURLIB, 0};
RETURN
0 if ok, !=0 if error
*/
+
int my_sync_dir(const char *dir_name __attribute__((unused)),
myf my_flags __attribute__((unused)))
{
@@ -138,7 +140,6 @@ int my_sync_dir(const char *dir_name __attribute__((unused)),
#endif
}
-
/*
Force directory information to disk.
@@ -150,6 +151,7 @@ int my_sync_dir(const char *dir_name __attribute__((unused)),
RETURN
0 if ok, !=0 if error
*/
+
int my_sync_dir_by_file(const char *file_name __attribute__((unused)),
myf my_flags __attribute__((unused)))
{
@@ -162,4 +164,3 @@ int my_sync_dir_by_file(const char *file_name __attribute__((unused)),
return 0;
#endif
}
-
diff --git a/mysys/my_uuid.c b/mysys/my_uuid.c
index f115806b4e9..e2372391b06 100644
--- a/mysys/my_uuid.c
+++ b/mysys/my_uuid.c
@@ -50,7 +50,7 @@ static ulonglong uuid_time= 0;
static uchar uuid_suffix[2+6]; /* clock_seq and node */
#ifdef THREAD
-pthread_mutex_t LOCK_uuid_generator;
+static pthread_mutex_t LOCK_uuid_generator;
#endif
/*
diff --git a/mysys/sha1.c b/mysys/sha1.c
index 3469e480c26..e5b33a9ad13 100644
--- a/mysys/sha1.c
+++ b/mysys/sha1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2004, 2006 MySQL AB
+/* Copyright (c) 2002, 2004, 2006 MySQL AB
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
@@ -6,26 +6,57 @@
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
+ 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 */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
/*
Original Source from: http://www.faqs.org/rfcs/rfc3174.html
+ Copyright (C) The Internet Society (2001). All Rights Reserved.
+
+ This document and translations of it may be copied and furnished to
+ others, and derivative works that comment on or otherwise explain it
+ or assist in its implementation may be prepared, copied, published
+ and distributed, in whole or in part, without restriction of any
+ kind, provided that the above copyright notice and this paragraph are
+ included on all such copies and derivative works. However, this
+ document itself may not be modified in any way, such as by removing
+ the copyright notice or references to the Internet Society or other
+ Internet organizations, except as needed for the purpose of
+ developing Internet standards in which case the procedures for
+ copyrights defined in the Internet Standards process must be
+ followed, or as required to translate it into languages other than
+ English.
+
+ The limited permissions granted above are perpetual and will not be
+ revoked by the Internet Society or its successors or assigns.
+
+ This document and the information contained herein is provided on an
+ "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
+ TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
+ BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
+ HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+
+ Acknowledgement
+ Funding for the RFC Editor function is currently provided by the
+ Internet Society.
+
DESCRIPTION
- This file implements the Secure Hashing Algorithm 1 as
- defined in FIPS PUB 180-1 published April 17, 1995.
-
- The SHA-1, produces a 160-bit message digest for a given data
- stream. It should take about 2**n steps to find a message with the
- same digest as a given message and 2**(n/2) to find any two
- messages with the same digest, when n is the digest size in bits.
- Therefore, this algorithm can serve as a means of providing a
- "fingerprint" for a message.
+ This file implements the Secure Hashing Algorithm 1 as
+ defined in FIPS PUB 180-1 published April 17, 1995.
+
+ The SHA-1, produces a 160-bit message digest for a given data
+ stream. It should take about 2**n steps to find a message with the
+ same digest as a given message and 2**(n/2) to find any two
+ messages with the same digest, when n is the digest size in bits.
+ Therefore, this algorithm can serve as a means of providing a
+ "fingerprint" for a message.
PORTABILITY ISSUES
SHA-1 is defined in terms of 32-bit "words". This code uses
diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c
index 341b2f0058e..68a3caf6da7 100644
--- a/mysys/thr_lock.c
+++ b/mysys/thr_lock.c
@@ -158,15 +158,13 @@ static int check_lock(struct st_lock_list *list, const char* lock_type,
{
THR_LOCK_DATA *data,**prev;
uint count=0;
- THR_LOCK_OWNER *UNINIT_VAR(first_owner);
prev= &list->data;
if (list->data)
{
- enum thr_lock_type last_lock_type=list->data->type;
+ enum thr_lock_type last_lock_type= list->data->type;
+ THR_LOCK_OWNER *first_owner= list->data->owner;
- if (same_owner && list->data)
- first_owner= list->data->owner;
for (data=list->data; data && count++ < MAX_LOCKS ; data=data->next)
{
if (data->type != last_lock_type)
@@ -184,8 +182,8 @@ static int check_lock(struct st_lock_list *list, const char* lock_type,
last_lock_type != TL_WRITE_CONCURRENT_INSERT)
{
fprintf(stderr,
- "Warning: Found locks from different threads in %s: %s\n",
- lock_type,where);
+ "Warning: Found locks from different threads in %s at '%s'. org_lock_type: %d last_lock_type: %d new_lock_type: %d\n",
+ lock_type, where, list->data->type, last_lock_type, data->type);
return 1;
}
if (no_cond && data->cond)
diff --git a/mysys/thr_mutex.c b/mysys/thr_mutex.c
index 5ab1e443a88..77f2286b3d1 100644
--- a/mysys/thr_mutex.c
+++ b/mysys/thr_mutex.c
@@ -527,8 +527,8 @@ int safe_cond_wait(pthread_cond_t *cond, safe_mutex_t *mp, const char *file,
int safe_cond_timedwait(pthread_cond_t *cond, safe_mutex_t *mp,
- struct timespec *abstime,
- const char *file, uint line)
+ const struct timespec *abstime,
+ const char *file, uint line)
{
int error;
safe_mutex_t save_state;
diff --git a/mysys/tree.c b/mysys/tree.c
index e4854581204..68eaecbb27b 100644
--- a/mysys/tree.c
+++ b/mysys/tree.c
@@ -375,6 +375,7 @@ void *tree_search_key(TREE *tree, const void *key,
case HA_READ_KEY_EXACT:
case HA_READ_KEY_OR_NEXT:
case HA_READ_BEFORE_KEY:
+ case HA_READ_KEY_OR_PREV:
last_equal_element= parents;
cmp= 1;
break;
@@ -418,6 +419,9 @@ void *tree_search_key(TREE *tree, const void *key,
case HA_READ_BEFORE_KEY:
*last_pos= last_right_step_parent;
break;
+ case HA_READ_KEY_OR_PREV:
+ *last_pos= last_equal_element ? last_equal_element : last_right_step_parent;
+ break;
default:
return NULL;
}
diff --git a/plugin/auth/dialog.c b/plugin/auth/dialog.c
index 72c6364f49a..49ab0c9a158 100644
--- a/plugin/auth/dialog.c
+++ b/plugin/auth/dialog.c
@@ -327,7 +327,10 @@ static int perform_dialog(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql)
or fall back to the default implementation.
*/
-static int init_dialog()
+static int init_dialog(char *errbuf __attribute__((unused)),
+ size_t sizeof_errbuf __attribute__((unused)),
+ int argc __attribute__((unused)),
+ va_list args __attribute__((unused)))
{
void *sym= dlsym(RTLD_DEFAULT, "mysql_authentication_dialog_ask");
ask= sym ? (mysql_authentication_dialog_ask_t)sym : builtin_ask;
diff --git a/plugin/daemon_example/Makefile.am b/plugin/daemon_example/Makefile.am
index 7bfaf5ac79f..5905e3ef075 100644
--- a/plugin/daemon_example/Makefile.am
+++ b/plugin/daemon_example/Makefile.am
@@ -34,6 +34,3 @@ EXTRA_LIBRARIES = libdaemon_example.a
noinst_LIBRARIES = @plugin_daemon_example_static_target@
libdaemon_example_a_CXXFLAGS = $(AM_CXXFLAGS)
libdaemon_example_a_SOURCES= daemon_example.cc
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/plugin/fulltext/Makefile.am b/plugin/fulltext/Makefile.am
index 45565e9fdb2..8be2a97a34f 100644
--- a/plugin/fulltext/Makefile.am
+++ b/plugin/fulltext/Makefile.am
@@ -22,6 +22,3 @@ pkgplugin_LTLIBRARIES= mypluglib.la
mypluglib_la_SOURCES= plugin_example.c
mypluglib_la_LDFLAGS= -module -rpath $(pkgplugindir)
mypluglib_la_CFLAGS= -shared -DMYSQL_DYNAMIC_PLUGIN
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/pstack/aout/Makefile.am b/pstack/aout/Makefile.am
index 2e61555db87..0b02cb7b643 100644
--- a/pstack/aout/Makefile.am
+++ b/pstack/aout/Makefile.am
@@ -1,4 +1 @@
noinst_HEADERS = aout64.h stab.def stab_gnu.h
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/regex/CMakeLists.txt b/regex/CMakeLists.txt
index b8a0a953af6..109b8d46a36 100755
--- a/regex/CMakeLists.txt
+++ b/regex/CMakeLists.txt
@@ -13,8 +13,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG -DSAFEMALLOC -DSAFE_MUTEX")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
diff --git a/regex/Makefile.am b/regex/Makefile.am
index 0fd62a777f6..6e46e537c4b 100644
--- a/regex/Makefile.am
+++ b/regex/Makefile.am
@@ -16,10 +16,10 @@
# MA 02111-1307, USA
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include
-noinst_LIBRARIES = libregex.a
-LDADD= libregex.a $(top_builddir)/strings/libmystrings.a
+noinst_LTLIBRARIES = libregex.la
+LDADD= libregex.la $(top_builddir)/strings/libmystrings.la
noinst_HEADERS = cclass.h cname.h regex2.h utils.h engine.c my_regex.h
-libregex_a_SOURCES = regerror.c regcomp.c regexec.c regfree.c reginit.c
+libregex_la_SOURCES = regerror.c regcomp.c regexec.c regfree.c reginit.c
noinst_PROGRAMS = re
re_SOURCES = split.c debug.c main.c
re_LDFLAGS= @NOINST_LDFLAGS@
diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist
index 8940c8b4eb4..37149440922 100755
--- a/scripts/make_win_bin_dist
+++ b/scripts/make_win_bin_dist
@@ -177,7 +177,6 @@ cp tests/$TARGET/*.exe $DESTDIR/bin/
cp libmysql/$TARGET/libmysql.dll $DESTDIR/bin/
cp sql/$TARGET/mysqld.exe $DESTDIR/bin/mysqld$EXE_SUFFIX.exe
-cp sql/$TARGET/mysqld.map $DESTDIR/bin/mysqld$EXE_SUFFIX.map
if [ x"$TARGET" != x"release" ] ; then
cp sql/$TARGET/mysqld.pdb $DESTDIR/bin/mysqld$EXE_SUFFIX.pdb
fi
@@ -186,7 +185,6 @@ if [ x"$PACK_DEBUG" = x"" -a -f "sql/debug/mysqld.exe" -o \
x"$PACK_DEBUG" = x"yes" ] ; then
cp sql/debug/mysqld.exe $DESTDIR/bin/mysqld-debug.exe
cp sql/debug/mysqld.pdb $DESTDIR/bin/mysqld-debug.pdb
- cp sql/debug/mysqld.map $DESTDIR/bin/mysqld-debug.map
fi
# ----------------------------------------------------------------------
diff --git a/scripts/mysql_convert_table_format.sh b/scripts/mysql_convert_table_format.sh
index 6f586d0e8e0..7983982913c 100644
--- a/scripts/mysql_convert_table_format.sh
+++ b/scripts/mysql_convert_table_format.sh
@@ -28,7 +28,7 @@ $opt_port=0;
$exit_status=0;
GetOptions(
- "e|engine|type=s" => \$opt_type,
+ "e|engine|type=s" => \$opt_engine,
"f|force" => \$opt_force,
"help|?" => \$opt_help,
"h|host=s" => \$opt_host,
diff --git a/server-tools/CMakeLists.txt b/server-tools/CMakeLists.txt
index 9cfeb4e80f9..74b16c5feb1 100644
--- a/server-tools/CMakeLists.txt
+++ b/server-tools/CMakeLists.txt
@@ -13,8 +13,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
ADD_DEFINITIONS(-DMYSQL_SERVER -DMYSQL_INSTANCE_MANAGER)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/sql
diff --git a/server-tools/instance-manager/CMakeLists.txt b/server-tools/instance-manager/CMakeLists.txt
index 2d04e522a6d..54389a6f3cc 100755
--- a/server-tools/instance-manager/CMakeLists.txt
+++ b/server-tools/instance-manager/CMakeLists.txt
@@ -14,13 +14,11 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
ADD_DEFINITIONS(-DMYSQL_SERVER -DMYSQL_INSTANCE_MANAGER)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/sql
${PROJECT_SOURCE_DIR}/extra/yassl/include)
-
+
ADD_EXECUTABLE(mysqlmanager buffer.cc command.cc commands.cc guardian.cc instance.cc instance_map.cc
instance_options.cc listener.cc log.cc manager.cc messages.cc mysql_connection.cc
mysqlmanager.cc options.cc parse.cc parse_output.cc priv.cc protocol.cc
diff --git a/server-tools/instance-manager/Makefile.am b/server-tools/instance-manager/Makefile.am
index 5c5af3377eb..dce7c77232d 100644
--- a/server-tools/instance-manager/Makefile.am
+++ b/server-tools/instance-manager/Makefile.am
@@ -99,6 +99,3 @@ EXTRA_DIST = WindowsService.cpp WindowsService.h IMService.cpp \
tags:
ctags -R *.h *.cc
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/sql-bench/compare-results.sh b/sql-bench/compare-results.sh
index fec65497c57..fe3563bd0b9 100644
--- a/sql-bench/compare-results.sh
+++ b/sql-bench/compare-results.sh
@@ -512,7 +512,7 @@ sub print_value
else
{
$first=1 if ($first == 0); # Assume that it took one second instead of 0
- $tmp= sprintf("%.2f",$value/$first);
+ $tmp= sprintf("%.3f",$value/$first);
}
if (defined($flags))
{
diff --git a/sql-common/client.c b/sql-common/client.c
index 3788ca9829b..c449cd17100 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -1978,7 +1978,7 @@ static int send_change_user_packet(MCPVIO_EXT *mpvio,
char *buff, *end;
int res= 1;
- buff= my_alloca(USERNAME_LENGTH + data_len + 1 + NAME_LEN + 2 + NAME_LEN);
+ buff= my_alloca(USERNAME_LENGTH+1 + data_len+1 + NAME_LEN+1 + 2 + NAME_LEN+1);
end= strmake(buff, mysql->user, USERNAME_LENGTH) + 1;
diff --git a/sql-common/client_plugin.c b/sql-common/client_plugin.c
index c609f165d1c..f33662bb222 100644
--- a/sql-common/client_plugin.c
+++ b/sql-common/client_plugin.c
@@ -50,7 +50,8 @@ struct st_client_plugin_int {
static my_bool initialized= 0;
static MEM_ROOT mem_root;
-static const char *plugin_declarations_sym= "_mysql_client_plugin_declaration_";
+static const char *plugin_declarations_sym __attribute__((unused)) =
+ "_mysql_client_plugin_declaration_";
static uint plugin_version[MYSQL_CLIENT_MAX_PLUGINS]=
{
0, /* these two are taken by Connector/C */
@@ -180,7 +181,7 @@ err2:
plugin->deinit();
err1:
if (dlhandle)
- dlclose(dlhandle);
+ (void)dlclose(dlhandle);
set_mysql_extended_error(mysql, CR_AUTH_PLUGIN_CANNOT_LOAD, unknown_sqlstate,
ER(CR_AUTH_PLUGIN_CANNOT_LOAD), plugin->name,
errmsg);
@@ -239,6 +240,8 @@ int mysql_client_plugin_init()
{
MYSQL mysql;
struct st_mysql_client_plugin **builtin;
+ va_list unused;
+ LINT_INIT_STRUCT(unused);
if (initialized)
return 0;
@@ -255,7 +258,7 @@ int mysql_client_plugin_init()
pthread_mutex_lock(&LOCK_load_client_plugin);
for (builtin= mysql_client_builtins; *builtin; builtin++)
- add_plugin(&mysql, *builtin, 0, 0, 0);
+ add_plugin(&mysql, *builtin, 0, 0, unused);
pthread_mutex_unlock(&LOCK_load_client_plugin);
@@ -285,7 +288,7 @@ void mysql_client_plugin_deinit()
if (p->plugin->deinit)
p->plugin->deinit();
if (p->dlhandle)
- dlclose(p->dlhandle);
+ (void)dlclose(p->dlhandle);
}
bzero(&plugin_list, sizeof(plugin_list));
@@ -301,6 +304,9 @@ struct st_mysql_client_plugin *
mysql_client_register_plugin(MYSQL *mysql,
struct st_mysql_client_plugin *plugin)
{
+ va_list unused;
+ LINT_INIT_STRUCT(unused);
+
if (is_not_initialized(mysql, plugin->name))
return NULL;
@@ -315,7 +321,7 @@ mysql_client_register_plugin(MYSQL *mysql,
plugin= NULL;
}
else
- plugin= add_plugin(mysql, plugin, 0, 0, 0);
+ plugin= add_plugin(mysql, plugin, 0, 0, unused);
pthread_mutex_unlock(&LOCK_load_client_plugin);
return plugin;
@@ -360,7 +366,7 @@ mysql_load_plugin_v(MYSQL *mysql, const char *name, int type,
if (!(sym= dlsym(dlhandle, plugin_declarations_sym)))
{
errmsg= "not a plugin";
- dlclose(dlhandle);
+ (void)dlclose(dlhandle);
goto err;
}
diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt
index b431ee075fe..9ba6bd1e1b4 100755
--- a/sql/CMakeLists.txt
+++ b/sql/CMakeLists.txt
@@ -14,11 +14,7 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
-SET(CMAKE_CXX_FLAGS_DEBUG
- "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR /Zi")
-SET(CMAKE_C_FLAGS_DEBUG
- "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR /Zi")
-SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MAP /MAPINFO:EXPORTS")
+ADD_DEFINITIONS(-DUSE_SYMDIR)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/extra/yassl/include
diff --git a/sql/Makefile.am b/sql/Makefile.am
index ba91f94d72d..1c3ee09c0d5 100644
--- a/sql/Makefile.am
+++ b/sql/Makefile.am
@@ -36,7 +36,7 @@ noinst_LTLIBRARIES= libndb.la \
SUPPORTING_LIBS = $(top_builddir)/vio/libvio.a \
$(top_builddir)/mysys/libmysys.a \
$(top_builddir)/dbug/libdbug.a \
- $(top_builddir)/regex/libregex.a \
+ $(top_builddir)/regex/libregex.la \
$(top_builddir)/strings/libmystrings.a
mysqld_DEPENDENCIES= @mysql_plugin_libs@ $(SUPPORTING_LIBS) libndb.la
LDADD = $(SUPPORTING_LIBS) @ZLIB_LIBS@ @NDB_SCI_LIBS@
diff --git a/sql/create_options.cc b/sql/create_options.cc
index 4478fc14791..a7124310279 100644
--- a/sql/create_options.cc
+++ b/sql/create_options.cc
@@ -187,7 +187,8 @@ static bool set_one_value(ha_create_table_option *opt,
*val= num;
DBUG_RETURN(0);
}
- if (*end) *end++;
+ if (*end)
+ end++;
start= end;
num++;
}
diff --git a/sql/debug_sync.cc b/sql/debug_sync.cc
index 23a649a89fa..c9c580c6442 100644
--- a/sql/debug_sync.cc
+++ b/sql/debug_sync.cc
@@ -1719,6 +1719,7 @@ static void debug_sync_execute(THD *thd, st_debug_sync_action *action)
if (action->execute)
{
const char *old_proc_info;
+ LINT_INIT(old_proc_info);
action->execute--;
diff --git a/sql/examples/CMakeLists.txt b/sql/examples/CMakeLists.txt
index 1a22e9a3efd..47a64c88c68 100755
--- a/sql/examples/CMakeLists.txt
+++ b/sql/examples/CMakeLists.txt
@@ -13,9 +13,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/extra/yassl/include
${CMAKE_SOURCE_DIR}/regex)
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index 782b77eac51..b7b7cdf1cce 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -6269,8 +6269,7 @@ void ha_ndbcluster::get_auto_increment(ulonglong offset, ulonglong increment,
Ndb_tuple_id_range_guard g(m_share);
if ((m_skip_auto_increment &&
ndb->readAutoIncrementValue(m_table, g.range, auto_value)) ||
- ndb->getAutoIncrementValue(m_table, g.range, auto_value, cache_size,
- increment, offset))
+ ndb->getAutoIncrementValue(m_table, g.range, auto_value, cache_size, increment, offset))
{
if (--retries &&
ndb->getNdbError().status == NdbError::TemporaryError)
@@ -9919,10 +9918,8 @@ bool ha_ndbcluster::check_if_incompatible_data(HA_CREATE_INFO *create_info,
{
Field *field= table->field[i];
const NDBCOL *col= tab->getColumn(i);
- if ((col->getStorageType() == NDB_STORAGETYPE_MEMORY &&
- create_info->storage_media != HA_SM_MEMORY) ||
- (col->getStorageType() == NDB_STORAGETYPE_DISK &&
- create_info->storage_media != HA_SM_DISK))
+ if ((col->getStorageType() == NDB_STORAGETYPE_MEMORY && create_info->storage_media != HA_SM_MEMORY) ||
+ (col->getStorageType() == NDB_STORAGETYPE_DISK && create_info->storage_media != HA_SM_DISK))
{
DBUG_PRINT("info", ("Column storage media is changed"));
DBUG_RETURN(COMPATIBLE_DATA_NO);
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index 9722cc2deb4..1a791507b22 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -233,6 +233,8 @@ void ha_partition::init_handler_variables()
m_innodb= FALSE;
m_extra_cache= FALSE;
m_extra_cache_size= 0;
+ m_extra_prepare_for_update= FALSE;
+ m_extra_cache_part_id= NO_CURRENT_PART_ID;
m_handler_status= handler_not_initialized;
m_low_byte_first= 1;
m_part_field_array= NULL;
@@ -2432,7 +2434,7 @@ bool ha_partition::get_from_handler_file(const char *name, MEM_ROOT *mem_root)
for (i= 0; i < m_tot_parts; i++)
m_engine_array[i]= ha_lock_engine(NULL, engine_array[i]);
- my_afree((gptr) engine_array);
+ my_afree(engine_array);
if (!m_file && create_handlers(mem_root))
{
@@ -2442,7 +2444,7 @@ bool ha_partition::get_from_handler_file(const char *name, MEM_ROOT *mem_root)
DBUG_RETURN(FALSE);
err3:
- my_afree((gptr) engine_array);
+ my_afree(engine_array);
err2:
my_free(file_buffer, MYF(0));
err1:
@@ -2454,6 +2456,21 @@ err1:
/****************************************************************************
MODULE open/close object
****************************************************************************/
+
+
+/**
+ A destructor for partition-specific TABLE_SHARE data.
+*/
+
+void ha_data_partition_destroy(void *ha_data)
+{
+ if (ha_data)
+ {
+ HA_DATA_PARTITION *ha_part_data= (HA_DATA_PARTITION*) ha_data;
+ pthread_mutex_destroy(&ha_part_data->LOCK_auto_inc);
+ }
+}
+
/*
Open handler object
@@ -2610,6 +2627,8 @@ int ha_partition::open(const char *name, int mode, uint test_if_locked)
}
DBUG_PRINT("info", ("table_share->ha_data 0x%p", ha_data));
bzero(ha_data, sizeof(HA_DATA_PARTITION));
+ table_share->ha_data_destroy= ha_data_partition_destroy;
+ VOID(pthread_mutex_init(&ha_data->LOCK_auto_inc, MY_MUTEX_INIT_FAST));
}
if (is_not_tmp_table)
pthread_mutex_unlock(&table_share->mutex);
@@ -4224,8 +4243,12 @@ int ha_partition::index_read_idx_map(uchar *buf, uint index,
get_partition_set(table, buf, index, &m_start_key, &m_part_spec);
- /* How can it be more than one partition with the current use? */
- DBUG_ASSERT(m_part_spec.start_part == m_part_spec.end_part);
+ /*
+ We have either found exactly 1 partition
+ (in which case start_part == end_part)
+ or no matching partitions (start_part > end_part)
+ */
+ DBUG_ASSERT(m_part_spec.start_part >= m_part_spec.end_part);
for (part= m_part_spec.start_part; part <= m_part_spec.end_part; part++)
{
@@ -4463,6 +4486,7 @@ int ha_partition::partition_scan_set_up(uchar * buf, bool idx_read_flag)
key not found.
*/
DBUG_PRINT("info", ("scan with no partition to scan"));
+ table->status= STATUS_NOT_FOUND;
DBUG_RETURN(HA_ERR_END_OF_FILE);
}
if (m_part_spec.start_part == m_part_spec.end_part)
@@ -4487,6 +4511,7 @@ int ha_partition::partition_scan_set_up(uchar * buf, bool idx_read_flag)
if (start_part == MY_BIT_NONE)
{
DBUG_PRINT("info", ("scan with no partition to scan"));
+ table->status= STATUS_NOT_FOUND;
DBUG_RETURN(HA_ERR_END_OF_FILE);
}
if (start_part > m_part_spec.start_part)
@@ -4617,19 +4642,6 @@ int ha_partition::handle_unordered_scan_next_partition(uchar * buf)
break;
case partition_index_first:
DBUG_PRINT("info", ("index_first on partition %d", i));
- /*
- MyISAM engine can fail if we call index_first() when indexes disabled
- that happens if the table is empty.
- Here we use file->stats.records instead of file->records() because
- file->records() is supposed to return an EXACT count, and it can be
- possibly slow. We don't need an exact number, an approximate one- from
- the last ::info() call - is sufficient.
- */
- if (file->stats.records == 0)
- {
- error= HA_ERR_END_OF_FILE;
- break;
- }
error= file->ha_index_first(buf);
break;
case partition_index_first_unordered:
@@ -4717,36 +4729,10 @@ int ha_partition::handle_ordered_index_scan(uchar *buf, bool reverse_order)
m_start_key.flag);
break;
case partition_index_first:
- /*
- MyISAM engine can fail if we call index_first() when indexes disabled
- that happens if the table is empty.
- Here we use file->stats.records instead of file->records() because
- file->records() is supposed to return an EXACT count, and it can be
- possibly slow. We don't need an exact number, an approximate one- from
- the last ::info() call - is sufficient.
- */
- if (file->stats.records == 0)
- {
- error= HA_ERR_END_OF_FILE;
- break;
- }
error= file->ha_index_first(rec_buf_ptr);
reverse_order= FALSE;
break;
case partition_index_last:
- /*
- MyISAM engine can fail if we call index_last() when indexes disabled
- that happens if the table is empty.
- Here we use file->stats.records instead of file->records() because
- file->records() is supposed to return an EXACT count, and it can be
- possibly slow. We don't need an exact number, an approximate one- from
- the last ::info() call - is sufficient.
- */
- if (file->stats.records == 0)
- {
- error= HA_ERR_END_OF_FILE;
- break;
- }
error= file->ha_index_last(rec_buf_ptr);
reverse_order= TRUE;
break;
@@ -5393,9 +5379,6 @@ void ha_partition::get_dynamic_partition_info(PARTITION_INFO *stat_info,
when performing the sequential scan we will check this recorded value
and call extra_opt whenever we start scanning a new partition.
- monty: Neads to be fixed so that it's passed to all handlers when we
- move to another partition during table scan.
-
HA_EXTRA_NO_CACHE:
When performing a UNION SELECT HA_EXTRA_NO_CACHE is called from the
flush method in the select_union class.
@@ -5407,7 +5390,7 @@ void ha_partition::get_dynamic_partition_info(PARTITION_INFO *stat_info,
for. If no cache is in use they will quickly return after finding
this out. And we also ensure that all caches are disabled and no one
is left by mistake.
- In the future this call will probably be deleted an we will instead call
+ In the future this call will probably be deleted and we will instead call
::reset();
HA_EXTRA_WRITE_CACHE:
@@ -5419,8 +5402,9 @@ void ha_partition::get_dynamic_partition_info(PARTITION_INFO *stat_info,
This is called as part of a multi-table update. When the table to be
updated is also scanned then this informs MyISAM handler to drop any
caches if dynamic records are used (fixed size records do not care
- about this call). We pass this along to all underlying MyISAM handlers
- and ignore it for the rest.
+ about this call). We pass this along to the first partition to scan, and
+ flag that it is to be called after HA_EXTRA_CACHE when moving to the next
+ partition to scan.
HA_EXTRA_PREPARE_FOR_DROP:
Only used by MyISAM, called in preparation for a DROP TABLE.
@@ -5567,9 +5551,23 @@ int ha_partition::extra(enum ha_extra_function operation)
/* Category 3), used by MyISAM handlers */
case HA_EXTRA_PREPARE_FOR_RENAME:
DBUG_RETURN(prepare_for_rename());
+ break;
+ case HA_EXTRA_PREPARE_FOR_UPDATE:
+ /*
+ Needs to be run on the first partition in the range now, and
+ later in late_extra_cache, when switching to a new partition to scan.
+ */
+ m_extra_prepare_for_update= TRUE;
+ if (m_part_spec.start_part != NO_CURRENT_PART_ID)
+ {
+ if (!m_extra_cache)
+ m_extra_cache_part_id= m_part_spec.start_part;
+ DBUG_ASSERT(m_extra_cache_part_id == m_part_spec.start_part);
+ VOID(m_file[m_part_spec.start_part]->extra(HA_EXTRA_PREPARE_FOR_UPDATE));
+ }
+ break;
case HA_EXTRA_NORMAL:
case HA_EXTRA_QUICK:
- case HA_EXTRA_PREPARE_FOR_UPDATE:
case HA_EXTRA_FORCE_REOPEN:
case HA_EXTRA_PREPARE_FOR_DROP:
case HA_EXTRA_FLUSH_CACHE:
@@ -5590,10 +5588,22 @@ int ha_partition::extra(enum ha_extra_function operation)
break;
}
case HA_EXTRA_NO_CACHE:
+ {
+ int ret= 0;
+ if (m_extra_cache_part_id != NO_CURRENT_PART_ID)
+ ret= m_file[m_extra_cache_part_id]->extra(HA_EXTRA_NO_CACHE);
+ m_extra_cache= FALSE;
+ m_extra_cache_size= 0;
+ m_extra_prepare_for_update= FALSE;
+ m_extra_cache_part_id= NO_CURRENT_PART_ID;
+ DBUG_RETURN(ret);
+ }
case HA_EXTRA_WRITE_CACHE:
{
m_extra_cache= FALSE;
m_extra_cache_size= 0;
+ m_extra_prepare_for_update= FALSE;
+ m_extra_cache_part_id= NO_CURRENT_PART_ID;
DBUG_RETURN(loop_extra(operation));
}
case HA_EXTRA_IGNORE_NO_KEY:
@@ -5721,6 +5731,7 @@ int ha_partition::extra_opt(enum ha_extra_function operation, ulong cachesize)
void ha_partition::prepare_extra_cache(uint cachesize)
{
DBUG_ENTER("ha_partition::prepare_extra_cache()");
+ DBUG_PRINT("info", ("cachesize %u", cachesize));
m_extra_cache= TRUE;
m_extra_cache_size= cachesize;
@@ -5779,16 +5790,18 @@ int ha_partition::loop_extra(enum ha_extra_function operation)
{
int result= 0, tmp;
handler **file;
+ bool is_select;
DBUG_ENTER("ha_partition::loop_extra()");
- /*
- TODO, 5.2: this is where you could possibly add optimisations to add the
- bitmap _if_ a SELECT.
- */
+ is_select= (thd_sql_command(ha_thd()) == SQLCOM_SELECT);
for (file= m_file; *file; file++)
{
- if ((tmp= (*file)->extra(operation)))
- result= tmp;
+ if (!is_select ||
+ bitmap_is_set(&(m_part_info->used_partitions), file - m_file))
+ {
+ if ((tmp= (*file)->extra(operation)))
+ result= tmp;
+ }
}
DBUG_RETURN(result);
}
@@ -5809,14 +5822,25 @@ void ha_partition::late_extra_cache(uint partition_id)
{
handler *file;
DBUG_ENTER("ha_partition::late_extra_cache");
+ DBUG_PRINT("info", ("extra_cache %u prepare %u partid %u size %u",
+ m_extra_cache, m_extra_prepare_for_update,
+ partition_id, m_extra_cache_size));
- if (!m_extra_cache)
+ if (!m_extra_cache && !m_extra_prepare_for_update)
DBUG_VOID_RETURN;
file= m_file[partition_id];
- if (m_extra_cache_size == 0)
- VOID(file->extra(HA_EXTRA_CACHE));
- else
- VOID(file->extra_opt(HA_EXTRA_CACHE, m_extra_cache_size));
+ if (m_extra_cache)
+ {
+ if (m_extra_cache_size == 0)
+ VOID(file->extra(HA_EXTRA_CACHE));
+ else
+ VOID(file->extra_opt(HA_EXTRA_CACHE, m_extra_cache_size));
+ }
+ if (m_extra_prepare_for_update)
+ {
+ VOID(file->extra(HA_EXTRA_PREPARE_FOR_UPDATE));
+ }
+ m_extra_cache_part_id= partition_id;
DBUG_VOID_RETURN;
}
@@ -5837,10 +5861,12 @@ void ha_partition::late_extra_no_cache(uint partition_id)
handler *file;
DBUG_ENTER("ha_partition::late_extra_no_cache");
- if (!m_extra_cache)
+ if (!m_extra_cache && !m_extra_prepare_for_update)
DBUG_VOID_RETURN;
file= m_file[partition_id];
VOID(file->extra(HA_EXTRA_NO_CACHE));
+ DBUG_ASSERT(partition_id == m_extra_cache_part_id);
+ m_extra_cache_part_id= NO_CURRENT_PART_ID;
DBUG_VOID_RETURN;
}
diff --git a/sql/ha_partition.h b/sql/ha_partition.h
index 1a9ec5bbf70..0cf1713ed13 100644
--- a/sql/ha_partition.h
+++ b/sql/ha_partition.h
@@ -44,6 +44,7 @@ typedef struct st_partition_share
typedef struct st_ha_data_partition
{
ulonglong next_auto_inc_val; /**< first non reserved value */
+ pthread_mutex_t LOCK_auto_inc;
bool auto_inc_initialized;
} HA_DATA_PARTITION;
@@ -153,6 +154,10 @@ private:
*/
bool m_extra_cache;
uint m_extra_cache_size;
+ /* The same goes for HA_EXTRA_PREPARE_FOR_UPDATE */
+ bool m_extra_prepare_for_update;
+ /* Which partition has active cache */
+ uint m_extra_cache_part_id;
void init_handler_variables();
/*
@@ -248,7 +253,6 @@ public:
DBUG_RETURN(0);
}
virtual void change_table_ptr(TABLE *table_arg, TABLE_SHARE *share);
- bool check_if_supported_virtual_columns(void) { return TRUE;}
virtual bool check_if_incompatible_data(HA_CREATE_INFO *create_info,
uint table_changes);
private:
@@ -942,8 +946,9 @@ private:
DBUG_ASSERT(table_share->ha_data && !auto_increment_lock);
if(table_share->tmp_table == NO_TMP_TABLE)
{
+ HA_DATA_PARTITION *ha_data= (HA_DATA_PARTITION*) table_share->ha_data;
auto_increment_lock= TRUE;
- pthread_mutex_lock(&table_share->mutex);
+ pthread_mutex_lock(&ha_data->LOCK_auto_inc);
}
}
virtual void unlock_auto_increment()
@@ -956,7 +961,8 @@ private:
*/
if(auto_increment_lock && !auto_increment_safe_stmt_log_lock)
{
- pthread_mutex_unlock(&table_share->mutex);
+ HA_DATA_PARTITION *ha_data= (HA_DATA_PARTITION*) table_share->ha_data;
+ pthread_mutex_unlock(&ha_data->LOCK_auto_inc);
auto_increment_lock= FALSE;
}
}
diff --git a/sql/handler.cc b/sql/handler.cc
index 59bfbb68452..92e20b86c6d 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -1135,7 +1135,7 @@ int ha_commit_trans(THD *thd, bool all)
uint rw_ha_count;
bool rw_trans;
- DBUG_EXECUTE_IF("crash_commit_before", abort(););
+ DBUG_EXECUTE_IF("crash_commit_before", DBUG_SUICIDE(););
/* Close all cursors that can not survive COMMIT */
if (is_real_trans) /* not a statement commit */
@@ -1187,7 +1187,7 @@ int ha_commit_trans(THD *thd, bool all)
}
status_var_increment(thd->status_var.ha_prepare_count);
}
- DBUG_EXECUTE_IF("crash_commit_after_prepare", DBUG_ABORT(););
+ DBUG_EXECUTE_IF("crash_commit_after_prepare", DBUG_SUICIDE(););
if (error || (is_real_trans && xid &&
(error= !(cookie= tc_log->log_xid(thd, xid)))))
{
@@ -1195,13 +1195,13 @@ int ha_commit_trans(THD *thd, bool all)
error= 1;
goto end;
}
- DBUG_EXECUTE_IF("crash_commit_after_log", DBUG_ABORT(););
+ DBUG_EXECUTE_IF("crash_commit_after_log", DBUG_SUICIDE(););
}
error=ha_commit_one_phase(thd, all) ? (cookie ? 2 : 1) : 0;
- DBUG_EXECUTE_IF("crash_commit_before_unlog", DBUG_ABORT(););
+ DBUG_EXECUTE_IF("crash_commit_before_unlog", DBUG_SUICIDE(););
if (cookie)
tc_log->unlog(cookie, xid);
- DBUG_EXECUTE_IF("crash_commit_after", DBUG_ABORT(););
+ DBUG_EXECUTE_IF("crash_commit_after", DBUG_SUICIDE(););
end:
if (rw_trans)
start_waiting_global_read_lock(thd);
@@ -2737,7 +2737,10 @@ void handler::print_error(int error, myf errflag)
textno=ER_DUP_UNIQUE;
break;
case HA_ERR_RECORD_CHANGED:
- SET_FATAL_ERROR;
+ /*
+ This is not fatal error when using HANDLER interface
+ SET_FATAL_ERROR;
+ */
textno=ER_CHECKREAD;
break;
case HA_ERR_CRASHED:
@@ -3867,6 +3870,7 @@ int ha_create_table_from_engine(THD* thd, const char *db, const char *name)
void st_ha_check_opt::init()
{
flags= sql_flags= 0;
+ start_time= my_time(0);
}
@@ -4521,11 +4525,11 @@ int handler::index_read_idx_map(uchar * buf, uint index, const uchar * key,
int error, error1;
LINT_INIT(error1);
- error= index_init(index, 0);
+ error= ha_index_init(index, 0);
if (!error)
{
error= index_read_map(buf, key, keypart_map, find_flag);
- error1= index_end();
+ error1= ha_index_end();
}
return error ? error : error1;
}
diff --git a/sql/handler.h b/sql/handler.h
index 13d93e98934..270c7bb0be2 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -137,6 +137,7 @@
#define HA_BINLOG_STMT_CAPABLE (LL(1) << 35)
/* Has automatic checksums and uses the new checksum format */
#define HA_HAS_NEW_CHECKSUM (LL(1) << 36)
+#define HA_CAN_VIRTUAL_COLUMNS (LL(1) << 37)
/*
Set of all binlog flags. Currently only contain the capabilities
@@ -1136,6 +1137,7 @@ typedef struct st_ha_check_opt
st_ha_check_opt() {} /* Remove gcc warning */
uint flags; /* isam layer flags (e.g. for myisamchk) */
uint sql_flags; /* sql layer flags - for something myisamchk cannot do */
+ time_t start_time; /* When check/repair starts */
KEY_CACHE *key_cache; /* new key cache when changing key cache */
void init();
} HA_CHECK_OPT;
@@ -1319,14 +1321,18 @@ public:
DBUG_ENTER("ha_index_init");
DBUG_ASSERT(inited==NONE);
if (!(result= index_init(idx, sorted)))
- inited=INDEX;
+ {
+ inited= INDEX;
+ active_index= idx;
+ }
DBUG_RETURN(result);
}
int ha_index_end()
{
DBUG_ENTER("ha_index_end");
DBUG_ASSERT(inited==INDEX);
- inited=NONE;
+ inited= NONE;
+ active_index= MAX_KEY;
DBUG_RETURN(index_end());
}
/* This is called after index_init() if we need to do a index scan */
@@ -1509,7 +1515,12 @@ public:
as there may be several calls to this routine.
*/
virtual void column_bitmaps_signal();
- uint get_index(void) const { return active_index; }
+ /*
+ We have to check for inited as some engines, like innodb, sets
+ active_index during table scan.
+ */
+ uint get_index(void) const
+ { return inited == INDEX ? active_index : MAX_KEY; }
virtual int close(void)=0;
/**
@@ -1751,6 +1762,7 @@ public:
{ return(NULL);} /* gets tablespace name from handler */
/** used in ALTER TABLE; 1 if changing storage engine is allowed */
virtual bool can_switch_engines() { return 1; }
+ virtual int can_continue_handler_scan() { return 0; }
/** used in REPLACE; is > 0 if table is referred by a FOREIGN KEY */
virtual int get_foreign_key_list(THD *thd, List<FOREIGN_KEY_INFO> *f_key_list)
{ return 0; }
@@ -1954,17 +1966,6 @@ public:
LEX_STRING *engine_name() { return hton_name(ht); }
- /*
- @brief
- Check whether the engine supports virtual columns
-
- @retval
- FALSE if the engine does not support virtual columns
- @retval
- TRUE if the engine supports virtual columns
- */
- virtual bool check_if_supported_virtual_columns(void) { return FALSE;}
-
protected:
/* deprecated, don't use in new engines */
inline void ha_statistic_increment(ulong SSV::*offset) const { }
@@ -2005,8 +2006,8 @@ private:
*/
virtual int open(const char *name, int mode, uint test_if_locked)=0;
- virtual int index_init(uint idx, bool sorted) { active_index= idx; return 0; }
- virtual int index_end() { active_index= MAX_KEY; return 0; }
+ virtual int index_init(uint idx, bool sorted) { return 0; }
+ virtual int index_end() { return 0; }
/**
rnd_init() can be called two times without rnd_end() in between
(it only makes sense if scan=1).
diff --git a/sql/item.cc b/sql/item.cc
index 660e68b901c..c46598e6172 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -380,6 +380,7 @@ Item::Item():
{
marker= 0;
maybe_null=null_value=with_sum_func=unsigned_flag=0;
+ in_rollup= 0;
decimals= 0; max_length= 0;
with_subselect= 0;
cmp_context= IMPOSSIBLE_RESULT;
@@ -420,6 +421,7 @@ Item::Item(THD *thd, Item *item):
marker(item->marker),
decimals(item->decimals),
maybe_null(item->maybe_null),
+ in_rollup(item->in_rollup),
null_value(item->null_value),
unsigned_flag(item->unsigned_flag),
with_sum_func(item->with_sum_func),
@@ -7039,14 +7041,14 @@ int stored_field_cmp_to_item(THD *thd, Field *field, Item *item)
enum_field_types field_type= field->type();
- if (field_type == MYSQL_TYPE_DATE || field_type == MYSQL_TYPE_DATETIME)
+ if (field_type == MYSQL_TYPE_DATE || field_type == MYSQL_TYPE_DATETIME ||
+ field_type == MYSQL_TYPE_TIMESTAMP)
{
enum_mysql_timestamp_type type= MYSQL_TIMESTAMP_ERROR;
if (field_type == MYSQL_TYPE_DATE)
type= MYSQL_TIMESTAMP_DATE;
-
- if (field_type == MYSQL_TYPE_DATETIME)
+ else
type= MYSQL_TIMESTAMP_DATETIME;
const char *field_name= field->field_name;
@@ -7473,9 +7475,12 @@ bool Item_cache_row::null_inside()
void Item_cache_row::bring_value()
{
+ if (!example)
+ return;
+ example->bring_value();
+ null_value= example->null_value;
for (uint i= 0; i < item_count; i++)
values[i]->bring_value();
- return;
}
diff --git a/sql/item.h b/sql/item.h
index 2ec9044cd16..3f732cf126e 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -506,8 +506,7 @@ public:
FIELD_VARIANCE_ITEM, INSERT_VALUE_ITEM,
SUBSELECT_ITEM, ROW_ITEM, CACHE_ITEM, TYPE_HOLDER,
PARAM_ITEM, TRIGGER_FIELD_ITEM, DECIMAL_ITEM,
- XPATH_NODESET, XPATH_NODESET_CMP,
- VIEW_FIXER_ITEM};
+ XPATH_NODESET, XPATH_NODESET_CMP};
enum cond_result { COND_UNDEF,COND_OK,COND_TRUE,COND_FALSE };
@@ -537,6 +536,8 @@ public:
int8 marker;
uint8 decimals;
bool maybe_null; /* If item may be null */
+ bool in_rollup; /* If used in GROUP BY list
+ of a query with ROLLUP */
bool null_value; /* if item is null */
bool unsigned_flag;
bool with_sum_func;
@@ -573,10 +574,17 @@ public:
Field *make_string_field(TABLE *table);
virtual bool fix_fields(THD *, Item **);
/*
- should be used in case where we are sure that we do not need
+ This method should be used in case where we are sure that we do not need
complete fix_fields() procedure.
- */
- inline void quick_fix_field() { fixed= 1; }
+ Usually this method is used by the optimizer when it has to create a new
+ item out of other already fixed items. For example, if the optimizer has
+ to create a new Item_func for an inferred equality whose left and right
+ parts are already fixed items. In some cases the optimizer cannot use
+ directly fixed items as the arguments of the created functional item,
+ but rather uses intermediate type conversion items. Then the method is
+ supposed to be applied recursively.
+ */
+ virtual inline void quick_fix_field() { fixed= 1; }
/* Function returns 1 on overflow and -1 on fatal errors */
int save_in_field_no_warnings(Field *field, bool no_conversions);
virtual int save_in_field(Field *field, bool no_conversions);
@@ -2998,7 +3006,8 @@ public:
{
return Item_field::save_in_field(field_arg, no_conversions);
}
- /*
+ enum Type type() const { return INSERT_VALUE_ITEM; }
+ /*
We use RAND_TABLE_BIT to prevent Item_insert_value from
being treated as a constant and precalculated before execution
*/
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 746eb482d5a..d7fa6cba030 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -1596,6 +1596,13 @@ int Arg_comparator::compare_row()
bool was_null= 0;
(*a)->bring_value();
(*b)->bring_value();
+
+ if ((*a)->null_value || (*b)->null_value)
+ {
+ owner->null_value= 1;
+ return -1;
+ }
+
uint n= (*a)->cols();
for (uint i= 0; i<n; i++)
{
@@ -1764,6 +1771,76 @@ bool Item_in_optimizer::fix_fields(THD *thd, Item **ref)
}
+/**
+ The implementation of optimized \<outer expression\> [NOT] IN \<subquery\>
+ predicates. The implementation works as follows.
+
+ For the current value of the outer expression
+
+ - If it contains only NULL values, the original (before rewrite by the
+ Item_in_subselect rewrite methods) inner subquery is non-correlated and
+ was previously executed, there is no need to re-execute it, and the
+ previous return value is returned.
+
+ - If it contains NULL values, check if there is a partial match for the
+ inner query block by evaluating it. For clarity we repeat here the
+ transformation previously performed on the sub-query. The expression
+
+ <tt>
+ ( oc_1, ..., oc_n )
+ \<in predicate\>
+ ( SELECT ic_1, ..., ic_n
+ FROM \<table\>
+ WHERE \<inner where\>
+ )
+ </tt>
+
+ was transformed into
+
+ <tt>
+ ( oc_1, ..., oc_n )
+ \<in predicate\>
+ ( SELECT ic_1, ..., ic_n
+ FROM \<table\>
+ WHERE \<inner where\> AND ... ( ic_k = oc_k OR ic_k IS NULL )
+ HAVING ... NOT ic_k IS NULL
+ )
+ </tt>
+
+ The evaluation will now proceed according to special rules set up
+ elsewhere. These rules include:
+
+ - The HAVING NOT \<inner column\> IS NULL conditions added by the
+ aforementioned rewrite methods will detect whether they evaluated (and
+ rejected) a NULL value and if so, will cause the subquery to evaluate
+ to NULL.
+
+ - The added WHERE and HAVING conditions are present only for those inner
+ columns that correspond to outer column that are not NULL at the moment.
+
+ - If there is an eligible index for executing the subquery, the special
+ access method "Full scan on NULL key" is employed which ensures that
+ the inner query will detect if there are NULL values resulting from the
+ inner query. This access method will quietly resort to table scan if it
+ needs to find NULL values as well.
+
+ - Under these conditions, the sub-query need only be evaluated in order to
+ find out whether it produced any rows.
+
+ - If it did, we know that there was a partial match since there are
+ NULL values in the outer row expression.
+
+ - If it did not, the result is FALSE or UNKNOWN. If at least one of the
+ HAVING sub-predicates rejected a NULL value corresponding to an outer
+ non-NULL, and hence the inner query block returns UNKNOWN upon
+ evaluation, there was a partial match and the result is UNKNOWN.
+
+ - If it contains no NULL values, the call is forwarded to the inner query
+ block.
+
+ @see Item_in_subselect::val_bool()
+ @see Item_is_not_null_test::val_int()
+ */
longlong Item_in_optimizer::val_int()
{
bool tmp;
@@ -1817,7 +1894,7 @@ longlong Item_in_optimizer::val_int()
all_left_cols_null= false;
}
- if (!((Item_in_subselect*)args[1])->is_correlated &&
+ if (!item_subs->is_correlated &&
all_left_cols_null && result_for_null_param != UNKNOWN)
{
/*
@@ -1831,8 +1908,11 @@ longlong Item_in_optimizer::val_int()
else
{
/* The subquery has to be evaluated */
- (void) args[1]->val_bool_result();
- null_value= !item_subs->engine->no_rows();
+ (void) item_subs->val_bool_result();
+ if (item_subs->engine->no_rows())
+ null_value= item_subs->null_value;
+ else
+ null_value= TRUE;
if (all_left_cols_null)
result_for_null_param= null_value;
}
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 56ef66fc26a..28104edc653 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -202,6 +202,21 @@ Item_func::fix_fields(THD *thd, Item **ref)
return FALSE;
}
+void
+Item_func::quick_fix_field()
+{
+ Item **arg,**arg_end;
+ if (arg_count)
+ {
+ for (arg=args, arg_end=args+arg_count; arg != arg_end ; arg++)
+ {
+ if (!(*arg)->fixed)
+ (*arg)->quick_fix_field();
+ }
+ }
+ fixed= 1;
+}
+
bool Item_func::walk(Item_processor processor, bool walk_subquery,
uchar *argument)
@@ -1355,9 +1370,13 @@ longlong Item_func_int_div::val_int()
signal_divide_by_null();
return 0;
}
- return (unsigned_flag ?
- (ulonglong) value / (ulonglong) val2 :
- value / val2);
+
+ if (unsigned_flag)
+ return ((ulonglong) value / (ulonglong) val2);
+ else if (value == LONGLONG_MIN && val2 == -1)
+ return LONGLONG_MIN;
+ else
+ return value / val2;
}
@@ -1391,9 +1410,9 @@ longlong Item_func_mod::int_op()
if (args[0]->unsigned_flag)
result= args[1]->unsigned_flag ?
((ulonglong) value) % ((ulonglong) val2) : ((ulonglong) value) % val2;
- else
- result= args[1]->unsigned_flag ?
- value % ((ulonglong) val2) : value % val2;
+ else result= args[1]->unsigned_flag ?
+ value % ((ulonglong) val2) :
+ (val2 == -1) ? 0 : value % val2;
return result;
}
@@ -4705,7 +4724,7 @@ void Item_func_get_user_var::fix_length_and_dec()
decimals=0;
break;
case STRING_RESULT:
- max_length= MAX_BLOB_WIDTH;
+ max_length= MAX_BLOB_WIDTH - 1;
break;
case DECIMAL_RESULT:
max_length= DECIMAL_MAX_STR_LENGTH;
@@ -5340,7 +5359,17 @@ void Item_func_match::init_search(bool no_order)
/* Check if init_search() has been called before */
if (ft_handler)
+ {
+ /*
+ We should reset ft_handler as it is cleaned up
+ on destruction of FT_SELECT object
+ (necessary in case of re-execution of subquery).
+ TODO: FT_SELECT should not clean up ft_handler.
+ */
+ if (join_key)
+ table->file->ft_handler= ft_handler;
DBUG_VOID_RETURN;
+ }
if (key == NO_SUCH_KEY)
{
@@ -6165,8 +6194,8 @@ void uuid_short_init()
longlong Item_func_uuid_short::val_int()
{
ulonglong val;
- pthread_mutex_lock(&LOCK_uuid_generator);
+ pthread_mutex_lock(&LOCK_short_uuid_generator);
val= uuid_value++;
- pthread_mutex_unlock(&LOCK_uuid_generator);
+ pthread_mutex_unlock(&LOCK_short_uuid_generator);
return (longlong) val;
}
diff --git a/sql/item_func.h b/sql/item_func.h
index 9d64bcad490..99660bd2a40 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -117,6 +117,7 @@ public:
// Constructor used for Item_cond_and/or (see Item comment)
Item_func(THD *thd, Item_func *item);
bool fix_fields(THD *, Item **ref);
+ void quick_fix_field();
table_map used_tables() const;
table_map not_null_tables() const;
void update_used_tables();
@@ -1583,7 +1584,7 @@ public:
join_key(0), ft_handler(0), table(0), master(0), concat_ws(0) { }
void cleanup()
{
- DBUG_ENTER("Item_func_match");
+ DBUG_ENTER("Item_func_match::cleanup");
Item_real_func::cleanup();
if (!master && ft_handler)
ft_handler->please->close_search(ft_handler);
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index cafabe9a3ee..aebbc21b0fc 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -1014,6 +1014,20 @@ String *Item_func_insert::val_str(String *str)
if ((length < 0) || (length > res->length()))
length= res->length();
+ /*
+ There is one exception not handled (intentionaly) by the character set
+ aggregation code. If one string is strong side and is binary, and
+ another one is weak side and is a multi-byte character string,
+ then we need to operate on the second string in terms on bytes when
+ calling ::numchars() and ::charpos(), rather than in terms of characters.
+ Lets substitute its character set to binary.
+ */
+ if (collation.collation == &my_charset_bin)
+ {
+ res->set_charset(&my_charset_bin);
+ res2->set_charset(&my_charset_bin);
+ }
+
/* start and length are now sufficiently valid to pass to charpos function */
start= res->charpos((int) start);
length= res->charpos((int) length, (uint32) start);
@@ -2515,6 +2529,20 @@ String *Item_func_rpad::val_str(String *str)
/* Set here so that rest of code sees out-of-bound value as such. */
if ((ulonglong) count > INT_MAX32)
count= INT_MAX32;
+ /*
+ There is one exception not handled (intentionaly) by the character set
+ aggregation code. If one string is strong side and is binary, and
+ another one is weak side and is a multi-byte character string,
+ then we need to operate on the second string in terms on bytes when
+ calling ::numchars() and ::charpos(), rather than in terms of characters.
+ Lets substitute its character set to binary.
+ */
+ if (collation.collation == &my_charset_bin)
+ {
+ res->set_charset(&my_charset_bin);
+ rpad->set_charset(&my_charset_bin);
+ }
+
if (count <= (res_char_length= res->numchars()))
{ // String to pad is big enough
res->length(res->charpos((int) count)); // Shorten result if longer
@@ -2617,6 +2645,20 @@ String *Item_func_lpad::val_str(String *str)
if ((ulonglong) count > INT_MAX32)
count= INT_MAX32;
+ /*
+ There is one exception not handled (intentionaly) by the character set
+ aggregation code. If one string is strong side and is binary, and
+ another one is weak side and is a multi-byte character string,
+ then we need to operate on the second string in terms on bytes when
+ calling ::numchars() and ::charpos(), rather than in terms of characters.
+ Lets substitute its character set to binary.
+ */
+ if (collation.collation == &my_charset_bin)
+ {
+ res->set_charset(&my_charset_bin);
+ pad->set_charset(&my_charset_bin);
+ }
+
res_char_length= res->numchars();
if (count <= res_char_length)
@@ -3094,6 +3136,7 @@ String* Item_func_inet_ntoa::val_str(String* str)
if ((null_value= (args[0]->null_value || n > (ulonglong) LL(4294967295))))
return 0; // Null value
+ str->set_charset(collation.collation);
str->length(0);
int4store(buf,n);
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index a82c93304e6..6d3a4c66649 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -48,7 +48,7 @@ Item_subselect::Item_subselect():
item value is NULL if select_subselect not changed this value
(i.e. some rows will be found returned)
*/
- null_value= 1;
+ null_value= TRUE;
}
@@ -452,9 +452,9 @@ void Item_maxmin_subselect::print(String *str, enum_query_type query_type)
void Item_singlerow_subselect::reset()
{
eliminated= FALSE;
- null_value= 1;
+ null_value= TRUE;
if (value)
- value->null_value= 1;
+ value->null_value= TRUE;
}
@@ -591,7 +591,10 @@ bool Item_singlerow_subselect::null_inside()
void Item_singlerow_subselect::bring_value()
{
- exec();
+ if (!exec() && assigned())
+ null_value= 0;
+ else
+ reset();
}
double Item_singlerow_subselect::val_real()
@@ -599,7 +602,7 @@ double Item_singlerow_subselect::val_real()
DBUG_ASSERT(fixed == 1);
if (!exec() && !value->null_value)
{
- null_value= 0;
+ null_value= FALSE;
return value->val_real();
}
else
@@ -614,7 +617,7 @@ longlong Item_singlerow_subselect::val_int()
DBUG_ASSERT(fixed == 1);
if (!exec() && !value->null_value)
{
- null_value= 0;
+ null_value= FALSE;
return value->val_int();
}
else
@@ -628,7 +631,7 @@ String *Item_singlerow_subselect::val_str(String *str)
{
if (!exec() && !value->null_value)
{
- null_value= 0;
+ null_value= FALSE;
return value->val_str(str);
}
else
@@ -643,7 +646,7 @@ my_decimal *Item_singlerow_subselect::val_decimal(my_decimal *decimal_value)
{
if (!exec() && !value->null_value)
{
- null_value= 0;
+ null_value= FALSE;
return value->val_decimal(decimal_value);
}
else
@@ -658,7 +661,7 @@ bool Item_singlerow_subselect::val_bool()
{
if (!exec() && !value->null_value)
{
- null_value= 0;
+ null_value= FALSE;
return value->val_bool();
}
else
@@ -676,7 +679,7 @@ Item_exists_subselect::Item_exists_subselect(st_select_lex *select_lex):
bool val_bool();
init(select_lex, new select_exists_subselect(this));
max_columns= UINT_MAX;
- null_value= 0; //can't be NULL
+ null_value= FALSE; //can't be NULL
maybe_null= 0; //can't be NULL
value= 0;
DBUG_VOID_RETURN;
@@ -839,15 +842,14 @@ double Item_in_subselect::val_real()
*/
DBUG_ASSERT(0);
DBUG_ASSERT(fixed == 1);
- null_value= 0;
+ null_value= was_null= FALSE;
if (exec())
{
reset();
- null_value= 1;
return 0;
}
if (was_null && !value)
- null_value= 1;
+ null_value= TRUE;
return (double) value;
}
@@ -860,15 +862,14 @@ longlong Item_in_subselect::val_int()
*/
DBUG_ASSERT(0);
DBUG_ASSERT(fixed == 1);
- null_value= 0;
+ null_value= was_null= FALSE;
if (exec())
{
reset();
- null_value= 1;
return 0;
}
if (was_null && !value)
- null_value= 1;
+ null_value= TRUE;
return value;
}
@@ -881,16 +882,15 @@ String *Item_in_subselect::val_str(String *str)
*/
DBUG_ASSERT(0);
DBUG_ASSERT(fixed == 1);
- null_value= 0;
+ null_value= was_null= FALSE;
if (exec())
{
reset();
- null_value= 1;
return 0;
}
if (was_null && !value)
{
- null_value= 1;
+ null_value= TRUE;
return 0;
}
str->set((ulonglong)value, &my_charset_bin);
@@ -901,20 +901,14 @@ String *Item_in_subselect::val_str(String *str)
bool Item_in_subselect::val_bool()
{
DBUG_ASSERT(fixed == 1);
- null_value= 0;
+ null_value= was_null= FALSE;
if (exec())
{
reset();
- /*
- Must mark the IN predicate as NULL so as to make sure an enclosing NOT
- predicate will return FALSE. See the comments in
- subselect_uniquesubquery_engine::copy_ref_key for further details.
- */
- null_value= 1;
return 0;
}
if (was_null && !value)
- null_value= 1;
+ null_value= TRUE;
return value;
}
@@ -925,16 +919,15 @@ my_decimal *Item_in_subselect::val_decimal(my_decimal *decimal_value)
method should not be used
*/
DBUG_ASSERT(0);
- null_value= 0;
+ null_value= was_null= FALSE;
DBUG_ASSERT(fixed == 1);
if (exec())
{
reset();
- null_value= 1;
return 0;
}
if (was_null && !value)
- null_value= 1;
+ null_value= TRUE;
int2my_decimal(E_DEC_FATAL_ERROR, value, 0, decimal_value);
return decimal_value;
}
@@ -1942,19 +1935,28 @@ int subselect_single_select_engine::exec()
DBUG_RETURN(join->error ? join->error : 1);
}
if (!select_lex->uncacheable && thd->lex->describe &&
- !(join->select_options & SELECT_DESCRIBE) &&
- join->need_tmp && item->const_item())
+ !(join->select_options & SELECT_DESCRIBE))
{
- /*
- Force join->join_tmp creation, because this subquery will be replaced
- by a simple select from the materialization temp table by optimize()
- called by EXPLAIN and we need to preserve the initial query structure
- so we can display it.
- */
- select_lex->uncacheable|= UNCACHEABLE_EXPLAIN;
- select_lex->master_unit()->uncacheable|= UNCACHEABLE_EXPLAIN;
- if (join->init_save_join_tab())
- DBUG_RETURN(1); /* purecov: inspected */
+ item->update_used_tables();
+ if (item->const_item())
+ {
+ /*
+ It's necessary to keep original JOIN table because
+ create_sort_index() function may overwrite original
+ JOIN_TAB::type and wrong optimization method can be
+ selected on re-execution.
+ */
+ select_lex->uncacheable|= UNCACHEABLE_EXPLAIN;
+ select_lex->master_unit()->uncacheable|= UNCACHEABLE_EXPLAIN;
+ /*
+ Force join->join_tmp creation, because this subquery will be replaced
+ by a simple select from the materialization temp table by optimize()
+ called by EXPLAIN and we need to preserve the initial query structure
+ so we can display it.
+ */
+ if (join->need_tmp && join->init_save_join_tab())
+ DBUG_RETURN(1); /* purecov: inspected */
+ }
}
if (item->engine_changed)
{
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index f4297f73a10..86d1b693f28 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -3423,8 +3423,6 @@ String* Item_func_group_concat::val_str(String* str)
void Item_func_group_concat::print(String *str, enum_query_type query_type)
{
- /* orig_args is not filled with valid values until fix_fields() */
- Item **pargs= fixed ? orig_args : args;
str->append(STRING_WITH_LEN("group_concat("));
if (distinct)
str->append(STRING_WITH_LEN("distinct "));
@@ -3432,7 +3430,7 @@ void Item_func_group_concat::print(String *str, enum_query_type query_type)
{
if (i)
str->append(',');
- pargs[i]->print(str, query_type);
+ orig_args[i]->print(str, query_type);
}
if (arg_count_order)
{
@@ -3441,7 +3439,7 @@ void Item_func_group_concat::print(String *str, enum_query_type query_type)
{
if (i)
str->append(',');
- pargs[i + arg_count_field]->print(str, query_type);
+ orig_args[i + arg_count_field]->print(str, query_type);
if (order[i]->asc)
str->append(STRING_WITH_LEN(" ASC"));
else
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index 57656f30294..443bf3faf6f 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -2277,8 +2277,6 @@ void Item_extract::print(String *str, enum_query_type query_type)
void Item_extract::fix_length_and_dec()
{
- value.alloc(32); // alloc buffer
-
maybe_null=1; // If wrong date
switch (int_type) {
case INTERVAL_YEAR: max_length=4; date_value=1; break;
@@ -2321,6 +2319,8 @@ longlong Item_extract::val_int()
}
else
{
+ char buf[40];
+ String value(buf, sizeof(buf), &my_charset_bin);;
String *res= args[0]->val_str(&value);
if (!res || str_to_time_with_warn(res->ptr(), res->length(), &ltime))
{
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h
index 22df9f34926..49fa87efd7b 100644
--- a/sql/item_timefunc.h
+++ b/sql/item_timefunc.h
@@ -737,7 +737,6 @@ public:
class Item_extract :public Item_int_func
{
- String value;
bool date_value;
public:
const interval_type int_type; // keep it public
diff --git a/sql/lock.cc b/sql/lock.cc
index 7c569bf7cfc..8f5b5ac233f 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -736,7 +736,6 @@ TABLE_LIST *mysql_lock_have_duplicate(THD *thd, TABLE_LIST *needle,
TABLE_LIST *haystack)
{
MYSQL_LOCK *mylock;
- TABLE **lock_tables;
TABLE *table;
TABLE *table2;
THR_LOCK_DATA **lock_locks;
@@ -765,12 +764,11 @@ TABLE_LIST *mysql_lock_have_duplicate(THD *thd, TABLE_LIST *needle,
if (mylock->table_count < 2)
goto end;
- lock_locks= mylock->locks;
- lock_tables= mylock->table;
+ lock_locks= mylock->locks;
/* Prepare table related variables that don't change in loop. */
DBUG_ASSERT((table->lock_position < mylock->table_count) &&
- (table == lock_tables[table->lock_position]));
+ (table == mylock->table[table->lock_position]));
table_lock_data= lock_locks + table->lock_data_start;
end_data= table_lock_data + table->lock_count;
@@ -784,7 +782,7 @@ TABLE_LIST *mysql_lock_have_duplicate(THD *thd, TABLE_LIST *needle,
/* All tables in list must be in lock. */
DBUG_ASSERT((table2->lock_position < mylock->table_count) &&
- (table2 == lock_tables[table2->lock_position]));
+ (table2 == mylock->table[table2->lock_position]));
for (lock_data2= lock_locks + table2->lock_data_start,
end_data2= lock_data2 + table2->lock_count;
diff --git a/sql/log.cc b/sql/log.cc
index 93a9383f731..7d837938ab4 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -1252,7 +1252,7 @@ void LOGGER::deactivate_log_handler(THD *thd, uint log_type)
file_log= file_log_handler->get_mysql_log();
break;
default:
- assert(0); // Impossible
+ MY_ASSERT_UNREACHABLE();
}
if (!(*tmp_opt))
@@ -1748,7 +1748,9 @@ static int binlog_savepoint_set(handlerton *hton, THD *thd, void *sv)
String log_query;
if (log_query.append(STRING_WITH_LEN("SAVEPOINT ")) ||
- log_query.append(thd->lex->ident.str, thd->lex->ident.length))
+ log_query.append("`") ||
+ log_query.append(thd->lex->ident.str, thd->lex->ident.length) ||
+ log_query.append("`"))
DBUG_RETURN(1);
int errcode= query_error_code(thd, thd->killed == THD::NOT_KILLED);
Query_log_event qinfo(thd, log_query.ptr(), log_query.length(),
@@ -1770,7 +1772,9 @@ static int binlog_savepoint_rollback(handlerton *hton, THD *thd, void *sv)
{
String log_query;
if (log_query.append(STRING_WITH_LEN("ROLLBACK TO ")) ||
- log_query.append(thd->lex->ident.str, thd->lex->ident.length))
+ log_query.append("`") ||
+ log_query.append(thd->lex->ident.str, thd->lex->ident.length) ||
+ log_query.append("`"))
DBUG_RETURN(1);
int errcode= query_error_code(thd, thd->killed == THD::NOT_KILLED);
Query_log_event qinfo(thd, log_query.ptr(), log_query.length(),
@@ -2657,7 +2661,7 @@ bool MYSQL_BIN_LOG::open(const char *log_name,
sql_print_error("MSYQL_BIN_LOG::open failed to sync the index file.");
DBUG_RETURN(1);
}
- DBUG_EXECUTE_IF("crash_create_non_critical_before_update_index", abort(););
+ DBUG_EXECUTE_IF("crash_create_non_critical_before_update_index", DBUG_SUICIDE(););
#endif
write_error= 0;
@@ -2754,7 +2758,7 @@ bool MYSQL_BIN_LOG::open(const char *log_name,
if (write_file_name_to_index_file)
{
#ifdef HAVE_REPLICATION
- DBUG_EXECUTE_IF("crash_create_critical_before_update_index", abort(););
+ DBUG_EXECUTE_IF("crash_create_critical_before_update_index", DBUG_SUICIDE(););
#endif
DBUG_ASSERT(my_b_inited(&index_file) != 0);
@@ -2773,7 +2777,7 @@ bool MYSQL_BIN_LOG::open(const char *log_name,
goto err;
#ifdef HAVE_REPLICATION
- DBUG_EXECUTE_IF("crash_create_after_update_index", abort(););
+ DBUG_EXECUTE_IF("crash_create_after_update_index", DBUG_SUICIDE(););
#endif
}
}
@@ -3225,7 +3229,7 @@ int MYSQL_BIN_LOG::purge_first_log(Relay_log_info* rli, bool included)
/* Store where we are in the new file for the execution thread */
flush_relay_log_info(rli);
- DBUG_EXECUTE_IF("crash_before_purge_logs", abort(););
+ DBUG_EXECUTE_IF("crash_before_purge_logs", DBUG_SUICIDE(););
pthread_mutex_lock(&rli->log_space_lock);
rli->relay_log.purge_logs(to_purge_if_included, included,
@@ -3353,7 +3357,7 @@ int MYSQL_BIN_LOG::purge_logs(const char *to_log,
break;
}
- DBUG_EXECUTE_IF("crash_purge_before_update_index", abort(););
+ DBUG_EXECUTE_IF("crash_purge_before_update_index", DBUG_SUICIDE(););
if ((error= sync_purge_index_file()))
{
@@ -3368,7 +3372,7 @@ int MYSQL_BIN_LOG::purge_logs(const char *to_log,
goto err;
}
- DBUG_EXECUTE_IF("crash_purge_critical_after_update_index", abort(););
+ DBUG_EXECUTE_IF("crash_purge_critical_after_update_index", DBUG_SUICIDE(););
err:
/* Read each entry from purge_index_file and delete the file. */
@@ -3378,7 +3382,7 @@ err:
" that would be purged.");
close_purge_index_file();
- DBUG_EXECUTE_IF("crash_purge_non_critical_after_update_index", abort(););
+ DBUG_EXECUTE_IF("crash_purge_non_critical_after_update_index", DBUG_SUICIDE(););
if (need_mutex)
pthread_mutex_unlock(&LOCK_index);
@@ -4899,7 +4903,7 @@ bool MYSQL_BIN_LOG::write(THD *thd, IO_CACHE *cache, Log_event *commit_event,
DBUG_PRINT("info", ("error writing binlog cache: %d",
write_error));
DBUG_PRINT("info", ("crashing before writing xid"));
- abort();
+ DBUG_SUICIDE();
});
if ((write_error= write_cache(thd, cache, FALSE, FALSE)))
@@ -4918,7 +4922,7 @@ bool MYSQL_BIN_LOG::write(THD *thd, IO_CACHE *cache, Log_event *commit_event,
if (flush_and_sync())
goto err;
- DBUG_EXECUTE_IF("half_binlogged_transaction", DBUG_ABORT(););
+ DBUG_EXECUTE_IF("half_binlogged_transaction", DBUG_SUICIDE(););
if (cache->error) // Error on read
{
sql_print_error(ER(ER_ERROR_ON_READ), cache->file_name, errno);
@@ -5144,10 +5148,32 @@ extern "C" my_bool reopen_fstreams(const char *filename,
FILE *outstream, FILE *errstream)
{
int handle_fd;
- int stream_fd;
+ int err_fd, out_fd;
HANDLE osfh;
- DBUG_ASSERT(filename && (outstream || errstream));
+ DBUG_ASSERT(filename && errstream);
+
+ // Services don't have stdout/stderr on Windows, so _fileno returns -1.
+ err_fd= _fileno(errstream);
+ if (err_fd < 0)
+ {
+ if (!freopen(filename, "a+", errstream))
+ return TRUE;
+
+ setbuf(errstream, NULL);
+ err_fd= _fileno(errstream);
+ }
+
+ if (outstream)
+ {
+ out_fd= _fileno(outstream);
+ if (out_fd < 0)
+ {
+ if (!freopen(filename, "a+", outstream))
+ return TRUE;
+ out_fd= _fileno(outstream);
+ }
+ }
if ((osfh= CreateFile(filename, GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE |
@@ -5163,24 +5189,16 @@ extern "C" my_bool reopen_fstreams(const char *filename,
return TRUE;
}
- if (outstream)
+ if (_dup2(handle_fd, err_fd) < 0)
{
- stream_fd= _fileno(outstream);
- if (_dup2(handle_fd, stream_fd) < 0)
- {
- CloseHandle(osfh);
- return TRUE;
- }
+ CloseHandle(osfh);
+ return TRUE;
}
- if (errstream)
+ if (outstream && _dup2(handle_fd, out_fd) < 0)
{
- stream_fd= _fileno(errstream);
- if (_dup2(handle_fd, stream_fd) < 0)
- {
- CloseHandle(osfh);
- return TRUE;
- }
+ CloseHandle(osfh);
+ return TRUE;
}
_close(handle_fd);
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 32552bfe85f..4a1ccc037a5 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -144,16 +144,21 @@ static void inline slave_rows_error_report(enum loglevel level, int ha_error,
len= my_snprintf(slider, buff_end - slider,
" %s, Error_code: %d;", err->msg, err->code);
}
-
- rli->report(level, thd->is_error()? thd->main_da.sql_errno() : 0,
- "Could not execute %s event on table %s.%s;"
- "%s handler error %s; "
- "the event's master log %s, end_log_pos %lu",
- type, table->s->db.str,
- table->s->table_name.str,
- buff,
- handler_error == NULL? "<unknown>" : handler_error,
- log_name, pos);
+
+ if (ha_error != 0)
+ rli->report(level, thd->is_error() ? thd->main_da.sql_errno() : 0,
+ "Could not execute %s event on table %s.%s;"
+ "%s handler error %s; "
+ "the event's master log %s, end_log_pos %lu",
+ type, table->s->db.str, table->s->table_name.str,
+ buff, handler_error == NULL ? "<unknown>" : handler_error,
+ log_name, pos);
+ else
+ rli->report(level, thd->is_error() ? thd->main_da.sql_errno() : 0,
+ "Could not execute %s event on table %s.%s;"
+ "%s the event's master log %s, end_log_pos %lu",
+ type, table->s->db.str, table->s->table_name.str,
+ buff, log_name, pos);
}
#endif
@@ -1224,7 +1229,7 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len,
break;
#ifdef HAVE_REPLICATION
case SLAVE_EVENT: /* can never happen (unused event) */
- ev = new Slave_log_event(buf, event_len);
+ ev = new Slave_log_event(buf, event_len, description_event);
break;
#endif /* HAVE_REPLICATION */
case CREATE_FILE_EVENT:
@@ -1312,8 +1317,10 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len,
(because constructor is "void") ; so instead we leave the pointer we
wanted to allocate (e.g. 'query') to 0 and we test it in is_valid().
Same for Format_description_log_event, member 'post_header_len'.
+
+ SLAVE_EVENT is never used, so it should not be read ever.
*/
- if (!ev || !ev->is_valid())
+ if (!ev || !ev->is_valid() || (event_type == SLAVE_EVENT))
{
DBUG_PRINT("error",("Found invalid event in binary log"));
@@ -2306,7 +2313,7 @@ bool Query_log_event::write(IO_CACHE* file)
start+= 4;
}
- if (thd && thd->is_current_user_used())
+ if (thd && thd->need_binlog_invoker())
{
LEX_STRING user;
LEX_STRING host;
@@ -3300,6 +3307,19 @@ START SLAVE; . Query: '%s'", expected_error, thd->query());
/* If the query was not ignored, it is printed to the general log */
if (!thd->is_error() || thd->main_da.sql_errno() != ER_SLAVE_IGNORED_TABLE)
general_log_write(thd, COM_QUERY, thd->query(), thd->query_length());
+ else
+ {
+ /*
+ Bug#54201: If we skip an INSERT query that uses auto_increment, then we
+ should reset any @@INSERT_ID set by an Intvar_log_event associated with
+ the query; otherwise the @@INSERT_ID will linger until the next INSERT
+ that uses auto_increment and may affect extra triggers on the slave etc.
+
+ We reset INSERT_ID unconditionally; it is probably cheaper than
+ checking if it is necessary.
+ */
+ thd->auto_inc_intervals_forced.empty();
+ }
compare_errors:
@@ -5981,8 +6001,12 @@ void Slave_log_event::init_from_mem_pool(int data_size)
/** This code is not used, so has not been updated to be format-tolerant. */
-Slave_log_event::Slave_log_event(const char* buf, uint event_len)
- :Log_event(buf,0) /*unused event*/ ,mem_pool(0),master_host(0)
+/* We are using description_event so that slave does not crash on Log_event
+ constructor */
+Slave_log_event::Slave_log_event(const char* buf,
+ uint event_len,
+ const Format_description_log_event* description_event)
+ :Log_event(buf,description_event),mem_pool(0),master_host(0)
{
if (event_len < LOG_EVENT_HEADER_LEN)
return;
@@ -7653,7 +7677,6 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli)
get_type_str(),
RPL_LOG_NAME, (ulong) log_pos);
thd->reset_current_stmt_binlog_row_based();
- const_cast<Relay_log_info*>(rli)->cleanup_context(thd, error);
thd->is_slave_error= 1;
DBUG_RETURN(error);
}
@@ -7684,14 +7707,12 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli)
const_cast<Relay_log_info*>(rli)->last_event_start_time= my_time(0);
}
- if (get_flags(STMT_END_F))
- if ((error= rows_event_stmt_cleanup(rli, thd)))
- rli->report(ERROR_LEVEL, error,
- "Error in %s event: commit of row events failed, "
- "table `%s`.`%s`",
- get_type_str(), m_table->s->db.str,
- m_table->s->table_name.str);
-
+ if (get_flags(STMT_END_F) && (error= rows_event_stmt_cleanup(rli, thd)))
+ slave_rows_error_report(ERROR_LEVEL,
+ thd->is_error() ? 0 : error,
+ rli, thd, table,
+ get_type_str(),
+ RPL_LOG_NAME, (ulong) log_pos);
DBUG_RETURN(error);
}
@@ -8359,6 +8380,7 @@ int Table_map_log_event::do_apply_event(Relay_log_info const *rli)
m_field_metadata, m_field_metadata_size,
m_null_bits, m_flags);
table_list->m_tabledef_valid= TRUE;
+ table_list->skip_temporary= 1;
/*
We record in the slave's information that the table should be
@@ -8463,7 +8485,7 @@ void Table_map_log_event::pack_info(Protocol *protocol)
#ifdef MYSQL_CLIENT
-void Table_map_log_event::print(FILE *file, PRINT_EVENT_INFO *print_event_info)
+void Table_map_log_event::print(FILE *, PRINT_EVENT_INFO *print_event_info)
{
if (!print_event_info->short_form)
{
diff --git a/sql/log_event.h b/sql/log_event.h
index 3c7ba766545..770fb29301b 100644
--- a/sql/log_event.h
+++ b/sql/log_event.h
@@ -986,9 +986,9 @@ public:
return (void*) my_malloc((uint)size, MYF(MY_WME|MY_FAE));
}
- static void operator delete(void *ptr, size_t size)
+ static void operator delete(void *ptr, size_t)
{
- my_free((uchar*) ptr, MYF(MY_WME|MY_ALLOW_ZERO_PTR));
+ my_free(ptr, MYF(MY_WME|MY_ALLOW_ZERO_PTR));
}
/* Placement version of the above operators */
@@ -1794,7 +1794,9 @@ public:
void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
#endif
- Slave_log_event(const char* buf, uint event_len);
+ Slave_log_event(const char* buf,
+ uint event_len,
+ const Format_description_log_event *description_event);
~Slave_log_event();
int get_data_size();
bool is_valid() const { return master_host != 0; }
diff --git a/sql/my_decimal.h b/sql/my_decimal.h
index d736bad9a4b..86f5db29ed7 100644
--- a/sql/my_decimal.h
+++ b/sql/my_decimal.h
@@ -308,7 +308,7 @@ int my_decimal2int(uint mask, const my_decimal *d, my_bool unsigned_flag,
inline
-int my_decimal2double(uint mask, const my_decimal *d, double *result)
+int my_decimal2double(uint, const my_decimal *d, double *result)
{
/* No need to call check_result as this will always succeed */
return decimal2double((decimal_t*) d, result);
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index 8b412b421b6..3f836a5ab1f 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -1086,7 +1086,8 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
char* packet, uint packet_length);
void log_slow_statement(THD *thd);
bool check_dup(const char *db, const char *name, TABLE_LIST *tables);
-bool compare_record(TABLE *table);
+bool records_are_comparable(const TABLE *table);
+bool compare_record(const TABLE *table);
bool append_file_to_dir(THD *thd, const char **filename_ptr,
const char *table_name);
void wait_while_table_is_used(THD *thd, TABLE *table,
@@ -2045,7 +2046,7 @@ extern FILE *stderror_file;
extern pthread_key(MEM_ROOT**,THR_MALLOC);
extern pthread_mutex_t LOCK_mysql_create_db,LOCK_Acl,LOCK_open, LOCK_lock_db,
LOCK_mapped_file,LOCK_user_locks, LOCK_status,
- LOCK_error_log, LOCK_delayed_insert, LOCK_uuid_generator,
+ LOCK_error_log, LOCK_delayed_insert, LOCK_short_uuid_generator,
LOCK_delayed_status, LOCK_delayed_create, LOCK_crypt, LOCK_timezone,
LOCK_slave_list, LOCK_active_mi, LOCK_manager, LOCK_global_read_lock,
LOCK_global_system_variables, LOCK_user_conn,
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 1f6e1c9c4b2..828dc27583f 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -707,7 +707,7 @@ pthread_mutex_t LOCK_mysql_create_db, LOCK_Acl, LOCK_open, LOCK_thread_count,
LOCK_crypt, LOCK_bytes_sent, LOCK_bytes_received,
LOCK_global_system_variables,
LOCK_user_conn, LOCK_slave_list, LOCK_active_mi,
- LOCK_connection_count, LOCK_uuid_generator;
+ LOCK_connection_count, LOCK_short_uuid_generator;
pthread_mutex_t LOCK_stats, LOCK_global_user_client_stats;
pthread_mutex_t LOCK_global_table_stats, LOCK_global_index_stats;
@@ -1049,8 +1049,9 @@ static void close_connections(void)
Events::deinit();
end_slave();
- if (thread_count)
- sleep(2); // Give threads time to die
+ /* Give threads time to die. */
+ for (int i= 0; thread_count && i < 100; i++)
+ my_sleep(20000);
/*
Force remaining threads to die by closing the connection to the client
@@ -1426,6 +1427,7 @@ void clean_up(bool print_message)
#ifdef HAVE_REPLICATION
end_slave_list();
#endif
+ my_uuid_end();
delete binlog_filter;
delete rpl_filter;
#ifndef EMBEDDED_LIBRARY
@@ -1538,7 +1540,7 @@ static void clean_up_mutexes()
(void) rwlock_destroy(&LOCK_sys_init_connect);
(void) rwlock_destroy(&LOCK_sys_init_slave);
(void) pthread_mutex_destroy(&LOCK_global_system_variables);
- (void) pthread_mutex_destroy(&LOCK_uuid_generator);
+ (void) pthread_mutex_destroy(&LOCK_short_uuid_generator);
(void) rwlock_destroy(&LOCK_system_variables_hash);
(void) pthread_mutex_destroy(&LOCK_global_read_lock);
(void) pthread_mutex_destroy(&LOCK_prepared_stmt_count);
@@ -3790,7 +3792,7 @@ static int init_thread_environment()
(void) my_rwlock_init(&LOCK_system_variables_hash, NULL);
(void) pthread_mutex_init(&LOCK_global_read_lock, MY_MUTEX_INIT_FAST);
(void) pthread_mutex_init(&LOCK_prepared_stmt_count, MY_MUTEX_INIT_FAST);
- (void) pthread_mutex_init(&LOCK_uuid_generator, MY_MUTEX_INIT_FAST);
+ (void) pthread_mutex_init(&LOCK_short_uuid_generator, MY_MUTEX_INIT_FAST);
(void) pthread_mutex_init(&LOCK_connection_count, MY_MUTEX_INIT_FAST);
(void) pthread_mutex_init(&LOCK_stats, MY_MUTEX_INIT_FAST);
(void) pthread_mutex_init(&LOCK_global_user_client_stats,
@@ -6506,7 +6508,7 @@ each time the SQL thread starts.",
0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
#endif
{"myisam-recover", OPT_MYISAM_RECOVER,
- "Syntax: myisam-recover=OFF or myisam-recover[=option[,option...]], where option can be DEFAULT, BACKUP, FORCE or QUICK.",
+ "Syntax: myisam-recover=OFF or myisam-recover[=option[,option...]], where option can be DEFAULT, BACKUP, BACKUP_ALL, FORCE or QUICK.",
&myisam_recover_options_str, &myisam_recover_options_str, 0,
GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
@@ -7558,7 +7560,11 @@ thread is in the relay logs.",
1024, 0},
{"thread_handling", OPT_THREAD_HANDLING,
"Define threads usage for handling queries: "
- "one-thread-per-connection or no-threads.",
+ "one-thread-per-connection"
+#if HAVE_POOL_OF_THREADS == 1
+ ", pool-of-threads"
+#endif
+ "or no-threads.",
&opt_thread_handling, &opt_thread_handling,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"updatable_views_with_limit", OPT_UPDATABLE_VIEWS_WITH_LIMIT,
@@ -8046,8 +8052,8 @@ SHOW_VAR status_vars[]= {
{"Opened_tables", (char*) offsetof(STATUS_VAR, opened_tables), SHOW_LONG_STATUS},
{"Opened_table_definitions", (char*) offsetof(STATUS_VAR, opened_shares), SHOW_LONG_STATUS},
{"Prepared_stmt_count", (char*) &show_prepared_stmt_count, SHOW_FUNC},
- {"Rows_sent", (char*) offsetof(STATUS_VAR, rows_sent), SHOW_LONG_STATUS},
- {"Rows_read", (char*) offsetof(STATUS_VAR, rows_read), SHOW_LONG_STATUS},
+ {"Rows_sent", (char*) offsetof(STATUS_VAR, rows_sent), SHOW_LONGLONG_STATUS},
+ {"Rows_read", (char*) offsetof(STATUS_VAR, rows_read), SHOW_LONGLONG_STATUS},
#ifdef HAVE_QUERY_CACHE
{"Qcache_free_blocks", (char*) &query_cache.free_memory_blocks, SHOW_LONG_NOFLUSH},
{"Qcache_free_memory", (char*) &query_cache.free_memory, SHOW_LONG_NOFLUSH},
diff --git a/sql/net_serv.cc b/sql/net_serv.cc
index 6a4079b1fef..9b23367da8a 100644
--- a/sql/net_serv.cc
+++ b/sql/net_serv.cc
@@ -168,7 +168,17 @@ my_bool net_realloc(NET *net, size_t length)
DBUG_ENTER("net_realloc");
DBUG_PRINT("enter",("length: %lu", (ulong) length));
- if (length >= net->max_packet_size)
+ /*
+ When compression is off, net->where_b is always 0.
+ With compression turned on, net->where_b may indicate
+ that we still have a piece of the previous logical
+ packet in the buffer, unprocessed. Take it into account
+ when checking that max_allowed_packet is not exceeded.
+ This ensures that the client treats max_allowed_packet
+ limit identically, regardless of compression being on
+ or off.
+ */
+ if (length >= (net->max_packet_size + net->where_b))
{
DBUG_PRINT("error", ("Packet too large. Max size: %lu",
net->max_packet_size));
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index c312ce7cb09..bfa6a49fbdc 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -1406,15 +1406,17 @@ failure:
*/
int QUICK_ROR_INTERSECT_SELECT::init_ror_merged_scan(bool reuse_handler)
{
- List_iterator_fast<QUICK_RANGE_SELECT> quick_it(quick_selects);
- QUICK_RANGE_SELECT* quick;
+ List_iterator_fast<QUICK_SELECT_WITH_RECORD> quick_it(quick_selects);
+ QUICK_SELECT_WITH_RECORD *cur;
+ QUICK_RANGE_SELECT *quick;
DBUG_ENTER("QUICK_ROR_INTERSECT_SELECT::init_ror_merged_scan");
/* Initialize all merged "children" quick selects */
DBUG_ASSERT(!need_to_fetch_row || reuse_handler);
if (!need_to_fetch_row && reuse_handler)
{
- quick= quick_it++;
+ cur= quick_it++;
+ quick= cur->quick;
/*
There is no use of this->file. Use it for the first of merged range
selects.
@@ -1423,8 +1425,9 @@ int QUICK_ROR_INTERSECT_SELECT::init_ror_merged_scan(bool reuse_handler)
DBUG_RETURN(1);
quick->file->extra(HA_EXTRA_KEYREAD_PRESERVE_FIELDS);
}
- while ((quick= quick_it++))
+ while ((cur= quick_it++))
{
+ quick= cur->quick;
if (quick->init_ror_merged_scan(FALSE))
DBUG_RETURN(1);
quick->file->extra(HA_EXTRA_KEYREAD_PRESERVE_FIELDS);
@@ -1456,10 +1459,10 @@ int QUICK_ROR_INTERSECT_SELECT::reset()
if (!scans_inited && init_ror_merged_scan(TRUE))
DBUG_RETURN(1);
scans_inited= TRUE;
- List_iterator_fast<QUICK_RANGE_SELECT> it(quick_selects);
- QUICK_RANGE_SELECT *quick;
- while ((quick= it++))
- quick->reset();
+ List_iterator_fast<QUICK_SELECT_WITH_RECORD> it(quick_selects);
+ QUICK_SELECT_WITH_RECORD *qr;
+ while ((qr= it++))
+ qr->quick->reset();
DBUG_RETURN(0);
}
@@ -1469,6 +1472,7 @@ int QUICK_ROR_INTERSECT_SELECT::reset()
SYNOPSIS
QUICK_ROR_INTERSECT_SELECT::push_quick_back()
+ alloc Mem root to create auxiliary structures on
quick Quick select to be added. The quick select must return
rows in rowid order.
NOTES
@@ -1480,11 +1484,17 @@ int QUICK_ROR_INTERSECT_SELECT::reset()
*/
bool
-QUICK_ROR_INTERSECT_SELECT::push_quick_back(QUICK_RANGE_SELECT *quick)
+QUICK_ROR_INTERSECT_SELECT::push_quick_back(MEM_ROOT *alloc, QUICK_RANGE_SELECT *quick)
{
- return quick_selects.push_back(quick);
+ QUICK_SELECT_WITH_RECORD *qr;
+ if (!(qr= new QUICK_SELECT_WITH_RECORD) ||
+ !(qr->key_tuple= (uchar*)alloc_root(alloc, quick->max_used_key_length)))
+ return TRUE;
+ qr->quick= quick;
+ return quick_selects.push_back(qr);
}
+
QUICK_ROR_INTERSECT_SELECT::~QUICK_ROR_INTERSECT_SELECT()
{
DBUG_ENTER("QUICK_ROR_INTERSECT_SELECT::~QUICK_ROR_INTERSECT_SELECT");
@@ -4947,7 +4957,7 @@ QUICK_SELECT_I *TRP_ROR_INTERSECT::make_quick(PARAM *param,
{
if (!(quick= get_quick_select(param, (*first_scan)->idx,
(*first_scan)->sel_arg, alloc)) ||
- quick_intrsect->push_quick_back(quick))
+ quick_intrsect->push_quick_back(alloc, quick))
{
delete quick_intrsect;
DBUG_RETURN(NULL);
@@ -7977,11 +7987,11 @@ bool QUICK_INDEX_MERGE_SELECT::is_keys_used(const MY_BITMAP *fields)
bool QUICK_ROR_INTERSECT_SELECT::is_keys_used(const MY_BITMAP *fields)
{
- QUICK_RANGE_SELECT *quick;
- List_iterator_fast<QUICK_RANGE_SELECT> it(quick_selects);
- while ((quick= it++))
+ QUICK_SELECT_WITH_RECORD *qr;
+ List_iterator_fast<QUICK_SELECT_WITH_RECORD> it(quick_selects);
+ while ((qr= it++))
{
- if (is_key_used(head, quick->index, fields))
+ if (is_key_used(head, qr->quick->index, fields))
return 1;
}
return 0;
@@ -8280,7 +8290,8 @@ int QUICK_INDEX_MERGE_SELECT::get_next()
int QUICK_ROR_INTERSECT_SELECT::get_next()
{
- List_iterator_fast<QUICK_RANGE_SELECT> quick_it(quick_selects);
+ List_iterator_fast<QUICK_SELECT_WITH_RECORD> quick_it(quick_selects);
+ QUICK_SELECT_WITH_RECORD *qr;
QUICK_RANGE_SELECT* quick;
int error, cmp;
uint last_rowid_count=0;
@@ -8289,7 +8300,8 @@ int QUICK_ROR_INTERSECT_SELECT::get_next()
do
{
/* Get a rowid for first quick and save it as a 'candidate' */
- quick= quick_it++;
+ qr= quick_it++;
+ quick= qr->quick;
error= quick->get_next();
if (cpk_quick)
{
@@ -8299,17 +8311,22 @@ int QUICK_ROR_INTERSECT_SELECT::get_next()
if (error)
DBUG_RETURN(error);
+ /* Save the read key tuple */
+ key_copy(qr->key_tuple, record, head->key_info + quick->index,
+ quick->max_used_key_length);
+
quick->file->position(quick->record);
memcpy(last_rowid, quick->file->ref, head->file->ref_length);
last_rowid_count= 1;
while (last_rowid_count < quick_selects.elements)
{
- if (!(quick= quick_it++))
+ if (!(qr= quick_it++))
{
quick_it.rewind();
- quick= quick_it++;
+ qr= quick_it++;
}
+ quick= qr->quick;
do
{
@@ -8319,6 +8336,9 @@ int QUICK_ROR_INTERSECT_SELECT::get_next()
cmp= head->file->cmp_ref(quick->file->ref, last_rowid);
} while (cmp < 0);
+ key_copy(qr->key_tuple, record, head->key_info + quick->index,
+ quick->max_used_key_length);
+
/* Ok, current select 'caught up' and returned ref >= cur_ref */
if (cmp > 0)
{
@@ -8334,6 +8354,10 @@ int QUICK_ROR_INTERSECT_SELECT::get_next()
}
memcpy(last_rowid, quick->file->ref, head->file->ref_length);
last_rowid_count= 1;
+
+ //save the fields here
+ key_copy(qr->key_tuple, record, head->key_info + quick->index,
+ quick->max_used_key_length);
}
else
{
@@ -8346,6 +8370,21 @@ int QUICK_ROR_INTERSECT_SELECT::get_next()
if (need_to_fetch_row)
error= head->file->ha_rnd_pos(head->record[0], last_rowid);
} while (error == HA_ERR_RECORD_DELETED);
+
+ if (!need_to_fetch_row)
+ {
+ /* Restore the columns we've read/saved with other quick selects */
+ quick_it.rewind();
+ while ((qr= quick_it++))
+ {
+ if (qr->quick != quick)
+ {
+ key_restore(record, qr->key_tuple, head->key_info + qr->quick->index,
+ qr->quick->max_used_key_length);
+ }
+ }
+ }
+
DBUG_RETURN(error);
}
@@ -8426,9 +8465,14 @@ int QUICK_RANGE_SELECT::reset()
in_range= FALSE;
cur_range= (QUICK_RANGE**) ranges.buffer;
- if (file->inited == handler::NONE && (error= file->ha_index_init(index,1)))
- DBUG_RETURN(error);
-
+ if (file->inited == handler::NONE)
+ {
+ if (in_ror_merged_scan)
+ head->column_bitmaps_set_no_signal(&column_bitmap, &column_bitmap);
+ if ((error= file->ha_index_init(index,1)))
+ DBUG_RETURN(error);
+ }
+
/* Do not allocate the buffers twice. */
if (multi_range_length)
{
@@ -8965,12 +9009,12 @@ void QUICK_INDEX_MERGE_SELECT::add_info_string(String *str)
void QUICK_ROR_INTERSECT_SELECT::add_info_string(String *str)
{
bool first= TRUE;
- QUICK_RANGE_SELECT *quick;
- List_iterator_fast<QUICK_RANGE_SELECT> it(quick_selects);
+ QUICK_SELECT_WITH_RECORD *qr;
+ List_iterator_fast<QUICK_SELECT_WITH_RECORD> it(quick_selects);
str->append(STRING_WITH_LEN("intersect("));
- while ((quick= it++))
+ while ((qr= it++))
{
- KEY *key_info= head->key_info + quick->index;
+ KEY *key_info= head->key_info + qr->quick->index;
if (!first)
str->append(',');
else
@@ -9057,11 +9101,11 @@ void QUICK_ROR_INTERSECT_SELECT::add_keys_and_lengths(String *key_names,
char buf[64];
uint length;
bool first= TRUE;
- QUICK_RANGE_SELECT *quick;
- List_iterator_fast<QUICK_RANGE_SELECT> it(quick_selects);
- while ((quick= it++))
+ QUICK_SELECT_WITH_RECORD *qr;
+ List_iterator_fast<QUICK_SELECT_WITH_RECORD> it(quick_selects);
+ while ((qr= it++))
{
- KEY *key_info= head->key_info + quick->index;
+ KEY *key_info= head->key_info + qr->quick->index;
if (first)
first= FALSE;
else
@@ -9070,7 +9114,7 @@ void QUICK_ROR_INTERSECT_SELECT::add_keys_and_lengths(String *key_names,
used_lengths->append(',');
}
key_names->append(key_info->name);
- length= longlong10_to_str(quick->max_used_key_length, buf, 10) - buf;
+ length= longlong10_to_str(qr->quick->max_used_key_length, buf, 10) - buf;
used_lengths->append(buf, length);
}
@@ -11014,6 +11058,7 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_min_in_range()
/* Compare the found key with max_key. */
int cmp_res= key_cmp(index_info->key_part, max_key,
real_prefix_len + min_max_arg_len);
+ my_afree(max_key);
/*
The key is outside of the range if:
the interval is open and the key is equal to the maximum boundry
@@ -11139,6 +11184,7 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_max_in_range()
/* Compare the found key with min_key. */
int cmp_res= key_cmp(index_info->key_part, min_key,
real_prefix_len + min_max_arg_len);
+ my_afree(min_key);
/*
The key is outside of the range if:
the interval is open and the key is equal to the minimum boundry
@@ -11428,13 +11474,13 @@ void QUICK_INDEX_MERGE_SELECT::dbug_dump(int indent, bool verbose)
void QUICK_ROR_INTERSECT_SELECT::dbug_dump(int indent, bool verbose)
{
- List_iterator_fast<QUICK_RANGE_SELECT> it(quick_selects);
- QUICK_RANGE_SELECT *quick;
+ List_iterator_fast<QUICK_SELECT_WITH_RECORD> it(quick_selects);
+ QUICK_SELECT_WITH_RECORD *qr;
fprintf(DBUG_FILE, "%*squick ROR-intersect select, %scovering\n",
indent, "", need_to_fetch_row? "":"non-");
fprintf(DBUG_FILE, "%*smerged scans {\n", indent, "");
- while ((quick= it++))
- quick->dbug_dump(indent+2, verbose);
+ while ((qr= it++))
+ qr->quick->dbug_dump(indent+2, verbose);
if (cpk_quick)
{
fprintf(DBUG_FILE, "%*sclustered PK quick:\n", indent, "");
diff --git a/sql/opt_range.h b/sql/opt_range.h
index 758dffe7a52..29df043cb69 100644
--- a/sql/opt_range.h
+++ b/sql/opt_range.h
@@ -585,13 +585,21 @@ public:
void dbug_dump(int indent, bool verbose);
#endif
int init_ror_merged_scan(bool reuse_handler);
- bool push_quick_back(QUICK_RANGE_SELECT *quick_sel_range);
+ bool push_quick_back(MEM_ROOT *alloc, QUICK_RANGE_SELECT *quick_sel_range);
+
+ class QUICK_SELECT_WITH_RECORD : public Sql_alloc
+ {
+ public:
+ QUICK_RANGE_SELECT *quick;
+ uchar *key_tuple;
+ ~QUICK_SELECT_WITH_RECORD() { delete quick; }
+ };
/*
Range quick selects this intersection consists of, not including
cpk_quick.
*/
- List<QUICK_RANGE_SELECT> quick_selects;
+ List<QUICK_SELECT_WITH_RECORD> quick_selects;
/*
Merged quick select that uses Clustered PK, if there is one. This quick
diff --git a/sql/rpl_record.cc b/sql/rpl_record.cc
index 3a46bbcd6ee..ecae1efdce4 100644
--- a/sql/rpl_record.cc
+++ b/sql/rpl_record.cc
@@ -77,7 +77,7 @@ pack_row(TABLE *table, MY_BITMAP const* cols,
unsigned int null_mask= 1U;
for ( ; (field= *p_field) ; p_field++)
{
- DBUG_PRINT("debug", ("null_mask=%d; null_ptr=%p; row_data=%p; null_byte_count=%d",
+ DBUG_PRINT("debug", ("null_mask: %d null_ptr: %p row_data: %p null_byte_count: %d",
null_mask, null_ptr, row_data, null_byte_count));
if (bitmap_is_set(cols, p_field - table->field))
{
diff --git a/sql/rpl_rli.h b/sql/rpl_rli.h
index 2c1f581e156..5cafcf47086 100644
--- a/sql/rpl_rli.h
+++ b/sql/rpl_rli.h
@@ -94,6 +94,16 @@ public:
*/
MYSQL_BIN_LOG relay_log;
LOG_INFO linfo;
+
+ /*
+ cur_log
+ Pointer that either points at relay_log.get_log_file() or
+ &rli->cache_buf, depending on whether the log is hot or there was
+ the need to open a cold relay_log.
+
+ cache_buf
+ IO_CACHE used when opening cold relay logs.
+ */
IO_CACHE cache_buf,*cur_log;
/* The following variables are safe to read any time */
diff --git a/sql/set_var.cc b/sql/set_var.cc
index fb3b951532f..9917ba9bfe3 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -128,7 +128,9 @@ static void fix_net_write_timeout(THD *thd, enum_var_type type);
static void fix_net_retry_count(THD *thd, enum_var_type type);
static void fix_max_join_size(THD *thd, enum_var_type type);
static void fix_query_cache_size(THD *thd, enum_var_type type);
+#ifdef HAVE_QUERY_CACHE
static void fix_query_cache_min_res_unit(THD *thd, enum_var_type type);
+#endif
static void fix_myisam_max_sort_file_size(THD *thd, enum_var_type type);
static void fix_max_binlog_size(THD *thd, enum_var_type type);
static void fix_max_relay_log_size(THD *thd, enum_var_type type);
@@ -2676,7 +2678,7 @@ bool update_sys_var_str_path(THD *thd, sys_var_str *var_str,
file_log= logger.get_log_file_handler();
break;
default:
- assert(0); // Impossible
+ MY_ASSERT_UNREACHABLE();
}
if (!old_value)
diff --git a/sql/share/Makefile.am b/sql/share/Makefile.am
index 68b393e619f..cb7cc2224a8 100644
--- a/sql/share/Makefile.am
+++ b/sql/share/Makefile.am
@@ -57,6 +57,3 @@ distclean-local:
# Do nothing
link_sources:
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt
index 54061931d5f..a872fa1f1e9 100644
--- a/sql/share/errmsg.txt
+++ b/sql/share/errmsg.txt
@@ -6017,7 +6017,7 @@ ER_ONLY_INTEGERS_ALLOWED
eng "Only integers allowed as number here"
ger "An dieser Stelle sind nur Ganzzahlen zulässig"
ER_UNSUPORTED_LOG_ENGINE
- eng "This storage engine cannot be used for log tables""
+ 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"
@@ -6236,13 +6236,15 @@ ER_WARNING_NON_DEFAULT_VALUE_FOR_VIRTUAL_COLUMN
eng "The value specified for computed column '%s' in table '%s' ignored"
ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN
- eng "'%s' is not yet supported for computed columns"
+ eng "This is not yet supported for computed columns"
ER_CONST_EXPR_IN_VCOL
eng "Constant expression in computed column function is not allowed"
ER_ROW_EXPR_FOR_VCOL
eng "Expression for computed column cannot return a row"
+ER_UNSUPPORTED_ENGINE_FOR_VIRTUAL_COLUMNS
+ eng "%s storage engine does not support computed columns"
ER_UNKNOWN_OPTION
eng "Unknown option '%-.64s'"
ER_BAD_OPTION_VALUE
diff --git a/sql/slave.cc b/sql/slave.cc
index 55bfcceeb47..0e41d897dd4 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -740,8 +740,17 @@ static bool sql_slave_killed(THD* thd, Relay_log_info* rli)
DBUG_ASSERT(rli->slave_running == 1);// tracking buffer overrun
if (abort_loop || thd->killed || rli->abort_slave)
{
+ /*
+ The transaction should always be binlogged if OPTION_KEEP_LOG is set
+ (it implies that something can not be rolled back). And such case
+ should be regarded similarly as modifing a non-transactional table
+ because retrying of the transaction will lead to an error or inconsistency
+ as well.
+ Example: OPTION_KEEP_LOG is set if a temporary table is created or dropped.
+ */
if (rli->abort_slave && rli->is_in_group() &&
- thd->transaction.all.modified_non_trans_table)
+ (thd->transaction.all.modified_non_trans_table ||
+ (thd->options & OPTION_KEEP_LOG)))
DBUG_RETURN(0);
/*
If we are in an unsafe situation (stopping could corrupt replication),
@@ -2304,7 +2313,7 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli)
else
{
exec_res= 0;
- end_trans(thd, ROLLBACK);
+ rli->cleanup_context(thd, 1);
/* chance for concurrent connection to get more locks */
safe_sleep(thd, min(rli->trans_retries, MAX_SLAVE_RETRY_PAUSE),
(CHECK_KILLED_FUNC)sql_slave_killed, (void*)rli);
@@ -3120,6 +3129,7 @@ the slave SQL thread with \"SLAVE START\". We stopped at log \
request is detected only by the present function, not by events), so we
must "proactively" clear playgrounds:
*/
+ thd->clear_error();
rli->cleanup_context(thd, 1);
/*
Some extra safety, which should not been needed (normally, event deletion
@@ -4312,12 +4322,66 @@ static Log_event* next_event(Relay_log_info* rli)
DBUG_ASSERT(rli->cur_log_fd == -1);
/*
- Read pointer has to be at the start since we are the only
- reader.
- We must keep the LOCK_log to read the 4 first bytes, as this is a hot
- log (same as when we call read_log_event() above: for a hot log we
- take the mutex).
+ When the SQL thread is [stopped and] (re)started the
+ following may happen:
+
+ 1. Log was hot at stop time and remains hot at restart
+
+ SQL thread reads again from hot_log (SQL thread was
+ reading from the active log when it was stopped and the
+ very same log is still active on SQL thread restart).
+
+ In this case, my_b_seek is performed on cur_log, while
+ cur_log points to relay_log.get_log_file();
+
+ 2. Log was hot at stop time but got cold before restart
+
+ The log was hot when SQL thread stopped, but it is not
+ anymore when the SQL thread restarts.
+
+ In this case, the SQL thread reopens the log, using
+ cache_buf, ie, cur_log points to &cache_buf, and thence
+ its coordinates are reset.
+
+ 3. Log was already cold at stop time
+
+ The log was not hot when the SQL thread stopped, and, of
+ course, it will not be hot when it restarts.
+
+ In this case, the SQL thread opens the cold log again,
+ using cache_buf, ie, cur_log points to &cache_buf, and
+ thence its coordinates are reset.
+
+ 4. Log was hot at stop time, DBA changes to previous cold
+ log and restarts SQL thread
+
+ The log was hot when the SQL thread was stopped, but the
+ user changed the coordinates of the SQL thread to
+ restart from a previous cold log.
+
+ In this case, at start time, cur_log points to a cold
+ log, opened using &cache_buf as cache, and coordinates
+ are reset. However, as it moves on to the next logs, it
+ will eventually reach the hot log. If the hot log is the
+ same at the time the SQL thread was stopped, then
+ coordinates were not reset - the cur_log will point to
+ relay_log.get_log_file(), and not a freshly opened
+ IO_CACHE through cache_buf. For this reason we need to
+ deploy a my_b_seek before calling check_binlog_magic at
+ this point of the code (see: BUG#55263 for more
+ details).
+
+ NOTES:
+ - We must keep the LOCK_log to read the 4 first bytes, as
+ this is a hot log (same as when we call read_log_event()
+ above: for a hot log we take the mutex).
+
+ - Because of scenario #4 above, we need to have a
+ my_b_seek here. Otherwise, we might hit the assertion
+ inside check_binlog_magic.
*/
+
+ my_b_seek(cur_log, (my_off_t) 0);
if (check_binlog_magic(cur_log,&errmsg))
{
if (!hot_log) pthread_mutex_unlock(log_lock);
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 496e8c310dd..9b1d0df4251 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -1593,6 +1593,7 @@ bool change_password(THD *thd, const char *host, const char *user,
/* Buffer should be extended when password length is extended. */
char buff[512];
ulong query_length;
+ bool save_binlog_row_based;
uint new_password_len= (uint) strlen(new_password);
bool result= 1;
DBUG_ENTER("change_password");
@@ -1628,6 +1629,14 @@ bool change_password(THD *thd, const char *host, const char *user,
if (!(table= open_ltable(thd, &tables, TL_WRITE, 0)))
DBUG_RETURN(1);
+ /*
+ This statement will be replicated as a statement, even when using
+ row-based replication. The flag will be reset at the end of the
+ statement.
+ */
+ if ((save_binlog_row_based= thd->current_stmt_binlog_row_based))
+ thd->clear_current_stmt_binlog_row_based();
+
VOID(pthread_mutex_lock(&acl_cache->lock));
ACL_USER *acl_user;
if (!(acl_user= find_acl_user(host, user, TRUE)))
@@ -1671,6 +1680,12 @@ bool change_password(THD *thd, const char *host, const char *user,
}
end:
close_thread_tables(thd);
+
+ /* Restore the state of binlog format */
+ DBUG_ASSERT(!thd->current_stmt_binlog_row_based);
+ if (save_binlog_row_based)
+ thd->set_current_stmt_binlog_row_based();
+
DBUG_RETURN(result);
}
@@ -5509,7 +5524,7 @@ static int handle_grant_struct(uint struct_no, bool drop,
host= grant_name->host.hostname;
break;
default:
- DBUG_ASSERT(0);
+ MY_ASSERT_UNREACHABLE();
}
if (! user)
user= "";
@@ -6965,16 +6980,16 @@ struct MPVIO_EXT : public MYSQL_PLUGIN_VIO
a helper function to report an access denied error in all the proper places
*/
-static void login_failed_error(THD *thd, bool passwd_used)
+static void login_failed_error(THD *thd)
{
my_error(ER_ACCESS_DENIED_ERROR, MYF(0),
thd->main_security_ctx.user,
thd->main_security_ctx.host_or_ip,
- passwd_used ? ER(ER_YES) : ER(ER_NO));
+ thd->password ? ER(ER_YES) : ER(ER_NO));
general_log_print(thd, COM_CONNECT, ER(ER_ACCESS_DENIED_ERROR),
thd->main_security_ctx.user,
thd->main_security_ctx.host_or_ip,
- passwd_used ? ER(ER_YES) : ER(ER_NO));
+ thd->password ? ER(ER_YES) : ER(ER_NO));
status_var_increment(thd->status_var.access_denied_errors);
/*
Log access denied messages to the error log when log-warnings = 2
@@ -6986,7 +7001,7 @@ static void login_failed_error(THD *thd, bool passwd_used)
sql_print_warning(ER(ER_ACCESS_DENIED_ERROR),
thd->main_security_ctx.user,
thd->main_security_ctx.host_or_ip,
- passwd_used ? ER(ER_YES) : ER(ER_NO));
+ thd->password ? ER(ER_YES) : ER(ER_NO));
}
}
@@ -7251,7 +7266,7 @@ static bool find_mpvio_user(MPVIO_EXT *mpvio, Security_context *sctx)
if (!mpvio->acl_user)
{
- login_failed_error(mpvio->thd, 0);
+ login_failed_error(mpvio->thd);
return 1;
}
@@ -7568,8 +7583,11 @@ static ulong parse_client_handshake_packet(MPVIO_EXT *mpvio,
return packet_error;
}
+ thd->password= passwd_len > 0;
if (find_mpvio_user(mpvio, sctx))
+ {
return packet_error;
+ }
if (thd->client_capabilities & CLIENT_PLUGIN_AUTH)
{
@@ -8057,7 +8075,7 @@ bool acl_authenticate(THD *thd, uint connect_errors, uint com_change_user_pkt_le
DBUG_ASSERT(mpvio.status == MPVIO_EXT::FAILURE);
if (!thd->is_error())
- login_failed_error(thd, thd->password);
+ login_failed_error(thd);
DBUG_RETURN(1);
}
@@ -8077,7 +8095,7 @@ bool acl_authenticate(THD *thd, uint connect_errors, uint com_change_user_pkt_le
*/
if (acl_check_ssl(thd, acl_user))
{
- login_failed_error(thd, thd->password);
+ login_failed_error(thd);
DBUG_RETURN(1);
}
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index b5876db7f45..b6281777f81 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -3115,8 +3115,6 @@ bool reopen_table(TABLE *table)
tmp.maybe_null= table->maybe_null;
tmp.status= table->status;
- tmp.s->table_map_id= table->s->table_map_id;
-
/* Get state */
tmp.in_use= thd;
tmp.reginfo.lock_type=table->reginfo.lock_type;
@@ -8262,11 +8260,9 @@ fill_record(THD * thd, List<Item> &fields, List<Item> &values,
List_iterator_fast<Item> f(fields),v(values);
Item *value, *fld;
Item_field *field;
- TABLE *table= 0;
- List<TABLE> tbl_list;
+ TABLE *table= 0, *vcol_table= 0;
bool abort_on_warning_saved= thd->abort_on_warning;
DBUG_ENTER("fill_record");
- tbl_list.empty();
/*
Reset the table->auto_increment_field_not_null as it is valid for
@@ -8289,7 +8285,7 @@ fill_record(THD * thd, List<Item> &fields, List<Item> &values,
f.rewind();
}
else if (thd->lex->unit.insert_table_with_stored_vcol)
- tbl_list.push_back(thd->lex->unit.insert_table_with_stored_vcol);
+ vcol_table= thd->lex->unit.insert_table_with_stored_vcol;
while ((fld= f++))
{
if (!(field= fld->filed_for_view_update()))
@@ -8319,31 +8315,17 @@ fill_record(THD * thd, List<Item> &fields, List<Item> &values,
my_message(ER_UNKNOWN_ERROR, ER(ER_UNKNOWN_ERROR), MYF(0));
goto err;
}
- tbl_list.push_back(table);
+ DBUG_ASSERT(vcol_table == 0 || vcol_table == table);
+ vcol_table= table;
}
/* Update virtual fields*/
thd->abort_on_warning= FALSE;
- if (tbl_list.head())
+ if (vcol_table)
{
- List_iterator_fast<TABLE> it(tbl_list);
- TABLE *prev_table= 0;
- while ((table= it++))
+ if (vcol_table->vfield)
{
- /*
- Do simple optimization to prevent unnecessary re-generating
- values for virtual fields
- */
- if (table != prev_table)
- {
- prev_table= table;
- if (table->vfield)
- {
- if (update_virtual_fields(thd, table, TRUE))
- {
- goto err;
- }
- }
- }
+ if (update_virtual_fields(thd, vcol_table, TRUE))
+ goto err;
}
}
thd->abort_on_warning= abort_on_warning_saved;
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index fb3d201e222..81cc87723c5 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -1349,6 +1349,57 @@ end:
}
+#ifndef EMBEDDED_LIBRARY
+/**
+ Send a single memory block from the query cache.
+
+ Respects the client/server protocol limits for the
+ size of the network packet, and splits a large block
+ in pieces to ensure that individual piece doesn't exceed
+ the maximal allowed size of the network packet (16M).
+
+ @param[in] net NET handler
+ @param[in] packet packet to send
+ @param[in] len packet length
+
+ @return Operation status
+ @retval FALSE On success
+ @retval TRUE On error
+*/
+static bool
+send_data_in_chunks(NET *net, const uchar *packet, ulong len)
+{
+ /*
+ On the client we may require more memory than max_allowed_packet
+ to keep, both, the truncated last logical packet, and the
+ compressed next packet. This never (or in practice never)
+ happens without compression, since without compression it's very
+ unlikely that a) a truncated logical packet would remain on the
+ client when it's time to read the next packet b) a subsequent
+ logical packet that is being read would be so large that
+ size-of-new-packet + size-of-old-packet-tail >
+ max_allowed_packet. To remedy this issue, we send data in 1MB
+ sized packets, that's below the current client default of 16MB
+ for max_allowed_packet, but large enough to ensure there is no
+ unnecessary overhead from too many syscalls per result set.
+ */
+ static const ulong MAX_CHUNK_LENGTH= 1024*1024;
+
+ while (len > MAX_CHUNK_LENGTH)
+ {
+ if (net_real_write(net, packet, MAX_CHUNK_LENGTH))
+ return TRUE;
+ packet+= MAX_CHUNK_LENGTH;
+ len-= MAX_CHUNK_LENGTH;
+ }
+ if (len && net_real_write(net, packet, len))
+ return TRUE;
+
+ return FALSE;
+}
+#endif
+
+
/*
Check if the query is in the cache. If it was cached, send it
to the user.
@@ -1660,11 +1711,11 @@ def_week_frmt: %lu, in_trans: %d, autocommit: %d",
ALIGN_SIZE(sizeof(Query_cache_result)))));
Query_cache_result *result = result_block->result();
- if (net_real_write(&thd->net, result->data(),
- result_block->used -
- result_block->headers_len() -
- ALIGN_SIZE(sizeof(Query_cache_result))))
- break; // Client aborted
+ if (send_data_in_chunks(&thd->net, result->data(),
+ result_block->used -
+ result_block->headers_len() -
+ ALIGN_SIZE(sizeof(Query_cache_result))))
+ break; // Client aborted
result_block = result_block->next;
thd->net.pkt_nr= query->last_pkt_nr; // Keep packet number updated
} while (result_block != first_result_block);
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 57462bbddf8..a02ab2bba9e 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -91,7 +91,9 @@ extern "C" void free_user_var(user_var_entry *entry)
bool Key_part_spec::operator==(const Key_part_spec& other) const
{
- return length == other.length && !strcmp(field_name, other.field_name);
+ return length == other.length &&
+ !my_strcasecmp(system_charset_info, field_name,
+ other.field_name);
}
/**
@@ -803,7 +805,7 @@ THD::THD()
m_internal_handler= NULL;
arena_for_cached_items= 0;
- current_user_used= FALSE;
+ m_binlog_invoker= FALSE;
memset(&invoker_user, 0, sizeof(invoker_user));
memset(&invoker_host, 0, sizeof(invoker_host));
}
@@ -1188,6 +1190,8 @@ void add_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var)
/* Handle the not ulong variables. See end of system_status_var */
to_var->bytes_received= from_var->bytes_received;
to_var->bytes_sent+= from_var->bytes_sent;
+ to_var->rows_read+= from_var->rows_read;
+ to_var->rows_sent+= from_var->rows_sent;
to_var->binlog_bytes_written= from_var->binlog_bytes_written;
to_var->cpu_time+= from_var->cpu_time;
to_var->busy_time+= from_var->busy_time;
@@ -1221,6 +1225,8 @@ void add_diff_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var,
to_var->bytes_received+= from_var->bytes_received -
dec_var->bytes_received;
to_var->bytes_sent+= from_var->bytes_sent - dec_var->bytes_sent;
+ to_var->rows_read+= from_var->rows_read - dec_var->rows_read;
+ to_var->rows_sent+= from_var->rows_sent - dec_var->rows_sent;
to_var->binlog_bytes_written+= from_var->binlog_bytes_written -
dec_var->binlog_bytes_written;
to_var->cpu_time+= from_var->cpu_time - dec_var->cpu_time;
@@ -1431,7 +1437,7 @@ void THD::cleanup_after_query()
where= THD::DEFAULT_WHERE;
/* reset table map for multi-table update */
table_map_for_update= 0;
- clean_current_user_used();
+ m_binlog_invoker= FALSE;
}
@@ -1740,6 +1746,36 @@ void THD::nocheck_register_item_tree_change(Item **place, Item *old_value,
change_list.append(change);
}
+/**
+ Check and register item change if needed
+
+ @param place place where we should assign new value
+ @param new_value place of the new value
+
+ @details
+ Let C be a reference to an item that changed the reference A
+ at the location (occurrence) L1 and this change has been registered.
+ If C is substituted for reference A another location (occurrence) L2
+ that is to be registered as well than this change has to be
+ consistent with the first change in order the procedure that rollback
+ changes to substitute the same reference at both locations L1 and L2.
+*/
+
+void THD::check_and_register_item_tree_change(Item **place, Item **new_value,
+ MEM_ROOT *runtime_memroot)
+{
+ Item_change_record *change;
+ I_List_iterator<Item_change_record> it(change_list);
+ while ((change= it++))
+ {
+ if (change->place == new_value)
+ break; // we need only very first value
+ }
+ if (change)
+ nocheck_register_item_tree_change(place, change->old_value,
+ runtime_memroot);
+}
+
void THD::rollback_item_tree_changes()
{
@@ -3460,7 +3496,7 @@ void THD::set_query(char *query_arg, uint32 query_length_arg)
void THD::get_definer(LEX_USER *definer)
{
- set_current_user_used();
+ binlog_invoker();
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
if (slave_thread && has_invoker())
{
diff --git a/sql/sql_class.h b/sql/sql_class.h
index bb986d6377f..f496cbe3b74 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -468,8 +468,6 @@ typedef struct system_status_var
ulong select_range_count;
ulong select_range_check_count;
ulong select_scan_count;
- ulong rows_read;
- ulong rows_sent;
ulong long_query_count;
ulong filesort_merge_passes;
ulong filesort_range_count;
@@ -483,6 +481,9 @@ typedef struct system_status_var
ulong com_stmt_fetch;
ulong com_stmt_reset;
ulong com_stmt_close;
+ ulong empty_queries;
+ ulong access_denied_errors;
+ ulong lost_connections;
/*
Number of statements sent from the client
*/
@@ -493,11 +494,10 @@ typedef struct system_status_var
Below 'last_system_status_var' are all variables that cannot be handled
automatically by add_to_status()/add_diff_to_status().
*/
- ulong empty_queries;
- ulong access_denied_errors; /* Can only be 0 or 1 */
- ulong lost_connections;
ulonglong bytes_received;
ulonglong bytes_sent;
+ ulonglong rows_read;
+ ulonglong rows_sent;
ulonglong binlog_bytes_written;
double last_query_cost;
double cpu_time, busy_time;
@@ -1584,7 +1584,7 @@ public:
/*
This is to track items changed during execution of a prepared
statement/stored procedure. It's created by
- register_item_tree_change() in memory root of THD, and freed in
+ nocheck_register_item_tree_change() in memory root of THD, and freed in
rollback_item_tree_changes(). For conventional execution it's always
empty.
*/
@@ -2208,8 +2208,26 @@ public:
nocheck_register_item_tree_change(place, *place, mem_root);
*place= new_value;
}
+ /**
+ Make change in item tree after checking whether it needs registering
+
+
+ @param place place where we should assign new value
+ @param new_value place of the new value
+
+ @details
+ see check_and_register_item_tree_change details
+ */
+ void check_and_register_item_tree(Item **place, Item **new_value)
+ {
+ if (!stmt_arena->is_conventional())
+ check_and_register_item_tree_change(place, new_value, mem_root);
+ *place= *new_value;
+ }
void nocheck_register_item_tree_change(Item **place, Item *old_value,
MEM_ROOT *runtime_memroot);
+ void check_and_register_item_tree_change(Item **place, Item **new_value,
+ MEM_ROOT *runtime_memroot);
void rollback_item_tree_changes();
/*
@@ -2404,9 +2422,8 @@ public:
Protected with LOCK_thd_data mutex.
*/
void set_query(char *query_arg, uint32 query_length_arg);
- void set_current_user_used() { current_user_used= TRUE; }
- bool is_current_user_used() { return current_user_used; }
- void clean_current_user_used() { current_user_used= FALSE; }
+ void binlog_invoker() { m_binlog_invoker= TRUE; }
+ bool need_binlog_invoker() { return m_binlog_invoker; }
void get_definer(LEX_USER *definer);
void set_invoker(const LEX_STRING *user, const LEX_STRING *host)
{
@@ -2462,10 +2479,10 @@ private:
statements or default definer is set in CREATE/ALTER SP, SF, Event,
TRIGGER or VIEW statements.
- Current user will be binlogged into Query_log_event if current_user_used
+ Current user will be binlogged into Query_log_event if m_binlog_invoker
is TRUE; It will be stored into invoker_host and invoker_user by SQL thread.
*/
- bool current_user_used;
+ bool m_binlog_invoker;
/**
It points to the invoker in the Query_log_event.
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index 1dd659283ac..7aa48524b20 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -1197,6 +1197,12 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db,
VOID(filename_to_tablename(file->name, table_list->table_name,
MYSQL50_TABLE_NAME_PREFIX_LENGTH +
strlen(file->name) + 1));
+
+ /* To be able to correctly look up the table in the table cache. */
+ if (lower_case_table_names)
+ table_list->table_name_length= my_casedn_str(files_charset_info,
+ table_list->table_name);
+
table_list->alias= table_list->table_name; // If lower_case_table_names=2
table_list->internal_tmp_table= is_prefix(file->name, tmp_file_prefix);
/* Link into list */
diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc
index 69be8c8e9b4..85b7e46a313 100644
--- a/sql/sql_handler.cc
+++ b/sql/sql_handler.cc
@@ -548,6 +548,12 @@ retry:
mode= RLAST;
}
}
+ else if (table->file->inited != handler::RND)
+ {
+ /* Convert RNEXT to RFIRST if we haven't started row scan */
+ if (mode == RNEXT)
+ mode= RFIRST;
+ }
if (insert_fields(thd, &thd->lex->select_lex.context,
tables->db, tables->alias, &it, 0))
@@ -569,6 +575,8 @@ retry:
case RNEXT:
if (table->file->inited != handler::NONE)
{
+ if ((error= table->file->can_continue_handler_scan()))
+ break;
if (keyname)
{
/* Check if we read from the same index. */
@@ -603,7 +611,9 @@ retry:
DBUG_ASSERT((uint) keyno == table->file->get_index());
if (table->file->inited != handler::NONE)
{
- error=table->file->ha_index_prev(table->record[0]);
+ if ((error= table->file->can_continue_handler_scan()))
+ break;
+ error= table->file->ha_index_prev(table->record[0]);
break;
}
/* else fall through */
@@ -673,8 +683,11 @@ retry:
continue;
if (error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE)
{
- sql_print_error("mysql_ha_read: Got error %d when reading table '%s'",
- error, tables->table_name);
+ /* Don't give error in the log file for some expected problems */
+ if (error != HA_ERR_RECORD_CHANGED && error != HA_ERR_WRONG_COMMAND)
+ sql_print_error("mysql_ha_read: Got error %d when reading "
+ "table '%s'",
+ error, tables->table_name);
table->file->print_error(error,MYF(0));
goto err;
}
diff --git a/sql/sql_help.cc b/sql/sql_help.cc
index 916557a46c4..6ede7bb9574 100644
--- a/sql/sql_help.cc
+++ b/sql/sql_help.cc
@@ -696,7 +696,7 @@ bool mysqld_help(THD *thd, const char *mask)
if (count_topics == 0)
{
- int key_id;
+ int UNINIT_VAR(key_id);
if (!(select=
prepare_select_for_name(thd,mask,mlen,tables,tables[3].table,
used_fields[help_keyword_name].field,
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 9477d2ca971..81f658b6a77 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -1515,9 +1515,7 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
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 (!records_are_comparable(table) || compare_record(table))
{
if ((error=table->file->ha_update_row(table->record[1],
table->record[0])) &&
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 524206d0af1..6256a0f89d6 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -2892,7 +2892,7 @@ static void fix_prepare_info_in_table_list(THD *thd, TABLE_LIST *tbl)
{
if (tbl->on_expr)
{
- tbl->prep_on_expr= tbl->on_expr;
+ thd->check_and_register_item_tree(&tbl->prep_on_expr, &tbl->on_expr);
tbl->on_expr= tbl->on_expr->copy_andor_structure(thd);
}
fix_prepare_info_in_table_list(thd, tbl->merge_underlying_list);
@@ -2926,12 +2926,12 @@ void st_select_lex::fix_prepare_information(THD *thd, Item **conds,
first_execution= 0;
if (*conds)
{
- prep_where= *conds;
+ thd->check_and_register_item_tree(&prep_where, conds);
*conds= where= prep_where->copy_andor_structure(thd);
}
if (*having_conds)
{
- prep_having= *having_conds;
+ thd->check_and_register_item_tree(&prep_having, having_conds);
*having_conds= having= prep_having->copy_andor_structure(thd);
}
fix_prepare_info_in_table_list(thd, table_list.first);
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index 75d9179c3bd..f440f78a9bc 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -1152,7 +1152,7 @@ READ_INFO::~READ_INFO()
if (need_end_io_cache)
::end_io_cache(&cache);
}
- my_free((uchar*) buffer,MYF(MY_ALLOW_ZERO_PTR));
+ my_free(buffer, MYF(MY_ALLOW_ZERO_PTR));
}
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index b26fbfae68e..50d45fdfa69 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -27,6 +27,7 @@
#include "sp_cache.h"
#include "events.h"
#include "sql_trigger.h"
+#include "debug_sync.h"
#ifdef WITH_ARIA_STORAGE_ENGINE
#include "../storage/maria/ha_maria.h"
@@ -3230,6 +3231,20 @@ end_with_restore_list:
thd->first_successful_insert_id_in_cur_stmt=
thd->first_successful_insert_id_in_prev_stmt;
+ DBUG_EXECUTE_IF("after_mysql_insert",
+ {
+ const char act1[]=
+ "now "
+ "wait_for signal.continue";
+ const char act2[]=
+ "now "
+ "signal signal.continued";
+ DBUG_ASSERT(opt_debug_sync_timeout > 0);
+ DBUG_ASSERT(!debug_sync_set_action(thd,
+ STRING_WITH_LEN(act1)));
+ DBUG_ASSERT(!debug_sync_set_action(thd,
+ STRING_WITH_LEN(act2)));
+ };);
break;
}
case SQLCOM_REPLACE_SELECT:
@@ -3885,6 +3900,10 @@ end_with_restore_list:
if (check_access(thd, UPDATE_ACL, "mysql", 0, 1, 1, 0) &&
check_global_access(thd,CREATE_USER_ACL))
break;
+
+ /* Replicate current user as grantor */
+ thd->binlog_invoker();
+
/* Conditionally writes to binlog */
if (!(res = mysql_revoke_all(thd, lex->users_list)))
my_ok(thd);
@@ -3905,6 +3924,9 @@ end_with_restore_list:
is_schema_db(select_lex->db) : 0))
goto error;
+ /* Replicate current user as grantor */
+ thd->binlog_invoker();
+
if (thd->security_ctx->user) // If not replication
{
LEX_USER *user, *tmp_user;
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index 551f19694ef..851bd6b875b 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -6787,8 +6787,8 @@ int get_part_iter_for_interval_via_mapping(partition_info *part_info,
}
}
else
- assert(0);
-
+ MY_ASSERT_UNREACHABLE();
+
can_match_multiple_values= (flags || !min_value || !max_value ||
memcmp(min_value, max_value, field_len));
if (can_match_multiple_values &&
diff --git a/sql/sql_plugin_services.h b/sql/sql_plugin_services.h
index 7491ddab79d..14a2a16561a 100644
--- a/sql/sql_plugin_services.h
+++ b/sql/sql_plugin_services.h
@@ -36,7 +36,7 @@ static struct thd_alloc_service_st thd_alloc_handler= {
thd_make_lex_string
};
-static struct st_service_ref list_of_services[]=
+static struct st_service_ref list_of_services[] __attribute__((unused)) =
{
{ "my_snprintf_service", VERSION_my_snprintf, &my_snprintf_handler },
{ "thd_alloc_service", VERSION_thd_alloc, &thd_alloc_handler }
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index bf1632d1d53..98434439998 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -2366,11 +2366,15 @@ void reinit_stmt_before_use(THD *thd, LEX *lex)
sl->where= sl->prep_where->copy_andor_structure(thd);
sl->where->cleanup();
}
+ else
+ sl->where= NULL;
if (sl->prep_having)
{
sl->having= sl->prep_having->copy_andor_structure(thd);
sl->having->cleanup();
}
+ else
+ sl->having= NULL;
DBUG_ASSERT(sl->join == 0);
ORDER *order;
/* Fix GROUP list */
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 94cc6a15c40..771c3c2e371 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -1472,6 +1472,15 @@ JOIN::optimize()
if (order)
{
/*
+ Do we need a temporary table due to the ORDER BY not being equal to
+ the GROUP BY? The call to test_if_skip_sort_order above tests for the
+ GROUP BY clause only and hence is not valid in this case. So the
+ estimated number of rows to be read from the first table is not valid.
+ We clear it here so that it doesn't show up in EXPLAIN.
+ */
+ if (need_tmp && (select_options & SELECT_DESCRIBE) != 0)
+ join_tab[const_tables].limit= 0;
+ /*
Force using of tmp table if sorting by a SP or UDF function due to
their expensive and probably non-deterministic nature.
*/
@@ -1694,11 +1703,14 @@ JOIN::reinit()
/* Reset effect of possible no_rows_in_result() */
List_iterator_fast<Item> it(fields_list);
Item *item;
-
no_rows_in_result_called= 0;
while ((item= it++))
item->restore_to_before_no_rows_in_result();
- }
+ }
+
+ if (!(select_options & SELECT_DESCRIBE))
+ init_ftfuncs(thd, select_lex, test(order));
+
DBUG_RETURN(0);
}
@@ -2485,6 +2497,13 @@ mysql_select(THD *thd, Item ***rref_pointer_array,
{
DBUG_RETURN(TRUE);
}
+ /*
+ Original join tabs might be overwritten at first
+ subselect execution. So we need to restore them.
+ */
+ Item_subselect *subselect= select_lex->master_unit()->item;
+ if (subselect && subselect->is_uncacheable() && join->reinit())
+ DBUG_RETURN(TRUE);
}
else
{
@@ -5059,7 +5078,7 @@ optimize_straight_join(JOIN *join, table_map join_tables)
All other cases are in-between these two extremes. Thus the parameter
'search_depth' controlls the exhaustiveness of the search. The higher the
- value, the longer the optimizaton time and possibly the better the
+ value, the longer the optimization time and possibly the better the
resulting plan. The lower the value, the fewer alternative plans are
estimated, but the more likely to get a bad QEP.
@@ -8901,6 +8920,8 @@ simplify_joins(JOIN *join, List<TABLE_LIST> *join_list, COND *conds, bool top)
For some of the inner tables there are conjunctive predicates
that reject nulls => the outer join can be replaced by an inner join.
*/
+ if (table->outer_join && !table->embedding && table->table)
+ table->table->maybe_null= FALSE;
table->outer_join= 0;
if (table->on_expr)
{
@@ -8987,6 +9008,8 @@ simplify_joins(JOIN *join, List<TABLE_LIST> *join_list, COND *conds, bool top)
while ((tbl= it++))
{
tbl->embedding= table->embedding;
+ if (!tbl->embedding && !tbl->on_expr && tbl->table)
+ tbl->table->maybe_null= FALSE;
tbl->join_list= table->join_list;
}
li.replace(nested_join->join_list);
@@ -9866,7 +9889,7 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
If item have to be able to store NULLs but underlaid field can't do it,
create_tmp_field_from_field() can't be used for tmp field creation.
*/
- if (field->maybe_null && !field->field->maybe_null())
+ if (field->maybe_null && field->in_rollup && !field->field->maybe_null())
{
result= create_tmp_field_from_item(thd, item, table, NULL,
modify_item, convert_blob_length);
@@ -11197,6 +11220,11 @@ create_internal_tmp_table_from_heap2(THD *thd, TABLE *table,
DBUG_EXECUTE_IF("raise_error", write_err= HA_ERR_FOUND_DUPP_KEY ;);
if (write_err)
goto err;
+ if (thd->killed)
+ {
+ thd->send_kill_message();
+ goto err_killed;
+ }
}
/* copy row that filled HEAP table */
if ((write_err=new_table.file->ha_write_row(table->record[0])))
@@ -11227,6 +11255,7 @@ create_internal_tmp_table_from_heap2(THD *thd, TABLE *table,
err:
DBUG_PRINT("error",("Got error: %d",write_err));
table->file->print_error(write_err, MYF(0));
+err_killed:
(void) table->file->ha_rnd_end();
(void) new_table.file->close();
err1:
@@ -11443,22 +11472,22 @@ do_select(JOIN *join,List<Item> *fields,TABLE *table,Procedure *procedure)
if (error == NESTED_LOOP_NO_MORE_ROWS)
error= NESTED_LOOP_OK;
+ if (table == NULL) // If sending data to client
+ {
+ /*
+ The following will unlock all cursors if the command wasn't an
+ update command
+ */
+ join->join_free(); // Unlock all cursors
+ }
if (error == NESTED_LOOP_OK)
{
/*
Sic: this branch works even if rc != 0, e.g. when
send_data above returns an error.
*/
- if (!table) // If sending data to client
- {
- /*
- The following will unlock all cursors if the command wasn't an
- update command
- */
- join->join_free(); // Unlock all cursors
- if (join->result->send_eof())
- rc= 1; // Don't send error
- }
+ if (table == NULL && join->result->send_eof()) // If sending data to client
+ rc= 1; // Don't send error
DBUG_PRINT("info",("%ld records output", (long) join->send_records));
}
else
@@ -13522,7 +13551,7 @@ list_contains_unique_index(TABLE *table,
key_part < key_part_end;
key_part++)
{
- if (key_part->field->maybe_null() ||
+ if (key_part->field->maybe_null() ||
!find_func(key_part->field, data))
break;
}
@@ -16341,6 +16370,7 @@ static bool change_group_ref(THD *thd, Item_func *expr, ORDER *group_list,
if (arg_changed)
{
expr->maybe_null= 1;
+ expr->in_rollup= 1;
*changed= TRUE;
}
}
@@ -16404,6 +16434,7 @@ bool JOIN::rollup_init()
if (*group_tmp->item == item)
{
item->maybe_null= 1;
+ item->in_rollup= 1;
found_in_group= 1;
break;
}
@@ -17033,7 +17064,15 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
if (tab->select && tab->select->quick)
examined_rows= tab->select->quick->records;
else if (tab->type == JT_NEXT || tab->type == JT_ALL)
- examined_rows= tab->limit ? tab->limit : tab->table->file->records();
+ {
+ if (tab->limit)
+ examined_rows= tab->limit;
+ else
+ {
+ tab->table->file->info(HA_STATUS_VARIABLE);
+ examined_rows= tab->table->file->stats.records;
+ }
+ }
else
examined_rows=(ha_rows)join->best_positions[i].records_read;
diff --git a/sql/sql_string.h b/sql/sql_string.h
index b154f0c1667..5da0d38f24d 100644
--- a/sql/sql_string.h
+++ b/sql/sql_string.h
@@ -96,9 +96,13 @@ public:
}
static void *operator new(size_t size, MEM_ROOT *mem_root) throw ()
{ return (void*) alloc_root(mem_root, (uint) size); }
- static void operator delete(void *ptr_arg,size_t size)
- { TRASH(ptr_arg, size); }
- static void operator delete(void *ptr_arg, MEM_ROOT *mem_root)
+ static void operator delete(void *ptr_arg, size_t size)
+ {
+ (void) ptr_arg;
+ (void) size;
+ TRASH(ptr_arg, size);
+ }
+ static void operator delete(void *, MEM_ROOT *)
{ /* never called */ }
~String() { free(); }
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 13b2ea3ae98..0f1928e37dc 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -3368,6 +3368,7 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
key_part_info->length=(uint16) length;
/* Use packed keys for long strings on the first column */
if (!((*db_options) & HA_OPTION_NO_PACK_KEYS) &&
+ !((create_info->table_options & HA_OPTION_NO_PACK_KEYS)) &&
(length >= KEY_DEFAULT_PACK_LENGTH &&
(sql_field->sql_type == MYSQL_TYPE_STRING ||
sql_field->sql_type == MYSQL_TYPE_VARCHAR ||
@@ -3928,12 +3929,16 @@ bool mysql_create_table_no_lock(THD *thd,
}
/* Give warnings for not supported table options */
- if (create_info->transactional && !file->ht->commit)
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
- ER_ILLEGAL_HA_CREATE_OPTION,
- ER(ER_ILLEGAL_HA_CREATE_OPTION),
- file->engine_name()->str,
- "TRANSACTIONAL=1");
+#if defined(WITH_ARIA_STORAGE_ENGINE)
+ extern handlerton *maria_hton;
+ if (file->ht != maria_hton)
+#endif
+ if (create_info->transactional)
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ ER_ILLEGAL_HA_CREATE_OPTION,
+ ER(ER_ILLEGAL_HA_CREATE_OPTION),
+ file->engine_name()->str,
+ "TRANSACTIONAL=1");
VOID(pthread_mutex_lock(&LOCK_open));
if (!internal_tmp_table && !(create_info->options & HA_LEX_CREATE_TMP_TABLE))
@@ -3953,7 +3958,7 @@ bool mysql_create_table_no_lock(THD *thd,
Then she could create the table. This case is pretty obscure and
therefore we don't introduce a new error message only for it.
*/
- if (get_cached_table_share(db, alias))
+ if (get_cached_table_share(db, table_name))
{
my_error(ER_TABLE_EXISTS_ERROR, MYF(0), table_name);
goto unlock_and_end;
@@ -4474,9 +4479,6 @@ static int prepare_for_repair(THD *thd, TABLE_LIST *table_list,
pthread_mutex_unlock(&LOCK_open);
}
- /* A MERGE table must not come here. */
- DBUG_ASSERT(!table->child_l);
-
/*
REPAIR TABLE ... USE_FRM for temporary tables makes little sense.
*/
@@ -6278,9 +6280,7 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
def->field=field;
if (field->stored_in_db != def->stored_in_db)
{
- my_error(ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN,
- MYF(0),
- "Changing the STORED status");
+ my_error(ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN, MYF(0));
goto err;
}
if (!def->after)
@@ -7228,6 +7228,16 @@ view_err:
/* Non-primary unique key. */
needed_online_flags|= HA_ONLINE_ADD_UNIQUE_INDEX;
needed_fast_flags|= HA_ONLINE_ADD_UNIQUE_INDEX_NO_WRITES;
+ if (ignore)
+ {
+ /*
+ If ignore is used, we have to remove all duplicate rows,
+ which require a full table copy.
+ */
+ need_copy_table= ALTER_TABLE_DATA_CHANGED;
+ pk_changed= 2; // Don't change need_copy_table
+ break;
+ }
}
}
else
diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc
index d1e974a2c04..1c4add27e57 100644
--- a/sql/sql_trigger.cc
+++ b/sql/sql_trigger.cc
@@ -1983,6 +1983,7 @@ bool Table_triggers_list::process_triggers(THD *thd,
bool err_status;
Sub_statement_state statement_state;
sp_head *sp_trigger= bodies[event][time_type];
+ SELECT_LEX *save_current_select;
if (sp_trigger == NULL)
return FALSE;
@@ -2006,11 +2007,19 @@ bool Table_triggers_list::process_triggers(THD *thd,
thd->reset_sub_statement_state(&statement_state, SUB_STMT_TRIGGER);
+ /*
+ Reset current_select before call execute_trigger() and
+ restore it after return from one. This way error is set
+ in case of failure during trigger execution.
+ */
+ save_current_select= thd->lex->current_select;
+ thd->lex->current_select= NULL;
err_status=
sp_trigger->execute_trigger(thd,
&trigger_table->s->db,
&trigger_table->s->table_name,
&subject_table_grants[event][time_type]);
+ thd->lex->current_select= save_current_select;
thd->restore_sub_statement_state(&statement_state);
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index 3b2ef92ab48..2cedce497b6 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -173,7 +173,6 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
SELECT_LEX *sl, *first_sl= first_select();
select_result *tmp_result;
bool is_union_select;
- TABLE *empty_table= 0;
DBUG_ENTER("st_select_lex_unit::prepare");
describe= test(additional_options & SELECT_DESCRIBE);
@@ -275,14 +274,6 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
types= first_sl->item_list;
else if (sl == first_sl)
{
- /*
- We need to create an empty table object. It is used
- to create tmp_table fields in Item_type_holder.
- The main reason of this is that we can't create
- field object without table.
- */
- DBUG_ASSERT(!empty_table);
- empty_table= (TABLE*) thd->calloc(sizeof(TABLE));
types.empty();
List_iterator_fast<Item> it(sl->item_list);
Item *item_tmp;
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 31cb6f4f24b..66a9f83387a 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -25,9 +25,26 @@
#include "sql_trigger.h"
#include "debug_sync.h"
-/* Return 0 if row hasn't changed */
-bool compare_record(TABLE *table)
+/**
+ True if the table's input and output record buffers are comparable using
+ compare_record(TABLE*).
+ */
+bool records_are_comparable(const TABLE *table) {
+ return ((table->file->ha_table_flags() & HA_PARTIAL_COLUMN_READ) == 0) ||
+ bitmap_is_subset(table->write_set, table->read_set);
+}
+
+
+/**
+ Compares the input and outbut record buffers of the table to see if a row
+ has changed.
+
+ @return true if row has changed.
+ @return false otherwise.
+*/
+
+bool compare_record(const TABLE *table)
{
if (table->s->can_cmp_whole_record)
return cmp_record(table,record[1]);
@@ -583,9 +600,7 @@ int mysql_update(THD *thd,
the table handler is returning all columns OR if
if all updated columns are read
*/
- can_compare_record= (!(table->file->ha_table_flags() &
- HA_PARTIAL_COLUMN_READ) ||
- bitmap_is_subset(table->write_set, table->read_set));
+ can_compare_record= records_are_comparable(table);
while (!(error=info.read_record(&info)) && !thd->killed)
{
@@ -1698,18 +1713,16 @@ bool multi_update::send_data(List<Item> &not_used_values)
if (table->status & (STATUS_NULL_ROW | STATUS_UPDATED))
continue;
- /*
- 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
- */
if (table == table_to_update)
{
+ /*
+ 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
+ */
bool can_compare_record;
- can_compare_record= (!(table->file->ha_table_flags() &
- HA_PARTIAL_COLUMN_READ) ||
- bitmap_is_subset(table->write_set,
- table->read_set));
+ can_compare_record= records_are_comparable(table);
+
table->status|= STATUS_UPDATED;
store_record(table,record[1]);
if (fill_record_n_invoke_before_triggers(thd, *fields_for_table[offset],
@@ -1960,10 +1973,7 @@ int multi_update::do_updates()
goto err;
}
- can_compare_record= (!(table->file->ha_table_flags() &
- HA_PARTIAL_COLUMN_READ) ||
- bitmap_is_subset(table->write_set,
- table->read_set));
+ can_compare_record= records_are_comparable(table);
for (;;)
{
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index e8890dde6cb..3ed25f2e78f 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -1282,6 +1282,8 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token YEAR_SYM /* SQL-2003-R */
%token ZEROFILL
+%token IMPOSSIBLE_ACTION /* To avoid warning for yyerrlab1 */
+
%left JOIN_SYM INNER_SYM STRAIGHT_JOIN CROSS LEFT RIGHT
/* A dummy token to force the priority of table_ref production in a join. */
%left TABLE_REF_PRIORITY
@@ -1480,6 +1482,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
init_key_options normal_key_options normal_key_opts all_key_opt
spatial_key_options fulltext_key_options normal_key_opt
fulltext_key_opt spatial_key_opt fulltext_key_opts spatial_key_opts
+ keep_gcc_happy
key_using_alg
server_def server_options_list server_option
definer_opt no_definer definer
@@ -1611,11 +1614,12 @@ statement:
| help
| insert
| install
+ | keep_gcc_happy
+ | keycache
| kill
| load
| lock
| optimize
- | keycache
| parse_vcol_expr
| partition_entry
| preload
@@ -11819,6 +11823,12 @@ user:
system_charset_info, 0) ||
check_host_name(&$$->host))
MYSQL_YYABORT;
+ /*
+ Convert hostname part of username to lowercase.
+ It's OK to use in-place lowercase as long as
+ the character set is utf8.
+ */
+ my_casedn_str(system_charset_info, $$->host.str);
}
| CURRENT_USER optional_braces
{
@@ -14020,6 +14030,13 @@ uninstall:
}
;
+/* Avoid compiler warning from sql_yacc.cc where yyerrlab1 is not used */
+keep_gcc_happy:
+ IMPOSSIBLE_ACTION
+ {
+ YYERROR;
+ }
+
/**
@} (end of group Parser)
*/
diff --git a/sql/table.cc b/sql/table.cc
index 2b0ea97e452..27d5b0643c7 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -432,6 +432,11 @@ void free_table_share(TABLE_SHARE *share)
key_info->flags= 0;
}
}
+ if (share->ha_data_destroy)
+ {
+ share->ha_data_destroy(share->ha_data);
+ share->ha_data_destroy= NULL;
+ }
/* We must copy mem_root from share because share is allocated through it */
memcpy((char*) &mem_root, (char*) &share->mem_root, sizeof(mem_root));
free_root(&mem_root, MYF(0)); // Free's share
@@ -1724,6 +1729,11 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
delete crypted;
delete handler_file;
hash_free(&share->name_hash);
+ if (share->ha_data_destroy)
+ {
+ share->ha_data_destroy(share->ha_data);
+ share->ha_data_destroy= NULL;
+ }
open_table_error(share, error, share->open_errno, errarg);
DBUG_RETURN(error);
@@ -2327,14 +2337,11 @@ partititon_err:
/* Check virtual columns against table's storage engine. */
if (share->vfields &&
- ((outparam->file &&
- !outparam->file->check_if_supported_virtual_columns()) ||
- (!outparam->file && share->db_type() &&
- share->db_type()->db_type == DB_TYPE_CSV_DB))) // Workaround for CSV
- {
- my_error(ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN,
- MYF(0),
- "Specified storage engine");
+ !(outparam->file &&
+ (outparam->file->ha_table_flags() & HA_CAN_VIRTUAL_COLUMNS)))
+ {
+ my_error(ER_UNSUPPORTED_ENGINE_FOR_VIRTUAL_COLUMNS, MYF(0),
+ plugin_name(share->db_plugin)->str);
error_reported= TRUE;
goto err;
}
diff --git a/sql/table.h b/sql/table.h
index aa4c0954a5a..bd767e34564 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -482,6 +482,7 @@ typedef struct st_table_share
/** place to store storage engine specific data */
void *ha_data;
+ void (*ha_data_destroy)(void *); /* An optional destructor for ha_data. */
/*
@@ -1780,7 +1781,7 @@ typedef struct st_nested_join
2. All child join nest nodes are fully covered.
*/
- bool is_fully_covered() const { return join_list.elements == counter; }
+ bool is_fully_covered() const { return n_tables == counter; }
} NESTED_JOIN;
diff --git a/storage/archive/CMakeLists.txt b/storage/archive/CMakeLists.txt
index f4492c3ce77..893a5dcf4f9 100755
--- a/storage/archive/CMakeLists.txt
+++ b/storage/archive/CMakeLists.txt
@@ -13,8 +13,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
INCLUDE("${PROJECT_SOURCE_DIR}/storage/mysql_storage_engine.cmake")
SET(ARCHIVE_SOURCES azio.c ha_archive.cc ha_archive.h)
diff --git a/storage/archive/Makefile.am b/storage/archive/Makefile.am
index 254c95bf68b..83df8bae0db 100644
--- a/storage/archive/Makefile.am
+++ b/storage/archive/Makefile.am
@@ -33,7 +33,7 @@ DEFS = @DEFS@
noinst_HEADERS = ha_archive.h azlib.h
noinst_PROGRAMS = archive_test archive_reader
-EXTRA_LTLIBRARIES = ha_archive.la
+EXTRA_LTLIBRARIES = libarchive.la ha_archive.la
pkgplugin_LTLIBRARIES = @plugin_archive_shared_target@
ha_archive_la_LDFLAGS = -module -rpath $(pkgplugindir)
ha_archive_la_CXXFLAGS= -shared $(AM_CXXFLAGS) -DMYSQL_DYNAMIC_PLUGIN
@@ -41,11 +41,10 @@ ha_archive_la_CFLAGS = -shared $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
ha_archive_la_SOURCES = ha_archive.cc azio.c
-EXTRA_LIBRARIES = libarchive.a
-noinst_LIBRARIES = @plugin_archive_static_target@
-libarchive_a_CXXFLAGS = $(AM_CXXFLAGS)
-libarchive_a_CFLAGS = $(AM_CFLAGS)
-libarchive_a_SOURCES = ha_archive.cc azio.c
+noinst_LTLIBRARIES = @plugin_archive_static_target@
+libarchive_la_CXXFLAGS = $(AM_CXXFLAGS)
+libarchive_la_CFLAGS = $(AM_CFLAGS)
+libarchive_la_SOURCES = ha_archive.cc azio.c
archive_test_SOURCES = archive_test.c azio.c
@@ -66,5 +65,3 @@ archive_reader_LDFLAGS = @NOINST_LDFLAGS@
EXTRA_DIST = CMakeLists.txt plug.in
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/archive/plug.in b/storage/archive/plug.in
index 52131b12e6b..d19c29414e3 100644
--- a/storage/archive/plug.in
+++ b/storage/archive/plug.in
@@ -1,4 +1,4 @@
MYSQL_STORAGE_ENGINE(archive,, [Archive Storage Engine],
[Archive Storage Engine], [max,max-no-ndb])
-MYSQL_PLUGIN_STATIC(archive, [libarchive.a])
+MYSQL_PLUGIN_STATIC(archive, [libarchive.la])
MYSQL_PLUGIN_DYNAMIC(archive, [ha_archive.la])
diff --git a/storage/blackhole/CMakeLists.txt b/storage/blackhole/CMakeLists.txt
index b762228d7fd..bed282ef21d 100644
--- a/storage/blackhole/CMakeLists.txt
+++ b/storage/blackhole/CMakeLists.txt
@@ -13,9 +13,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-
INCLUDE("${PROJECT_SOURCE_DIR}/storage/mysql_storage_engine.cmake")
SET(BLACKHOLE_SOURCES ha_blackhole.cc ha_blackhole.h)
diff --git a/storage/blackhole/Makefile.am b/storage/blackhole/Makefile.am
index 148746a9336..0ff5ebaa17a 100644
--- a/storage/blackhole/Makefile.am
+++ b/storage/blackhole/Makefile.am
@@ -32,19 +32,16 @@ DEFS = @DEFS@
noinst_HEADERS = ha_blackhole.h
-EXTRA_LTLIBRARIES = ha_blackhole.la
+EXTRA_LTLIBRARIES = libblackhole.la ha_blackhole.la
pkgplugin_LTLIBRARIES = @plugin_blackhole_shared_target@
ha_blackhole_la_LDFLAGS=-module -rpath $(pkgplugindir)
ha_blackhole_la_CXXFLAGS=-shared $(AM_CXXFLAGS) -DMYSQL_DYNAMIC_PLUGIN
ha_blackhole_la_SOURCES=ha_blackhole.cc
-EXTRA_LIBRARIES = libblackhole.a
-noinst_LIBRARIES = @plugin_blackhole_static_target@
-libblackhole_a_CXXFLAGS=$(AM_CXXFLAGS)
-libblackhole_a_SOURCES= ha_blackhole.cc
+noinst_LTLIBRARIES = @plugin_blackhole_static_target@
+libblackhole_la_CXXFLAGS=$(AM_CXXFLAGS)
+libblackhole_la_SOURCES= ha_blackhole.cc
EXTRA_DIST = CMakeLists.txt plug.in
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/blackhole/plug.in b/storage/blackhole/plug.in
index 725db0facba..2f3b120fa5d 100644
--- a/storage/blackhole/plug.in
+++ b/storage/blackhole/plug.in
@@ -1,6 +1,6 @@
MYSQL_STORAGE_ENGINE(blackhole,,[Blackhole Storage Engine],
[Basic Write-only Read-never tables], [max,max-no-ndb])
MYSQL_PLUGIN_DIRECTORY(blackhole, [storage/blackhole])
-MYSQL_PLUGIN_STATIC(blackhole, [libblackhole.a])
+MYSQL_PLUGIN_STATIC(blackhole, [libblackhole.la])
MYSQL_PLUGIN_DYNAMIC(blackhole, [ha_blackhole.la])
diff --git a/storage/csv/CMakeLists.txt b/storage/csv/CMakeLists.txt
index eb21a9b048c..133425218e0 100644
--- a/storage/csv/CMakeLists.txt
+++ b/storage/csv/CMakeLists.txt
@@ -13,9 +13,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-
INCLUDE("${PROJECT_SOURCE_DIR}/storage/mysql_storage_engine.cmake")
SET(CSV_SOURCES ha_tina.cc ha_tina.h transparent_file.cc transparent_file.h)
MYSQL_STORAGE_ENGINE(CSV) \ No newline at end of file
diff --git a/storage/csv/Makefile.am b/storage/csv/Makefile.am
index 75ad9062984..2965b0c87eb 100644
--- a/storage/csv/Makefile.am
+++ b/storage/csv/Makefile.am
@@ -29,17 +29,14 @@ LDADD =
DEFS = @DEFS@
noinst_HEADERS = ha_tina.h transparent_file.h
-EXTRA_LTLIBRARIES = ha_csv.la
+EXTRA_LTLIBRARIES = libcsv.la ha_csv.la
pkglib_LTLIBRARIES = @plugin_csv_shared_target@
ha_csv_la_LDFLAGS = -module -rpath $(MYSQLLIBdir)
ha_csv_la_CXXFLAGS = -shared $(AM_CXXFLAGS) -DMYSQL_PLUGIN
ha_csv_la_SOURCES = transparent_file.cc ha_tina.cc
-EXTRA_LIBRARIES = libcsv.a
-noinst_LIBRARIES = @plugin_csv_static_target@
-libcsv_a_CXXFLAGS = $(AM_CXXFLAGS)
-libcsv_a_SOURCES = transparent_file.cc ha_tina.cc
+noinst_LTLIBRARIES = @plugin_csv_static_target@
+libcsv_la_CXXFLAGS = $(AM_CXXFLAGS)
+libcsv_la_SOURCES = transparent_file.cc ha_tina.cc
EXTRA_DIST = CMakeLists.txt plug.in
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/csv/plug.in b/storage/csv/plug.in
index bbc69680fcd..4ff32959fa2 100644
--- a/storage/csv/plug.in
+++ b/storage/csv/plug.in
@@ -1,5 +1,5 @@
MYSQL_STORAGE_ENGINE(csv,, [CSV Storage Engine],
[Stores tables in text CSV format])
MYSQL_PLUGIN_DIRECTORY(csv, [storage/csv])
-MYSQL_PLUGIN_STATIC(csv, [libcsv.a])
+MYSQL_PLUGIN_STATIC(csv, [libcsv.la])
MYSQL_PLUGIN_MANDATORY(csv) dnl Used for logging
diff --git a/storage/example/CMakeLists.txt b/storage/example/CMakeLists.txt
index a328da107bd..f0b1343ab9c 100644
--- a/storage/example/CMakeLists.txt
+++ b/storage/example/CMakeLists.txt
@@ -13,8 +13,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
INCLUDE("${PROJECT_SOURCE_DIR}/storage/mysql_storage_engine.cmake")
SET(EXAMPLE_SOURCES ha_example.cc)
MYSQL_STORAGE_ENGINE(EXAMPLE)
diff --git a/storage/example/Makefile.am b/storage/example/Makefile.am
index dc499e2f9dd..f4ee8e3c276 100644
--- a/storage/example/Makefile.am
+++ b/storage/example/Makefile.am
@@ -32,18 +32,17 @@ DEFS = @DEFS@
noinst_HEADERS = ha_example.h
-EXTRA_LTLIBRARIES = ha_example.la
+EXTRA_LTLIBRARIES = libexample.la ha_example.la
pkgplugin_LTLIBRARIES = @plugin_example_shared_target@
ha_example_la_LDFLAGS = -module -rpath $(pkgplugindir) -L$(top_builddir)/libservices -lmysqlservices
ha_example_la_CXXFLAGS= -shared $(AM_CXXFLAGS) -DMYSQL_DYNAMIC_PLUGIN
ha_example_la_SOURCES = ha_example.cc
-EXTRA_LIBRARIES = libexample.a
-noinst_LIBRARIES = @plugin_example_static_target@
-libexample_a_CXXFLAGS = $(AM_CXXFLAGS)
-libexample_a_SOURCES= ha_example.cc
+
+noinst_LTLIBRARIES = @plugin_example_static_target@
+libexample_la_CXXFLAGS = $(AM_CXXFLAGS)
+libexample_la_SOURCES= ha_example.cc
EXTRA_DIST = CMakeLists.txt plug.in
-# Don't update the files from bitkeeper
-%::SCCS/s.%
+
diff --git a/storage/federated/CMakeLists.txt b/storage/federated/CMakeLists.txt
index d371c0fc02b..3f3201d351c 100755
--- a/storage/federated/CMakeLists.txt
+++ b/storage/federated/CMakeLists.txt
@@ -13,9 +13,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-
INCLUDE("${PROJECT_SOURCE_DIR}/storage/mysql_storage_engine.cmake")
SET(FEDERATED_SOURCES ha_federated.cc)
MYSQL_STORAGE_ENGINE(FEDERATED)
diff --git a/storage/federated/Makefile.am b/storage/federated/Makefile.am
index 7853ccedd21..48d86dded69 100644
--- a/storage/federated/Makefile.am
+++ b/storage/federated/Makefile.am
@@ -30,7 +30,7 @@ DEFS = @DEFS@
noinst_HEADERS = ha_federated.h
-EXTRA_LTLIBRARIES = ha_federated.la
+EXTRA_LTLIBRARIES = libfederated.la libfederated_embedded.la ha_federated.la
pkgplugin_LTLIBRARIES = @plugin_federated_shared_target@
ha_federated_la_LDFLAGS = -module -rpath $(pkgplugindir) \
-L$(top_builddir)/libservices -lmysqlservices
@@ -39,12 +39,13 @@ ha_federated_la_CFLAGS = -shared $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
ha_federated_la_SOURCES = ha_federated.cc $(top_srcdir)/mysys/string.c
-EXTRA_LIBRARIES = libfederated.a
-noinst_LIBRARIES = @plugin_federated_static_target@
-libfederated_a_CXXFLAGS = $(AM_CXXFLAGS)
-libfederated_a_SOURCES= ha_federated.cc
+noinst_LTLIBRARIES = @plugin_federated_static_target@ @plugin_federated_embedded_static_target@
+libfederated_la_CXXFLAGS = $(AM_CXXFLAGS)
+libfederated_la_SOURCES= ha_federated.cc
+
+libfederated_embedded_la_CXXFLAGS = $(AM_CXXFLAGS) @plugin_embedded_defs@
+libfederated_embedded_la_CFLAGS = $(AM_CFLAGS) @plugin_embedded_defs@
+libfederated_embedded_la_SOURCES= ha_federated.cc
EXTRA_DIST = CMakeLists.txt plug.in
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc
index fcc178b09a6..34509e04799 100644
--- a/storage/federated/ha_federated.cc
+++ b/storage/federated/ha_federated.cc
@@ -2453,7 +2453,6 @@ int ha_federated::index_init(uint keynr, bool sorted)
{
DBUG_ENTER("ha_federated::index_init");
DBUG_PRINT("info", ("table: '%s' key: %u", table->s->table_name.str, keynr));
- active_index= keynr;
DBUG_RETURN(0);
}
@@ -2589,7 +2588,6 @@ int ha_federated::index_end(void)
{
DBUG_ENTER("ha_federated::index_end");
free_result();
- active_index= MAX_KEY;
DBUG_RETURN(0);
}
diff --git a/storage/federated/plug.in b/storage/federated/plug.in
index 714888b2ebf..3db4a35de08 100644
--- a/storage/federated/plug.in
+++ b/storage/federated/plug.in
@@ -1,5 +1,4 @@
MYSQL_STORAGE_ENGINE(federated,,[Federated Storage Engine],
[Connects to tables on remote MySQL servers], [])
-MYSQL_PLUGIN_STATIC(federated, [libfederated.a])
+MYSQL_PLUGIN_STATIC(federated, [libfederated.la], [libfederated_embedded.la])
MYSQL_PLUGIN_DYNAMIC(federated, [ha_federated.la])
-MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS(federated, [ha_federated.cc])
diff --git a/storage/federatedx/Makefile.am b/storage/federatedx/Makefile.am
index 0e3249866ea..731b5dee01e 100644
--- a/storage/federatedx/Makefile.am
+++ b/storage/federatedx/Makefile.am
@@ -17,7 +17,7 @@ DEFS = @DEFS@
noinst_HEADERS = ha_federatedx.h federatedx_probes.h
-EXTRA_LTLIBRARIES = ha_federatedx.la
+EXTRA_LTLIBRARIES = libfederatedx.la libfederatedx_common.la libfederatedx_embedded.la ha_federatedx.la
pkgplugin_LTLIBRARIES = @plugin_federatedx_shared_target@
ha_federatedx_la_LDFLAGS = -module -rpath $(pkgplugindir) \
-L$(top_builddir)/libservices -lmysqlservices
@@ -25,13 +25,24 @@ ha_federatedx_la_CXXFLAGS= -shared $(AM_CXXFLAGS) -DMYSQL_DYNAMIC_PLUGIN
ha_federatedx_la_CFLAGS = -shared $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
-EXTRA_LIBRARIES = libfederatedx.a
-noinst_LIBRARIES = @plugin_federatedx_static_target@
-libfederatedx_a_CXXFLAGS = $(AM_CXXFLAGS)
-libfederatedx_a_SOURCES= ha_federatedx.cc federatedx_txn.cc \
+noinst_LTLIBRARIES = @plugin_federatedx_static_target@ @plugin_federatedx_embedded_static_target@
+libfederatedx_common_la_CXXFLAGS = $(AM_CXXFLAGS)
+libfederatedx_common_la_CFLAGS = $(AM_CFLAGS)
+libfederatedx_common_la_SOURCES= federatedx_txn.cc \
federatedx_io.cc federatedx_io_null.cc \
federatedx_io_mysql.cc
+libfederatedx_la_CXXFLAGS = $(AM_CFLAGS)
+libfederatedx_la_CFLAGS = $(AM_CFLAGS)
+libfederatedx_la_LIBADD = libfederatedx_common.la
+libfederatedx_la_SOURCES= ha_federatedx.cc
+
+libfederatedx_embedded_la_CXXFLAGS = $(AM_CFLAGS) @plugin_embedded_defs@
+libfederatedx_embedded_la_CFLAGS = $(AM_CFLAGS) @plugin_embedded_defs@
+libfederatedx_embedded_la_LDFLAGS = $(AM_LDFLAGS)
+libfederatedx_embedded_la_LIBADD = libfederatedx_common.la
+libfederatedx_embedded_la_SOURCES= ha_federatedx.cc
+
EXTRA_DIST = CMakeLists.txt plug.in ha_federatedx.h \
federatedx_probes.h
@@ -58,6 +69,3 @@ ha_federatedx_la_LIBADD =
# $(DTRACE) $(DTRACEFLAGS) -G -s federatedx_probes.d $(DTRACEFILES)
# End
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/federatedx/plug.in b/storage/federatedx/plug.in
index 95afe270f4c..4a8a88e7280 100644
--- a/storage/federatedx/plug.in
+++ b/storage/federatedx/plug.in
@@ -1,5 +1,4 @@
MYSQL_STORAGE_ENGINE(federatedx,,[FederatedX Storage Engine],
[FederatedX Storage Engine], [max,max-no-ndb])
MYSQL_PLUGIN_DYNAMIC(federatedx, [ha_federatedx.la])
-MYSQL_PLUGIN_STATIC(federatedx, [libfederatedx.a])
-MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS(federatedx, [ha_federatedx.cc])
+MYSQL_PLUGIN_STATIC(federatedx, [libfederatedx.la], [libfederatedx_embedded.la])
diff --git a/storage/heap/CMakeLists.txt b/storage/heap/CMakeLists.txt
index c2d2cd1290f..1e560b5e3b1 100755
--- a/storage/heap/CMakeLists.txt
+++ b/storage/heap/CMakeLists.txt
@@ -13,9 +13,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-
INCLUDE("${PROJECT_SOURCE_DIR}/storage/mysql_storage_engine.cmake")
SET(HEAP_SOURCES _check.c _rectest.c hp_block.c hp_clear.c hp_close.c hp_create.c
ha_heap.cc
diff --git a/storage/heap/Makefile.am b/storage/heap/Makefile.am
index ec1445dea67..d1b5c3b0cc9 100644
--- a/storage/heap/Makefile.am
+++ b/storage/heap/Makefile.am
@@ -27,8 +27,11 @@ LDADD =
DEFS = @DEFS@
pkglib_LIBRARIES = libheap.a
+noinst_LTLIBRARIES = libheap.la libheap_s.la \
+ @plugin_heap_embedded_static_target@
+EXTRA_LTLIBRARIES = libheap_embedded.la
+
noinst_PROGRAMS = hp_test1 hp_test2
-noinst_LIBRARIES = libheap.a
hp_test1_LDFLAGS = @NOINST_LDFLAGS@
hp_test1_LDADD = libheap.a \
$(top_builddir)/mysys/libmysys.a \
@@ -40,16 +43,24 @@ hp_test2_LDADD = libheap.a \
$(top_builddir)/dbug/libdbug.a \
$(top_builddir)/strings/libmystrings.a
noinst_HEADERS = heapdef.h ha_heap.h
-libheap_a_SOURCES = hp_open.c hp_extra.c hp_close.c hp_panic.c hp_info.c \
+libheap_la_SOURCES = hp_open.c hp_extra.c hp_close.c hp_panic.c hp_info.c \
hp_rrnd.c hp_scan.c hp_update.c hp_write.c hp_delete.c \
hp_rsame.c hp_create.c hp_rename.c hp_rfirst.c \
hp_rnext.c hp_rlast.c hp_rprev.c hp_clear.c \
hp_rkey.c hp_block.c \
- ha_heap.cc \
hp_hash.c _check.c _rectest.c hp_static.c
+libheap_s_la_SOURCES = ha_heap.cc
+libheap_s_la_CFLAGS = $(AM_CFLAGS)
+libheap_s_la_CXXFLAGS = $(AM_CXXFLAGS)
+libheap_s_la_LIBADD = libheap.la
+libheap_embedded_la_SOURCES = ha_heap.cc
+libheap_embedded_la_LIBADD = libheap.la
+libheap_embedded_la_CXXFLAGS = @plugin_embedded_defs@
-EXTRA_DIST = CMakeLists.txt plug.in
+libheap_a_SOURCES=
+libheap.a: libheap.la
+ $(CP) .libs/libheap.a $@
-# Don't update the files from bitkeeper
-%::SCCS/s.%
+
+EXTRA_DIST = CMakeLists.txt plug.in
diff --git a/storage/heap/plug.in b/storage/heap/plug.in
index 50f31c60f2b..92ec01d3c88 100644
--- a/storage/heap/plug.in
+++ b/storage/heap/plug.in
@@ -1,7 +1,6 @@
MYSQL_STORAGE_ENGINE(heap,no, [Memory Storage Engine],
[Volatile memory based tables])
MYSQL_PLUGIN_DIRECTORY(heap, [storage/heap])
-MYSQL_PLUGIN_STATIC(heap, [libheap.a])
+MYSQL_PLUGIN_STATIC(heap, [libheap_s.la], [libheap_embedded.la])
MYSQL_PLUGIN_MANDATORY(heap) dnl Memory tables
-MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS(heap, [ha_heap.cc])
diff --git a/storage/ibmdb2i/CMakeLists.txt b/storage/ibmdb2i/CMakeLists.txt
index 11cc4300569..f9a3c8cc0de 100644
--- a/storage/ibmdb2i/CMakeLists.txt
+++ b/storage/ibmdb2i/CMakeLists.txt
@@ -13,9 +13,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/regex
${CMAKE_SOURCE_DIR}/extra/yassl/include)
diff --git a/storage/ibmdb2i/Makefile.am b/storage/ibmdb2i/Makefile.am
index b9602e392e0..a9977de895d 100644
--- a/storage/ibmdb2i/Makefile.am
+++ b/storage/ibmdb2i/Makefile.am
@@ -50,5 +50,3 @@ libibmdb2i_a_SOURCES= $(ha_ibmdb2i_la_SOURCES)
EXTRA_DIST = CMakeLists.txt plug.in
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/ibmdb2i/db2i_ioBuffers.h b/storage/ibmdb2i/db2i_ioBuffers.h
index 350d854f055..8fb815ba3be 100644
--- a/storage/ibmdb2i/db2i_ioBuffers.h
+++ b/storage/ibmdb2i/db2i_ioBuffers.h
@@ -290,7 +290,7 @@ class IOAsyncReadBuffer : public IOReadBuffer
Return a pointer to the next row in the table, where "next" is defined
by the orientation.
- @param orientaton
+ @param orientation
@param[out] rrn The relative record number of the row returned. Not reliable
if NULL is returned by this function.
diff --git a/storage/innobase/Makefile.am b/storage/innobase/Makefile.am
index 29ba83c0668..fb75bc1eb92 100644
--- a/storage/innobase/Makefile.am
+++ b/storage/innobase/Makefile.am
@@ -122,9 +122,8 @@ noinst_HEADERS= include/btr0btr.h include/btr0btr.ic \
include/ut0list.ic include/ut0wqueue.h \
include/ha_prototypes.h handler/ha_innodb.h
-EXTRA_LIBRARIES= libinnobase.a
-noinst_LIBRARIES= @plugin_innobase_static_target@
-libinnobase_a_SOURCES= btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c \
+noinst_LTLIBRARIES= @plugin_innobase_static_target@
+libinnobase_la_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 \
@@ -156,10 +155,10 @@ libinnobase_a_SOURCES= btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c \
ut/ut0ut.c ut/ut0vec.c ut/ut0wqueue.c \
handler/ha_innodb.cc
-libinnobase_a_CXXFLAGS= $(AM_CXXFLAGS)
-libinnobase_a_CFLAGS= $(AM_CFLAGS)
+libinnobase_la_CXXFLAGS= $(AM_CXXFLAGS)
+libinnobase_la_CFLAGS= $(AM_CFLAGS)
-EXTRA_LTLIBRARIES= ha_innodb.la
+EXTRA_LTLIBRARIES= libinnobase.la ha_innodb.la
pkgplugin_LTLIBRARIES= @plugin_innobase_shared_target@
ha_innodb_la_LDFLAGS= -module -rpath $(pkgplugindir)
@@ -170,6 +169,3 @@ 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/btr0btr.c b/storage/innobase/btr/btr0btr.c
index 5e8831b5d5e..b1b59227883 100644
--- a/storage/innobase/btr/btr0btr.c
+++ b/storage/innobase/btr/btr0btr.c
@@ -2060,7 +2060,6 @@ btr_compress(
ulint n_recs;
ulint max_ins_size;
ulint max_ins_size_reorg;
- ulint level;
ulint comp;
page = btr_cur_get_page(cursor);
@@ -2072,7 +2071,6 @@ btr_compress(
MTR_MEMO_X_LOCK));
ut_ad(mtr_memo_contains(mtr, buf_block_align(page),
MTR_MEMO_PAGE_X_FIX));
- level = btr_page_get_level(page, mtr);
space = dict_index_get_space(index);
left_page_no = btr_page_get_prev(page, mtr);
diff --git a/storage/innobase/btr/btr0cur.c b/storage/innobase/btr/btr0cur.c
index d2a2e4d2157..a7160d74a32 100644
--- a/storage/innobase/btr/btr0cur.c
+++ b/storage/innobase/btr/btr0cur.c
@@ -3365,7 +3365,9 @@ btr_store_big_rec_extern_fields(
page_t* page;
ulint space_id;
page_t* prev_page;
+#ifdef UNIV_SYNC_DEBUG
page_t* rec_page;
+#endif /* UNIV_SYNC_DEBUG */
ulint prev_page_no;
ulint hint_page_no;
ulint i;
@@ -3460,9 +3462,12 @@ btr_store_big_rec_extern_fields(
extern_len -= store_len;
- rec_page = buf_page_get(space_id,
- buf_frame_get_page_no(data),
- RW_X_LATCH, &mtr);
+#ifdef UNIV_SYNC_DEBUG
+ rec_page =
+#endif /* UNIV_SYNC_DEBUG */
+ buf_page_get(space_id,
+ buf_frame_get_page_no(data),
+ RW_X_LATCH, &mtr);
#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(rec_page, SYNC_NO_ORDER_CHECK);
#endif /* UNIV_SYNC_DEBUG */
@@ -3536,10 +3541,11 @@ btr_free_externally_stored_field(
X-latch to the index tree */
{
page_t* page;
+#ifdef UNIV_SYNC_DEBUG
page_t* rec_page;
+#endif /* UNIV_SYNC_DEBUG */
ulint space_id;
ulint page_no;
- ulint offset;
ulint extern_len;
ulint next_page_no;
ulint part_len;
@@ -3556,9 +3562,12 @@ btr_free_externally_stored_field(
for (;;) {
mtr_start(&mtr);
- rec_page = buf_page_get(buf_frame_get_space_id(data),
- buf_frame_get_page_no(data),
- RW_X_LATCH, &mtr);
+#ifdef UNIV_SYNC_DEBUG
+ rec_page =
+#endif /* UNIV_SYNC_DEBUG */
+ buf_page_get(buf_frame_get_space_id(data),
+ buf_frame_get_page_no(data),
+ RW_X_LATCH, &mtr);
#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(rec_page, SYNC_NO_ORDER_CHECK);
#endif /* UNIV_SYNC_DEBUG */
@@ -3568,8 +3577,6 @@ btr_free_externally_stored_field(
page_no = mach_read_from_4(data + local_len
+ BTR_EXTERN_PAGE_NO);
- offset = mach_read_from_4(data + local_len
- + BTR_EXTERN_OFFSET);
extern_len = mach_read_from_4(data + local_len
+ BTR_EXTERN_LEN + 4);
diff --git a/storage/innobase/btr/btr0pcur.c b/storage/innobase/btr/btr0pcur.c
index 65b3c90c809..f73e82fb597 100644
--- a/storage/innobase/btr/btr0pcur.c
+++ b/storage/innobase/btr/btr0pcur.c
@@ -429,7 +429,6 @@ btr_pcur_move_backward_from_page(
mtr_t* mtr) /* in: mtr */
{
ulint prev_page_no;
- ulint space;
page_t* page;
page_t* prev_page;
ulint latch_mode;
@@ -465,7 +464,6 @@ btr_pcur_move_backward_from_page(
page = btr_pcur_get_page(cursor);
prev_page_no = btr_page_get_prev(page, mtr);
- space = buf_frame_get_space_id(page);
if (btr_pcur_is_before_first_on_page(cursor, mtr)
&& (prev_page_no != FIL_NULL)) {
diff --git a/storage/innobase/btr/btr0sea.c b/storage/innobase/btr/btr0sea.c
index 84ad0e27110..97c9f89db72 100644
--- a/storage/innobase/btr/btr0sea.c
+++ b/storage/innobase/btr/btr0sea.c
@@ -1401,7 +1401,6 @@ btr_search_update_hash_on_delete(
rec_t* rec;
ulint fold;
dulint index_id;
- ibool found;
ulint offsets_[REC_OFFS_NORMAL_SIZE];
mem_heap_t* heap = NULL;
*offsets_ = (sizeof offsets_) / sizeof *offsets_;
@@ -1433,7 +1432,7 @@ btr_search_update_hash_on_delete(
}
rw_lock_x_lock(&btr_search_latch);
- found = ha_search_and_delete_if_found(table, fold, rec);
+ ha_search_and_delete_if_found(table, fold, rec);
rw_lock_x_unlock(&btr_search_latch);
}
diff --git a/storage/innobase/buf/buf0buf.c b/storage/innobase/buf/buf0buf.c
index 45867388a61..500088c3901 100644
--- a/storage/innobase/buf/buf0buf.c
+++ b/storage/innobase/buf/buf0buf.c
@@ -1270,6 +1270,30 @@ loop:
buf_awe_map_page_to_frame(block, TRUE);
}
+#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
+ if (mode == BUF_GET_IF_IN_POOL && ibuf_debug) {
+ /* Try to evict the block from the buffer pool, to use the
+ insert buffer as much as possible. */
+
+ if (buf_LRU_free_block(block)) {
+ mutex_exit(&buf_pool->mutex);
+ mutex_exit(&block->mutex);
+ fprintf(stderr,
+ "innodb_change_buffering_debug evict %u %u\n",
+ (unsigned) space, (unsigned) offset);
+ return(NULL);
+ } else if (buf_flush_page_try(block)) {
+ fprintf(stderr,
+ "innodb_change_buffering_debug flush %u %u\n",
+ (unsigned) space, (unsigned) offset);
+ guess = block->frame;
+ goto loop;
+ }
+
+ /* Failed to evict the page; change it directly */
+ }
+#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
+
#ifdef UNIV_SYNC_DEBUG
buf_block_buf_fix_inc_debug(block, file, line);
#else
diff --git a/storage/innobase/buf/buf0flu.c b/storage/innobase/buf/buf0flu.c
index 7533205d695..7dd6bfd9198 100644
--- a/storage/innobase/buf/buf0flu.c
+++ b/storage/innobase/buf/buf0flu.c
@@ -723,6 +723,82 @@ buf_flush_try_page(
return(0);
}
+# if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
+/**********************************************************************
+Writes a flushable page asynchronously from the buffer pool to a file.
+NOTE: buf_pool_mutex and block->mutex must be held upon entering this
+function, and they will be released by this function after flushing.
+This is loosely based on buf_flush_batch() and buf_flush_try_page(). */
+
+ibool
+buf_flush_page_try(
+/*===============*/
+ /* out: TRUE if flushed and
+ mutexes released */
+ buf_block_t* block) /*!< in/out: buffer control block */
+{
+ ut_ad(mutex_own(&buf_pool->mutex));
+ ut_ad(block->state == BUF_BLOCK_FILE_PAGE);
+ ut_ad(mutex_own(&block->mutex));
+
+ if (!buf_flush_ready_for_flush(block, BUF_FLUSH_LRU)) {
+ return(FALSE);
+ }
+
+ if (buf_pool->n_flush[BUF_FLUSH_LRU] > 0
+ || buf_pool->init_flush[BUF_FLUSH_LRU]) {
+ /* There is already a flush batch of the same type running */
+ return(FALSE);
+ }
+
+ buf_pool->init_flush[BUF_FLUSH_LRU] = TRUE;
+
+ block->io_fix = BUF_IO_WRITE;
+ block->flush_type = BUF_FLUSH_LRU;
+
+ if (buf_pool->n_flush[BUF_FLUSH_LRU]++ == 0) {
+
+ os_event_reset(buf_pool->no_flush[BUF_FLUSH_LRU]);
+ }
+
+ /* VERY IMPORTANT:
+ Because any thread may call the LRU flush, even when owning
+ locks on pages, to avoid deadlocks, we must make sure that the
+ s-lock is acquired on the page without waiting: this is
+ accomplished because buf_flush_ready_for_flush() must hold,
+ and that requires the page not to be bufferfixed. */
+
+ rw_lock_s_lock_gen(&block->lock, BUF_IO_WRITE);
+
+ /* Note that the s-latch is acquired before releasing the
+ buf_pool mutex: this ensures that the latch is acquired
+ immediately. */
+
+ mutex_exit(&block->mutex);
+ mutex_exit(&buf_pool->mutex);
+
+ /* Even though block is not protected by any mutex at this
+ point, it is safe to access block, because it is io_fixed and
+ oldest_modification != 0. Thus, it cannot be relocated in the
+ buffer pool or removed from flush_list or LRU_list. */
+
+ buf_flush_write_block_low(block);
+
+ mutex_enter(&buf_pool->mutex);
+ buf_pool->init_flush[BUF_FLUSH_LRU] = FALSE;
+
+ if (buf_pool->n_flush[BUF_FLUSH_LRU] == 0) {
+ /* The running flush batch has ended */
+ os_event_set(buf_pool->no_flush[BUF_FLUSH_LRU]);
+ }
+
+ mutex_exit(&buf_pool->mutex);
+ buf_flush_buffered_writes();
+
+ return(TRUE);
+}
+#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
+
/***************************************************************
Flushes to disk all flushable pages within the flush area. */
static
@@ -841,7 +917,6 @@ buf_flush_batch(
{
buf_block_t* block;
ulint page_count = 0;
- ulint old_page_count;
ulint space;
ulint offset;
ibool found;
@@ -913,15 +988,9 @@ buf_flush_batch(
mutex_exit(&block->mutex);
mutex_exit(&(buf_pool->mutex));
- old_page_count = page_count;
-
/* Try to flush also all the neighbors */
page_count += buf_flush_try_neighbors(
space, offset, flush_type);
- /* fprintf(stderr,
- "Flush type %lu, page no %lu, neighb %lu\n",
- flush_type, offset,
- page_count - old_page_count); */
mutex_enter(&(buf_pool->mutex));
diff --git a/storage/innobase/buf/buf0lru.c b/storage/innobase/buf/buf0lru.c
index d3c787d1578..1dc3efd1464 100644
--- a/storage/innobase/buf/buf0lru.c
+++ b/storage/innobase/buf/buf0lru.c
@@ -321,6 +321,60 @@ buf_LRU_get_recent_limit(void)
}
/**********************************************************************
+Try to put a block from the LRU list to the free list. */
+
+ibool
+buf_LRU_free_block(
+/*===============*/
+ /* out: TRUE if freed */
+ buf_block_t* block) /* in/out: block to be freed */
+{
+ if (!buf_flush_ready_for_replace(block)) {
+ return(FALSE);
+ }
+
+#ifdef UNIV_DEBUG
+ if (buf_debug_prints) {
+ fprintf(stderr,
+ "Putting space %lu page %lu"
+ " to free list\n",
+ (ulong) block->space,
+ (ulong) block->offset);
+ }
+#endif /* UNIV_DEBUG */
+
+ buf_LRU_block_remove_hashed_page(block);
+
+ mutex_exit(&(buf_pool->mutex));
+ mutex_exit(&block->mutex);
+
+ /* Remove possible adaptive hash index built on the
+ page; in the case of AWE the block may not have a
+ frame at all */
+
+ if (block->frame) {
+ /* The page was declared uninitialized
+ by buf_LRU_block_remove_hashed_page().
+ We need to flag the contents of the
+ page valid (which it still is) in
+ order to avoid bogus Valgrind
+ warnings. */
+ UNIV_MEM_VALID(block->frame, UNIV_PAGE_SIZE);
+ btr_search_drop_page_hash_index(block->frame);
+ UNIV_MEM_INVALID(block->frame, UNIV_PAGE_SIZE);
+ }
+
+ ut_a(block->buf_fix_count == 0);
+
+ mutex_enter(&(buf_pool->mutex));
+ mutex_enter(&block->mutex);
+
+ buf_LRU_block_free_hashed_page(block);
+
+ return(TRUE);
+}
+
+/**********************************************************************
Look for a replaceable block from the end of the LRU list and put it to
the free list if found. */
@@ -348,54 +402,13 @@ buf_LRU_search_and_free_block(
ut_a(block->in_LRU_list);
mutex_enter(&block->mutex);
+ freed = buf_LRU_free_block(block);
+ mutex_exit(&block->mutex);
- if (buf_flush_ready_for_replace(block)) {
-
-#ifdef UNIV_DEBUG
- if (buf_debug_prints) {
- fprintf(stderr,
- "Putting space %lu page %lu"
- " to free list\n",
- (ulong) block->space,
- (ulong) block->offset);
- }
-#endif /* UNIV_DEBUG */
-
- buf_LRU_block_remove_hashed_page(block);
-
- mutex_exit(&(buf_pool->mutex));
- mutex_exit(&block->mutex);
-
- /* Remove possible adaptive hash index built on the
- page; in the case of AWE the block may not have a
- frame at all */
-
- if (block->frame) {
- /* The page was declared uninitialized
- by buf_LRU_block_remove_hashed_page().
- We need to flag the contents of the
- page valid (which it still is) in
- order to avoid bogus Valgrind
- warnings. */
- UNIV_MEM_VALID(block->frame, UNIV_PAGE_SIZE);
- btr_search_drop_page_hash_index(block->frame);
- UNIV_MEM_INVALID(block->frame, UNIV_PAGE_SIZE);
- }
-
- ut_a(block->buf_fix_count == 0);
-
- mutex_enter(&(buf_pool->mutex));
- mutex_enter(&block->mutex);
-
- buf_LRU_block_free_hashed_page(block);
- freed = TRUE;
- mutex_exit(&block->mutex);
-
+ if (freed) {
break;
}
- mutex_exit(&block->mutex);
-
block = UT_LIST_GET_PREV(LRU, block);
distance++;
diff --git a/storage/innobase/dict/dict0load.c b/storage/innobase/dict/dict0load.c
index 625956600c0..c505bfbd6c4 100644
--- a/storage/innobase/dict/dict0load.c
+++ b/storage/innobase/dict/dict0load.c
@@ -878,13 +878,13 @@ err_exit:
if (err != DB_SUCCESS) {
dict_table_remove_from_cache(table);
table = NULL;
+ } else {
+ table->fk_max_recusive_level = 0;
}
} else if (!srv_force_recovery) {
dict_table_remove_from_cache(table);
table = NULL;
}
-
- table->fk_max_recusive_level = 0;
#if 0
if (err != DB_SUCCESS && table != NULL) {
diff --git a/storage/innobase/eval/eval0eval.c b/storage/innobase/eval/eval0eval.c
index cbc47ec508f..52e9923fc05 100644
--- a/storage/innobase/eval/eval0eval.c
+++ b/storage/innobase/eval/eval0eval.c
@@ -367,18 +367,13 @@ eval_notfound(
/*==========*/
func_node_t* func_node) /* in: function node */
{
- que_node_t* arg1;
- que_node_t* arg2;
sym_node_t* cursor;
sel_node_t* sel_node;
ibool ibool_val;
- arg1 = func_node->args;
- arg2 = que_node_get_next(arg1);
-
ut_ad(func_node->func == PARS_NOTFOUND_TOKEN);
- cursor = arg1;
+ cursor = func_node->args;
ut_ad(que_node_get_type(cursor) == QUE_NODE_SYMBOL);
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 887f29064ed..4c52326a58a 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -79,6 +79,7 @@ extern "C" {
#include "../storage/innobase/include/dict0crea.h"
#include "../storage/innobase/include/btr0cur.h"
#include "../storage/innobase/include/btr0btr.h"
+#include "../storage/innobase/include/ibuf0ibuf.h"
#include "../storage/innobase/include/fsp0fsp.h"
#include "../storage/innobase/include/sync0sync.h"
#include "../storage/innobase/include/fil0fil.h"
@@ -3723,17 +3724,18 @@ include_field:
n_requested_fields++;
templ->col_no = i;
+ templ->clust_rec_field_no = dict_col_get_clust_pos_noninline(
+ &index->table->cols[i], clust_index);
+ ut_ad(templ->clust_rec_field_no != ULINT_UNDEFINED);
if (index == clust_index) {
- templ->rec_field_no = dict_col_get_clust_pos_noninline(
- &index->table->cols[i], index);
+ templ->rec_field_no = templ->clust_rec_field_no;
} else {
templ->rec_field_no = dict_index_get_nth_col_pos(
index, i);
- }
-
- if (templ->rec_field_no == ULINT_UNDEFINED) {
- prebuilt->need_to_access_clustered = TRUE;
+ if (templ->rec_field_no == ULINT_UNDEFINED) {
+ prebuilt->need_to_access_clustered = TRUE;
+ }
}
if (field->null_ptr) {
@@ -3785,9 +3787,7 @@ skip_field:
for (i = 0; i < n_requested_fields; i++) {
templ = prebuilt->mysql_template + i;
- templ->rec_field_no = dict_col_get_clust_pos_noninline(
- &index->table->cols[templ->col_no],
- clust_index);
+ templ->rec_field_no = templ->clust_rec_field_no;
}
}
}
@@ -5983,7 +5983,6 @@ innobase_drop_database(
trx_t* parent_trx;
trx_t* trx;
char* ptr;
- int error;
char* namebuf;
THD* thd = current_thd;
@@ -6021,7 +6020,7 @@ innobase_drop_database(
trx->check_foreigns = FALSE;
}
- error = row_drop_database_for_mysql(namebuf, trx);
+ row_drop_database_for_mysql(namebuf, trx);
my_free(namebuf, MYF(0));
/* Flush the log to reduce probability that the .frm files and
@@ -6037,13 +6036,7 @@ innobase_drop_database(
innobase_commit_low(trx);
trx_free_for_mysql(trx);
-#ifdef NO_LONGER_INTERESTED_IN_DROP_DB_ERROR
- error = convert_error_code_to_mysql(error, NULL);
-
- return(error);
-#else
return;
-#endif
}
/*************************************************************************
@@ -6374,9 +6367,12 @@ Returns statistics information of the table to the MySQL interpreter,
in various fields of the handle object. */
int
-ha_innobase::info(
-/*==============*/
- uint flag) /* in: what information MySQL requests */
+ha_innobase::info_low(
+/*==================*/
+ uint flag, /* in: what information MySQL
+ requests */
+ bool called_from_analyze) /* in: TRUE if called from
+ ::analyze() */
{
dict_table_t* ib_table;
dict_index_t* index;
@@ -6407,7 +6403,7 @@ ha_innobase::info(
ib_table = prebuilt->table;
if (flag & HA_STATUS_TIME) {
- if (innobase_stats_on_metadata) {
+ if (called_from_analyze || innobase_stats_on_metadata) {
/* In sql_show we call with this flag: update
then statistics so that they are up-to-date */
@@ -6623,6 +6619,18 @@ func_exit:
DBUG_RETURN(0);
}
+/*************************************************************************
+Returns statistics information of the table to the MySQL interpreter,
+in various fields of the handle object. */
+
+int
+ha_innobase::info(
+/*==============*/
+ uint flag) /* in: what information MySQL requests */
+{
+ return(info_low(flag, false /* not called from analyze */));
+}
+
/**************************************************************************
Updates index cardinalities of the table, based on 8 random dives into
each index tree. This does NOT calculate exact statistics on the table. */
@@ -6639,7 +6647,8 @@ ha_innobase::analyze(
pthread_mutex_lock(&analyze_mutex);
/* Simply call ::info() with all the flags */
- info(HA_STATUS_TIME | HA_STATUS_CONST | HA_STATUS_VARIABLE);
+ info_low(HA_STATUS_TIME | HA_STATUS_CONST | HA_STATUS_VARIABLE,
+ true /* called from analyze */);
pthread_mutex_unlock(&analyze_mutex);
@@ -6812,8 +6821,6 @@ ha_innobase::get_foreign_key_create_info(void)
flen = ftell(srv_dict_tmpfile);
if (flen < 0) {
flen = 0;
- } else if (flen > 64000 - 1) {
- flen = 64000 - 1;
}
/* allocate buffer for the string, and
@@ -7560,12 +7567,9 @@ innodb_show_status(
mutex_exit_noninline(&srv_monitor_file_mutex);
- bool result = FALSE;
+ stat_print(thd, innobase_hton_name, (uint) strlen(innobase_hton_name),
+ STRING_WITH_LEN(""), str, flen);
- if (stat_print(thd, innobase_hton_name, (uint) strlen(innobase_hton_name),
- STRING_WITH_LEN(""), str, flen)) {
- result= TRUE;
- }
my_free(str, MYF(0));
DBUG_RETURN(FALSE);
@@ -8986,6 +8990,13 @@ static MYSQL_SYSVAR_LONG(autoinc_lock_mode, innobase_autoinc_lock_mode,
AUTOINC_OLD_STYLE_LOCKING, /* Minimum value */
AUTOINC_NO_LOCKING, 0); /* Maximum value */
+#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
+static MYSQL_SYSVAR_UINT(change_buffering_debug, ibuf_debug,
+ PLUGIN_VAR_RQCMDARG,
+ "Debug flags for InnoDB change buffering (0=none)",
+ NULL, NULL, 0, 0, 1, 0);
+#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
+
static struct st_mysql_sys_var* innobase_system_variables[]= {
MYSQL_SYSVAR(additional_mem_pool_size),
MYSQL_SYSVAR(autoextend_increment),
@@ -9027,6 +9038,9 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
MYSQL_SYSVAR(thread_concurrency),
MYSQL_SYSVAR(thread_sleep_delay),
MYSQL_SYSVAR(autoinc_lock_mode),
+#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
+ MYSQL_SYSVAR(change_buffering_debug),
+#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
NULL
};
diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h
index eb9199b8955..8b91f7d4c51 100644
--- a/storage/innobase/handler/ha_innodb.h
+++ b/storage/innobase/handler/ha_innodb.h
@@ -80,6 +80,7 @@ class ha_innobase: public handler
ulong innobase_update_autoinc(ulonglong auto_inc);
void innobase_initialize_autoinc();
dict_index_t* innobase_get_index(uint keynr);
+ int info_low(uint flag, bool called_from_analyze);
/* Init values for the class: */
public:
diff --git a/storage/innobase/ibuf/ibuf0ibuf.c b/storage/innobase/ibuf/ibuf0ibuf.c
index d54a3378993..71ecc7ec49f 100644
--- a/storage/innobase/ibuf/ibuf0ibuf.c
+++ b/storage/innobase/ibuf/ibuf0ibuf.c
@@ -22,6 +22,7 @@ Created 7/19/1997 Heikki Tuuri
#include "btr0cur.h"
#include "btr0pcur.h"
#include "btr0btr.h"
+#include "row0upd.h"
#include "sync0sync.h"
#include "dict0boot.h"
#include "fut0lst.h"
@@ -137,6 +138,11 @@ access order rules. */
/* Buffer pool size per the maximum insert buffer size */
#define IBUF_POOL_SIZE_PER_MAX_SIZE 2
+#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
+/* Flag to control insert buffer debugging. */
+uint ibuf_debug;
+#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
+
/* The insert buffer control structure */
ibuf_t* ibuf = NULL;
@@ -2824,6 +2830,72 @@ During merge, inserts to an index page a secondary index entry extracted
from the insert buffer. */
static
void
+ibuf_insert_to_index_page_low(
+/*==========================*/
+ dtuple_t* entry, /* in: buffered entry to insert */
+ page_t* page, /* in: index page where the buffered entry
+ should be placed */
+ dict_index_t* index, /* in: record descriptor */
+ mtr_t* mtr, /* in: mtr */
+ page_cur_t* page_cur)/* in: cursor positioned on the record
+ after which to insert the buffered entry */
+{
+ ulint space;
+ ulint page_no;
+ page_t* bitmap_page;
+ ulint old_bits;
+
+ if (UNIV_LIKELY
+ (page_cur_tuple_insert(page_cur, entry, index, mtr) != NULL)) {
+ return;
+ }
+
+ /* If the record did not fit, reorganize */
+
+ btr_page_reorganize(page, index, mtr);
+
+ page_cur_search(page, index, entry, PAGE_CUR_LE, page_cur);
+
+ /* This time the record must fit */
+
+ if (UNIV_LIKELY
+ (page_cur_tuple_insert(page_cur, entry, index, mtr) != NULL)) {
+ return;
+ }
+
+ ut_print_timestamp(stderr);
+
+ fprintf(stderr,
+ " InnoDB: Error: Insert buffer insert fails;"
+ " page free %lu, dtuple size %lu\n",
+ (ulong) page_get_max_insert_size(page, 1),
+ (ulong) rec_get_converted_size(index, entry));
+ fputs("InnoDB: Cannot insert index record ", stderr);
+ dtuple_print(stderr, entry);
+ fputs("\nInnoDB: The table where this index record belongs\n"
+ "InnoDB: is now probably corrupt. Please run CHECK TABLE on\n"
+ "InnoDB: that table.\n", stderr);
+
+ space = buf_frame_get_space_id(page);
+ page_no = buf_frame_get_page_no(page);
+
+ bitmap_page = ibuf_bitmap_get_map_page(space, page_no, mtr);
+ old_bits = ibuf_bitmap_page_get_bits(bitmap_page, page_no,
+ IBUF_BITMAP_FREE, mtr);
+
+ fprintf(stderr,
+ "InnoDB: space %lu, page %lu, bitmap bits %lu\n",
+ (ulong) space, (ulong) page_no, (ulong) old_bits);
+
+ fputs("InnoDB: Submit a detailed bug report"
+ " to http://bugs.mysql.com\n", stderr);
+}
+
+/************************************************************************
+During merge, inserts to an index page a secondary index entry extracted
+from the insert buffer. */
+static
+void
ibuf_insert_to_index_page(
/*======================*/
dtuple_t* entry, /* in: buffered entry to insert */
@@ -2835,11 +2907,10 @@ ibuf_insert_to_index_page(
page_cur_t page_cur;
ulint low_match;
rec_t* rec;
- page_t* bitmap_page;
- ulint old_bits;
ut_ad(ibuf_inside());
ut_ad(dtuple_check_typed(entry));
+ ut_ad(!buf_block_align(page)->is_hashed);
if (UNIV_UNLIKELY(dict_table_is_comp(index->table)
!= (ibool)!!page_is_comp(page))) {
@@ -2877,61 +2948,79 @@ dump:
low_match = page_cur_search(page, index, entry,
PAGE_CUR_LE, &page_cur);
- if (low_match == dtuple_get_n_fields(entry)) {
+ if (UNIV_UNLIKELY(low_match == dtuple_get_n_fields(entry))) {
+ mem_heap_t* heap;
+ upd_t* update;
+ ulint* offsets;
+
rec = page_cur_get_rec(&page_cur);
- btr_cur_del_unmark_for_ibuf(rec, mtr);
- } else {
- rec = page_cur_tuple_insert(&page_cur, entry, index, mtr);
+ /* This is based on
+ row_ins_sec_index_entry_by_modify(BTR_MODIFY_LEAF). */
+ ut_ad(rec_get_deleted_flag(rec, page_is_comp(page)));
- if (rec == NULL) {
- /* If the record did not fit, reorganize */
+ heap = mem_heap_create(1024);
- btr_page_reorganize(page, index, mtr);
+ offsets = rec_get_offsets(rec, index, NULL, ULINT_UNDEFINED,
+ &heap);
+ update = row_upd_build_sec_rec_difference_binary(
+ index, entry, rec, NULL, heap);
- page_cur_search(page, index, entry,
- PAGE_CUR_LE, &page_cur);
+ if (update->n_fields == 0) {
+ /* The records only differ in the delete-mark.
+ Clear the delete-mark, like we did before
+ Bug #56680 was fixed. */
+ btr_cur_del_unmark_for_ibuf(rec, mtr);
+updated_in_place:
+ mem_heap_free(heap);
+ return;
+ }
- /* This time the record must fit */
- if (UNIV_UNLIKELY(!page_cur_tuple_insert(
- &page_cur, entry, index,
- mtr))) {
+ /* Copy the info bits. Clear the delete-mark. */
+ update->info_bits = rec_get_info_bits(rec, page_is_comp(page));
+ update->info_bits &= ~REC_INFO_DELETED_FLAG;
+
+ /* We cannot invoke btr_cur_optimistic_update() here,
+ because we do not have a btr_cur_t or que_thr_t,
+ as the insert buffer merge occurs at a very low level. */
+ if (!row_upd_changes_field_size_or_external(index, offsets,
+ update)) {
+ /* This is the easy case. Do something similar
+ to btr_cur_update_in_place(). */
+ row_upd_rec_in_place(rec, offsets, update);
+ goto updated_in_place;
+ }
- ut_print_timestamp(stderr);
+ /* A collation may identify values that differ in
+ storage length.
+ Some examples (1 or 2 bytes):
+ utf8_turkish_ci: I = U+0131 LATIN SMALL LETTER DOTLESS I
+ utf8_general_ci: S = U+00DF LATIN SMALL LETTER SHARP S
+ utf8_general_ci: A = U+00E4 LATIN SMALL LETTER A WITH DIAERESIS
- fprintf(stderr,
- " InnoDB: Error: Insert buffer insert"
- " fails; page free %lu,"
- " dtuple size %lu\n",
- (ulong) page_get_max_insert_size(
- page, 1),
- (ulong) rec_get_converted_size(
- index, entry));
- fputs("InnoDB: Cannot insert index record ",
- stderr);
- dtuple_print(stderr, entry);
- fputs("\nInnoDB: The table where"
- " this index record belongs\n"
- "InnoDB: is now probably corrupt."
- " Please run CHECK TABLE on\n"
- "InnoDB: that table.\n", stderr);
-
- bitmap_page = ibuf_bitmap_get_map_page(
- buf_frame_get_space_id(page),
- buf_frame_get_page_no(page),
- mtr);
- old_bits = ibuf_bitmap_page_get_bits(
- bitmap_page,
- buf_frame_get_page_no(page),
- IBUF_BITMAP_FREE, mtr);
+ latin1_german2_ci: SS = U+00DF LATIN SMALL LETTER SHARP S
- fprintf(stderr, "InnoDB: Bitmap bits %lu\n",
- (ulong) old_bits);
+ Examples of a character (3-byte UTF-8 sequence)
+ identified with 2 or 4 characters (1-byte UTF-8 sequences):
- fputs("InnoDB: Submit a detailed bug report"
- " to http://bugs.mysql.com\n", stderr);
- }
- }
+ utf8_unicode_ci: 'II' = U+2171 SMALL ROMAN NUMERAL TWO
+ utf8_unicode_ci: '(10)' = U+247D PARENTHESIZED NUMBER TEN
+ */
+
+ /* Delete the different-length record, and insert the
+ buffered one. */
+
+ lock_rec_store_on_page_infimum(page, rec);
+ page_cur_delete_rec(&page_cur, index, offsets, mtr);
+ page_cur_move_to_prev(&page_cur);
+ mem_heap_free(heap);
+
+ ibuf_insert_to_index_page_low(entry, page, index, mtr,
+ &page_cur);
+ lock_rec_restore_from_page_infimum(rec, page);
+ } else {
+ ibuf_insert_to_index_page_low(entry, page, index, mtr,
+ &page_cur);
}
}
diff --git a/storage/innobase/include/buf0flu.h b/storage/innobase/include/buf0flu.h
index 322848509f4..e52c22b8f57 100644
--- a/storage/innobase/include/buf0flu.h
+++ b/storage/innobase/include/buf0flu.h
@@ -38,6 +38,20 @@ buf_flush_init_for_writing(
dulint newest_lsn, /* in: newest modification lsn to the page */
ulint space, /* in: space id */
ulint page_no); /* in: page number */
+# if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
+/**********************************************************************
+Writes a flushable page asynchronously from the buffer pool to a file.
+NOTE: buf_pool_mutex and block->mutex must be held upon entering this
+function, and they will be released by this function after flushing.
+This is loosely based on buf_flush_batch() and buf_flush_try_page(). */
+
+ibool
+buf_flush_page_try(
+/*===============*/
+ /* out: TRUE if flushed and
+ mutexes released */
+ buf_block_t* block); /*!< in/out: buffer control block */
+#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
/***********************************************************************
This utility flushes dirty blocks from the end of the LRU list or flush_list.
NOTE 1: in the case of an LRU flush the calling thread may own latches to
diff --git a/storage/innobase/include/buf0lru.h b/storage/innobase/include/buf0lru.h
index 6d26fd4d3b2..777e55a350d 100644
--- a/storage/innobase/include/buf0lru.h
+++ b/storage/innobase/include/buf0lru.h
@@ -66,6 +66,14 @@ buf_LRU_get_recent_limit(void);
/*==========================*/
/* out: the limit; zero if could not determine it */
/**********************************************************************
+Try to put a block from the LRU list to the free list. */
+
+ibool
+buf_LRU_free_block(
+/*===============*/
+ /* out: TRUE if freed */
+ buf_block_t* block); /* in/out: block to be freed */
+/**********************************************************************
Look for a replaceable block from the end of the LRU list and put it to
the free list if found. */
diff --git a/storage/innobase/include/ibuf0ibuf.h b/storage/innobase/include/ibuf0ibuf.h
index 77fefe2020b..d6d7a918b62 100644
--- a/storage/innobase/include/ibuf0ibuf.h
+++ b/storage/innobase/include/ibuf0ibuf.h
@@ -18,6 +18,11 @@ Created 7/19/1997 Heikki Tuuri
#include "ibuf0types.h"
#include "fsp0fsp.h"
+#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
+/* Flag to control insert buffer debugging. */
+extern uint ibuf_debug;
+#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
+
extern ibuf_t* ibuf;
/**********************************************************************
diff --git a/storage/innobase/include/rem0rec.h b/storage/innobase/include/rem0rec.h
index abc204bb583..58762fc3111 100644
--- a/storage/innobase/include/rem0rec.h
+++ b/storage/innobase/include/rem0rec.h
@@ -19,6 +19,9 @@ if and only if the record is the first user record on a non-leaf
B-tree page that is the leftmost page on its level
(PAGE_LEVEL is nonzero and FIL_PAGE_PREV is FIL_NULL). */
#define REC_INFO_MIN_REC_FLAG 0x10UL
+/* The deleted flag in info bits */
+#define REC_INFO_DELETED_FLAG 0x20UL /* when bit is set to 1, it means the
+ record has been delete marked */
/* Number of extra bytes in an old-style record,
in addition to the data and the offsets */
diff --git a/storage/innobase/include/rem0rec.ic b/storage/innobase/include/rem0rec.ic
index d91fb4c4391..df66bb13aeb 100644
--- a/storage/innobase/include/rem0rec.ic
+++ b/storage/innobase/include/rem0rec.ic
@@ -98,9 +98,6 @@ and the shift needed to obtain each bit-field of the record. */
#define REC_INFO_BITS_MASK 0xF0UL
#define REC_INFO_BITS_SHIFT 0
-/* The deleted flag in info bits */
-#define REC_INFO_DELETED_FLAG 0x20UL /* when bit is set to 1, it means the
- record has been delete marked */
/* The following masks are used to filter the SQL null bit from
one-byte and two-byte offsets */
diff --git a/storage/innobase/include/row0mysql.h b/storage/innobase/include/row0mysql.h
index 488177791a4..52b13838cc7 100644
--- a/storage/innobase/include/row0mysql.h
+++ b/storage/innobase/include/row0mysql.h
@@ -485,6 +485,10 @@ struct mysql_row_templ_struct {
Innobase record in the current index;
not defined if template_type is
ROW_MYSQL_WHOLE_ROW */
+ ulint clust_rec_field_no; /* field number of the column in an
+ Innobase record in the clustered index;
+ not defined if template_type is
+ ROW_MYSQL_WHOLE_ROW */
ulint mysql_col_offset; /* offset of the column in the MySQL
row format */
ulint mysql_col_len; /* length of the column in the MySQL
diff --git a/storage/innobase/include/row0upd.h b/storage/innobase/include/row0upd.h
index efbc6d6facf..034b1dafb17 100644
--- a/storage/innobase/include/row0upd.h
+++ b/storage/innobase/include/row0upd.h
@@ -129,9 +129,11 @@ row_upd_changes_field_size_or_external(
const ulint* offsets,/* in: rec_get_offsets(rec, index) */
upd_t* update);/* in: update vector */
/***************************************************************
-Replaces the new column values stored in the update vector to the record
-given. No field size changes are allowed. This function is used only for
-a clustered index */
+Replaces the new column values stored in the update vector to the
+record given. No field size changes are allowed. This function is
+usually invoked on a clustered index. The only use case for a
+secondary index is row_ins_sec_index_entry_by_modify() or its
+counterpart in ibuf_insert_to_index_page(). */
void
row_upd_rec_in_place(
diff --git a/storage/innobase/include/ut0dbg.h b/storage/innobase/include/ut0dbg.h
index a317f35f4be..06dead7fc03 100644
--- a/storage/innobase/include/ut0dbg.h
+++ b/storage/innobase/include/ut0dbg.h
@@ -39,7 +39,7 @@ extern ibool panic_shutdown;
void ut_dbg_panic(void);
# define UT_DBG_PANIC ut_dbg_panic()
/* Stop threads in ut_a(). */
-# define UT_DBG_STOP while (0) /* We do not do this on NetWare */
+# define UT_DBG_STOP do {} while (0) /* We do not do this on NetWare */
#else /* __NETWARE__ */
# if defined(__WIN__) || defined(__INTEL_COMPILER)
# undef UT_DBG_USE_ABORT
@@ -71,7 +71,7 @@ ut_dbg_stop_thread(
/* Abort the execution. */
# define UT_DBG_PANIC abort()
/* Stop threads (null operation) */
-# define UT_DBG_STOP while (0)
+# define UT_DBG_STOP do {} while (0)
# else /* UT_DBG_USE_ABORT */
/* Abort the execution. */
# define UT_DBG_PANIC \
diff --git a/storage/innobase/include/ut0rnd.ic b/storage/innobase/include/ut0rnd.ic
index 625c378489a..dc4c0d62f56 100644
--- a/storage/innobase/include/ut0rnd.ic
+++ b/storage/innobase/include/ut0rnd.ic
@@ -67,9 +67,6 @@ ut_rnd_gen_ulint(void)
/* out: the 'random' number */
{
ulint rnd;
- ulint n_bits;
-
- n_bits = 8 * sizeof(ulint);
ut_rnd_ulint_counter = UT_RND1 * ut_rnd_ulint_counter + UT_RND2;
diff --git a/storage/innobase/lock/lock0lock.c b/storage/innobase/lock/lock0lock.c
index 04240960b3a..57df99fb401 100644
--- a/storage/innobase/lock/lock0lock.c
+++ b/storage/innobase/lock/lock0lock.c
@@ -4296,7 +4296,6 @@ lock_print_info_all_transactions(
lock_t* lock;
ulint space;
ulint page_no;
- page_t* page;
ibool load_page_first = TRUE;
ulint nth_trx = 0;
ulint nth_lock = 0;
@@ -4410,8 +4409,7 @@ loop:
mtr_start(&mtr);
- page = buf_page_get_with_no_latch(
- space, page_no, &mtr);
+ buf_page_get_with_no_latch(space, page_no, &mtr);
mtr_commit(&mtr);
diff --git a/storage/innobase/log/log0recv.c b/storage/innobase/log/log0recv.c
index e6524eeefbf..6e1ca58cb15 100644
--- a/storage/innobase/log/log0recv.c
+++ b/storage/innobase/log/log0recv.c
@@ -400,10 +400,8 @@ recv_synchronize_groups(
dulint start_lsn;
dulint end_lsn;
dulint recovered_lsn;
- dulint limit_lsn;
recovered_lsn = recv_sys->recovered_lsn;
- limit_lsn = recv_sys->limit_lsn;
/* Read the last recovered log block to the recovery system buffer:
the block is always incomplete */
@@ -2506,7 +2504,9 @@ recv_recovery_from_checkpoint_start(
dulint old_scanned_lsn;
dulint group_scanned_lsn;
dulint contiguous_lsn;
+#ifdef UNIV_LOG_ARCHIVE
dulint archived_lsn;
+#endif /* UNIV_LOG_ARCHIVE */
ulint capacity;
byte* buf;
byte log_hdr_buf[LOG_FILE_HDR_SIZE];
@@ -2552,7 +2552,9 @@ recv_recovery_from_checkpoint_start(
checkpoint_lsn = mach_read_from_8(buf + LOG_CHECKPOINT_LSN);
checkpoint_no = mach_read_from_8(buf + LOG_CHECKPOINT_NO);
+#ifdef UNIV_LOG_ARCHIVE
archived_lsn = mach_read_from_8(buf + LOG_CHECKPOINT_ARCHIVED_LSN);
+#endif /* UNIV_LOG_ARCHIVE */
/* Read the first log file header to print a note if this is
a recovery from a restored InnoDB Hot Backup */
diff --git a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c
index 3396d1adf2f..566c50381e7 100644
--- a/storage/innobase/os/os0file.c
+++ b/storage/innobase/os/os0file.c
@@ -1138,9 +1138,12 @@ Tries to disable OS caching on an opened file descriptor. */
void
os_file_set_nocache(
/*================*/
- int fd, /* in: file descriptor to alter */
- const char* file_name, /* in: used in the diagnostic message */
- const char* operation_name) /* in: used in the diagnostic message,
+ int fd /* in: file descriptor to alter */
+ __attribute__((unused)),
+ const char* file_name /* in: used in the diagnostic message */
+ __attribute__((unused)),
+ const char* operation_name __attribute__((unused)))
+ /* in: used in the diagnostic message,
we call os_file_set_nocache()
immediately after opening or creating
a file, so this is either "open" or
@@ -1314,8 +1317,6 @@ try_again:
int create_flag;
ibool retry;
const char* mode_str = NULL;
- const char* type_str = NULL;
- const char* purpose_str = NULL;
try_again:
ut_a(name);
@@ -1335,26 +1336,9 @@ try_again:
ut_error;
}
- if (type == OS_LOG_FILE) {
- type_str = "LOG";
- } else if (type == OS_DATA_FILE) {
- type_str = "DATA";
- } else {
- ut_error;
- }
-
- if (purpose == OS_FILE_AIO) {
- purpose_str = "AIO";
- } else if (purpose == OS_FILE_NORMAL) {
- purpose_str = "NORMAL";
- } else {
- ut_error;
- }
+ ut_a(type == OS_LOG_FILE || type == OS_DATA_FILE);
+ ut_a(purpose == OS_FILE_AIO || purpose == OS_FILE_NORMAL);
-#if 0
- fprintf(stderr, "Opening file %s, mode %s, type %s, purpose %s\n",
- name, mode_str, type_str, purpose_str);
-#endif
#ifdef O_SYNC
/* We let O_SYNC only affect log files; note that we map O_DSYNC to
O_SYNC because the datasync options seemed to corrupt files in 2001
@@ -2223,7 +2207,10 @@ os_file_read(
ibool retry;
ulint i;
+ /* On 64-bit Windows, ulint is 64 bits. But offset and n should be
+ no more than 32 bits. */
ut_a((offset & 0xFFFFFFFFUL) == offset);
+ ut_a((n & 0xFFFFFFFFUL) == n);
os_n_file_reads++;
os_bytes_read_since_printout += n;
@@ -2340,7 +2327,10 @@ os_file_read_no_error_handling(
ibool retry;
ulint i;
+ /* On 64-bit Windows, ulint is 64 bits. But offset and n should be
+ no more than 32 bits. */
ut_a((offset & 0xFFFFFFFFUL) == offset);
+ ut_a((n & 0xFFFFFFFFUL) == n);
os_n_file_reads++;
os_bytes_read_since_printout += n;
@@ -2463,7 +2453,10 @@ os_file_write(
ulint n_retries = 0;
ulint err;
- ut_a((offset & 0xFFFFFFFF) == offset);
+ /* On 64-bit Windows, ulint is 64 bits. But offset and n should be
+ no more than 32 bits. */
+ ut_a((offset & 0xFFFFFFFFUL) == offset);
+ ut_a((n & 0xFFFFFFFFUL) == n);
os_n_file_writes++;
@@ -3261,14 +3254,16 @@ os_aio_array_reserve_slot(
ulint len) /* in: length of the block to read or write */
{
os_aio_slot_t* slot;
+ ulint i;
#ifdef WIN_ASYNC_IO
OVERLAPPED* control;
+ ut_a((len & 0xFFFFFFFFUL) == len);
#elif defined(POSIX_ASYNC_IO)
struct aiocb* control;
#endif
- ulint i;
+
loop:
os_mutex_enter(array->mutex);
@@ -3533,6 +3528,9 @@ os_aio(
ut_ad(n % OS_FILE_LOG_BLOCK_SIZE == 0);
ut_ad(offset % OS_FILE_LOG_BLOCK_SIZE == 0);
ut_ad(os_aio_validate());
+#ifdef WIN_ASYNC_IO
+ ut_ad((n & 0xFFFFFFFFUL) == n);
+#endif
wake_later = mode & OS_AIO_SIMULATED_WAKE_LATER;
mode = mode & (~OS_AIO_SIMULATED_WAKE_LATER);
@@ -3781,16 +3779,18 @@ os_aio_windows_handle(
/* retry failed read/write operation synchronously.
No need to hold array->mutex. */
+ ut_a((slot->len & 0xFFFFFFFFUL) == slot->len);
+
switch (slot->type) {
case OS_FILE_WRITE:
ret = WriteFile(slot->file, slot->buf,
- slot->len, &len,
+ (DWORD) slot->len, &len,
&(slot->control));
break;
case OS_FILE_READ:
ret = ReadFile(slot->file, slot->buf,
- slot->len, &len,
+ (DWORD) slot->len, &len,
&(slot->control));
break;
diff --git a/storage/innobase/plug.in.disabled b/storage/innobase/plug.in.disabled
index de7302dd6cc..b18950b9c7a 100644
--- a/storage/innobase/plug.in.disabled
+++ b/storage/innobase/plug.in.disabled
@@ -1,7 +1,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_STATIC(innobase, [libinnobase.la])
MYSQL_PLUGIN_DYNAMIC(innobase, [ha_innodb.la])
MYSQL_PLUGIN_ACTIONS(innobase, [
AC_CHECK_LIB(rt, aio_read, [innodb_system_libs="-lrt"])
diff --git a/storage/innobase/que/que0que.c b/storage/innobase/que/que0que.c
index bf83f28f04e..1a76823ca4d 100644
--- a/storage/innobase/que/que0que.c
+++ b/storage/innobase/que/que0que.c
@@ -802,13 +802,11 @@ que_thr_dec_refer_count(
{
que_fork_t* fork;
trx_t* trx;
- sess_t* sess;
ulint fork_type;
ibool stopped;
fork = thr->common.parent;
trx = thr_get_trx(thr);
- sess = trx->sess;
mutex_enter(&kernel_mutex);
@@ -1292,18 +1290,13 @@ que_run_threads_low(
que_thr_t* thr) /* in: query thread */
{
que_thr_t* next_thr;
- ulint cumul_resource;
ulint loop_count;
ut_ad(thr->state == QUE_THR_RUNNING);
ut_a(thr_get_trx(thr)->error_state == DB_SUCCESS);
ut_ad(!mutex_own(&kernel_mutex));
- /* cumul_resource counts how much resources the OS thread (NOT the
- query thread) has spent in this function */
-
loop_count = QUE_MAX_LOOPS_WITHOUT_CHECK;
- cumul_resource = 0;
loop:
/* Check that there is enough space in the log to accommodate
possible log entries by this query step; if the operation can touch
diff --git a/storage/innobase/row/row0mysql.c b/storage/innobase/row/row0mysql.c
index aae4703737b..4fdd92c7cba 100644
--- a/storage/innobase/row/row0mysql.c
+++ b/storage/innobase/row/row0mysql.c
@@ -400,7 +400,7 @@ row_mysql_convert_row_to_innobase(
row is used, as row may contain
pointers to this record! */
{
- mysql_row_templ_t* templ;
+ const mysql_row_templ_t*templ;
dfield_t* dfield;
ulint i;
@@ -1457,7 +1457,12 @@ run_again:
srv_n_rows_updated++;
}
- row_update_statistics_if_needed(prebuilt->table);
+ /* We update table statistics only if it is a DELETE or UPDATE
+ that changes indexed columns, UPDATEs that change only non-indexed
+ columns would not affect statistics. */
+ if (node->is_delete || !(node->cmpl_info & UPD_NODE_NO_ORD_CHANGE)) {
+ row_update_statistics_if_needed(prebuilt->table);
+ }
trx->op_info = "";
@@ -1608,6 +1613,9 @@ row_update_cascade_for_mysql(
trx = thr_get_trx(thr);
+ /* Increment fk_cascade_depth to record the recursive call depth on
+ a single update/delete that affects multiple tables chained
+ together with foreign key relations. */
thr->fk_cascade_depth++;
if (thr->fk_cascade_depth > FK_MAX_CASCADE_DEL) {
@@ -1619,6 +1627,12 @@ run_again:
row_upd_step(thr);
+ /* The recursive call for cascading update/delete happens
+ in above row_upd_step(), reset the counter once we come
+ out of the recursive call, so it does not accumulate for
+ different row deletes */
+ thr->fk_cascade_depth = 0;
+
err = trx->error_state;
/* Note that the cascade node is a subnode of another InnoDB
@@ -1967,6 +1981,7 @@ row_create_table_for_mysql(
table already exists */
trx->error_state = DB_SUCCESS;
+ dict_mem_table_free(table);
}
que_graph_free((que_t*) que_node_get_parent(thr));
diff --git a/storage/innobase/row/row0purge.c b/storage/innobase/row/row0purge.c
index 1fef47da13f..deec3b0a454 100644
--- a/storage/innobase/row/row0purge.c
+++ b/storage/innobase/row/row0purge.c
@@ -667,7 +667,7 @@ row_purge_step(
err = row_purge(node, thr);
- ut_ad(err == DB_SUCCESS);
+ ut_a(err == DB_SUCCESS);
return(thr);
}
diff --git a/storage/innobase/row/row0sel.c b/storage/innobase/row/row0sel.c
index 06a19ba7979..e03d3d79768 100644
--- a/storage/innobase/row/row0sel.c
+++ b/storage/innobase/row/row0sel.c
@@ -2601,38 +2601,38 @@ row_sel_store_mysql_rec(
row_prebuilt_t* prebuilt, /* in: prebuilt struct */
rec_t* rec, /* in: Innobase record in the index
which was described in prebuilt's
- template */
+ template, or in the clustered index;
+ must be protected by a page latch */
+ ibool rec_clust, /* in: TRUE if rec is in the clustered
+ index instead of prebuilt->index */
const ulint* offsets) /* in: array returned by
- rec_get_offsets() */
+ rec_get_offsets(rec) */
{
- mysql_row_templ_t* templ;
mem_heap_t* extern_field_heap = NULL;
mem_heap_t* heap;
- byte* data;
- ulint len;
ulint i;
ut_ad(prebuilt->mysql_template);
ut_ad(prebuilt->default_rec);
ut_ad(rec_offs_validate(rec, NULL, offsets));
+ ut_ad(!rec_get_deleted_flag(rec, rec_offs_comp(offsets)));
if (UNIV_LIKELY_NULL(prebuilt->blob_heap)) {
mem_heap_free(prebuilt->blob_heap);
prebuilt->blob_heap = NULL;
}
- /* init null bytes with default values as they might be
- left uninitialized in some cases and this uninited bytes
- might be copied into mysql record buffer that leads to
- valgrind warnings */
- memcpy(mysql_rec, prebuilt->default_rec, prebuilt->null_bitmap_len);
-
for (i = 0; i < prebuilt->n_template; i++) {
- templ = prebuilt->mysql_template + i;
+ const mysql_row_templ_t*templ = prebuilt->mysql_template + i;
+ byte* data;
+ ulint len;
+ ulint field_no;
+
+ field_no = rec_clust
+ ? templ->clust_rec_field_no : templ->rec_field_no;
- if (UNIV_UNLIKELY(rec_offs_nth_extern(offsets,
- templ->rec_field_no))) {
+ if (UNIV_UNLIKELY(rec_offs_nth_extern(offsets, field_no))) {
/* Copy an externally stored field to the temporary
heap */
@@ -2658,15 +2658,13 @@ row_sel_store_mysql_rec(
causes an assert */
data = btr_rec_copy_externally_stored_field(
- rec, offsets, templ->rec_field_no,
- &len, heap);
+ rec, offsets, field_no, &len, heap);
ut_a(len != UNIV_SQL_NULL);
} else {
/* Field is stored in the row. */
- data = rec_get_nth_field(rec, offsets,
- templ->rec_field_no, &len);
+ data = rec_get_nth_field(rec, offsets, field_no, &len);
if (UNIV_UNLIKELY(templ->type == DATA_BLOB)
&& len != UNIV_SQL_NULL) {
@@ -3025,7 +3023,7 @@ row_sel_pop_cached_row_for_mysql(
row_prebuilt_t* prebuilt) /* in: prebuilt struct */
{
ulint i;
- mysql_row_templ_t* templ;
+ const mysql_row_templ_t*templ;
byte* cached_rec;
ut_ad(prebuilt->n_fetch_cached > 0);
ut_ad(prebuilt->mysql_prefix_len <= prebuilt->mysql_row_len);
@@ -3081,14 +3079,19 @@ void
row_sel_push_cache_row_for_mysql(
/*=============================*/
row_prebuilt_t* prebuilt, /* in: prebuilt struct */
- rec_t* rec, /* in: record to push */
- const ulint* offsets) /* in: rec_get_offsets() */
+ rec_t* rec, /* in: Innobase record in the index
+ which was described in prebuilt's
+ template, or in the clustered index */
+ ibool rec_clust, /* in: TRUE if rec is in the clustered
+ index instead of prebuilt->index */
+ const ulint* offsets) /* in: rec_get_offsets(rec) */
{
byte* buf;
ulint i;
ut_ad(prebuilt->n_fetch_cached < MYSQL_FETCH_CACHE_SIZE);
ut_ad(rec_offs_validate(rec, NULL, offsets));
+ ut_ad(!rec_get_deleted_flag(rec, rec_offs_comp(offsets)));
ut_a(!prebuilt->templ_contains_blob);
if (prebuilt->fetch_cache[0] == NULL) {
@@ -3117,7 +3120,7 @@ row_sel_push_cache_row_for_mysql(
if (UNIV_UNLIKELY(!row_sel_store_mysql_rec(
prebuilt->fetch_cache[
prebuilt->n_fetch_cached],
- prebuilt, rec, offsets))) {
+ prebuilt, rec, rec_clust, offsets))) {
ut_error;
}
@@ -3259,6 +3262,7 @@ row_search_for_mysql(
mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_;
+ ibool table_lock_waited = FALSE;
*offsets_ = (sizeof offsets_) / sizeof *offsets_;
@@ -3505,7 +3509,8 @@ row_search_for_mysql(
rec, offsets));
#endif
if (!row_sel_store_mysql_rec(buf, prebuilt,
- rec, offsets)) {
+ rec, FALSE,
+ offsets)) {
err = DB_TOO_BIG_RECORD;
/* We let the main loop to do the
@@ -3599,6 +3604,44 @@ shortcut_fails_too_big_rec:
clust_index = dict_table_get_first_index(index->table);
+ /* Do some start-of-statement preparations */
+
+ if (!prebuilt->sql_stat_start) {
+ /* No need to set an intention lock or assign a read view */
+
+ if (trx->read_view == NULL
+ && prebuilt->select_lock_type == LOCK_NONE) {
+
+ fputs("InnoDB: Error: MySQL is trying to"
+ " perform a consistent read\n"
+ "InnoDB: but the read view is not assigned!\n",
+ stderr);
+ trx_print(stderr, trx, 600);
+ fputc('\n', stderr);
+ ut_error;
+ }
+ } else if (prebuilt->select_lock_type == LOCK_NONE) {
+ /* This is a consistent read */
+ /* Assign a read view for the query */
+
+ trx_assign_read_view(trx);
+ prebuilt->sql_stat_start = FALSE;
+ } else {
+wait_table_again:
+ err = lock_table(0, index->table,
+ prebuilt->select_lock_type == LOCK_S
+ ? LOCK_IS : LOCK_IX, thr);
+
+ if (err != DB_SUCCESS) {
+
+ table_lock_waited = TRUE;
+ goto lock_table_wait;
+ }
+ prebuilt->sql_stat_start = FALSE;
+ }
+
+ /* Open or restore index cursor position */
+
if (UNIV_LIKELY(direction != 0)) {
ibool need_to_process = sel_restore_position_for_mysql(
&same_user_rec, BTR_SEARCH_LEAF,
@@ -3674,42 +3717,6 @@ shortcut_fails_too_big_rec:
}
}
- if (!prebuilt->sql_stat_start) {
- /* No need to set an intention lock or assign a read view */
-
- if (trx->read_view == NULL
- && prebuilt->select_lock_type == LOCK_NONE) {
-
- fputs("InnoDB: Error: MySQL is trying to"
- " perform a consistent read\n"
- "InnoDB: but the read view is not assigned!\n",
- stderr);
- trx_print(stderr, trx, 600);
- fputc('\n', stderr);
- ut_a(0);
- }
- } else if (prebuilt->select_lock_type == LOCK_NONE) {
- /* This is a consistent read */
- /* Assign a read view for the query */
-
- trx_assign_read_view(trx);
- prebuilt->sql_stat_start = FALSE;
- } else {
- ulint lock_mode;
- if (prebuilt->select_lock_type == LOCK_S) {
- lock_mode = LOCK_IS;
- } else {
- lock_mode = LOCK_IX;
- }
- err = lock_table(0, index->table, lock_mode, thr);
-
- if (err != DB_SUCCESS) {
-
- goto lock_wait_or_error;
- }
- prebuilt->sql_stat_start = FALSE;
- }
-
rec_loop:
/*-------------------------------------------------------------*/
/* PHASE 4: Look for matching records in a loop */
@@ -4236,19 +4243,8 @@ requires_clust_rec:
goto next_rec;
}
- if (prebuilt->need_to_access_clustered) {
-
- result_rec = clust_rec;
-
- ut_ad(rec_offs_validate(result_rec, clust_index,
- offsets));
- } else {
- /* We used 'offsets' for the clust rec, recalculate
- them for 'rec' */
- offsets = rec_get_offsets(rec, index, offsets,
- ULINT_UNDEFINED, &heap);
- result_rec = rec;
- }
+ result_rec = clust_rec;
+ ut_ad(rec_offs_validate(result_rec, clust_index, offsets));
} else {
result_rec = rec;
}
@@ -4259,6 +4255,7 @@ requires_clust_rec:
ut_ad(rec_offs_validate(result_rec,
result_rec != rec ? clust_index : index,
offsets));
+ ut_ad(!rec_get_deleted_flag(result_rec, comp));
if ((match_mode == ROW_SEL_EXACT
|| prebuilt->n_rows_fetched >= MYSQL_FETCH_CACHE_THRESHOLD)
@@ -4279,7 +4276,7 @@ requires_clust_rec:
cursor. */
row_sel_push_cache_row_for_mysql(prebuilt, result_rec,
- offsets);
+ result_rec != rec, offsets);
if (prebuilt->n_fetch_cached == MYSQL_FETCH_CACHE_SIZE) {
goto got_row;
@@ -4287,15 +4284,31 @@ requires_clust_rec:
goto next_rec;
} else {
- if (prebuilt->template_type == ROW_MYSQL_DUMMY_TEMPLATE) {
+ if (UNIV_UNLIKELY
+ (prebuilt->template_type == ROW_MYSQL_DUMMY_TEMPLATE)) {
+ /* CHECK TABLE: fetch the row */
+
+ if (result_rec != rec
+ && !prebuilt->need_to_access_clustered) {
+ /* We used 'offsets' for the clust
+ rec, recalculate them for 'rec' */
+ offsets = rec_get_offsets(rec, index, offsets,
+ ULINT_UNDEFINED,
+ &heap);
+ result_rec = rec;
+ }
+
memcpy(buf + 4, result_rec
- rec_offs_extra_size(offsets),
rec_offs_size(offsets));
mach_write_to_4(buf,
rec_offs_extra_size(offsets) + 4);
} else {
- if (!row_sel_store_mysql_rec(buf, prebuilt,
- result_rec, offsets)) {
+ /* Returning a row to MySQL */
+
+ if (!row_sel_store_mysql_rec(buf, prebuilt, result_rec,
+ result_rec != rec,
+ offsets)) {
err = DB_TOO_BIG_RECORD;
goto lock_wait_or_error;
@@ -4408,6 +4421,7 @@ lock_wait_or_error:
btr_pcur_store_position(pcur, &mtr);
+lock_table_wait:
mtr_commit(&mtr);
mtr_has_extra_clust_latch = FALSE;
@@ -4425,6 +4439,14 @@ lock_wait_or_error:
thr->lock_state = QUE_THR_LOCK_NOLOCK;
mtr_start(&mtr);
+ /* Table lock waited, go try to obtain table lock
+ again */
+ if (table_lock_waited) {
+ table_lock_waited = FALSE;
+
+ goto wait_table_again;
+ }
+
sel_restore_position_for_mysql(&same_user_rec,
BTR_SEARCH_LEAF, pcur,
moves_up, &mtr);
diff --git a/storage/innobase/row/row0umod.c b/storage/innobase/row/row0umod.c
index 68139da116e..a3333fcc536 100644
--- a/storage/innobase/row/row0umod.c
+++ b/storage/innobase/row/row0umod.c
@@ -89,12 +89,17 @@ row_undo_mod_clust_low(
btr_pcur_t* pcur;
btr_cur_t* btr_cur;
ulint err;
+#ifdef UNIV_DEBUG
ibool success;
+#endif /* UNIV_DEBUG */
pcur = &(node->pcur);
btr_cur = btr_pcur_get_btr_cur(pcur);
- success = btr_pcur_restore_position(mode, pcur, mtr);
+#ifdef UNIV_DEBUG
+ success =
+#endif /* UNIV_DEBUG */
+ btr_pcur_restore_position(mode, pcur, mtr);
ut_ad(success);
diff --git a/storage/innobase/row/row0upd.c b/storage/innobase/row/row0upd.c
index c91cc449b96..0790cfe02e2 100644
--- a/storage/innobase/row/row0upd.c
+++ b/storage/innobase/row/row0upd.c
@@ -430,9 +430,11 @@ row_upd_changes_field_size_or_external(
}
/***************************************************************
-Replaces the new column values stored in the update vector to the record
-given. No field size changes are allowed. This function is used only for
-a clustered index */
+Replaces the new column values stored in the update vector to the
+record given. No field size changes are allowed. This function is
+usually invoked on a clustered index. The only use case for a
+secondary index is row_ins_sec_index_entry_by_modify() or its
+counterpart in ibuf_insert_to_index_page(). */
void
row_upd_rec_in_place(
@@ -2037,7 +2039,9 @@ row_upd_in_place_in_select(
upd_node_t* node;
btr_pcur_t* pcur;
btr_cur_t* btr_cur;
+#ifdef UNIV_DEBUG
ulint err;
+#endif /* UNIV_DEBUG */
mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE];
*offsets_ = (sizeof offsets_) / sizeof *offsets_;
@@ -2074,8 +2078,11 @@ row_upd_in_place_in_select(
ut_ad(node->cmpl_info & UPD_NODE_NO_ORD_CHANGE);
ut_ad(node->select_will_do_update);
- err = btr_cur_update_in_place(BTR_NO_LOCKING_FLAG, btr_cur,
- node->update, node->cmpl_info,
- thr, mtr);
+#ifdef UNIV_DEBUG
+ err =
+#endif /* UNIV_DEBUG */
+ btr_cur_update_in_place(BTR_NO_LOCKING_FLAG, btr_cur,
+ node->update, node->cmpl_info,
+ thr, mtr);
ut_ad(err == DB_SUCCESS);
}
diff --git a/storage/innobase/row/row0vers.c b/storage/innobase/row/row0vers.c
index 03d9a2f1203..f4adfa855df 100644
--- a/storage/innobase/row/row0vers.c
+++ b/storage/innobase/row/row0vers.c
@@ -59,7 +59,9 @@ row_vers_impl_x_locked_off_kernel(
trx_t* trx;
ulint vers_del;
ulint rec_del;
+#ifdef UNIV_DEBUG
ulint err;
+#endif /* UNIV_DEBUG */
mtr_t mtr;
ulint comp;
@@ -152,9 +154,12 @@ row_vers_impl_x_locked_off_kernel(
heap2 = heap;
heap = mem_heap_create(1024);
- err = trx_undo_prev_version_build(clust_rec, &mtr, version,
- clust_index, clust_offsets,
- heap, &prev_version);
+#ifdef UNIV_DEBUG
+ err =
+#endif /* UNIV_DEBUG */
+ trx_undo_prev_version_build(clust_rec, &mtr, version,
+ clust_index, clust_offsets,
+ heap, &prev_version);
mem_heap_free(heap2); /* free version and clust_offsets */
if (prev_version) {
diff --git a/storage/innobase/trx/trx0purge.c b/storage/innobase/trx/trx0purge.c
index f0f300d918e..9e09efc82b2 100644
--- a/storage/innobase/trx/trx0purge.c
+++ b/storage/innobase/trx/trx0purge.c
@@ -249,9 +249,10 @@ trx_purge_add_update_undo_to_history(
trx_undo_t* undo;
trx_rseg_t* rseg;
trx_rsegf_t* rseg_header;
+#ifdef UNIV_DEBUG
trx_usegf_t* seg_header;
+#endif /* UNIV_DEBUG */
trx_ulogf_t* undo_header;
- trx_upagef_t* page_header;
ulint hist_size;
undo = trx->update_undo;
@@ -265,8 +266,9 @@ trx_purge_add_update_undo_to_history(
rseg_header = trx_rsegf_get(rseg->space, rseg->page_no, mtr);
undo_header = undo_page + undo->hdr_offset;
+#ifdef UNIV_DEBUG
seg_header = undo_page + TRX_UNDO_SEG_HDR;
- page_header = undo_page + TRX_UNDO_PAGE_HDR;
+#endif /* UNIV_DEBUG */
if (undo->state != TRX_UNDO_CACHED) {
/* The undo log segment will not be reused */
@@ -594,7 +596,6 @@ trx_purge_rseg_get_next_history_log(
{
page_t* undo_page;
trx_ulogf_t* log_hdr;
- trx_usegf_t* seg_hdr;
fil_addr_t prev_log_addr;
dulint trx_no;
ibool del_marks;
@@ -615,7 +616,6 @@ trx_purge_rseg_get_next_history_log(
undo_page = trx_undo_page_get_s_latched(rseg->space,
rseg->last_page_no, &mtr);
log_hdr = undo_page + rseg->last_offset;
- seg_hdr = undo_page + TRX_UNDO_SEG_HDR;
/* Increase the purge page count by one for every handled log */
@@ -1004,12 +1004,8 @@ trx_purge_rec_release(
/*==================*/
trx_undo_inf_t* cell) /* in: storage cell */
{
- trx_undo_arr_t* arr;
-
mutex_enter(&(purge_sys->mutex));
- arr = purge_sys->arr;
-
trx_purge_arr_remove_info(cell);
mutex_exit(&(purge_sys->mutex));
diff --git a/storage/innobase/trx/trx0roll.c b/storage/innobase/trx/trx0roll.c
index 8934fe87c7e..285e30796a5 100644
--- a/storage/innobase/trx/trx0roll.c
+++ b/storage/innobase/trx/trx0roll.c
@@ -713,13 +713,8 @@ trx_undo_arr_remove_info(
dulint undo_no)/* in: undo number */
{
trx_undo_inf_t* cell;
- ulint n_used;
- ulint n;
ulint i;
- n_used = arr->n_used;
- n = 0;
-
for (i = 0;; i++) {
cell = trx_undo_arr_get_nth_info(arr, i);
diff --git a/storage/innobase/trx/trx0sys.c b/storage/innobase/trx/trx0sys.c
index f732aca93f5..137771b71ed 100644
--- a/storage/innobase/trx/trx0sys.c
+++ b/storage/innobase/trx/trx0sys.c
@@ -165,7 +165,9 @@ trx_sys_create_doublewrite_buf(void)
{
page_t* page;
page_t* page2;
+#ifdef UNIV_SYNC_DEBUG
page_t* new_page;
+#endif /* UNIV_SYNC_DEBUG */
byte* doublewrite;
byte* fseg_header;
ulint page_no;
@@ -271,8 +273,11 @@ start_again:
the page position in the tablespace, then the page
has not been written to in doublewrite. */
- new_page = buf_page_get(TRX_SYS_SPACE, page_no,
- RW_X_LATCH, &mtr);
+#ifdef UNIV_SYNC_DEBUG
+ new_page =
+#endif /* UNIV_SYNC_DEBUG */
+ buf_page_get(TRX_SYS_SPACE, page_no,
+ RW_X_LATCH, &mtr);
#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(new_page, SYNC_NO_ORDER_CHECK);
#endif /* UNIV_SYNC_DEBUG */
diff --git a/storage/innobase/trx/trx0trx.c b/storage/innobase/trx/trx0trx.c
index 545226a5994..21f75e0818f 100644
--- a/storage/innobase/trx/trx0trx.c
+++ b/storage/innobase/trx/trx0trx.c
@@ -1827,7 +1827,6 @@ trx_prepare_off_kernel(
/*===================*/
trx_t* trx) /* in: transaction */
{
- page_t* update_hdr_page;
trx_rseg_t* rseg;
ibool must_flush_log = FALSE;
dulint lsn;
@@ -1863,7 +1862,7 @@ trx_prepare_off_kernel(
}
if (trx->update_undo) {
- update_hdr_page = trx_undo_set_state_at_prepare(
+ trx_undo_set_state_at_prepare(
trx, trx->update_undo, &mtr);
}
diff --git a/storage/innobase/trx/trx0undo.c b/storage/innobase/trx/trx0undo.c
index deb6c85e6e3..329565943c8 100644
--- a/storage/innobase/trx/trx0undo.c
+++ b/storage/innobase/trx/trx0undo.c
@@ -1012,14 +1012,11 @@ trx_undo_truncate_end(
ulint last_page_no;
trx_undo_rec_t* rec;
trx_undo_rec_t* trunc_here;
- trx_rseg_t* rseg;
mtr_t mtr;
ut_ad(mutex_own(&(trx->undo_mutex)));
ut_ad(mutex_own(&(trx->rseg->mutex)));
- rseg = trx->rseg;
-
for (;;) {
mtr_start(&mtr);
@@ -1755,21 +1752,11 @@ trx_undo_set_state_at_finish(
if (undo->size == 1
&& mach_read_from_2(page_hdr + TRX_UNDO_PAGE_FREE)
- < TRX_UNDO_PAGE_REUSE_LIMIT) {
+ < TRX_UNDO_PAGE_REUSE_LIMIT
+ && UT_LIST_GET_LEN(rseg->update_undo_list) < 500
+ && UT_LIST_GET_LEN(rseg->insert_undo_list) < 500) {
- /* This is a heuristic to avoid the problem of all UNDO
- slots ending up in one of the UNDO lists. Previously if
- the server crashed with all the slots in one of the lists,
- transactions that required the slots of a different type
- would fail for lack of slots. */
-
- if (UT_LIST_GET_LEN(rseg->update_undo_list) < 500
- && UT_LIST_GET_LEN(rseg->insert_undo_list) < 500) {
-
- state = TRX_UNDO_CACHED;
- } else {
- state = TRX_UNDO_TO_FREE;
- }
+ state = TRX_UNDO_CACHED;
} else if (undo->type == TRX_UNDO_INSERT) {
@@ -1798,7 +1785,6 @@ trx_undo_set_state_at_prepare(
mtr_t* mtr) /* in: mtr */
{
trx_usegf_t* seg_hdr;
- trx_upagef_t* page_hdr;
trx_ulogf_t* undo_header;
page_t* undo_page;
ulint offset;
@@ -1815,7 +1801,6 @@ trx_undo_set_state_at_prepare(
undo_page = trx_undo_page_get(undo->space, undo->hdr_page_no, mtr);
seg_hdr = undo_page + TRX_UNDO_SEG_HDR;
- page_hdr = undo_page + TRX_UNDO_PAGE_HDR;
/*------------------------------*/
undo->state = TRX_UNDO_PREPARED;
diff --git a/storage/innodb_plugin/CMakeLists.txt b/storage/innodb_plugin/CMakeLists.txt
index 87318ceec78..6dfac4e52cb 100644
--- a/storage/innodb_plugin/CMakeLists.txt
+++ b/storage/innodb_plugin/CMakeLists.txt
@@ -16,9 +16,6 @@
# This is the CMakeLists for InnoDB Plugin
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-
# Starting at 5.1.38, MySQL CMake files are simplified. But the plugin
# CMakeLists.txt still needs to work with previous versions of MySQL.
IF (MYSQL_VERSION_ID GREATER "50137")
@@ -40,12 +37,19 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/zlib
${CMAKE_SOURCE_DIR}/extra/yassl/include)
-# Removing compiler optimizations for innodb/mem/* files on 64-bit Windows
-# due to 64-bit compiler error, See MySQL Bug #19424, #36366, #34297
-IF (MSVC AND $(WIN64))
- SET_SOURCE_FILES_PROPERTIES(mem/mem0mem.c mem/mem0pool.c
- PROPERTIES COMPILE_FLAGS -Od)
-ENDIF (MSVC AND $(WIN64))
+IF(MSVC)
+ # Removing compiler optimizations for innodb/mem/* files on 64-bit Windows
+ # due to 64-bit compiler error, See MySQL Bug #19424, #36366, #34297
+ IF(CMAKE_SIZEOF_VOID_P MATCHES 8)
+ SET_SOURCE_FILES_PROPERTIES(mem/mem0mem.c mem/mem0pool.c
+ PROPERTIES COMPILE_FLAGS -Od)
+ ENDIF()
+ # Avoid "unreferenced label" warning in generated file
+ SET_SOURCE_FILES_PROPERTIES(pars/pars0grm.c
+ PROPERTIES COMPILE_FLAGS "/wd4102")
+ SET_SOURCE_FILES_PROPERTIES(pars/lexyy.c
+ PROPERTIES COMPILE_FLAGS "/wd4003")
+ENDIF()
SET(INNODB_PLUGIN_SOURCES btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c btr/btr0sea.c
buf/buf0buddy.c buf/buf0buf.c buf/buf0flu.c buf/buf0lru.c buf/buf0rea.c
diff --git a/storage/innodb_plugin/ChangeLog b/storage/innodb_plugin/ChangeLog
index 43f87a1baf5..0cd8ac8a7e6 100644
--- a/storage/innodb_plugin/ChangeLog
+++ b/storage/innodb_plugin/ChangeLog
@@ -1,7 +1,73 @@
+2010-10-24 The InnoDB Team
+
+ * row/row0mysql.c
+ Fix Bug #57700 Latching order violation in
+ row_truncate_table_for_mysql()
+
+2010-10-20 The InnoDB Team
+
+ * dict/dict0load.c
+ Fix Bug #57616 Sig 11 in dict_load_table() when failed to load
+ index or foreign key
+
+2010-10-19 The InnoDB Team
+
+ * btr/btr0cur.c, buf/buf0buf.c, buf/buf0flu.c, handler/ha_innodb.cc,
+ ibuf/ibuf0ibuf.c, include/btr0cur.h, include/buf0flu.h,
+ include/ibuf0ibuf.h, include/row0mysql.h,
+ row/row0mysql.c, row/row0sel.c,
+ innodb_bug56680.test, innodb_bug56680.result:
+ Fix Bug #56680 InnoDB may return wrong results from a
+ case-insensitive covering index
+
+2010-10-18 The InnoDB Team
+
+ * handler/ha_innodb.cc, handler/ha_innodb.h, innodb_bug57252.result,
+ innodb_bug57252.test:
+ Fix Bug#57252 disabling innobase_stats_on_metadata disables ANALYZE
+
+2010-10-14 The InnoDB Team
+
+ * handler/ha_innodb.cc, innodb_bug56143.result, innodb_bug56143.test:
+ Fix Bug#56143 too many foreign keys causes output of show create
+ table to become invalid
+
+2010-10-14 The InnoDB Team
+
+ * srv/srv0start.c:
+ Fix Bug#57397 io_handler_thread() will never cleanup
+
+2010-10-11 The InnoDB Team
+
+ * row/row0sel.c
+ Fix Bug #57345 btr_pcur_store_position abort for load with
+ concurrent lock/unlock tables
+
+2010-10-11 The InnoDB Team
+
+ * row/row0mysql.c, innodb_bug56947.result, innodb_bug56947.test:
+ Fix Bug #56947 InnoDB leaks memory when failing to create a table
+
+2010-10-06 The InnoDB Team
+
+ * row/row0mysql.c, innodb_bug57255.result, innodb_bug57255.test
+ Fix Bug #57255 Cascade Delete results in "Got error -1 from
+ storage engine"
+
+2010-09-27 The InnoDB Team
+
+ * row/row0sel.c, innodb_bug56716.result, innodb_bug56716.test:
+ Fix Bug#56716 InnoDB locks a record gap without locking the table
+
+2010-09-06 The InnoDB Team
+
+ * dict/dict0load.c, innodb_bug53756.test innodb_bug53756.result:
+ Fix Bug#53756 ALTER TABLE ADD PRIMARY KEY affects crash recovery
+
2010-08-24 The InnoDB Team
* handler/ha_innodb.c, dict/dict0dict.c:
- Fix Bug #55832 selects crash too easily when innodb_force_recovery>3
+ Fix Bug#55832 selects crash too easily when innodb_force_recovery>3
2010-08-03 The InnoDB Team
@@ -19,15 +85,14 @@
2010-08-03 The InnoDB Team
* include/ut0mem.h, ut/ut0mem.c:
- Fix Bug #55627 segv in ut_free pars_lexer_close innobase_shutdown
+ Fix Bug#55627 segv in ut_free pars_lexer_close innobase_shutdown
innodb-use-sys-malloc=0
2010-08-01 The InnoDB Team
- * handler/ha_innodb.cc
- Fix Bug #55382 Assignment with SELECT expressions takes unexpected
+ * handler/ha_innodb.cc:
+ Fix Bug#55382 Assignment with SELECT expressions takes unexpected
S locks in READ COMMITTED
->>>>>>> MERGE-SOURCE
2010-07-27 The InnoDB Team
@@ -48,8 +113,8 @@
2010-06-29 The InnoDB Team
- * btr/btr0cur.c, include/btr0cur.h,
- include/row0mysql.h, row/row0merge.c, row/row0sel.c:
+ * btr/btr0cur.c, include/btr0cur.h, include/row0mysql.h,
+ row/row0merge.c, row/row0sel.c:
Fix Bug#54358 READ UNCOMMITTED access failure of off-page DYNAMIC
or COMPRESSED columns
diff --git a/storage/innodb_plugin/Makefile.am b/storage/innodb_plugin/Makefile.am
index 1bed796f0d4..846a6acef36 100644
--- a/storage/innodb_plugin/Makefile.am
+++ b/storage/innodb_plugin/Makefile.am
@@ -228,9 +228,8 @@ noinst_HEADERS= \
include/ut0wqueue.h \
mem/mem0dbg.c
-EXTRA_LIBRARIES= libinnobase.a
-noinst_LIBRARIES= @plugin_innodb_plugin_static_target@
-libinnobase_a_SOURCES= \
+noinst_LTLIBRARIES= @plugin_innodb_plugin_static_target@
+libinnobase_la_SOURCES= \
btr/btr0btr.c \
btr/btr0cur.c \
btr/btr0pcur.c \
@@ -325,20 +324,17 @@ libinnobase_a_SOURCES= \
ut/ut0vec.c \
ut/ut0wqueue.c
-libinnobase_a_CXXFLAGS= $(AM_CXXFLAGS)
-libinnobase_a_CFLAGS= $(AM_CFLAGS)
+libinnobase_la_CXXFLAGS= $(AM_CXXFLAGS)
+libinnobase_la_CFLAGS= $(AM_CFLAGS)
-EXTRA_LTLIBRARIES= ha_innodb_plugin.la
+EXTRA_LTLIBRARIES= libinnobase.la ha_innodb_plugin.la
pkgplugin_LTLIBRARIES= @plugin_innodb_plugin_shared_target@
ha_innodb_plugin_la_LDFLAGS= -module -rpath $(pkgplugindir) -L$(top_builddir)/libservices -lmysqlservices
ha_innodb_plugin_la_CXXFLAGS= -shared $(AM_CXXFLAGS) $(INNODB_DYNAMIC_CFLAGS)
ha_innodb_plugin_la_CFLAGS= -shared $(AM_CFLAGS) $(INNODB_DYNAMIC_CFLAGS)
-ha_innodb_plugin_la_SOURCES= $(libinnobase_a_SOURCES)
+ha_innodb_plugin_la_SOURCES= $(libinnobase_la_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/innodb_plugin/btr/btr0btr.c b/storage/innodb_plugin/btr/btr0btr.c
index 02677e0a71c..29cd470e650 100644
--- a/storage/innodb_plugin/btr/btr0btr.c
+++ b/storage/innodb_plugin/btr/btr0btr.c
@@ -1895,7 +1895,6 @@ btr_page_split_and_insert(
buf_block_t* left_block;
buf_block_t* right_block;
buf_block_t* insert_block;
- page_t* insert_page;
page_cur_t* page_cursor;
rec_t* first_rec;
byte* buf = 0; /* remove warning */
@@ -2153,8 +2152,6 @@ insert_empty:
insert_block = right_block;
}
- insert_page = buf_block_get_frame(insert_block);
-
/* 7. Reposition the cursor for insert and try insertion */
page_cursor = btr_cur_get_page_cur(cursor);
@@ -2166,8 +2163,12 @@ insert_empty:
#ifdef UNIV_ZIP_DEBUG
{
+ page_t* insert_page
+ = buf_block_get_frame(insert_block);
+
page_zip_des_t* insert_page_zip
= buf_block_get_page_zip(insert_block);
+
ut_a(!insert_page_zip
|| page_zip_validate(insert_page_zip, insert_page));
}
@@ -2560,7 +2561,6 @@ btr_compress(
ulint n_recs;
ulint max_ins_size;
ulint max_ins_size_reorg;
- ulint level;
block = btr_cur_get_block(cursor);
page = btr_cur_get_page(cursor);
@@ -2570,7 +2570,6 @@ btr_compress(
ut_ad(mtr_memo_contains(mtr, dict_index_get_lock(index),
MTR_MEMO_X_LOCK));
ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
- level = btr_page_get_level(page, mtr);
space = dict_index_get_space(index);
zip_size = dict_table_zip_size(index->table);
diff --git a/storage/innodb_plugin/btr/btr0cur.c b/storage/innodb_plugin/btr/btr0cur.c
index 8db12a0bbb8..79fe328a631 100644
--- a/storage/innodb_plugin/btr/btr0cur.c
+++ b/storage/innodb_plugin/btr/btr0cur.c
@@ -1626,7 +1626,7 @@ func_exit:
See if there is enough place in the page modification log to log
an update-in-place.
@return TRUE if enough place */
-static
+UNIV_INTERN
ibool
btr_cur_update_alloc_zip(
/*=====================*/
@@ -1836,7 +1836,6 @@ btr_cur_optimistic_update(
page_t* page;
page_zip_des_t* page_zip;
rec_t* rec;
- rec_t* orig_rec;
ulint max_size;
ulint new_rec_size;
ulint old_rec_size;
@@ -1850,7 +1849,7 @@ btr_cur_optimistic_update(
block = btr_cur_get_block(cursor);
page = buf_block_get_frame(block);
- orig_rec = rec = btr_cur_get_rec(cursor);
+ rec = btr_cur_get_rec(cursor);
index = cursor->index;
ut_ad(!!page_rec_is_comp(rec) == dict_table_is_comp(index->table));
ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
@@ -4285,12 +4284,17 @@ btr_free_externally_stored_field(
}
for (;;) {
+#ifdef UNIV_SYNC_DEBUG
buf_block_t* rec_block;
+#endif /* UNIV_SYNC_DEBUG */
buf_block_t* ext_block;
mtr_start(&mtr);
- rec_block = buf_page_get(page_get_space_id(
+#ifdef UNIV_SYNC_DEBUG
+ rec_block =
+#endif /* UNIV_SYNC_DEBUG */
+ buf_page_get(page_get_space_id(
page_align(field_ref)),
rec_zip_size,
page_get_page_no(
diff --git a/storage/innodb_plugin/btr/btr0pcur.c b/storage/innodb_plugin/btr/btr0pcur.c
index 658901208ef..056896c7927 100644
--- a/storage/innodb_plugin/btr/btr0pcur.c
+++ b/storage/innodb_plugin/btr/btr0pcur.c
@@ -452,7 +452,6 @@ btr_pcur_move_backward_from_page(
mtr_t* mtr) /*!< in: mtr */
{
ulint prev_page_no;
- ulint space;
page_t* page;
buf_block_t* prev_block;
ulint latch_mode;
@@ -488,7 +487,6 @@ btr_pcur_move_backward_from_page(
page = btr_pcur_get_page(cursor);
prev_page_no = btr_page_get_prev(page, mtr);
- space = buf_block_get_space(btr_pcur_get_block(cursor));
if (prev_page_no == FIL_NULL) {
} else if (btr_pcur_is_before_first_on_page(cursor)) {
diff --git a/storage/innodb_plugin/btr/btr0sea.c b/storage/innodb_plugin/btr/btr0sea.c
index f3ffe07a951..035fdbb61d2 100644
--- a/storage/innodb_plugin/btr/btr0sea.c
+++ b/storage/innodb_plugin/btr/btr0sea.c
@@ -1495,7 +1495,6 @@ btr_search_update_hash_on_delete(
rec_t* rec;
ulint fold;
dulint index_id;
- ibool found;
ulint offsets_[REC_OFFS_NORMAL_SIZE];
mem_heap_t* heap = NULL;
rec_offs_init(offsets_);
@@ -1528,7 +1527,7 @@ btr_search_update_hash_on_delete(
}
rw_lock_x_lock(&btr_search_latch);
- found = ha_search_and_delete_if_found(table, fold, rec);
+ ha_search_and_delete_if_found(table, fold, rec);
rw_lock_x_unlock(&btr_search_latch);
}
diff --git a/storage/innodb_plugin/buf/buf0buf.c b/storage/innodb_plugin/buf/buf0buf.c
index 660686bac1e..65d4311b840 100644
--- a/storage/innodb_plugin/buf/buf0buf.c
+++ b/storage/innodb_plugin/buf/buf0buf.c
@@ -2286,6 +2286,30 @@ wait_until_unfixed:
bytes. */
UNIV_MEM_ASSERT_RW(&block->page, sizeof block->page);
#endif
+#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
+ if (mode == BUF_GET_IF_IN_POOL && ibuf_debug) {
+ /* Try to evict the block from the buffer pool, to use the
+ insert buffer as much as possible. */
+
+ if (buf_LRU_free_block(&block->page, TRUE, NULL)
+ == BUF_LRU_FREED) {
+ buf_pool_mutex_exit();
+ mutex_exit(&block->mutex);
+ fprintf(stderr,
+ "innodb_change_buffering_debug evict %u %u\n",
+ (unsigned) space, (unsigned) offset);
+ return(NULL);
+ } else if (buf_flush_page_try(block)) {
+ fprintf(stderr,
+ "innodb_change_buffering_debug flush %u %u\n",
+ (unsigned) space, (unsigned) offset);
+ guess = block;
+ goto loop;
+ }
+
+ /* Failed to evict the page; change it directly */
+ }
+#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
buf_block_buf_fix_inc(block, file, line);
diff --git a/storage/innodb_plugin/buf/buf0flu.c b/storage/innodb_plugin/buf/buf0flu.c
index d8c0497fa1e..2123f8a060d 100644
--- a/storage/innodb_plugin/buf/buf0flu.c
+++ b/storage/innodb_plugin/buf/buf0flu.c
@@ -128,10 +128,15 @@ buf_flush_delete_from_flush_rbt(
buf_page_t* bpage) /*!< in: bpage to be removed. */
{
+#ifdef UNIV_DEBUG
ibool ret = FALSE;
+#endif /* UNIV_DEBUG */
ut_ad(buf_pool_mutex_own());
- ret = rbt_delete(buf_pool->flush_rbt, &bpage);
+#ifdef UNIV_DEBUG
+ ret =
+#endif /* UNIV_DEBUG */
+ rbt_delete(buf_pool->flush_rbt, &bpage);
ut_ad(ret);
}
@@ -1034,6 +1039,82 @@ buf_flush_write_block_low(
}
}
+# if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
+/********************************************************************//**
+Writes a flushable page asynchronously from the buffer pool to a file.
+NOTE: buf_pool_mutex and block->mutex must be held upon entering this
+function, and they will be released by this function after flushing.
+This is loosely based on buf_flush_batch() and buf_flush_page().
+@return TRUE if the page was flushed and the mutexes released */
+UNIV_INTERN
+ibool
+buf_flush_page_try(
+/*===============*/
+ buf_block_t* block) /*!< in/out: buffer control block */
+{
+ ut_ad(buf_pool_mutex_own());
+ ut_ad(buf_block_get_state(block) == BUF_BLOCK_FILE_PAGE);
+ ut_ad(mutex_own(&block->mutex));
+
+ if (!buf_flush_ready_for_flush(&block->page, BUF_FLUSH_LRU)) {
+ return(FALSE);
+ }
+
+ if (buf_pool->n_flush[BUF_FLUSH_LRU] > 0
+ || buf_pool->init_flush[BUF_FLUSH_LRU]) {
+ /* There is already a flush batch of the same type running */
+ return(FALSE);
+ }
+
+ buf_pool->init_flush[BUF_FLUSH_LRU] = TRUE;
+
+ buf_page_set_io_fix(&block->page, BUF_IO_WRITE);
+
+ buf_page_set_flush_type(&block->page, BUF_FLUSH_LRU);
+
+ if (buf_pool->n_flush[BUF_FLUSH_LRU]++ == 0) {
+
+ os_event_reset(buf_pool->no_flush[BUF_FLUSH_LRU]);
+ }
+
+ /* VERY IMPORTANT:
+ Because any thread may call the LRU flush, even when owning
+ locks on pages, to avoid deadlocks, we must make sure that the
+ s-lock is acquired on the page without waiting: this is
+ accomplished because buf_flush_ready_for_flush() must hold,
+ and that requires the page not to be bufferfixed. */
+
+ rw_lock_s_lock_gen(&block->lock, BUF_IO_WRITE);
+
+ /* Note that the s-latch is acquired before releasing the
+ buf_pool mutex: this ensures that the latch is acquired
+ immediately. */
+
+ mutex_exit(&block->mutex);
+ buf_pool_mutex_exit();
+
+ /* Even though block is not protected by any mutex at this
+ point, it is safe to access block, because it is io_fixed and
+ oldest_modification != 0. Thus, it cannot be relocated in the
+ buffer pool or removed from flush_list or LRU_list. */
+
+ buf_flush_write_block_low(&block->page);
+
+ buf_pool_mutex_enter();
+ buf_pool->init_flush[BUF_FLUSH_LRU] = FALSE;
+
+ if (buf_pool->n_flush[BUF_FLUSH_LRU] == 0) {
+ /* The running flush batch has ended */
+ os_event_set(buf_pool->no_flush[BUF_FLUSH_LRU]);
+ }
+
+ buf_pool_mutex_exit();
+ buf_flush_buffered_writes();
+
+ return(TRUE);
+}
+# endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
+
/********************************************************************//**
Writes a flushable page asynchronously from the buffer pool to a file.
NOTE: in simulated aio we must call
@@ -1266,7 +1347,6 @@ buf_flush_batch(
{
buf_page_t* bpage;
ulint page_count = 0;
- ulint old_page_count;
ulint space;
ulint offset;
@@ -1338,15 +1418,9 @@ flush_next:
buf_pool_mutex_exit();
- old_page_count = page_count;
-
/* Try to flush also all the neighbors */
page_count += buf_flush_try_neighbors(
space, offset, flush_type);
- /* fprintf(stderr,
- "Flush type %lu, page no %lu, neighb %lu\n",
- flush_type, offset,
- page_count - old_page_count); */
buf_pool_mutex_enter();
goto flush_next;
diff --git a/storage/innodb_plugin/dict/dict0crea.c b/storage/innodb_plugin/dict/dict0crea.c
index 09353c45c8c..e63f8bc3e6a 100644
--- a/storage/innodb_plugin/dict/dict0crea.c
+++ b/storage/innodb_plugin/dict/dict0crea.c
@@ -627,7 +627,6 @@ dict_create_index_tree_step(
{
dict_index_t* index;
dict_table_t* sys_indexes;
- dict_table_t* table;
dtuple_t* search_tuple;
ulint zip_size;
btr_pcur_t pcur;
@@ -636,7 +635,6 @@ dict_create_index_tree_step(
ut_ad(mutex_own(&(dict_sys->mutex)));
index = node->index;
- table = node->table;
sys_indexes = dict_sys->sys_indexes;
diff --git a/storage/innodb_plugin/dict/dict0dict.c b/storage/innodb_plugin/dict/dict0dict.c
index 560534345f9..a3575c283cd 100644
--- a/storage/innodb_plugin/dict/dict0dict.c
+++ b/storage/innodb_plugin/dict/dict0dict.c
@@ -4441,7 +4441,6 @@ dict_index_print_low(
{
ib_int64_t n_vals;
ulint i;
- const char* type_string;
ut_ad(mutex_own(&(dict_sys->mutex)));
@@ -4456,14 +4455,6 @@ dict_index_print_low(
dict_index_stat_mutex_exit(index);
- if (dict_index_is_clust(index)) {
- type_string = "clustered index";
- } else if (dict_index_is_unique(index)) {
- type_string = "unique index";
- } else {
- type_string = "secondary index";
- }
-
fprintf(stderr,
" INDEX: name %s, id %lu %lu, fields %lu/%lu,"
" uniq %lu, type %lu\n"
diff --git a/storage/innodb_plugin/dict/dict0load.c b/storage/innodb_plugin/dict/dict0load.c
index 3acc267308f..3dcee46b92c 100644
--- a/storage/innodb_plugin/dict/dict0load.c
+++ b/storage/innodb_plugin/dict/dict0load.c
@@ -1023,13 +1023,13 @@ err_exit:
if (err != DB_SUCCESS) {
dict_table_remove_from_cache(table);
table = NULL;
+ } else {
+ table->fk_max_recusive_level = 0;
}
} else if (!srv_force_recovery) {
dict_table_remove_from_cache(table);
table = NULL;
}
-
- table->fk_max_recusive_level = 0;
#if 0
if (err != DB_SUCCESS && table != NULL) {
@@ -1083,6 +1083,8 @@ dict_load_table_on_id(
ut_ad(mutex_own(&(dict_sys->mutex)));
+ table = NULL;
+
/* NOTE that the operation of this function is protected by
the dictionary mutex, and therefore no deadlocks can occur
with other dictionary operations. */
@@ -1109,15 +1111,17 @@ dict_load_table_on_id(
BTR_SEARCH_LEAF, &pcur, &mtr);
rec = btr_pcur_get_rec(&pcur);
- if (!btr_pcur_is_on_user_rec(&pcur)
- || rec_get_deleted_flag(rec, 0)) {
+ if (!btr_pcur_is_on_user_rec(&pcur)) {
/* Not found */
+ goto func_exit;
+ }
- btr_pcur_close(&pcur);
- mtr_commit(&mtr);
- mem_heap_free(heap);
-
- return(NULL);
+ /* Find the first record that is not delete marked */
+ while (rec_get_deleted_flag(rec, 0)) {
+ if (!btr_pcur_move_to_next_user_rec(&pcur, &mtr)) {
+ goto func_exit;
+ }
+ rec = btr_pcur_get_rec(&pcur);
}
/*---------------------------------------------------*/
@@ -1130,19 +1134,14 @@ dict_load_table_on_id(
/* Check if the table id in record is the one searched for */
if (ut_dulint_cmp(table_id, mach_read_from_8(field)) != 0) {
-
- btr_pcur_close(&pcur);
- mtr_commit(&mtr);
- mem_heap_free(heap);
-
- return(NULL);
+ goto func_exit;
}
/* Now we get the table name from the record */
field = rec_get_nth_field_old(rec, 1, &len);
/* Load the table definition to memory */
table = dict_load_table(mem_heap_strdupl(heap, (char*) field, len));
-
+func_exit:
btr_pcur_close(&pcur);
mtr_commit(&mtr);
mem_heap_free(heap);
diff --git a/storage/innodb_plugin/eval/eval0eval.c b/storage/innodb_plugin/eval/eval0eval.c
index 589b0fa1576..dcd416adeee 100644
--- a/storage/innodb_plugin/eval/eval0eval.c
+++ b/storage/innodb_plugin/eval/eval0eval.c
@@ -384,18 +384,13 @@ eval_notfound(
/*==========*/
func_node_t* func_node) /*!< in: function node */
{
- que_node_t* arg1;
- que_node_t* arg2;
sym_node_t* cursor;
sel_node_t* sel_node;
ibool ibool_val;
- arg1 = func_node->args;
- arg2 = que_node_get_next(arg1);
-
ut_ad(func_node->func == PARS_NOTFOUND_TOKEN);
- cursor = arg1;
+ cursor = func_node->args;
ut_ad(que_node_get_type(cursor) == QUE_NODE_SYMBOL);
diff --git a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc
index a865d2ba3de..9715cb54d2c 100644
--- a/storage/innodb_plugin/handler/ha_innodb.cc
+++ b/storage/innodb_plugin/handler/ha_innodb.cc
@@ -4432,17 +4432,18 @@ include_field:
n_requested_fields++;
templ->col_no = i;
+ templ->clust_rec_field_no = dict_col_get_clust_pos(
+ &index->table->cols[i], clust_index);
+ ut_ad(templ->clust_rec_field_no != ULINT_UNDEFINED);
if (index == clust_index) {
- templ->rec_field_no = dict_col_get_clust_pos(
- &index->table->cols[i], index);
+ templ->rec_field_no = templ->clust_rec_field_no;
} else {
templ->rec_field_no = dict_index_get_nth_col_pos(
index, i);
- }
-
- if (templ->rec_field_no == ULINT_UNDEFINED) {
- prebuilt->need_to_access_clustered = TRUE;
+ if (templ->rec_field_no == ULINT_UNDEFINED) {
+ prebuilt->need_to_access_clustered = TRUE;
+ }
}
if (field->null_ptr) {
@@ -4494,9 +4495,7 @@ skip_field:
for (i = 0; i < n_requested_fields; i++) {
templ = prebuilt->mysql_template + i;
- templ->rec_field_no = dict_col_get_clust_pos(
- &index->table->cols[templ->col_no],
- clust_index);
+ templ->rec_field_no = templ->clust_rec_field_no;
}
}
}
@@ -6376,8 +6375,8 @@ create_options_are_valid(
? "COMPRESSED"
: "DYNAMIC";
- /* These two ROW_FORMATs require
- srv_file_per_table and srv_file_format */
+ /* These two ROW_FORMATs require srv_file_per_table
+ and srv_file_format > Antelope */
if (!srv_file_per_table) {
push_warning_printf(
thd,
@@ -6387,7 +6386,6 @@ create_options_are_valid(
" requires innodb_file_per_table.",
row_format_name);
ret = FALSE;
-
}
if (srv_file_format < DICT_TF_FORMAT_ZIP) {
@@ -6586,6 +6584,8 @@ ha_innobase::create(
ulint ssize, ksize;
ulint key_block_size = create_info->key_block_size;
+ /* Set 'flags' to the correct key_block_size.
+ It will be zero if key_block_size is an invalid number.*/
for (ssize = ksize = 1; ssize <= DICT_TF_ZSSIZE_MAX;
ssize++, ksize <<= 1) {
if (key_block_size == ksize) {
@@ -6626,10 +6626,10 @@ ha_innobase::create(
row_type = form->s->row_type;
if (flags) {
- /* KEY_BLOCK_SIZE was specified. */
- if (!(create_info->used_fields & HA_CREATE_USED_ROW_FORMAT)) {
- /* ROW_FORMAT was not specified;
- default to ROW_FORMAT=COMPRESSED */
+ /* if KEY_BLOCK_SIZE was specified on this statement and
+ ROW_FORMAT was not, automatically change ROW_FORMAT to COMPRESSED.*/
+ if ( (create_info->used_fields & HA_CREATE_USED_KEY_BLOCK_SIZE)
+ && !(create_info->used_fields & HA_CREATE_USED_ROW_FORMAT)) {
row_type = ROW_TYPE_COMPRESSED;
} else if (row_type != ROW_TYPE_COMPRESSED) {
/* ROW_FORMAT other than COMPRESSED
@@ -6648,7 +6648,7 @@ ha_innobase::create(
flags = 0;
}
} else {
- /* No KEY_BLOCK_SIZE */
+ /* flags == 0 means no KEY_BLOCK_SIZE.*/
if (row_type == ROW_TYPE_COMPRESSED) {
/* ROW_FORMAT=COMPRESSED without
KEY_BLOCK_SIZE implies half the
@@ -7028,7 +7028,6 @@ innobase_drop_database(
ulint len = 0;
trx_t* trx;
char* ptr;
- int error;
char* namebuf;
THD* thd = current_thd;
@@ -7071,7 +7070,7 @@ innobase_drop_database(
#else
trx = innobase_trx_allocate(thd);
#endif
- error = row_drop_database_for_mysql(namebuf, trx);
+ row_drop_database_for_mysql(namebuf, trx);
my_free(namebuf, MYF(0));
/* Flush the log to reduce probability that the .frm files and
@@ -7524,9 +7523,12 @@ Returns statistics information of the table to the MySQL interpreter,
in various fields of the handle object. */
UNIV_INTERN
int
-ha_innobase::info(
-/*==============*/
- uint flag) /*!< in: what information MySQL requests */
+ha_innobase::info_low(
+/*==================*/
+ uint flag, /*!< in: what information MySQL
+ requests */
+ bool called_from_analyze) /* in: TRUE if called from
+ ::analyze() */
{
dict_table_t* ib_table;
dict_index_t* index;
@@ -7557,7 +7559,7 @@ ha_innobase::info(
ib_table = prebuilt->table;
if (flag & HA_STATUS_TIME) {
- if (innobase_stats_on_metadata) {
+ if (called_from_analyze || innobase_stats_on_metadata) {
/* In sql_show we call with this flag: update
then statistics so that they are up-to-date */
@@ -7805,6 +7807,18 @@ func_exit:
DBUG_RETURN(0);
}
+/*********************************************************************//**
+Returns statistics information of the table to the MySQL interpreter,
+in various fields of the handle object. */
+UNIV_INTERN
+int
+ha_innobase::info(
+/*==============*/
+ uint flag) /*!< in: what information MySQL requests */
+{
+ return(info_low(flag, false /* not called from analyze */));
+}
+
/**********************************************************************//**
Updates index cardinalities of the table, based on 8 random dives into
each index tree. This does NOT calculate exact statistics on the table.
@@ -7817,7 +7831,8 @@ ha_innobase::analyze(
HA_CHECK_OPT* check_opt) /*!< in: currently ignored */
{
/* Simply call ::info() with all the flags */
- info(HA_STATUS_TIME | HA_STATUS_CONST | HA_STATUS_VARIABLE);
+ info_low(HA_STATUS_TIME | HA_STATUS_CONST | HA_STATUS_VARIABLE,
+ true /* called from analyze */);
return(0);
}
@@ -8118,8 +8133,6 @@ ha_innobase::get_foreign_key_create_info(void)
flen = ftell(srv_dict_tmpfile);
if (flen < 0) {
flen = 0;
- } else if (flen > 64000 - 1) {
- flen = 64000 - 1;
}
/* allocate buffer for the string, and
@@ -8869,12 +8882,9 @@ innodb_show_status(
mutex_exit(&srv_monitor_file_mutex);
- bool result = FALSE;
+ stat_print(thd, innobase_hton_name, (uint) strlen(innobase_hton_name),
+ STRING_WITH_LEN(""), str, flen);
- if (stat_print(thd, innobase_hton_name, (uint) strlen(innobase_hton_name),
- STRING_WITH_LEN(""), str, flen)) {
- result= TRUE;
- }
my_free(str, MYF(0));
DBUG_RETURN(FALSE);
@@ -9414,7 +9424,11 @@ ha_innobase::innobase_peek_autoinc(void)
auto_inc = dict_table_autoinc_read(innodb_table);
- ut_a(auto_inc > 0);
+ if (auto_inc == 0) {
+ ut_print_timestamp(stderr);
+ fprintf(stderr, " InnoDB: AUTOINC next value generation "
+ "is disabled for '%s'\n", innodb_table->name);
+ }
dict_table_autoinc_unlock(innodb_table);
@@ -10931,6 +10945,13 @@ static MYSQL_SYSVAR_STR(change_buffering, innobase_change_buffering,
innodb_change_buffering_validate,
innodb_change_buffering_update, "inserts");
+#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
+static MYSQL_SYSVAR_UINT(change_buffering_debug, ibuf_debug,
+ PLUGIN_VAR_RQCMDARG,
+ "Debug flags for InnoDB change buffering (0=none)",
+ NULL, NULL, 0, 0, 1, 0);
+#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
+
static MYSQL_SYSVAR_ULONG(read_ahead_threshold, srv_read_ahead_threshold,
PLUGIN_VAR_RQCMDARG,
"Number of pages that must be accessed sequentially for InnoDB to "
@@ -10991,6 +11012,9 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
MYSQL_SYSVAR(version),
MYSQL_SYSVAR(use_sys_malloc),
MYSQL_SYSVAR(change_buffering),
+#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
+ MYSQL_SYSVAR(change_buffering_debug),
+#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
MYSQL_SYSVAR(read_ahead_threshold),
MYSQL_SYSVAR(io_capacity),
NULL
diff --git a/storage/innodb_plugin/handler/ha_innodb.h b/storage/innodb_plugin/handler/ha_innodb.h
index 9789e4ba639..7a8f29853de 100644
--- a/storage/innodb_plugin/handler/ha_innodb.h
+++ b/storage/innodb_plugin/handler/ha_innodb.h
@@ -109,6 +109,7 @@ class ha_innobase: public handler
ulint innobase_update_autoinc(ulonglong auto_inc);
void innobase_initialize_autoinc();
dict_index_t* innobase_get_index(uint keynr);
+ int info_low(uint flag, bool called_from_analyze);
/* Init values for the class: */
public:
diff --git a/storage/innodb_plugin/handler/i_s.cc b/storage/innodb_plugin/handler/i_s.cc
index 524fe696de2..9ad2d656365 100644
--- a/storage/innodb_plugin/handler/i_s.cc
+++ b/storage/innodb_plugin/handler/i_s.cc
@@ -1012,6 +1012,7 @@ trx_i_s_common_fill_table(
deadlock occurs between the mysqld server and mysql client,
see http://bugs.mysql.com/29900 ; when that bug is resolved
we can enable the DBUG_RETURN(ret) above */
+ ret++; // silence a gcc46 warning
DBUG_RETURN(0);
#endif
}
diff --git a/storage/innodb_plugin/ibuf/ibuf0ibuf.c b/storage/innodb_plugin/ibuf/ibuf0ibuf.c
index 5e9b4b27611..701e8f0ef04 100644
--- a/storage/innodb_plugin/ibuf/ibuf0ibuf.c
+++ b/storage/innodb_plugin/ibuf/ibuf0ibuf.c
@@ -49,6 +49,7 @@ Created 7/19/1997 Heikki Tuuri
#include "btr0cur.h"
#include "btr0pcur.h"
#include "btr0btr.h"
+#include "row0upd.h"
#include "sync0sync.h"
#include "dict0boot.h"
#include "fut0lst.h"
@@ -170,6 +171,11 @@ access order rules. */
/** Operations that can currently be buffered. */
UNIV_INTERN ibuf_use_t ibuf_use = IBUF_USE_INSERT;
+#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
+/** Flag to control insert buffer debugging. */
+UNIV_INTERN uint ibuf_debug;
+#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
+
/** The insert buffer control structure */
UNIV_INTERN ibuf_t* ibuf = NULL;
@@ -2881,9 +2887,80 @@ During merge, inserts to an index page a secondary index entry extracted
from the insert buffer. */
static
void
+ibuf_insert_to_index_page_low(
+/*==========================*/
+ const dtuple_t* entry, /*!< in: buffered entry to insert */
+ buf_block_t* block, /*!< in/out: index page where the buffered
+ entry should be placed */
+ dict_index_t* index, /*!< in: record descriptor */
+ mtr_t* mtr, /*!< in/out: mtr */
+ page_cur_t* page_cur)/*!< in/out: cursor positioned on the record
+ after which to insert the buffered entry */
+{
+ const page_t* page;
+ ulint space;
+ ulint page_no;
+ ulint zip_size;
+ const page_t* bitmap_page;
+ ulint old_bits;
+
+ if (UNIV_LIKELY
+ (page_cur_tuple_insert(page_cur, entry, index, 0, mtr) != NULL)) {
+ return;
+ }
+
+ /* If the record did not fit, reorganize */
+
+ btr_page_reorganize(block, index, mtr);
+ page_cur_search(block, index, entry, PAGE_CUR_LE, page_cur);
+
+ /* This time the record must fit */
+
+ if (UNIV_LIKELY
+ (page_cur_tuple_insert(page_cur, entry, index, 0, mtr) != NULL)) {
+ return;
+ }
+
+ page = buf_block_get_frame(block);
+
+ ut_print_timestamp(stderr);
+
+ fprintf(stderr,
+ " InnoDB: Error: Insert buffer insert fails;"
+ " page free %lu, dtuple size %lu\n",
+ (ulong) page_get_max_insert_size(page, 1),
+ (ulong) rec_get_converted_size(index, entry, 0));
+ fputs("InnoDB: Cannot insert index record ", stderr);
+ dtuple_print(stderr, entry);
+ fputs("\nInnoDB: The table where this index record belongs\n"
+ "InnoDB: is now probably corrupt. Please run CHECK TABLE on\n"
+ "InnoDB: that table.\n", stderr);
+
+ space = page_get_space_id(page);
+ zip_size = buf_block_get_zip_size(block);
+ page_no = page_get_page_no(page);
+
+ bitmap_page = ibuf_bitmap_get_map_page(space, page_no, zip_size, mtr);
+ old_bits = ibuf_bitmap_page_get_bits(bitmap_page, page_no, zip_size,
+ IBUF_BITMAP_FREE, mtr);
+
+ fprintf(stderr,
+ "InnoDB: space %lu, page %lu, zip_size %lu, bitmap bits %lu\n",
+ (ulong) space, (ulong) page_no,
+ (ulong) zip_size, (ulong) old_bits);
+
+ fputs("InnoDB: Submit a detailed bug report"
+ " to http://bugs.mysql.com\n", stderr);
+}
+
+/************************************************************************
+During merge, inserts to an index page a secondary index entry extracted
+from the insert buffer. */
+static
+void
ibuf_insert_to_index_page(
/*======================*/
- dtuple_t* entry, /*!< in: buffered entry to insert */
+ const dtuple_t* entry, /*!< in: buffered entry to insert */
buf_block_t* block, /*!< in/out: index page where the buffered entry
should be placed */
dict_index_t* index, /*!< in: record descriptor */
@@ -2893,11 +2970,10 @@ ibuf_insert_to_index_page(
ulint low_match;
page_t* page = buf_block_get_frame(block);
rec_t* rec;
- page_t* bitmap_page;
- ulint old_bits;
ut_ad(ibuf_inside());
ut_ad(dtuple_check_typed(entry));
+ ut_ad(!buf_block_align(page)->is_hashed);
if (UNIV_UNLIKELY(dict_table_is_comp(index->table)
!= (ibool)!!page_is_comp(page))) {
@@ -2935,71 +3011,86 @@ dump:
low_match = page_cur_search(block, index, entry,
PAGE_CUR_LE, &page_cur);
- if (low_match == dtuple_get_n_fields(entry)) {
+ if (UNIV_UNLIKELY(low_match == dtuple_get_n_fields(entry))) {
+ mem_heap_t* heap;
+ upd_t* update;
+ ulint* offsets;
page_zip_des_t* page_zip;
rec = page_cur_get_rec(&page_cur);
- page_zip = buf_block_get_page_zip(block);
- btr_cur_del_unmark_for_ibuf(rec, page_zip, mtr);
- } else {
- rec = page_cur_tuple_insert(&page_cur, entry, index, 0, mtr);
+ /* This is based on
+ row_ins_sec_index_entry_by_modify(BTR_MODIFY_LEAF). */
+ ut_ad(rec_get_deleted_flag(rec, page_is_comp(page)));
- if (UNIV_LIKELY(rec != NULL)) {
+ heap = mem_heap_create(1024);
+
+ offsets = rec_get_offsets(rec, index, NULL, ULINT_UNDEFINED,
+ &heap);
+ update = row_upd_build_sec_rec_difference_binary(
+ index, entry, rec, NULL, heap);
+
+ page_zip = buf_block_get_page_zip(block);
+
+ if (update->n_fields == 0) {
+ /* The records only differ in the delete-mark.
+ Clear the delete-mark, like we did before
+ Bug #56680 was fixed. */
+ btr_cur_del_unmark_for_ibuf(rec, page_zip, mtr);
+updated_in_place:
+ mem_heap_free(heap);
return;
}
- /* If the record did not fit, reorganize */
-
- btr_page_reorganize(block, index, mtr);
- page_cur_search(block, index, entry, PAGE_CUR_LE, &page_cur);
+ /* Copy the info bits. Clear the delete-mark. */
+ update->info_bits = rec_get_info_bits(rec, page_is_comp(page));
+ update->info_bits &= ~REC_INFO_DELETED_FLAG;
+
+ /* We cannot invoke btr_cur_optimistic_update() here,
+ because we do not have a btr_cur_t or que_thr_t,
+ as the insert buffer merge occurs at a very low level. */
+ if (!row_upd_changes_field_size_or_external(index, offsets,
+ update)
+ && (!page_zip || btr_cur_update_alloc_zip(
+ page_zip, block, index,
+ rec_offs_size(offsets), FALSE, mtr))) {
+ /* This is the easy case. Do something similar
+ to btr_cur_update_in_place(). */
+ row_upd_rec_in_place(rec, index, offsets,
+ update, page_zip);
+ goto updated_in_place;
+ }
- /* This time the record must fit */
- if (UNIV_UNLIKELY
- (!page_cur_tuple_insert(&page_cur, entry, index,
- 0, mtr))) {
- ulint space;
- ulint page_no;
- ulint zip_size;
+ /* A collation may identify values that differ in
+ storage length.
+ Some examples (1 or 2 bytes):
+ utf8_turkish_ci: I = U+0131 LATIN SMALL LETTER DOTLESS I
+ utf8_general_ci: S = U+00DF LATIN SMALL LETTER SHARP S
+ utf8_general_ci: A = U+00E4 LATIN SMALL LETTER A WITH DIAERESIS
- ut_print_timestamp(stderr);
+ latin1_german2_ci: SS = U+00DF LATIN SMALL LETTER SHARP S
- fprintf(stderr,
- " InnoDB: Error: Insert buffer insert"
- " fails; page free %lu,"
- " dtuple size %lu\n",
- (ulong) page_get_max_insert_size(
- page, 1),
- (ulong) rec_get_converted_size(
- index, entry, 0));
- fputs("InnoDB: Cannot insert index record ",
- stderr);
- dtuple_print(stderr, entry);
- fputs("\nInnoDB: The table where"
- " this index record belongs\n"
- "InnoDB: is now probably corrupt."
- " Please run CHECK TABLE on\n"
- "InnoDB: that table.\n", stderr);
+ Examples of a character (3-byte UTF-8 sequence)
+ identified with 2 or 4 characters (1-byte UTF-8 sequences):
- space = page_get_space_id(page);
- zip_size = buf_block_get_zip_size(block);
- page_no = page_get_page_no(page);
+ utf8_unicode_ci: 'II' = U+2171 SMALL ROMAN NUMERAL TWO
+ utf8_unicode_ci: '(10)' = U+247D PARENTHESIZED NUMBER TEN
+ */
- bitmap_page = ibuf_bitmap_get_map_page(
- space, page_no, zip_size, mtr);
- old_bits = ibuf_bitmap_page_get_bits(
- bitmap_page, page_no, zip_size,
- IBUF_BITMAP_FREE, mtr);
+ /* Delete the different-length record, and insert the
+ buffered one. */
- fprintf(stderr,
- "InnoDB: space %lu, page %lu,"
- " zip_size %lu, bitmap bits %lu\n",
- (ulong) space, (ulong) page_no,
- (ulong) zip_size, (ulong) old_bits);
+ lock_rec_store_on_page_infimum(block, rec);
+ page_cur_delete_rec(&page_cur, index, offsets, mtr);
+ page_cur_move_to_prev(&page_cur);
+ mem_heap_free(heap);
- fputs("InnoDB: Submit a detailed bug report"
- " to http://bugs.mysql.com\n", stderr);
- }
+ ibuf_insert_to_index_page_low(entry, block, index, mtr,
+ &page_cur);
+ lock_rec_restore_from_page_infimum(block, rec, block);
+ } else {
+ ibuf_insert_to_index_page_low(entry, block, index, mtr,
+ &page_cur);
}
}
diff --git a/storage/innodb_plugin/include/btr0cur.h b/storage/innodb_plugin/include/btr0cur.h
index e151fdcb563..7f6bff11f84 100644
--- a/storage/innodb_plugin/include/btr0cur.h
+++ b/storage/innodb_plugin/include/btr0cur.h
@@ -242,6 +242,22 @@ btr_cur_pessimistic_insert(
que_thr_t* thr, /*!< in: query thread or NULL */
mtr_t* mtr); /*!< in: mtr */
/*************************************************************//**
+See if there is enough place in the page modification log to log
+an update-in-place.
+@return TRUE if enough place */
+UNIV_INTERN
+ibool
+btr_cur_update_alloc_zip(
+/*=====================*/
+ page_zip_des_t* page_zip,/*!< in/out: compressed page */
+ buf_block_t* block, /*!< in/out: buffer page */
+ dict_index_t* index, /*!< in: the index corresponding to the block */
+ ulint length, /*!< in: size needed */
+ ibool create, /*!< in: TRUE=delete-and-insert,
+ FALSE=update-in-place */
+ mtr_t* mtr) /*!< in: mini-transaction */
+ __attribute__((nonnull, warn_unused_result));
+/*************************************************************//**
Updates a record when the update causes no size changes in its fields.
@return DB_SUCCESS or error number */
UNIV_INTERN
diff --git a/storage/innodb_plugin/include/buf0flu.h b/storage/innodb_plugin/include/buf0flu.h
index c996f6eaab4..cb8c49fde15 100644
--- a/storage/innodb_plugin/include/buf0flu.h
+++ b/storage/innodb_plugin/include/buf0flu.h
@@ -75,6 +75,20 @@ buf_flush_init_for_writing(
ib_uint64_t newest_lsn); /*!< in: newest modification lsn
to the page */
#ifndef UNIV_HOTBACKUP
+# if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
+/********************************************************************//**
+Writes a flushable page asynchronously from the buffer pool to a file.
+NOTE: buf_pool_mutex and block->mutex must be held upon entering this
+function, and they will be released by this function after flushing.
+This is loosely based on buf_flush_batch() and buf_flush_page().
+@return TRUE if the page was flushed and the mutexes released */
+UNIV_INTERN
+ibool
+buf_flush_page_try(
+/*===============*/
+ buf_block_t* block) /*!< in/out: buffer control block */
+ __attribute__((nonnull, warn_unused_result));
+# endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
/*******************************************************************//**
This utility flushes dirty blocks from the end of the LRU list or flush_list.
NOTE 1: in the case of an LRU flush the calling thread may own latches to
diff --git a/storage/innodb_plugin/include/ibuf0ibuf.h b/storage/innodb_plugin/include/ibuf0ibuf.h
index 8aa21fb9d95..f8cc4471d43 100644
--- a/storage/innodb_plugin/include/ibuf0ibuf.h
+++ b/storage/innodb_plugin/include/ibuf0ibuf.h
@@ -48,6 +48,11 @@ typedef enum {
/** Operations that can currently be buffered. */
extern ibuf_use_t ibuf_use;
+#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
+/** Flag to control insert buffer debugging. */
+extern uint ibuf_debug;
+#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
+
/** The insert buffer control structure */
extern ibuf_t* ibuf;
diff --git a/storage/innodb_plugin/include/os0sync.h b/storage/innodb_plugin/include/os0sync.h
index 0c22162b900..f32e7ab710a 100644
--- a/storage/innodb_plugin/include/os0sync.h
+++ b/storage/innodb_plugin/include/os0sync.h
@@ -330,7 +330,7 @@ amount of increment. */
Returns the old value of *ptr, atomically sets *ptr to new_val */
# define os_atomic_test_and_set_byte(ptr, new_val) \
- __sync_lock_test_and_set(ptr, new_val)
+ __sync_lock_test_and_set(ptr, (byte) new_val)
#elif defined(HAVE_IB_SOLARIS_ATOMICS)
diff --git a/storage/innodb_plugin/include/row0mysql.h b/storage/innodb_plugin/include/row0mysql.h
index b69e657361b..42182cc0044 100644
--- a/storage/innodb_plugin/include/row0mysql.h
+++ b/storage/innodb_plugin/include/row0mysql.h
@@ -527,6 +527,10 @@ struct mysql_row_templ_struct {
Innobase record in the current index;
not defined if template_type is
ROW_MYSQL_WHOLE_ROW */
+ ulint clust_rec_field_no; /*!< field number of the column in an
+ Innobase record in the clustered index;
+ not defined if template_type is
+ ROW_MYSQL_WHOLE_ROW */
ulint mysql_col_offset; /*!< offset of the column in the MySQL
row format */
ulint mysql_col_len; /*!< length of the column in the MySQL
diff --git a/storage/innodb_plugin/include/row0upd.h b/storage/innodb_plugin/include/row0upd.h
index 635d746d5a1..4e2de9bd2ec 100644
--- a/storage/innodb_plugin/include/row0upd.h
+++ b/storage/innodb_plugin/include/row0upd.h
@@ -167,8 +167,11 @@ row_upd_changes_field_size_or_external(
const upd_t* update);/*!< in: update vector */
#endif /* !UNIV_HOTBACKUP */
/***********************************************************//**
-Replaces the new column values stored in the update vector to the record
-given. No field size changes are allowed. */
+Replaces the new column values stored in the update vector to the
+record given. No field size changes are allowed. This function is
+usually invoked on a clustered index. The only use case for a
+secondary index is row_ins_sec_index_entry_by_modify() or its
+counterpart in ibuf_insert_to_index_page(). */
UNIV_INTERN
void
row_upd_rec_in_place(
diff --git a/storage/innodb_plugin/include/univ.i b/storage/innodb_plugin/include/univ.i
index 627b65cf849..0bb4b744d05 100644
--- a/storage/innodb_plugin/include/univ.i
+++ b/storage/innodb_plugin/include/univ.i
@@ -46,7 +46,7 @@ Created 1/20/1994 Heikki Tuuri
#define INNODB_VERSION_MAJOR 1
#define INNODB_VERSION_MINOR 0
-#define INNODB_VERSION_BUGFIX 12
+#define INNODB_VERSION_BUGFIX 13
/* The following is the InnoDB version as shown in
SELECT plugin_version FROM information_schema.plugins;
diff --git a/storage/innodb_plugin/include/ut0rnd.ic b/storage/innodb_plugin/include/ut0rnd.ic
index c3dbd86923c..a33813037ea 100644
--- a/storage/innodb_plugin/include/ut0rnd.ic
+++ b/storage/innodb_plugin/include/ut0rnd.ic
@@ -85,9 +85,6 @@ ut_rnd_gen_ulint(void)
/*==================*/
{
ulint rnd;
- ulint n_bits;
-
- n_bits = 8 * sizeof(ulint);
ut_rnd_ulint_counter = UT_RND1 * ut_rnd_ulint_counter + UT_RND2;
diff --git a/storage/innodb_plugin/log/log0recv.c b/storage/innodb_plugin/log/log0recv.c
index a727d6be768..c1d12dad413 100644
--- a/storage/innodb_plugin/log/log0recv.c
+++ b/storage/innodb_plugin/log/log0recv.c
@@ -559,10 +559,8 @@ recv_synchronize_groups(
ib_uint64_t start_lsn;
ib_uint64_t end_lsn;
ib_uint64_t recovered_lsn;
- ib_uint64_t limit_lsn;
recovered_lsn = recv_sys->recovered_lsn;
- limit_lsn = recv_sys->limit_lsn;
/* Read the last recovered log block to the recovery system buffer:
the block is always incomplete */
@@ -2891,7 +2889,9 @@ recv_recovery_from_checkpoint_start_func(
ib_uint64_t old_scanned_lsn;
ib_uint64_t group_scanned_lsn;
ib_uint64_t contiguous_lsn;
+#ifdef UNIV_LOG_ARCHIVE
ib_uint64_t archived_lsn;
+#endif /* UNIV_LOG_ARCHIVE */
byte* buf;
byte log_hdr_buf[LOG_FILE_HDR_SIZE];
ulint err;
@@ -2946,7 +2946,9 @@ recv_recovery_from_checkpoint_start_func(
checkpoint_lsn = mach_read_ull(buf + LOG_CHECKPOINT_LSN);
checkpoint_no = mach_read_ull(buf + LOG_CHECKPOINT_NO);
+#ifdef UNIV_LOG_ARCHIVE
archived_lsn = mach_read_ull(buf + LOG_CHECKPOINT_ARCHIVED_LSN);
+#endif /* UNIV_LOG_ARCHIVE */
/* Read the first log file header to print a note if this is
a recovery from a restored InnoDB Hot Backup */
diff --git a/storage/innodb_plugin/os/os0file.c b/storage/innodb_plugin/os/os0file.c
index 9f937b9def2..ff80f7ed1b4 100644
--- a/storage/innodb_plugin/os/os0file.c
+++ b/storage/innodb_plugin/os/os0file.c
@@ -1182,10 +1182,12 @@ UNIV_INTERN
void
os_file_set_nocache(
/*================*/
- int fd, /*!< in: file descriptor to alter */
- const char* file_name, /*!< in: file name, used in the
- diagnostic message */
- const char* operation_name) /*!< in: "open" or "create"; used in the
+ int fd /*!< in: file descriptor to alter */
+ __attribute__((unused)),
+ const char* file_name /*!< in: used in the diagnostic message */
+ __attribute__((unused)),
+ const char* operation_name __attribute__((unused)))
+ /*!< in: "open" or "create"; used in the
diagnostic message */
{
/* some versions of Solaris may not have DIRECTIO_ON */
@@ -1367,8 +1369,6 @@ try_again:
int create_flag;
ibool retry;
const char* mode_str = NULL;
- const char* type_str = NULL;
- const char* purpose_str = NULL;
try_again:
ut_a(name);
@@ -1388,26 +1388,9 @@ try_again:
ut_error;
}
- if (type == OS_LOG_FILE) {
- type_str = "LOG";
- } else if (type == OS_DATA_FILE) {
- type_str = "DATA";
- } else {
- ut_error;
- }
-
- if (purpose == OS_FILE_AIO) {
- purpose_str = "AIO";
- } else if (purpose == OS_FILE_NORMAL) {
- purpose_str = "NORMAL";
- } else {
- ut_error;
- }
+ ut_a(type == OS_LOG_FILE || type == OS_DATA_FILE);
+ ut_a(purpose == OS_FILE_AIO || purpose == OS_FILE_NORMAL);
-#if 0
- fprintf(stderr, "Opening file %s, mode %s, type %s, purpose %s\n",
- name, mode_str, type_str, purpose_str);
-#endif
#ifdef O_SYNC
/* We let O_SYNC only affect log files; note that we map O_DSYNC to
O_SYNC because the datasync options seemed to corrupt files in 2001
@@ -2297,7 +2280,10 @@ os_file_read(
ulint i;
#endif /* !UNIV_HOTBACKUP */
+ /* On 64-bit Windows, ulint is 64 bits. But offset and n should be
+ no more than 32 bits. */
ut_a((offset & 0xFFFFFFFFUL) == offset);
+ ut_a((n & 0xFFFFFFFFUL) == n);
os_n_file_reads++;
os_bytes_read_since_printout += n;
@@ -2421,7 +2407,10 @@ os_file_read_no_error_handling(
ulint i;
#endif /* !UNIV_HOTBACKUP */
+ /* On 64-bit Windows, ulint is 64 bits. But offset and n should be
+ no more than 32 bits. */
ut_a((offset & 0xFFFFFFFFUL) == offset);
+ ut_a((n & 0xFFFFFFFFUL) == n);
os_n_file_reads++;
os_bytes_read_since_printout += n;
@@ -2551,7 +2540,10 @@ os_file_write(
ulint i;
#endif /* !UNIV_HOTBACKUP */
- ut_a((offset & 0xFFFFFFFF) == offset);
+ /* On 64-bit Windows, ulint is 64 bits. But offset and n should be
+ no more than 32 bits. */
+ ut_a((offset & 0xFFFFFFFFUL) == offset);
+ ut_a((n & 0xFFFFFFFFUL) == n);
os_n_file_writes++;
@@ -3321,12 +3313,14 @@ os_aio_array_reserve_slot(
ulint len) /*!< in: length of the block to read or write */
{
os_aio_slot_t* slot;
-#ifdef WIN_ASYNC_IO
- OVERLAPPED* control;
-#endif
ulint i;
ulint slots_per_seg;
ulint local_seg;
+#ifdef WIN_ASYNC_IO
+ OVERLAPPED* control;
+
+ ut_a((len & 0xFFFFFFFFUL) == len);
+#endif
/* No need of a mutex. Only reading constant fields */
slots_per_seg = array->n_slots / array->n_segments;
@@ -3606,6 +3600,9 @@ os_aio(
ut_ad(n % OS_FILE_LOG_BLOCK_SIZE == 0);
ut_ad(offset % OS_FILE_LOG_BLOCK_SIZE == 0);
ut_ad(os_aio_validate());
+#ifdef WIN_ASYNC_IO
+ ut_ad((n & 0xFFFFFFFFUL) == n);
+#endif
wake_later = mode & OS_AIO_SIMULATED_WAKE_LATER;
mode = mode & (~OS_AIO_SIMULATED_WAKE_LATER);
@@ -3846,16 +3843,18 @@ os_aio_windows_handle(
/* retry failed read/write operation synchronously.
No need to hold array->mutex. */
+ ut_a((slot->len & 0xFFFFFFFFUL) == slot->len);
+
switch (slot->type) {
case OS_FILE_WRITE:
ret = WriteFile(slot->file, slot->buf,
- slot->len, &len,
+ (DWORD) slot->len, &len,
&(slot->control));
break;
case OS_FILE_READ:
ret = ReadFile(slot->file, slot->buf,
- slot->len, &len,
+ (DWORD) slot->len, &len,
&(slot->control));
break;
diff --git a/storage/innodb_plugin/plug.in b/storage/innodb_plugin/plug.in
index 38e14d9d2fd..c99703415f9 100644
--- a/storage/innodb_plugin/plug.in
+++ b/storage/innodb_plugin/plug.in
@@ -137,10 +137,11 @@ MYSQL_PLUGIN_ACTIONS(innodb_plugin, [
AC_MSG_CHECKING(whether Solaris libc atomic functions are available)
# either define HAVE_IB_SOLARIS_ATOMICS or not
- AC_CHECK_FUNCS(atomic_add_long \
+ AC_CHECK_FUNCS(atomic_cas_ulong \
atomic_cas_32 \
atomic_cas_64 \
- atomic_cas_ulong,
+ atomic_add_long_nv \
+ atomic_swap_uchar,
AC_DEFINE([HAVE_IB_SOLARIS_ATOMICS], [1],
[Define to 1 if Solaris libc atomic functions \
diff --git a/storage/innodb_plugin/que/que0que.c b/storage/innodb_plugin/que/que0que.c
index 2fe046fa9b8..b616b3d9c14 100644
--- a/storage/innodb_plugin/que/que0que.c
+++ b/storage/innodb_plugin/que/que0que.c
@@ -1284,18 +1284,13 @@ que_run_threads_low(
que_thr_t* thr) /*!< in: query thread */
{
que_thr_t* next_thr;
- ulint cumul_resource;
ulint loop_count;
ut_ad(thr->state == QUE_THR_RUNNING);
ut_a(thr_get_trx(thr)->error_state == DB_SUCCESS);
ut_ad(!mutex_own(&kernel_mutex));
- /* cumul_resource counts how much resources the OS thread (NOT the
- query thread) has spent in this function */
-
loop_count = QUE_MAX_LOOPS_WITHOUT_CHECK;
- cumul_resource = 0;
loop:
/* Check that there is enough space in the log to accommodate
possible log entries by this query step; if the operation can touch
diff --git a/storage/innodb_plugin/row/row0mysql.c b/storage/innodb_plugin/row/row0mysql.c
index 9d7cb976caf..9e8d0a884f4 100644
--- a/storage/innodb_plugin/row/row0mysql.c
+++ b/storage/innodb_plugin/row/row0mysql.c
@@ -444,7 +444,7 @@ row_mysql_convert_row_to_innobase(
row is used, as row may contain
pointers to this record! */
{
- mysql_row_templ_t* templ;
+ const mysql_row_templ_t*templ;
dfield_t* dfield;
ulint i;
@@ -1433,7 +1433,12 @@ run_again:
srv_n_rows_updated++;
}
- row_update_statistics_if_needed(prebuilt->table);
+ /* We update table statistics only if it is a DELETE or UPDATE
+ that changes indexed columns, UPDATEs that change only non-indexed
+ columns would not affect statistics. */
+ if (node->is_delete || !(node->cmpl_info & UPD_NODE_NO_ORD_CHANGE)) {
+ row_update_statistics_if_needed(prebuilt->table);
+ }
trx->op_info = "";
@@ -1588,6 +1593,9 @@ row_update_cascade_for_mysql(
trx = thr_get_trx(thr);
+ /* Increment fk_cascade_depth to record the recursive call depth on
+ a single update/delete that affects multiple tables chained
+ together with foreign key relations. */
thr->fk_cascade_depth++;
if (thr->fk_cascade_depth > FK_MAX_CASCADE_DEL) {
@@ -1599,6 +1607,12 @@ run_again:
row_upd_step(thr);
+ /* The recursive call for cascading update/delete happens
+ in above row_upd_step(), reset the counter once we come
+ out of the recursive call, so it does not accumulate for
+ different row deletes */
+ thr->fk_cascade_depth = 0;
+
err = trx->error_state;
/* Note that the cascade node is a subnode of another InnoDB
@@ -1865,15 +1879,13 @@ err_exit:
err = trx->error_state;
- if (UNIV_UNLIKELY(err != DB_SUCCESS)) {
+ switch (err) {
+ case DB_SUCCESS:
+ break;
+ case DB_OUT_OF_FILE_SPACE:
trx->error_state = DB_SUCCESS;
trx_general_rollback_for_mysql(trx, NULL);
- /* TO DO: free table? The code below will dereference
- table->name, though. */
- }
- switch (err) {
- case DB_OUT_OF_FILE_SPACE:
ut_print_timestamp(stderr);
fputs(" InnoDB: Warning: cannot create table ",
stderr);
@@ -1888,9 +1900,13 @@ err_exit:
break;
case DB_DUPLICATE_KEY:
+ default:
/* We may also get err == DB_ERROR if the .ibd file for the
table already exists */
+ trx->error_state = DB_SUCCESS;
+ trx_general_rollback_for_mysql(trx, NULL);
+ dict_mem_table_free(table);
break;
}
@@ -2766,15 +2782,6 @@ row_truncate_table_for_mysql(
trx->table_id = table->id;
- /* Lock all index trees for this table, as we will
- truncate the table/index and possibly change their metadata.
- All DML/DDL are blocked by table level lock, with
- a few exceptions such as queries into information schema
- about the table, MySQL could try to access index stats
- for this kind of query, we need to use index locks to
- sync up */
- dict_table_x_lock_indexes(table);
-
if (table->space && !table->dir_path_of_temp_table) {
/* Discard and create the single-table tablespace. */
ulint space = table->space;
@@ -2787,6 +2794,11 @@ row_truncate_table_for_mysql(
dict_hdr_get_new_id(NULL, NULL, &space);
+ /* Lock all index trees for this table. We must
+ do so after dict_hdr_get_new_id() to preserve
+ the latch order */
+ dict_table_x_lock_indexes(table);
+
if (space == ULINT_UNDEFINED
|| fil_create_new_single_table_tablespace(
space, table->name, FALSE, flags,
@@ -2820,6 +2832,15 @@ row_truncate_table_for_mysql(
FIL_IBD_FILE_INITIAL_SIZE, &mtr);
mtr_commit(&mtr);
}
+ } else {
+ /* Lock all index trees for this table, as we will
+ truncate the table/index and possibly change their metadata.
+ All DML/DDL are blocked by table level lock, with
+ a few exceptions such as queries into information schema
+ about the table, MySQL could try to access index stats
+ for this kind of query, we need to use index locks to
+ sync up */
+ dict_table_x_lock_indexes(table);
}
/* scan SYS_INDEXES for all indexes of the table */
diff --git a/storage/innodb_plugin/row/row0purge.c b/storage/innodb_plugin/row/row0purge.c
index 835af990672..31b255cf2d4 100644
--- a/storage/innodb_plugin/row/row0purge.c
+++ b/storage/innodb_plugin/row/row0purge.c
@@ -684,7 +684,9 @@ row_purge_step(
que_thr_t* thr) /*!< in: query thread */
{
purge_node_t* node;
+#ifdef UNIV_DEBUG
ulint err;
+#endif /* UNIV_DEBUG */
ut_ad(thr);
@@ -692,7 +694,10 @@ row_purge_step(
ut_ad(que_node_get_type(node) == QUE_NODE_PURGE);
- err = row_purge(node, thr);
+#ifdef UNIV_DEBUG
+ err =
+#endif /* UNIV_DEBUG */
+ row_purge(node, thr);
ut_ad(err == DB_SUCCESS);
diff --git a/storage/innodb_plugin/row/row0sel.c b/storage/innodb_plugin/row/row0sel.c
index aff36b65124..ac78a95839c 100644
--- a/storage/innodb_plugin/row/row0sel.c
+++ b/storage/innodb_plugin/row/row0sel.c
@@ -2675,39 +2675,39 @@ row_sel_store_mysql_rec(
row_prebuilt_t* prebuilt, /*!< in: prebuilt struct */
const rec_t* rec, /*!< in: Innobase record in the index
which was described in prebuilt's
- template; must be protected by
- a page latch */
+ template, or in the clustered index;
+ must be protected by a page latch */
+ ibool rec_clust, /*!< in: TRUE if rec is in the
+ clustered index instead of
+ prebuilt->index */
const ulint* offsets) /*!< in: array returned by
- rec_get_offsets() */
+ rec_get_offsets(rec) */
{
- mysql_row_templ_t* templ;
- mem_heap_t* extern_field_heap = NULL;
- mem_heap_t* heap;
- const byte* data;
- ulint len;
- ulint i;
+ mem_heap_t* extern_field_heap = NULL;
+ mem_heap_t* heap;
+ ulint i;
ut_ad(prebuilt->mysql_template);
ut_ad(prebuilt->default_rec);
ut_ad(rec_offs_validate(rec, NULL, offsets));
+ ut_ad(!rec_get_deleted_flag(rec, rec_offs_comp(offsets)));
if (UNIV_LIKELY_NULL(prebuilt->blob_heap)) {
mem_heap_free(prebuilt->blob_heap);
prebuilt->blob_heap = NULL;
}
- /* init null bytes with default values as they might be
- left uninitialized in some cases and these uninited bytes
- might be copied into mysql record buffer that leads to
- valgrind warnings */
- memcpy(mysql_rec, prebuilt->default_rec, prebuilt->null_bitmap_len);
-
for (i = 0; i < prebuilt->n_template; i++) {
- templ = prebuilt->mysql_template + i;
+ const mysql_row_templ_t*templ = prebuilt->mysql_template + i;
+ const byte* data;
+ ulint len;
+ ulint field_no;
+
+ field_no = rec_clust
+ ? templ->clust_rec_field_no : templ->rec_field_no;
- if (UNIV_UNLIKELY(rec_offs_nth_extern(offsets,
- templ->rec_field_no))) {
+ if (UNIV_UNLIKELY(rec_offs_nth_extern(offsets, field_no))) {
/* Copy an externally stored field to the temporary
heap */
@@ -2735,7 +2735,7 @@ row_sel_store_mysql_rec(
data = btr_rec_copy_externally_stored_field(
rec, offsets,
dict_table_zip_size(prebuilt->table),
- templ->rec_field_no, &len, heap);
+ field_no, &len, heap);
if (UNIV_UNLIKELY(!data)) {
/* The externally stored field
@@ -2756,8 +2756,7 @@ row_sel_store_mysql_rec(
} else {
/* Field is stored in the row. */
- data = rec_get_nth_field(rec, offsets,
- templ->rec_field_no, &len);
+ data = rec_get_nth_field(rec, offsets, field_no, &len);
if (UNIV_UNLIKELY(templ->type == DATA_BLOB)
&& len != UNIV_SQL_NULL) {
@@ -3119,7 +3118,7 @@ row_sel_pop_cached_row_for_mysql(
row_prebuilt_t* prebuilt) /*!< in: prebuilt struct */
{
ulint i;
- mysql_row_templ_t* templ;
+ const mysql_row_templ_t*templ;
byte* cached_rec;
ut_ad(prebuilt->n_fetch_cached > 0);
ut_ad(prebuilt->mysql_prefix_len <= prebuilt->mysql_row_len);
@@ -3176,15 +3175,21 @@ ibool
row_sel_push_cache_row_for_mysql(
/*=============================*/
row_prebuilt_t* prebuilt, /*!< in: prebuilt struct */
- const rec_t* rec, /*!< in: record to push; must
- be protected by a page latch */
- const ulint* offsets) /*!< in: rec_get_offsets() */
+ const rec_t* rec, /*!< in: record to push, in the index
+ which was described in prebuilt's
+ template, or in the clustered index;
+ must be protected by a page latch */
+ ibool rec_clust, /*!< in: TRUE if rec is in the
+ clustered index instead of
+ prebuilt->index */
+ const ulint* offsets) /*!< in: rec_get_offsets(rec) */
{
byte* buf;
ulint i;
ut_ad(prebuilt->n_fetch_cached < MYSQL_FETCH_CACHE_SIZE);
ut_ad(rec_offs_validate(rec, NULL, offsets));
+ ut_ad(!rec_get_deleted_flag(rec, rec_offs_comp(offsets)));
ut_a(!prebuilt->templ_contains_blob);
if (prebuilt->fetch_cache[0] == NULL) {
@@ -3213,7 +3218,7 @@ row_sel_push_cache_row_for_mysql(
if (UNIV_UNLIKELY(!row_sel_store_mysql_rec(
prebuilt->fetch_cache[
prebuilt->n_fetch_cached],
- prebuilt, rec, offsets))) {
+ prebuilt, rec, rec_clust, offsets))) {
return(FALSE);
}
@@ -3356,6 +3361,7 @@ row_search_for_mysql(
mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_;
+ ibool table_lock_waited = FALSE;
rec_offs_init(offsets_);
@@ -3613,7 +3619,8 @@ row_search_for_mysql(
ut_ad(!rec_get_deleted_flag(rec, comp));
if (!row_sel_store_mysql_rec(buf, prebuilt,
- rec, offsets)) {
+ rec, FALSE,
+ offsets)) {
/* Only fresh inserts may contain
incomplete externally stored
columns. Pretend that such
@@ -3719,6 +3726,44 @@ release_search_latch_if_needed:
clust_index = dict_table_get_first_index(index->table);
+ /* Do some start-of-statement preparations */
+
+ if (!prebuilt->sql_stat_start) {
+ /* No need to set an intention lock or assign a read view */
+
+ if (trx->read_view == NULL
+ && prebuilt->select_lock_type == LOCK_NONE) {
+
+ fputs("InnoDB: Error: MySQL is trying to"
+ " perform a consistent read\n"
+ "InnoDB: but the read view is not assigned!\n",
+ stderr);
+ trx_print(stderr, trx, 600);
+ fputc('\n', stderr);
+ ut_error;
+ }
+ } else if (prebuilt->select_lock_type == LOCK_NONE) {
+ /* This is a consistent read */
+ /* Assign a read view for the query */
+
+ trx_assign_read_view(trx);
+ prebuilt->sql_stat_start = FALSE;
+ } else {
+wait_table_again:
+ err = lock_table(0, index->table,
+ prebuilt->select_lock_type == LOCK_S
+ ? LOCK_IS : LOCK_IX, thr);
+
+ if (err != DB_SUCCESS) {
+
+ table_lock_waited = TRUE;
+ goto lock_table_wait;
+ }
+ prebuilt->sql_stat_start = FALSE;
+ }
+
+ /* Open or restore index cursor position */
+
if (UNIV_LIKELY(direction != 0)) {
ibool need_to_process = sel_restore_position_for_mysql(
&same_user_rec, BTR_SEARCH_LEAF,
@@ -3794,42 +3839,6 @@ release_search_latch_if_needed:
}
}
- if (!prebuilt->sql_stat_start) {
- /* No need to set an intention lock or assign a read view */
-
- if (trx->read_view == NULL
- && prebuilt->select_lock_type == LOCK_NONE) {
-
- fputs("InnoDB: Error: MySQL is trying to"
- " perform a consistent read\n"
- "InnoDB: but the read view is not assigned!\n",
- stderr);
- trx_print(stderr, trx, 600);
- fputc('\n', stderr);
- ut_a(0);
- }
- } else if (prebuilt->select_lock_type == LOCK_NONE) {
- /* This is a consistent read */
- /* Assign a read view for the query */
-
- trx_assign_read_view(trx);
- prebuilt->sql_stat_start = FALSE;
- } else {
- ulint lock_mode;
- if (prebuilt->select_lock_type == LOCK_S) {
- lock_mode = LOCK_IS;
- } else {
- lock_mode = LOCK_IX;
- }
- err = lock_table(0, index->table, lock_mode, thr);
-
- if (err != DB_SUCCESS) {
-
- goto lock_wait_or_error;
- }
- prebuilt->sql_stat_start = FALSE;
- }
-
rec_loop:
/*-------------------------------------------------------------*/
/* PHASE 4: Look for matching records in a loop */
@@ -4245,7 +4254,6 @@ no_gap_lock:
is necessary, because we can only get the undo
information via the clustered index record. */
- ut_ad(index != clust_index);
ut_ad(!dict_index_is_clust(index));
if (!lock_sec_rec_cons_read_sees(
@@ -4361,26 +4369,10 @@ requires_clust_rec:
goto next_rec;
}
- if (prebuilt->need_to_access_clustered) {
-
- result_rec = clust_rec;
-
- ut_ad(rec_offs_validate(result_rec, clust_index,
- offsets));
- } else {
- /* We used 'offsets' for the clust rec, recalculate
- them for 'rec' */
- offsets = rec_get_offsets(rec, index, offsets,
- ULINT_UNDEFINED, &heap);
- result_rec = rec;
- }
-
- /* result_rec can legitimately be delete-marked
- now that it has been established that it points to a
- clustered index record that exists in the read view. */
+ result_rec = clust_rec;
+ ut_ad(rec_offs_validate(result_rec, clust_index, offsets));
} else {
result_rec = rec;
- ut_ad(!rec_get_deleted_flag(rec, comp));
}
/* We found a qualifying record 'result_rec'. At this point,
@@ -4389,6 +4381,7 @@ requires_clust_rec:
ut_ad(rec_offs_validate(result_rec,
result_rec != rec ? clust_index : index,
offsets));
+ ut_ad(!rec_get_deleted_flag(result_rec, comp));
/* At this point, the clustered index record is protected
by a page latch that was acquired when pcur was positioned.
@@ -4413,6 +4406,7 @@ requires_clust_rec:
cursor. */
if (!row_sel_push_cache_row_for_mysql(prebuilt, result_rec,
+ result_rec != rec,
offsets)) {
/* Only fresh inserts may contain incomplete
externally stored columns. Pretend that such
@@ -4430,15 +4424,31 @@ requires_clust_rec:
goto next_rec;
} else {
- if (prebuilt->template_type == ROW_MYSQL_DUMMY_TEMPLATE) {
+ if (UNIV_UNLIKELY
+ (prebuilt->template_type == ROW_MYSQL_DUMMY_TEMPLATE)) {
+ /* CHECK TABLE: fetch the row */
+
+ if (result_rec != rec
+ && !prebuilt->need_to_access_clustered) {
+ /* We used 'offsets' for the clust
+ rec, recalculate them for 'rec' */
+ offsets = rec_get_offsets(rec, index, offsets,
+ ULINT_UNDEFINED,
+ &heap);
+ result_rec = rec;
+ }
+
memcpy(buf + 4, result_rec
- rec_offs_extra_size(offsets),
rec_offs_size(offsets));
mach_write_to_4(buf,
rec_offs_extra_size(offsets) + 4);
} else {
- if (!row_sel_store_mysql_rec(buf, prebuilt,
- result_rec, offsets)) {
+ /* Returning a row to MySQL */
+
+ if (!row_sel_store_mysql_rec(buf, prebuilt, result_rec,
+ result_rec != rec,
+ offsets)) {
/* Only fresh inserts may contain
incomplete externally stored
columns. Pretend that such records do
@@ -4559,6 +4569,7 @@ lock_wait_or_error:
btr_pcur_store_position(pcur, &mtr);
+lock_table_wait:
mtr_commit(&mtr);
mtr_has_extra_clust_latch = FALSE;
@@ -4576,6 +4587,14 @@ lock_wait_or_error:
thr->lock_state = QUE_THR_LOCK_NOLOCK;
mtr_start(&mtr);
+ /* Table lock waited, go try to obtain table lock
+ again */
+ if (table_lock_waited) {
+ table_lock_waited = FALSE;
+
+ goto wait_table_again;
+ }
+
sel_restore_position_for_mysql(&same_user_rec,
BTR_SEARCH_LEAF, pcur,
moves_up, &mtr);
diff --git a/storage/innodb_plugin/row/row0umod.c b/storage/innodb_plugin/row/row0umod.c
index 8464b0f95cc..5998dadd16d 100644
--- a/storage/innodb_plugin/row/row0umod.c
+++ b/storage/innodb_plugin/row/row0umod.c
@@ -114,12 +114,17 @@ row_undo_mod_clust_low(
btr_pcur_t* pcur;
btr_cur_t* btr_cur;
ulint err;
+#ifdef UNIV_DEBUG
ibool success;
+#endif /* UNIV_DEBUG */
pcur = &(node->pcur);
btr_cur = btr_pcur_get_btr_cur(pcur);
- success = btr_pcur_restore_position(mode, pcur, mtr);
+#ifdef UNIV_DEBUG
+ success =
+#endif /* UNIV_DEBUG */
+ btr_pcur_restore_position(mode, pcur, mtr);
ut_ad(success);
diff --git a/storage/innodb_plugin/row/row0upd.c b/storage/innodb_plugin/row/row0upd.c
index 04c3139fcc7..444003ba3f0 100644
--- a/storage/innodb_plugin/row/row0upd.c
+++ b/storage/innodb_plugin/row/row0upd.c
@@ -466,8 +466,11 @@ row_upd_changes_field_size_or_external(
#endif /* !UNIV_HOTBACKUP */
/***********************************************************//**
-Replaces the new column values stored in the update vector to the record
-given. No field size changes are allowed. */
+Replaces the new column values stored in the update vector to the
+record given. No field size changes are allowed. This function is
+usually invoked on a clustered index. The only use case for a
+secondary index is row_ins_sec_index_entry_by_modify() or its
+counterpart in ibuf_insert_to_index_page(). */
UNIV_INTERN
void
row_upd_rec_in_place(
diff --git a/storage/innodb_plugin/row/row0vers.c b/storage/innodb_plugin/row/row0vers.c
index a4fbb5289aa..b6d35363f08 100644
--- a/storage/innodb_plugin/row/row0vers.c
+++ b/storage/innodb_plugin/row/row0vers.c
@@ -71,7 +71,9 @@ row_vers_impl_x_locked_off_kernel(
warning */
trx_t* trx;
ulint rec_del;
+#ifdef UNIV_DEBUG
ulint err;
+#endif /* UNIV_DEBUG */
mtr_t mtr;
ulint comp;
@@ -169,9 +171,12 @@ row_vers_impl_x_locked_off_kernel(
heap2 = heap;
heap = mem_heap_create(1024);
- err = trx_undo_prev_version_build(clust_rec, &mtr, version,
- clust_index, clust_offsets,
- heap, &prev_version);
+#ifdef UNIV_DEBUG
+ err =
+#endif /* UNIV_DEBUG */
+ trx_undo_prev_version_build(clust_rec, &mtr, version,
+ clust_index, clust_offsets,
+ heap, &prev_version);
mem_heap_free(heap2); /* free version and clust_offsets */
if (prev_version == NULL) {
diff --git a/storage/innodb_plugin/srv/srv0start.c b/storage/innodb_plugin/srv/srv0start.c
index ba9fc831b39..f823b72fbc1 100644
--- a/storage/innodb_plugin/srv/srv0start.c
+++ b/storage/innodb_plugin/srv/srv0start.c
@@ -463,7 +463,6 @@ io_handler_thread(
the aio array */
{
ulint segment;
- ulint i;
segment = *((ulint*)arg);
@@ -471,7 +470,7 @@ io_handler_thread(
fprintf(stderr, "Io handler thread %lu starts, id %lu\n", segment,
os_thread_pf(os_thread_get_curr_id()));
#endif
- for (i = 0;; i++) {
+ while (srv_shutdown_state != SRV_SHUTDOWN_EXIT_THREADS) {
fil_aio_wait(segment);
mutex_enter(&ios_mutex);
@@ -479,8 +478,6 @@ io_handler_thread(
mutex_exit(&ios_mutex);
}
- thr_local_free(os_thread_get_curr_id());
-
/* We count the number of threads in os_thread_exit(). A created
thread should always use that to exit and not use return() to exit.
The thread actually never comes here because it is exited in an
@@ -1894,7 +1891,7 @@ innobase_shutdown_for_mysql(void)
#ifdef __NETWARE__
if (!panic_shutdown)
#endif
- logs_empty_and_mark_files_at_shutdown();
+ logs_empty_and_mark_files_at_shutdown();
if (srv_conc_n_threads != 0) {
fprintf(stderr,
diff --git a/storage/innodb_plugin/trx/trx0i_s.c b/storage/innodb_plugin/trx/trx0i_s.c
index 5bc8302d0c0..c0b9a73a68c 100644
--- a/storage/innodb_plugin/trx/trx0i_s.c
+++ b/storage/innodb_plugin/trx/trx0i_s.c
@@ -157,10 +157,6 @@ struct trx_i_s_cache_struct {
ullint last_read; /*!< last time the cache was read;
measured in microseconds since
epoch */
- mutex_t last_read_mutex;/*!< mutex protecting the
- last_read member - it is updated
- inside a shared lock of the
- rw_lock member */
i_s_table_cache_t innodb_trx; /*!< innodb_trx table */
i_s_table_cache_t innodb_locks; /*!< innodb_locks table */
i_s_table_cache_t innodb_lock_waits;/*!< innodb_lock_waits table */
@@ -1101,13 +1097,6 @@ can_cache_be_updated(
{
ullint now;
- /* Here we read cache->last_read without acquiring its mutex
- because last_read is only updated when a shared rw lock on the
- whole cache is being held (see trx_i_s_cache_end_read()) and
- we are currently holding an exclusive rw lock on the cache.
- So it is not possible for last_read to be updated while we are
- reading it. */
-
#ifdef UNIV_SYNC_DEBUG
ut_a(rw_lock_own(&cache->rw_lock, RW_LOCK_EX));
#endif
@@ -1205,6 +1194,12 @@ trx_i_s_possibly_fetch_data_into_cache(
/*===================================*/
trx_i_s_cache_t* cache) /*!< in/out: cache */
{
+ ullint now;
+
+#ifdef UNIV_SYNC_DEBUG
+ ut_a(rw_lock_own(&cache->rw_lock, RW_LOCK_EX));
+#endif
+
if (!can_cache_be_updated(cache)) {
return(1);
@@ -1217,6 +1212,10 @@ trx_i_s_possibly_fetch_data_into_cache(
mutex_exit(&kernel_mutex);
+ /* update cache last read time */
+ now = ut_time_us(NULL);
+ cache->last_read = now;
+
return(0);
}
@@ -1247,16 +1246,12 @@ trx_i_s_cache_init(
release kernel_mutex
release trx_i_s_cache_t::rw_lock
acquire trx_i_s_cache_t::rw_lock, S
- acquire trx_i_s_cache_t::last_read_mutex
- release trx_i_s_cache_t::last_read_mutex
release trx_i_s_cache_t::rw_lock */
rw_lock_create(&cache->rw_lock, SYNC_TRX_I_S_RWLOCK);
cache->last_read = 0;
- mutex_create(&cache->last_read_mutex, SYNC_TRX_I_S_LAST_READ);
-
table_cache_init(&cache->innodb_trx, sizeof(i_s_trx_row_t));
table_cache_init(&cache->innodb_locks, sizeof(i_s_locks_row_t));
table_cache_init(&cache->innodb_lock_waits,
@@ -1307,18 +1302,10 @@ trx_i_s_cache_end_read(
/*===================*/
trx_i_s_cache_t* cache) /*!< in: cache */
{
- ullint now;
-
#ifdef UNIV_SYNC_DEBUG
ut_a(rw_lock_own(&cache->rw_lock, RW_LOCK_SHARED));
#endif
- /* update cache last read time */
- now = ut_time_us(NULL);
- mutex_enter(&cache->last_read_mutex);
- cache->last_read = now;
- mutex_exit(&cache->last_read_mutex);
-
rw_lock_s_unlock(&cache->rw_lock);
}
diff --git a/storage/innodb_plugin/trx/trx0purge.c b/storage/innodb_plugin/trx/trx0purge.c
index abbfa3d7f81..1a70750083a 100644
--- a/storage/innodb_plugin/trx/trx0purge.c
+++ b/storage/innodb_plugin/trx/trx0purge.c
@@ -304,9 +304,10 @@ trx_purge_add_update_undo_to_history(
trx_undo_t* undo;
trx_rseg_t* rseg;
trx_rsegf_t* rseg_header;
+#ifdef UNIV_DEBUG
trx_usegf_t* seg_header;
+#endif /* UNIV_DEBUG */
trx_ulogf_t* undo_header;
- trx_upagef_t* page_header;
ulint hist_size;
undo = trx->update_undo;
@@ -321,8 +322,9 @@ trx_purge_add_update_undo_to_history(
rseg->page_no, mtr);
undo_header = undo_page + undo->hdr_offset;
+#ifdef UNIV_DEBUG
seg_header = undo_page + TRX_UNDO_SEG_HDR;
- page_header = undo_page + TRX_UNDO_PAGE_HDR;
+#endif /* UNIV_DEBUG */
if (undo->state != TRX_UNDO_CACHED) {
/* The undo log segment will not be reused */
@@ -655,7 +657,6 @@ trx_purge_rseg_get_next_history_log(
{
page_t* undo_page;
trx_ulogf_t* log_hdr;
- trx_usegf_t* seg_hdr;
fil_addr_t prev_log_addr;
trx_id_t trx_no;
ibool del_marks;
@@ -676,7 +677,6 @@ trx_purge_rseg_get_next_history_log(
undo_page = trx_undo_page_get_s_latched(rseg->space, rseg->zip_size,
rseg->last_page_no, &mtr);
log_hdr = undo_page + rseg->last_offset;
- seg_hdr = undo_page + TRX_UNDO_SEG_HDR;
/* Increase the purge page count by one for every handled log */
@@ -1068,12 +1068,8 @@ trx_purge_rec_release(
/*==================*/
trx_undo_inf_t* cell) /*!< in: storage cell */
{
- trx_undo_arr_t* arr;
-
mutex_enter(&(purge_sys->mutex));
- arr = purge_sys->arr;
-
trx_purge_arr_remove_info(cell);
mutex_exit(&(purge_sys->mutex));
diff --git a/storage/innodb_plugin/trx/trx0roll.c b/storage/innodb_plugin/trx/trx0roll.c
index c925478cdf4..1a43e419214 100644
--- a/storage/innodb_plugin/trx/trx0roll.c
+++ b/storage/innodb_plugin/trx/trx0roll.c
@@ -740,13 +740,8 @@ trx_undo_arr_remove_info(
undo_no_t undo_no)/*!< in: undo number */
{
trx_undo_inf_t* cell;
- ulint n_used;
- ulint n;
ulint i;
- n_used = arr->n_used;
- n = 0;
-
for (i = 0;; i++) {
cell = trx_undo_arr_get_nth_info(arr, i);
diff --git a/storage/innodb_plugin/trx/trx0sys.c b/storage/innodb_plugin/trx/trx0sys.c
index 410c55f132d..48963bc7e45 100644
--- a/storage/innodb_plugin/trx/trx0sys.c
+++ b/storage/innodb_plugin/trx/trx0sys.c
@@ -241,7 +241,9 @@ trx_sys_create_doublewrite_buf(void)
{
buf_block_t* block;
buf_block_t* block2;
+#ifdef UNIV_SYNC_DEBUG
buf_block_t* new_block;
+#endif /* UNIV_SYNC_DEBUG */
byte* doublewrite;
byte* fseg_header;
ulint page_no;
@@ -344,8 +346,11 @@ start_again:
the page position in the tablespace, then the page
has not been written to in doublewrite. */
- new_block = buf_page_get(TRX_SYS_SPACE, 0, page_no,
- RW_X_LATCH, &mtr);
+#ifdef UNIV_SYNC_DEBUG
+ new_block =
+#endif /* UNIV_SYNC_DEBUG */
+ buf_page_get(TRX_SYS_SPACE, 0, page_no,
+ RW_X_LATCH, &mtr);
buf_block_dbg_add_level(new_block,
SYNC_NO_ORDER_CHECK);
@@ -1338,7 +1343,7 @@ trx_sys_print_mysql_binlog_offset_from_page(
/* THESE ARE COPIED FROM NON-HOTBACKUP PART OF THE INNODB SOURCE TREE
- (This code duplicaton should be fixed at some point!)
+ (This code duplication should be fixed at some point!)
*/
#define TRX_SYS_SPACE 0 /* the SYSTEM tablespace */
diff --git a/storage/innodb_plugin/trx/trx0trx.c b/storage/innodb_plugin/trx/trx0trx.c
index 9722bb59a5e..ee744fd58b1 100644
--- a/storage/innodb_plugin/trx/trx0trx.c
+++ b/storage/innodb_plugin/trx/trx0trx.c
@@ -1805,7 +1805,6 @@ trx_prepare_off_kernel(
/*===================*/
trx_t* trx) /*!< in: transaction */
{
- page_t* update_hdr_page;
trx_rseg_t* rseg;
ib_uint64_t lsn = 0;
mtr_t mtr;
@@ -1838,7 +1837,7 @@ trx_prepare_off_kernel(
}
if (trx->update_undo) {
- update_hdr_page = trx_undo_set_state_at_prepare(
+ trx_undo_set_state_at_prepare(
trx, trx->update_undo, &mtr);
}
diff --git a/storage/innodb_plugin/trx/trx0undo.c b/storage/innodb_plugin/trx/trx0undo.c
index eb5112c4d31..76e88948e41 100644
--- a/storage/innodb_plugin/trx/trx0undo.c
+++ b/storage/innodb_plugin/trx/trx0undo.c
@@ -1066,14 +1066,11 @@ trx_undo_truncate_end(
ulint last_page_no;
trx_undo_rec_t* rec;
trx_undo_rec_t* trunc_here;
- trx_rseg_t* rseg;
mtr_t mtr;
ut_ad(mutex_own(&(trx->undo_mutex)));
ut_ad(mutex_own(&(trx->rseg->mutex)));
- rseg = trx->rseg;
-
for (;;) {
mtr_start(&mtr);
@@ -1826,21 +1823,11 @@ trx_undo_set_state_at_finish(
if (undo->size == 1
&& mach_read_from_2(page_hdr + TRX_UNDO_PAGE_FREE)
- < TRX_UNDO_PAGE_REUSE_LIMIT) {
+ < TRX_UNDO_PAGE_REUSE_LIMIT
+ && UT_LIST_GET_LEN(rseg->update_undo_list) < 500
+ && UT_LIST_GET_LEN(rseg->insert_undo_list) < 500) {
- /* This is a heuristic to avoid the problem of all UNDO
- slots ending up in one of the UNDO lists. Previously if
- the server crashed with all the slots in one of the lists,
- transactions that required the slots of a different type
- would fail for lack of slots. */
-
- if (UT_LIST_GET_LEN(rseg->update_undo_list) < 500
- && UT_LIST_GET_LEN(rseg->insert_undo_list) < 500) {
-
- state = TRX_UNDO_CACHED;
- } else {
- state = TRX_UNDO_TO_FREE;
- }
+ state = TRX_UNDO_CACHED;
} else if (undo->type == TRX_UNDO_INSERT) {
@@ -1868,7 +1855,6 @@ trx_undo_set_state_at_prepare(
mtr_t* mtr) /*!< in: mtr */
{
trx_usegf_t* seg_hdr;
- trx_upagef_t* page_hdr;
trx_ulogf_t* undo_header;
page_t* undo_page;
ulint offset;
@@ -1886,7 +1872,6 @@ trx_undo_set_state_at_prepare(
undo->hdr_page_no, mtr);
seg_hdr = undo_page + TRX_UNDO_SEG_HDR;
- page_hdr = undo_page + TRX_UNDO_PAGE_HDR;
/*------------------------------*/
undo->state = TRX_UNDO_PREPARED;
diff --git a/storage/maria/CMakeLists.txt b/storage/maria/CMakeLists.txt
index 850c2dd40cd..7724f9c5311 100644
--- a/storage/maria/CMakeLists.txt
+++ b/storage/maria/CMakeLists.txt
@@ -16,9 +16,6 @@ INCLUDE("${PROJECT_SOURCE_DIR}/storage/mysql_storage_engine.cmake")
INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib
${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/regex
@@ -65,9 +62,8 @@ TARGET_LINK_LIBRARIES(aria_read_log aria myisam mysys dbug strings zlib wsock32)
ADD_EXECUTABLE(aria_pack maria_pack.c)
TARGET_LINK_LIBRARIES(aria_pack aria myisam mysys dbug strings zlib wsock32)
-ADD_EXECUTABLE(aria_dump_log ma_loghandler.c unittest/ma_loghandler_examples.c)
+ADD_EXECUTABLE(aria_dump_log maria_dump_log.c unittest/ma_loghandler_examples.c)
TARGET_LINK_LIBRARIES(aria_dump_log aria myisam mysys dbug strings zlib wsock32)
-SET_TARGET_PROPERTIES(aria_dump_log PROPERTIES COMPILE_FLAGS "-DMARIA_DUMP_LOG")
ADD_EXECUTABLE(ma_test1 ma_test1.c)
TARGET_LINK_LIBRARIES(ma_test1 aria myisam mysys dbug strings zlib wsock32)
diff --git a/storage/maria/Makefile.am b/storage/maria/Makefile.am
index a83063a0226..c2bb61e77dd 100644
--- a/storage/maria/Makefile.am
+++ b/storage/maria/Makefile.am
@@ -34,6 +34,9 @@ EXTRA_DIST = ma_test_all.sh ma_test_all.res ma_test_big.sh \
ma_ft_stem.c CMakeLists.txt plug.in ma_test_recovery
pkgdata_DATA =
pkglib_LIBRARIES = libaria.a
+noinst_LTLIBRARIES = libaria.la libaria_s.la \
+ @plugin_aria_embedded_static_target@
+EXTRA_LTLIBRARIES = libaria_embedded.la
bin_PROGRAMS = aria_chk aria_pack aria_ftdump aria_read_log \
aria_dump_log
aria_chk_DEPENDENCIES= $(LIBRARIES)
@@ -66,8 +69,7 @@ aria_dump_log_LDADD= @CLIENT_EXTRA_LDFLAGS@ libaria.a \
$(top_builddir)/mysys/libmysys.a \
$(top_builddir)/dbug/libdbug.a \
$(top_builddir)/strings/libmystrings.a @ZLIB_LIBS@
-aria_dump_log_SOURCES= ma_loghandler.c unittest/ma_loghandler_examples.c
-aria_dump_log_CPPFLAGS= -DMARIA_DUMP_LOG
+aria_dump_log_SOURCES= maria_dump_log.c unittest/ma_loghandler_examples.c
noinst_PROGRAMS = ma_test1 ma_test2 ma_test3 ma_rt_test ma_sp_test
noinst_HEADERS = maria_def.h ma_rt_index.h ma_rt_key.h ma_rt_mbr.h \
ma_sp_defs.h ma_fulltext.h ma_ftdefs.h ma_ft_test1.h \
@@ -117,7 +119,7 @@ ma_sp_test_LDADD= @CLIENT_EXTRA_LDFLAGS@ libaria.a \
$(top_builddir)/mysys/libmysys.a \
$(top_builddir)/dbug/libdbug.a \
$(top_builddir)/strings/libmystrings.a @ZLIB_LIBS@
-libaria_a_SOURCES = ma_init.c ma_open.c ma_extra.c ma_info.c ma_rkey.c \
+libaria_la_SOURCES = ma_init.c ma_open.c ma_extra.c ma_info.c ma_rkey.c \
ma_rnext.c ma_rnext_same.c \
ma_search.c ma_page.c ma_key_recover.c ma_key.c \
ma_locking.c ma_state.c \
@@ -140,7 +142,20 @@ libaria_a_SOURCES = ma_init.c ma_open.c ma_extra.c ma_info.c ma_rkey.c \
ma_pagecache.c ma_pagecaches.c \
ma_checkpoint.c ma_recovery.c ma_commit.c \
ma_pagecrc.c ma_recovery_util.c \
- ha_maria.cc compat_aliases.cc ma_servicethread.c
+ compat_aliases.cc ma_servicethread.c
+
+libaria_s_la_SOURCES = ha_maria.cc
+libaria_s_la_CXXFLAGS = $(AM_CXXFLAGS)
+libaria_s_la_LIBADD = libaria.la
+libaria_embedded_la_SOURCES = ha_maria.cc
+libaria_embedded_la_LIBADD = libaria.la
+libaria_embedded_la_CXXFLAGS = $(AM_CXXFLAGS) @plugin_embedded_defs@
+
+libaria_a_SOURCES=
+libaria.a: libaria.la
+ $(CP) .libs/libaria.a $@
+
+
CLEANFILES = test?.MA? FT?.MA? isam.log ma_test_all ma_rt_test.MA? sp_test.MA? aria_log_control aria_log.0000*
SUFFIXES = .sh
@@ -197,6 +212,3 @@ test:
test-verbose:
HARNESS_VERBOSE=1 perl $(top_srcdir)/unittest/unit.pl run $(unittests)
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc
index 4b4537f8312..12637604869 100644
--- a/storage/maria/ha_maria.cc
+++ b/storage/maria/ha_maria.cc
@@ -228,7 +228,7 @@ static MYSQL_SYSVAR_ULONGLONG(pagecache_buffer_size, pagecache_buffer_size,
"The size of the buffer used for index blocks for Aria tables. "
"Increase this to get better index handling (for all reads and "
"multiple writes) to as much as you can afford.", 0, 0,
- KEY_CACHE_SIZE, 0, ~(ulong) 0, 1);
+ KEY_CACHE_SIZE, 8192*16L, ~(ulong) 0, 1);
static MYSQL_SYSVAR_ULONG(pagecache_division_limit, pagecache_division_limit,
PLUGIN_VAR_RQCMDARG,
@@ -821,7 +821,7 @@ int_table_flags(HA_NULL_IN_KEY | HA_CAN_FULLTEXT | HA_CAN_SQL_HANDLER |
HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE |
HA_DUPLICATE_POS | HA_CAN_INDEX_BLOBS | HA_AUTO_PART_KEY |
HA_FILE_BASED | HA_CAN_GEOMETRY | CANNOT_ROLLBACK_FLAG |
- HA_CAN_BIT_FIELD | HA_CAN_RTREEKEYS |
+ HA_CAN_BIT_FIELD | HA_CAN_RTREEKEYS | HA_CAN_VIRTUAL_COLUMNS |
HA_HAS_RECORDS | HA_STATS_RECORDS_IS_EXACT),
can_enable_indexes(1), bulk_insert_single_undo(BULK_INSERT_NONE)
{}
@@ -1059,8 +1059,6 @@ int ha_maria::close(void)
int ha_maria::write_row(uchar * buf)
{
- ha_statistic_increment(&SSV::ha_write_count);
-
/* If we have a timestamp column, update it to the current time */
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT)
table->timestamp_field->set_time();
@@ -1354,6 +1352,7 @@ int ha_maria::repair(THD * thd, HA_CHECK_OPT *check_opt)
T_SILENT | T_FORCE_CREATE | T_CALC_CHECKSUM |
(check_opt->flags & T_EXTEND ? T_REP : T_REP_BY_SORT));
param.sort_buffer_length= THDVAR(thd, sort_buffer_size);
+ param.backup_time= check_opt->start_time;
start_records= file->state->records;
while ((error= repair(thd, &param, 0)) && param.retry_repair)
{
@@ -2059,6 +2058,7 @@ bool ha_maria::check_and_repair(THD *thd)
DBUG_ENTER("ha_maria::check_and_repair");
check_opt.init();
+ check_opt.flags= T_MEDIUM | T_AUTO_REPAIR;
error= 1;
if ((file->s->state.changed &
@@ -2079,7 +2079,6 @@ bool ha_maria::check_and_repair(THD *thd)
DBUG_RETURN(error);
error= 0;
- check_opt.flags= T_MEDIUM | T_AUTO_REPAIR;
// Don't use quick if deleted rows
if (!file->state->del && (maria_recover_options & HA_RECOVER_QUICK))
check_opt.flags |= T_QUICK;
@@ -2130,7 +2129,6 @@ bool ha_maria::is_crashed() const
int ha_maria::update_row(const uchar * old_data, uchar * new_data)
{
CHECK_UNTIL_WE_FULLY_IMPLEMENTED_VERSIONING("UPDATE in WRITE CONCURRENT");
- ha_statistic_increment(&SSV::ha_update_count);
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE)
table->timestamp_field->set_time();
return maria_update(file, old_data, new_data);
@@ -2140,7 +2138,6 @@ int ha_maria::update_row(const uchar * old_data, uchar * new_data)
int ha_maria::delete_row(const uchar * buf)
{
CHECK_UNTIL_WE_FULLY_IMPLEMENTED_VERSIONING("DELETE in WRITE CONCURRENT");
- ha_statistic_increment(&SSV::ha_delete_count);
return maria_delete(file, buf);
}
@@ -2150,7 +2147,6 @@ int ha_maria::index_read_map(uchar * buf, const uchar * key,
enum ha_rkey_function find_flag)
{
DBUG_ASSERT(inited == INDEX);
- ha_statistic_increment(&SSV::ha_read_key_count);
int error= maria_rkey(file, buf, active_index, key, keypart_map, find_flag);
table->status= error ? STATUS_NOT_FOUND : 0;
return error;
@@ -2161,7 +2157,6 @@ int ha_maria::index_read_idx_map(uchar * buf, uint index, const uchar * key,
key_part_map keypart_map,
enum ha_rkey_function find_flag)
{
- ha_statistic_increment(&SSV::ha_read_key_count);
int error= maria_rkey(file, buf, index, key, keypart_map, find_flag);
table->status= error ? STATUS_NOT_FOUND : 0;
return error;
@@ -2173,7 +2168,6 @@ int ha_maria::index_read_last_map(uchar * buf, const uchar * key,
{
DBUG_ENTER("ha_maria::index_read_last_map");
DBUG_ASSERT(inited == INDEX);
- ha_statistic_increment(&SSV::ha_read_key_count);
int error= maria_rkey(file, buf, active_index, key, keypart_map,
HA_READ_PREFIX_LAST);
table->status= error ? STATUS_NOT_FOUND : 0;
@@ -2184,7 +2178,6 @@ int ha_maria::index_read_last_map(uchar * buf, const uchar * key,
int ha_maria::index_next(uchar * buf)
{
DBUG_ASSERT(inited == INDEX);
- ha_statistic_increment(&SSV::ha_read_next_count);
int error= maria_rnext(file, buf, active_index);
table->status= error ? STATUS_NOT_FOUND : 0;
return error;
@@ -2194,7 +2187,6 @@ int ha_maria::index_next(uchar * buf)
int ha_maria::index_prev(uchar * buf)
{
DBUG_ASSERT(inited == INDEX);
- ha_statistic_increment(&SSV::ha_read_prev_count);
int error= maria_rprev(file, buf, active_index);
table->status= error ? STATUS_NOT_FOUND : 0;
return error;
@@ -2204,7 +2196,6 @@ int ha_maria::index_prev(uchar * buf)
int ha_maria::index_first(uchar * buf)
{
DBUG_ASSERT(inited == INDEX);
- ha_statistic_increment(&SSV::ha_read_first_count);
int error= maria_rfirst(file, buf, active_index);
table->status= error ? STATUS_NOT_FOUND : 0;
return error;
@@ -2214,7 +2205,6 @@ int ha_maria::index_first(uchar * buf)
int ha_maria::index_last(uchar * buf)
{
DBUG_ASSERT(inited == INDEX);
- ha_statistic_increment(&SSV::ha_read_last_count);
int error= maria_rlast(file, buf, active_index);
table->status= error ? STATUS_NOT_FOUND : 0;
return error;
@@ -2227,7 +2217,6 @@ int ha_maria::index_next_same(uchar * buf,
{
int error;
DBUG_ASSERT(inited == INDEX);
- ha_statistic_increment(&SSV::ha_read_next_count);
/*
TODO: Delete this loop in Maria 1.5 as versioning will ensure this never
happens
@@ -2259,7 +2248,6 @@ int ha_maria::rnd_end()
int ha_maria::rnd_next(uchar *buf)
{
- ha_statistic_increment(&SSV::ha_read_rnd_next_count);
int error= maria_scan(file, buf);
table->status= error ? STATUS_NOT_FOUND : 0;
return error;
@@ -2281,7 +2269,6 @@ int ha_maria::restart_rnd_next(uchar *buf)
int ha_maria::rnd_pos(uchar *buf, uchar *pos)
{
- ha_statistic_increment(&SSV::ha_read_rnd_count);
int error= maria_rrnd(file, buf, my_get_ptr(pos, ref_length));
table->status= error ? STATUS_NOT_FOUND : 0;
return error;
@@ -3301,6 +3288,9 @@ static int ha_maria_init(void *p)
maria_hton->panic= maria_hton_panic;
maria_hton->commit= maria_commit;
maria_hton->rollback= maria_rollback;
+#ifdef MARIA_CANNOT_ROLLBACK
+ maria_hton->commit= 0;
+#endif
maria_hton->flush_logs= maria_flush_logs;
maria_hton->show_status= maria_show_status;
/* TODO: decide if we support Maria being used for log tables */
diff --git a/storage/maria/ha_maria.h b/storage/maria/ha_maria.h
index 251e4069d59..39307e5efdd 100644
--- a/storage/maria/ha_maria.h
+++ b/storage/maria/ha_maria.h
@@ -143,7 +143,6 @@ public:
int assign_to_keycache(THD * thd, HA_CHECK_OPT * check_opt);
int preload_keys(THD * thd, HA_CHECK_OPT * check_opt);
bool check_if_incompatible_data(HA_CREATE_INFO * info, uint table_changes);
- bool check_if_supported_virtual_columns(void) { return TRUE;}
#ifdef HAVE_REPLICATION
int dump(THD * thd, int fd);
int net_read_dump(NET * net);
diff --git a/storage/maria/ma_bitmap.c b/storage/maria/ma_bitmap.c
index c0763b0612d..bc83f6ea0e9 100644
--- a/storage/maria/ma_bitmap.c
+++ b/storage/maria/ma_bitmap.c
@@ -399,7 +399,8 @@ my_bool _ma_bitmap_flush_all(MARIA_SHARE *share)
become false, wake them up.
*/
DBUG_PRINT("info", ("bitmap flusher waking up others"));
- pthread_cond_broadcast(&bitmap->bitmap_cond);
+ if (bitmap->flush_all_requested)
+ pthread_cond_broadcast(&bitmap->bitmap_cond);
}
pthread_mutex_unlock(&bitmap->bitmap_lock);
DBUG_RETURN(res);
@@ -465,7 +466,8 @@ void _ma_bitmap_unlock(MARIA_SHARE *share)
bitmap->flush_all_requested--;
bitmap->non_flushable= 0;
pthread_mutex_unlock(&bitmap->bitmap_lock);
- pthread_cond_broadcast(&bitmap->bitmap_cond);
+ if (bitmap->flush_all_requested > 0)
+ pthread_cond_broadcast(&bitmap->bitmap_cond);
DBUG_VOID_RETURN;
}
@@ -492,7 +494,7 @@ static void _ma_bitmap_unpin_all(MARIA_SHARE *share)
while (pinned_page-- != page_link)
pagecache_unlock_by_link(share->pagecache, pinned_page->link,
pinned_page->unlock, PAGECACHE_UNPIN,
- LSN_IMPOSSIBLE, LSN_IMPOSSIBLE, TRUE, TRUE);
+ LSN_IMPOSSIBLE, LSN_IMPOSSIBLE, FALSE, TRUE);
bitmap->pinned_pages.elements= 0;
DBUG_VOID_RETURN;
}
diff --git a/storage/maria/ma_blockrec.c b/storage/maria/ma_blockrec.c
index fd02e2ac0ec..a2faeb6e7fa 100644
--- a/storage/maria/ma_blockrec.c
+++ b/storage/maria/ma_blockrec.c
@@ -2506,7 +2506,7 @@ static my_bool free_full_page_range(MARIA_HA *info, pgcache_page_no_t page,
}
if (delete_count &&
pagecache_delete_pages(share->pagecache, &info->dfile,
- page, delete_count, PAGECACHE_LOCK_WRITE, 0))
+ page, delete_count, PAGECACHE_LOCK_WRITE, 1))
res= 1;
if (share->now_transactional)
@@ -2816,7 +2816,6 @@ static my_bool write_block_record(MARIA_HA *info,
DBUG_PRINT("info", ("Used head length on page: %u header_length: %u",
head_length,
(uint) (flag & ROW_FLAG_TRANSID ? TRANSID_SIZE : 0)));
- DBUG_ASSERT(data <= end_of_data);
if (head_length < share->base.min_block_length)
{
/* Extend row to be of size min_block_length */
@@ -2825,6 +2824,7 @@ static my_bool write_block_record(MARIA_HA *info,
data+= diff_length;
head_length= share->base.min_block_length;
}
+ DBUG_ASSERT(data <= end_of_data);
/*
If this is a redo entry (ie, undo_lsn != LSN_ERROR) then we should have
written exactly head_length bytes (same as original record).
@@ -3492,7 +3492,9 @@ static my_bool allocate_and_write_block_record(MARIA_HA *info,
/* page will be pinned & locked by get_head_or_tail_page */
if (get_head_or_tail_page(info, blocks->block, info->buff,
- row->space_on_head_page, HEAD_PAGE,
+ max(row->space_on_head_page,
+ info->s->base.min_block_length),
+ HEAD_PAGE,
PAGECACHE_LOCK_WRITE, &row_pos))
goto err;
row->lastpos= ma_recordpos(blocks->block->page, row_pos.rownr);
@@ -4179,6 +4181,13 @@ static my_bool delete_head_or_tail(MARIA_HA *info,
log_data, NULL))
DBUG_RETURN(1);
}
+ /*
+ Mark that this page must be written to disk by page cache, even
+ if we could call pagecache_delete() on it.
+ This is needed to ensure that repair finds the empty page on disk
+ and not old data.
+ */
+ pagecache_set_write_on_delete_by_link(page_link.link);
DBUG_ASSERT(empty_space >= share->bitmap.sizes[0]);
}
@@ -4932,7 +4941,7 @@ int _ma_read_block_record2(MARIA_HA *info, uchar *record,
goto err;
}
#ifdef EXTRA_DEBUG
- if (share->calc_checksum)
+ if (share->calc_checksum && !info->in_check_table)
{
/* Esnure that row checksum is correct */
DBUG_ASSERT(((share->calc_checksum)(info, record) & 255) ==
@@ -6485,7 +6494,13 @@ err:
@param info Maria handler
@param header Header (without FILEID)
- @note It marks the pages free in the bitmap
+ Mark the pages free in the bitmap.
+
+ We have to check against _ma_redo_not_needed_for_page()
+ to guard against the case where we first clear a block and after
+ that insert new data into the blocks. If we would unconditionally
+ clear the bitmap here, future changes would be ignored for the page
+ if it's not in the dirty list (ie, it would be flushed).
@return Operation status
@retval 0 OK
@@ -6494,19 +6509,25 @@ err:
uint _ma_apply_redo_free_blocks(MARIA_HA *info,
LSN lsn __attribute__((unused)),
+ LSN redo_lsn,
const uchar *header)
{
MARIA_SHARE *share= info->s;
uint ranges;
+ uint16 sid;
DBUG_ENTER("_ma_apply_redo_free_blocks");
share->state.changed|= (STATE_CHANGED | STATE_NOT_ZEROFILLED |
STATE_NOT_MOVABLE);
+ sid= fileid_korr(header);
+ header+= FILEID_STORE_SIZE;
ranges= pagerange_korr(header);
header+= PAGERANGE_STORE_SIZE;
DBUG_ASSERT(ranges > 0);
+ /** @todo leave bitmap lock to the bitmap code... */
+ pthread_mutex_lock(&share->bitmap.bitmap_lock);
while (ranges--)
{
my_bool res;
@@ -6523,18 +6544,22 @@ uint _ma_apply_redo_free_blocks(MARIA_HA *info,
DBUG_PRINT("info", ("page: %lu pages: %u", (long) page, page_range));
- /** @todo leave bitmap lock to the bitmap code... */
- pthread_mutex_lock(&share->bitmap.bitmap_lock);
- res= _ma_bitmap_reset_full_page_bits(info, &share->bitmap, start_page,
- page_range);
- pthread_mutex_unlock(&share->bitmap.bitmap_lock);
- if (res)
+ for ( ; page_range-- ; start_page++)
{
- _ma_mark_file_crashed(share);
- DBUG_ASSERT(0);
- DBUG_RETURN(res);
+ if (_ma_redo_not_needed_for_page(sid, redo_lsn, start_page, FALSE))
+ continue;
+ res= _ma_bitmap_reset_full_page_bits(info, &share->bitmap, start_page,
+ 1);
+ if (res)
+ {
+ pthread_mutex_unlock(&share->bitmap.bitmap_lock);
+ _ma_mark_file_crashed(share);
+ DBUG_ASSERT(0);
+ DBUG_RETURN(res);
+ }
}
}
+ pthread_mutex_unlock(&share->bitmap.bitmap_lock);
DBUG_RETURN(0);
}
@@ -6687,21 +6712,23 @@ uint _ma_apply_redo_insert_row_blobs(MARIA_HA *info,
uint page_range;
pgcache_page_no_t page, start_page;
uchar *buff;
+ uint data_on_page= data_size;
start_page= page= page_korr(header);
header+= PAGE_STORE_SIZE;
page_range= pagerange_korr(header);
header+= PAGERANGE_STORE_SIZE;
- for (i= page_range; i-- > 0 ; page++)
+ for (i= page_range; i-- > 0 ; page++, data+= data_on_page)
{
MARIA_PINNED_PAGE page_link;
enum pagecache_page_lock unlock_method;
enum pagecache_page_pin unpin_method;
- uint length;
set_if_smaller(first_page2, page);
set_if_bigger(last_page2, page);
+ if (i == 0 && sub_ranges == 0)
+ data_on_page= data_size - empty_space; /* data on last page */
if (_ma_redo_not_needed_for_page(sid, redo_lsn, page, FALSE))
continue;
@@ -6764,7 +6791,7 @@ uint _ma_apply_redo_insert_row_blobs(MARIA_HA *info,
PAGECACHE_LOCK_WRITE_UNLOCK,
PAGECACHE_UNPIN, LSN_IMPOSSIBLE,
LSN_IMPOSSIBLE, 0, FALSE);
- continue;
+ goto fix_bitmap;
}
DBUG_ASSERT((found_page_type == (uchar) BLOB_PAGE) ||
(found_page_type == (uchar) UNALLOCATED_PAGE));
@@ -6780,33 +6807,32 @@ uint _ma_apply_redo_insert_row_blobs(MARIA_HA *info,
lsn_store(buff, lsn);
buff[PAGE_TYPE_OFFSET]= BLOB_PAGE;
- length= data_size;
- if (i == 0 && sub_ranges == 0)
+ if (data_on_page != data_size)
{
/*
Last page may be only partly filled. We zero the rest, like
write_full_pages() does.
*/
- length-= empty_space;
bzero(buff + share->block_size - PAGE_SUFFIX_SIZE - empty_space,
empty_space);
}
- memcpy(buff+ PAGE_TYPE_OFFSET + 1, data, length);
- data+= length;
+ memcpy(buff+ PAGE_TYPE_OFFSET + 1, data, data_on_page);
if (pagecache_write(share->pagecache,
&info->dfile, page, 0,
buff, PAGECACHE_PLAIN_PAGE,
unlock_method, unpin_method,
PAGECACHE_WRITE_DELAY, 0, LSN_IMPOSSIBLE))
goto err;
- }
+
+ fix_bitmap:
/** @todo leave bitmap lock to the bitmap code... */
- pthread_mutex_lock(&share->bitmap.bitmap_lock);
- res= _ma_bitmap_set_full_page_bits(info, &share->bitmap, start_page,
- page_range);
- pthread_mutex_unlock(&share->bitmap.bitmap_lock);
- if (res)
- goto err;
+ pthread_mutex_lock(&share->bitmap.bitmap_lock);
+ res= _ma_bitmap_set_full_page_bits(info, &share->bitmap, page,
+ 1);
+ pthread_mutex_unlock(&share->bitmap.bitmap_lock);
+ if (res)
+ goto err;
+ }
}
}
*first_page= first_page2;
diff --git a/storage/maria/ma_blockrec.h b/storage/maria/ma_blockrec.h
index a5858880dd0..e63af8eed5b 100644
--- a/storage/maria/ma_blockrec.h
+++ b/storage/maria/ma_blockrec.h
@@ -235,7 +235,7 @@ uint _ma_apply_redo_insert_row_head_or_tail(MARIA_HA *info, LSN lsn,
uint _ma_apply_redo_purge_row_head_or_tail(MARIA_HA *info, LSN lsn,
uint page_type,
const uchar *header);
-uint _ma_apply_redo_free_blocks(MARIA_HA *info, LSN lsn,
+uint _ma_apply_redo_free_blocks(MARIA_HA *info, LSN lsn, LSN rec_lsn,
const uchar *header);
uint _ma_apply_redo_free_head_or_tail(MARIA_HA *info, LSN lsn,
const uchar *header);
diff --git a/storage/maria/ma_check.c b/storage/maria/ma_check.c
index 307befab5c7..4dd59043c59 100644
--- a/storage/maria/ma_check.c
+++ b/storage/maria/ma_check.c
@@ -100,6 +100,9 @@ static my_bool _ma_flush_table_files_before_swap(HA_CHECK *param,
static TrID max_trid_in_system(void);
static void _ma_check_print_not_visible_error(HA_CHECK *param, TrID used_trid);
void retry_if_quick(MARIA_SORT_PARAM *param, int error);
+static void print_bitmap_description(MARIA_SHARE *share,
+ pgcache_page_no_t page,
+ uchar *buff);
/* Initialize check param with default values */
@@ -878,6 +881,7 @@ static int chk_index(HA_CHECK *param, MARIA_HA *info, MARIA_KEYDEF *keyinfo,
}
info->last_key.keyinfo= tmp_key.keyinfo= keyinfo;
+ info->lastinx= ~0; /* Safety */
tmp_key.data= tmp_key_buff;
for ( ;; )
{
@@ -1131,6 +1135,7 @@ static int check_keys_in_record(HA_CHECK *param, MARIA_HA *info, int extend,
{
(*keyinfo->make_key)(info, &key, keynr, info->lastkey_buff, record,
start_recpos, 0);
+ info->last_key.keyinfo= key.keyinfo;
if (extend)
{
/* We don't need to lock the key tree here as we don't allow
@@ -1842,6 +1847,8 @@ static int check_block_record(HA_CHECK *param, MARIA_HA *info, int extend,
}
param->used+= block_size;
param->link_used+= block_size;
+ if (param->verbose > 2)
+ print_bitmap_description(share, page, bitmap_buff);
continue;
}
/* Skip pages marked as empty in bitmap */
@@ -2034,6 +2041,8 @@ int maria_chk_data_link(HA_CHECK *param, MARIA_HA *info, my_bool extend)
bzero((char*) param->tmp_key_crc,
share->base.keys * sizeof(param->tmp_key_crc[0]));
+ info->in_check_table= 1; /* Don't assert on checksum errors */
+
switch (share->data_file_type) {
case BLOCK_RECORD:
error= check_block_record(param, info, extend, record);
@@ -2049,6 +2058,8 @@ int maria_chk_data_link(HA_CHECK *param, MARIA_HA *info, my_bool extend)
break;
} /* switch */
+ info->in_check_table= 0;
+
if (error)
goto err;
@@ -2177,12 +2188,17 @@ int maria_chk_data_link(HA_CHECK *param, MARIA_HA *info, my_bool extend)
llstr(param->del_length, llbuff2));
printf("Empty space: %12s Linkdata: %10s\n",
llstr(param->empty, llbuff),llstr(param->link_used, llbuff2));
- if (param->lost)
- printf("Lost space: %12s", llstr(param->lost, llbuff));
- if (param->max_found_trid)
+ if (share->data_file_type == BLOCK_RECORD)
{
- printf("Max trans. id: %11s\n",
- llstr(param->max_found_trid, llbuff));
+ printf("Full pages: %12s Tail count: %12s\n",
+ llstr(param->full_page_count, llbuff),
+ llstr(param->tail_count, llbuff2));
+ printf("Lost space: %12s\n", llstr(param->lost, llbuff));
+ if (param->max_found_trid)
+ {
+ printf("Max trans. id: %11s\n",
+ llstr(param->max_found_trid, llbuff));
+ }
}
}
my_free(record,MYF(0));
@@ -2616,6 +2632,7 @@ int maria_repair(HA_CHECK *param, register MARIA_HA *info,
maria_lock_memory(param); /* Everything is alloced */
+ sort_param.sort_info->info->in_check_table= 1;
/* Re-create all keys, which are set in key_map. */
while (!(error=sort_get_next_record(&sort_param)))
{
@@ -2743,7 +2760,7 @@ int maria_repair(HA_CHECK *param, register MARIA_HA *info,
new_file= -1;
change_data_file_descriptor(info, -1);
if (maria_change_to_newfile(share->data_file_name.str, MARIA_NAME_DEXT,
- DATA_TMP_EXT,
+ DATA_TMP_EXT, param->backup_time,
(param->testflag & T_BACKUP_DATA ?
MYF(MY_REDEL_MAKE_BACKUP): MYF(0)) |
sync_dir) ||
@@ -2783,6 +2800,7 @@ err:
VOID(end_io_cache(&sort_info.new_info->rec_cache));
info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED);
sort_info.new_info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED);
+ sort_param.sort_info->info->in_check_table= 0;
/* this below could fail, shouldn't we detect error? */
if (got_error)
{
@@ -3059,7 +3077,7 @@ int maria_sort_index(HA_CHECK *param, register MARIA_HA *info, char *name)
pthread_mutex_unlock(&share->intern_lock);
VOID(my_close(new_file,MYF(MY_WME)));
if (maria_change_to_newfile(share->index_file_name.str, MARIA_NAME_IEXT,
- INDEX_TMP_EXT, sync_dir) ||
+ INDEX_TMP_EXT, 0, sync_dir) ||
_ma_open_keyfile(share))
goto err2;
info->lock_type= F_UNLCK; /* Force maria_readinfo to lock */
@@ -3133,7 +3151,8 @@ static int sort_one_index(HA_CHECK *param, MARIA_HA *info,
key.keyinfo= keyinfo;
if (!(buff= (uchar*) my_alloca((uint) keyinfo->block_length +
- keyinfo->maxlength)))
+ keyinfo->maxlength +
+ MARIA_INDEX_OVERHEAD_SIZE)))
{
_ma_check_print_error(param,"Not enough memory for key block");
DBUG_RETURN(-1);
@@ -3232,6 +3251,7 @@ static my_bool maria_zerofill_index(HA_CHECK *param, MARIA_HA *info,
uint block_size= share->block_size;
my_bool zero_lsn= (share->base.born_transactional &&
!(param->testflag & T_ZEROFILL_KEEP_LSN));
+ int error= 1;
DBUG_ENTER("maria_zerofill_index");
if (!(param->testflag & T_SILENT))
@@ -3256,7 +3276,7 @@ static my_bool maria_zerofill_index(HA_CHECK *param, MARIA_HA *info,
_ma_check_print_error(param,
"Page %9s: Got error %d when reading index file",
llstr(pos, llbuff), my_errno);
- DBUG_RETURN(1);
+ goto end;
}
if (zero_lsn)
bzero(buff, LSN_SIZE);
@@ -3264,7 +3284,7 @@ static my_bool maria_zerofill_index(HA_CHECK *param, MARIA_HA *info,
if (share->base.born_transactional)
{
uint keynr= _ma_get_keynr(share, buff);
- if (keynr != MARIA_DELETE_KEY_NR)
+ if (keynr < share->base.keys)
{
MARIA_PAGE page;
DBUG_ASSERT(keynr < share->base.keys);
@@ -3276,7 +3296,7 @@ static my_bool maria_zerofill_index(HA_CHECK *param, MARIA_HA *info,
"Page %9s: Got error %d when reading index "
"file",
llstr(pos, llbuff), my_errno);
- DBUG_RETURN(1);
+ goto end;
}
}
}
@@ -3290,10 +3310,13 @@ static my_bool maria_zerofill_index(HA_CHECK *param, MARIA_HA *info,
PAGECACHE_UNPIN, LSN_IMPOSSIBLE,
LSN_IMPOSSIBLE, 1, FALSE);
}
+ error= 0; /* ok */
+
+end:
if (flush_pagecache_blocks(share->pagecache, &share->kfile,
FLUSH_FORCE_WRITE))
DBUG_RETURN(1);
- DBUG_RETURN(0);
+ DBUG_RETURN(error);
}
@@ -3492,20 +3515,15 @@ int maria_zerofill(HA_CHECK *param, MARIA_HA *info, const char *name)
*/
int maria_change_to_newfile(const char * filename, const char * old_ext,
- const char * new_ext, myf MyFlags)
+ const char * new_ext, time_t backup_time,
+ myf MyFlags)
{
char old_filename[FN_REFLEN],new_filename[FN_REFLEN];
-#ifdef USE_RAID
- if (raid_chunks)
- return my_raid_redel(fn_format(old_filename,filename,"",old_ext,2+4),
- fn_format(new_filename,filename,"",new_ext,2+4),
- raid_chunks,
- MYF(MY_WME | MY_LINK_WARNING | MyFlags));
-#endif
/* Get real path to filename */
(void) fn_format(old_filename,filename,"",old_ext,2+4+32);
return my_redel(old_filename,
fn_format(new_filename,old_filename,"",new_ext,2+4),
+ backup_time,
MYF(MY_WME | MY_LINK_WARNING | MyFlags));
} /* maria_change_to_newfile */
@@ -3875,7 +3893,7 @@ int maria_repair_by_sort(HA_CHECK *param, register MARIA_HA *info,
}
change_data_file_descriptor(info, -1);
if (maria_change_to_newfile(share->data_file_name.str, MARIA_NAME_DEXT,
- DATA_TMP_EXT,
+ DATA_TMP_EXT, param->backup_time,
(param->testflag & T_BACKUP_DATA ?
MYF(MY_REDEL_MAKE_BACKUP): MYF(0)) |
sync_dir) ||
@@ -4500,7 +4518,7 @@ err:
my_close(new_file,MYF(0));
info->dfile.file= new_file= -1;
if (maria_change_to_newfile(share->data_file_name.str, MARIA_NAME_DEXT,
- DATA_TMP_EXT,
+ DATA_TMP_EXT, param->backup_time,
MYF((param->testflag & T_BACKUP_DATA ?
MY_REDEL_MAKE_BACKUP : 0) |
sync_dir)) ||
@@ -4758,7 +4776,7 @@ static int sort_get_next_record(MARIA_SORT_PARAM *sort_param)
DBUG_RETURN(-1);
}
/* Retry only if wrong record, not if disk error */
- if (flag != HA_ERR_WRONG_IN_RECORD)
+ if (flag != HA_ERR_WRONG_IN_RECORD && flag != HA_ERR_WRONG_CRC)
{
retry_if_quick(sort_param, flag);
DBUG_RETURN(flag);
@@ -6448,6 +6466,9 @@ static void change_data_file_descriptor(MARIA_HA *info, File new_file)
static void unuse_data_file_descriptor(MARIA_HA *info)
{
+ (void) flush_pagecache_blocks(info->s->pagecache,
+ &info->s->bitmap.file,
+ FLUSH_IGNORE_CHANGED);
info->dfile.file= info->s->bitmap.file.file= -1;
_ma_bitmap_reset_cache(info->s);
}
@@ -6803,3 +6824,46 @@ void retry_if_quick(MARIA_SORT_PARAM *sort_param, int error)
param->testflag|=T_RETRY_WITHOUT_QUICK;
}
}
+
+/* Print information about bitmap page */
+
+static void print_bitmap_description(MARIA_SHARE *share,
+ pgcache_page_no_t page,
+ uchar *bitmap_data)
+{
+ uchar *pos, *end;
+ MARIA_FILE_BITMAP *bitmap= &share->bitmap;
+ uint count=0, dot_printed= 0;
+ char buff[80], last[80];
+
+ printf("Bitmap page %lu\n", (ulong) page);
+ page++;
+ last[0]=0;
+ for (pos= bitmap_data, end= pos+ bitmap->used_size ; pos < end ; pos+= 6)
+ {
+ ulonglong bits= uint6korr(pos); /* 6 bytes = 6*8/3= 16 patterns */
+ uint i;
+
+ for (i= 0; i < 16 ; i++, bits>>= 3)
+ {
+ if (count > 60)
+ {
+ buff[count]= 0;
+ if (strcmp(buff, last))
+ {
+ memcpy(last, buff, count+1);
+ printf("%8lu: %s\n", (ulong) page - count, buff);
+ dot_printed= 0;
+ }
+ else if (!(dot_printed++))
+ printf("...\n");
+ count= 0;
+ }
+ buff[count++]= '0' + (uint) (bits & 7);
+ page++;
+ }
+ }
+ buff[count]= 0;
+ printf("%8lu: %s\n", (ulong) page - count, buff);
+ fputs("\n", stdout);
+}
diff --git a/storage/maria/ma_extra.c b/storage/maria/ma_extra.c
index 81f3789523f..e436a51248a 100644
--- a/storage/maria/ma_extra.c
+++ b/storage/maria/ma_extra.c
@@ -50,7 +50,7 @@ int maria_extra(MARIA_HA *info, enum ha_extra_function function,
switch (function) {
case HA_EXTRA_RESET_STATE: /* Reset state (don't free buffers) */
- info->lastinx= 0; /* Use first index as def */
+ info->lastinx= ~0; /* Detect index changes */
info->last_search_keypage= info->cur_row.lastpos= HA_OFFSET_ERROR;
info->page_changed= 1;
/* Next/prev gives first/last */
@@ -545,7 +545,7 @@ int maria_reset(MARIA_HA *info)
#endif
info->opt_flag&= ~(KEY_READ_USED | REMEMBER_OLD_POS);
info->quick_mode= 0;
- info->lastinx= 0; /* Use first index as def */
+ info->lastinx= ~0; /* detect index changes */
info->last_search_keypage= info->cur_row.lastpos= HA_OFFSET_ERROR;
info->page_changed= 1;
info->update= ((info->update & HA_STATE_CHANGED) | HA_STATE_NEXT_FOUND |
diff --git a/storage/maria/ma_ft_boolean_search.c b/storage/maria/ma_ft_boolean_search.c
index d302892ce05..35a34d32713 100644
--- a/storage/maria/ma_ft_boolean_search.c
+++ b/storage/maria/ma_ft_boolean_search.c
@@ -356,7 +356,8 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
{
ftbw->key_root=info->s->state.key_root[ftb->keynr];
ftbw->keyinfo=info->s->keyinfo+ftb->keynr;
- key.keyinfo= ftbw->keyinfo;
+ info->last_key.keyinfo= key.keyinfo= ftbw->keyinfo;
+ info->lastinx= ~0; /* Safety */
key.data= ftbw->word;
key.data_length= ftbw->len;
key.ref_length= 0;
@@ -380,7 +381,8 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
max_docid);
}
- key.keyinfo= ftbw->keyinfo;
+ info->last_key.keyinfo= key.keyinfo= ftbw->keyinfo;
+ info->lastinx= ~0; /* Safety */
key.data= lastkey_buf;
key.data_length= USE_WHOLE_KEY;
key.ref_length= 0;
diff --git a/storage/maria/ma_loghandler.c b/storage/maria/ma_loghandler.c
index dc99554a08d..948cd2bf712 100644
--- a/storage/maria/ma_loghandler.c
+++ b/storage/maria/ma_loghandler.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007 MySQL AB & Sanja Belkin
+/* Copyright (C) 2007 MySQL AB & Sanja Belkin. 2010 Monty Program Ab.
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
@@ -1149,34 +1149,14 @@ static my_bool translog_max_lsn_to_header(File file, LSN lsn)
/*
- Information from transaction log file header
-*/
-
-typedef struct st_loghandler_file_info
-{
- /*
- LSN_IMPOSSIBLE for current file (not finished file).
- Maximum LSN of the record which parts stored in the
- file.
- */
- LSN max_lsn;
- ulonglong timestamp; /* Time stamp */
- ulong maria_version; /* Version of maria loghandler */
- ulong mysql_version; /* Version of mysql server */
- ulong server_id; /* Server ID */
- ulong page_size; /* Loghandler page size */
- ulong file_number; /* Number of the file (from the file header) */
-} LOGHANDLER_FILE_INFO;
-
-/*
@brief Extract hander file information from loghandler file page
@param desc header information descriptor to be filled with information
@param page_buff buffer with the page content
*/
-static void translog_interpret_file_header(LOGHANDLER_FILE_INFO *desc,
- uchar *page_buff)
+void translog_interpret_file_header(LOGHANDLER_FILE_INFO *desc,
+ uchar *page_buff)
{
uchar *ptr;
@@ -2557,24 +2537,13 @@ my_bool translog_prev_buffer_flush_wait(struct st_translog_buffer *buffer)
LSN_IN_PARTS(buffer->prev_sent_to_disk),
LSN_IN_PARTS(buffer->prev_buffer_offset)));
translog_buffer_lock_assert_owner(buffer);
- /*
- if prev_sent_to_disk == LSN_IMPOSSIBLE then
- prev_buffer_offset should be LSN_IMPOSSIBLE
- because it means that this buffer was never used
- */
- DBUG_ASSERT((buffer->prev_sent_to_disk == LSN_IMPOSSIBLE &&
- buffer->prev_buffer_offset == LSN_IMPOSSIBLE) ||
- buffer->prev_sent_to_disk != LSN_IMPOSSIBLE);
if (buffer->prev_buffer_offset != buffer->prev_sent_to_disk)
{
do {
pthread_cond_wait(&buffer->prev_sent_to_disk_cond, &buffer->mutex);
if (buffer->file != file || buffer->offset != offset ||
buffer->ver != ver)
- {
- translog_buffer_unlock(buffer);
DBUG_RETURN(1); /* some the thread flushed the buffer already */
- }
} while(buffer->prev_buffer_offset != buffer->prev_sent_to_disk);
}
DBUG_RETURN(0);
@@ -2621,11 +2590,10 @@ static my_bool translog_buffer_flush(struct st_translog_buffer *buffer)
{
/* some other flush in progress */
translog_wait_for_closing(buffer);
+ if (buffer->file != file || buffer->offset != offset || buffer->ver != ver)
+ DBUG_RETURN(0); /* some the thread flushed the buffer already */
}
- if (buffer->file != file || buffer->offset != offset || buffer->ver != ver)
- DBUG_RETURN(0); /* some the thread flushed the buffer already */
-
if (buffer->overlay && translog_prev_buffer_flush_wait(buffer))
DBUG_RETURN(0); /* some the thread flushed the buffer already */
@@ -3520,7 +3488,7 @@ my_bool translog_walk_filenames(const char *directory,
@brief Fills table of dependence length of page header from page flags
*/
-static void translog_fill_overhead_table()
+void translog_fill_overhead_table()
{
uint i;
for (i= 0; i < TRANSLOG_FLAGS_NUM; i++)
@@ -7792,6 +7760,7 @@ void translog_flush_buffers(TRANSLOG_ADDRESS *lsn,
uint i;
uint8 last_buffer_no, start_buffer_no;
DBUG_ENTER("translog_flush_buffers");
+ LINT_INIT(last_buffer_no);
/*
We will recheck information when will lock buffers one by
@@ -7812,7 +7781,6 @@ void translog_flush_buffers(TRANSLOG_ADDRESS *lsn,
(uint) start_buffer_no, (uint) log_descriptor.bc.buffer_no,
LSN_IN_PARTS(log_descriptor.bc.buffer->prev_last_lsn)));
-
/*
if LSN up to which we have to flush bigger then maximum LSN of previous
buffer and at least one LSN was saved in the current buffer (last_lsn !=
@@ -7824,18 +7792,28 @@ void translog_flush_buffers(TRANSLOG_ADDRESS *lsn,
struct st_translog_buffer *buffer= log_descriptor.bc.buffer;
*lsn= log_descriptor.bc.buffer->last_lsn; /* fix lsn if it was horizon */
DBUG_PRINT("info", ("LSN to flush fixed to last lsn: (%lu,0x%lx)",
- LSN_IN_PARTS(log_descriptor.bc.buffer->last_lsn)));
+ LSN_IN_PARTS(*lsn)));
last_buffer_no= log_descriptor.bc.buffer_no;
log_descriptor.is_everything_flushed= 1;
translog_force_current_buffer_to_finish();
translog_buffer_unlock(buffer);
}
- else
+ else if (log_descriptor.bc.buffer->prev_last_lsn != LSN_IMPOSSIBLE)
{
+ /* fix lsn if it was horizon */
+ *lsn= log_descriptor.bc.buffer->prev_last_lsn;
+ DBUG_PRINT("info", ("LSN to flush fixed to prev last lsn: (%lu,0x%lx)",
+ LSN_IN_PARTS(*lsn)));
last_buffer_no= ((log_descriptor.bc.buffer_no + TRANSLOG_BUFFERS_NO -1) %
TRANSLOG_BUFFERS_NO);
translog_unlock();
}
+ else if (log_descriptor.bc.buffer->last_lsn == LSN_IMPOSSIBLE)
+ {
+ DBUG_PRINT("info", ("There is no LSNs yet generated => do nothing"));
+ translog_unlock();
+ DBUG_VOID_RETURN;
+ }
/* flush buffers */
*sent_to_disk= translog_get_sent_to_disk();
@@ -8861,117 +8839,6 @@ void translog_soft_sync_end(void)
}
-#ifdef MARIA_DUMP_LOG
-#include <my_getopt.h>
-extern void translog_example_table_init();
-static const char *load_default_groups[]= { "aria_dump_log",0 };
-static void get_options(int *argc,char * * *argv);
-#ifndef DBUG_OFF
-#if defined(__WIN__)
-const char *default_dbug_option= "d:t:i:O,\\aria_dump_log.trace";
-#else
-const char *default_dbug_option= "d:t:i:o,/tmp/aria_dump_log.trace";
-#endif
-#endif
-static ulonglong opt_offset;
-static ulong opt_pages;
-static const char *opt_file= NULL;
-static File handler= -1;
-static my_bool opt_unit= 0;
-static struct my_option my_long_options[] =
-{
-#ifdef IMPLTMENTED
- {"body", 'b',
- "Print chunk body dump",
- (uchar **) &opt_body, (uchar **) &opt_body, 0,
- GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-#endif
-#ifndef DBUG_OFF
- {"debug", '#', "Output debug log. Often the argument is 'd:t:o,filename'.",
- 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
-#endif
- {"file", 'f', "Path to file which will be read",
- (uchar**) &opt_file, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"help", '?', "Display this help and exit.",
- 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- { "offset", 'o', "Start reading log from this offset",
- (uchar**) &opt_offset, (uchar**) &opt_offset,
- 0, GET_ULL, REQUIRED_ARG, 0, 0, ~(longlong) 0, 0, 0, 0 },
- { "pages", 'n', "Number of pages to read",
- (uchar**) &opt_pages, (uchar**) &opt_pages, 0,
- GET_ULONG, REQUIRED_ARG, (long) ~(ulong) 0,
- (long) 1, (long) ~(ulong) 0, (long) 0,
- (long) 1, 0},
- {"unit-test", 'U',
- "Use unit test record table (for logs created by unittests",
- (uchar **) &opt_unit, (uchar **) &opt_unit, 0,
- GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"version", 'V', "Print version and exit.",
- 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
-};
-
-
-static void print_version(void)
-{
- VOID(printf("%s Ver 1.0 for %s on %s\n",
- my_progname_short, SYSTEM_TYPE, MACHINE_TYPE));
- NETWARE_SET_SCREEN_MODE(1);
-}
-
-
-static void usage(void)
-{
- print_version();
- puts("Copyright (C) 2008 MySQL AB");
- puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,");
- puts("and you are welcome to modify and redistribute it under the GPL license\n");
-
- puts("Dump content of aria log pages.");
- VOID(printf("\nUsage: %s -f file OPTIONS\n", my_progname_short));
- my_print_help(my_long_options);
- print_defaults("my", load_default_groups);
- my_print_variables(my_long_options);
-}
-
-
-static my_bool
-get_one_option(int optid __attribute__((unused)),
- const struct my_option *opt __attribute__((unused)),
- char *argument __attribute__((unused)))
-{
- switch (optid) {
- case '?':
- usage();
- exit(0);
- case 'V':
- print_version();
- exit(0);
-#ifndef DBUG_OFF
- case '#':
- DBUG_SET_INITIAL(argument ? argument : default_dbug_option);
- break;
-#endif
- }
- return 0;
-}
-
-
-static void get_options(int *argc,char ***argv)
-{
- int ho_error;
-
- if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
- exit(ho_error);
-
- if (opt_file == NULL)
- {
- usage();
- exit(1);
- }
-}
-
-
/**
@brief Dump information about file header page.
*/
@@ -9157,7 +9024,7 @@ static uchar *dump_chunk(uchar *buffer, uchar *ptr)
@brief Dump information about page with data.
*/
-static void dump_datapage(uchar *buffer)
+static void dump_datapage(uchar *buffer, File handler)
{
uchar *ptr;
ulong offset;
@@ -9238,79 +9105,12 @@ static void dump_datapage(uchar *buffer)
@brief Dump information about page.
*/
-static void dump_page(uchar *buffer)
+void dump_page(uchar *buffer, File handler)
{
- printf("Page by offset %llu (0x%llx)\n", opt_offset, opt_offset);
if (strncmp((char*)maria_trans_file_magic, (char*)buffer,
sizeof(maria_trans_file_magic)) == 0)
{
dump_header_page(buffer);
}
- dump_datapage(buffer);
-}
-
-
-/**
- @brief maria_dump_log main function.
-*/
-
-int main(int argc, char **argv)
-{
- char **default_argv;
- uchar buffer[TRANSLOG_PAGE_SIZE];
- MY_INIT(argv[0]);
-
- load_defaults("my", load_default_groups, &argc, &argv);
- default_argv= argv;
- get_options(&argc, &argv);
-
- if (opt_unit)
- translog_example_table_init();
- else
- translog_table_init();
- translog_fill_overhead_table();
-
- maria_data_root= (char *)".";
-
- if ((handler= my_open(opt_file, O_RDONLY, MYF(MY_WME))) < 0)
- {
- fprintf(stderr, "Can't open file: '%s' errno: %d\n",
- opt_file, my_errno);
- goto err;
- }
- if (my_seek(handler, opt_offset, SEEK_SET, MYF(MY_WME)) !=
- opt_offset)
- {
- fprintf(stderr, "Can't set position %lld file: '%s' errno: %d\n",
- opt_offset, opt_file, my_errno);
- goto err;
- }
- for (;
- opt_pages;
- opt_offset+= TRANSLOG_PAGE_SIZE, opt_pages--)
- {
- if (my_pread(handler, buffer, TRANSLOG_PAGE_SIZE, opt_offset,
- MYF(MY_NABP)))
- {
- if (my_errno == HA_ERR_FILE_TOO_SHORT)
- goto end;
- fprintf(stderr, "Can't read page at position %lld file: '%s' "
- "errno: %d\n", opt_offset, opt_file, my_errno);
- goto err;
- }
- dump_page(buffer);
- }
-
-end:
- my_close(handler, MYF(0));
- free_defaults(default_argv);
- exit(0);
- return 0; /* No compiler warning */
-
-err:
- my_close(handler, MYF(0));
- fprintf(stderr, "%s: FAILED\n", my_progname_short);
- free_defaults(default_argv);
- exit(1);
+ dump_datapage(buffer, handler);
}
-#endif
diff --git a/storage/maria/ma_loghandler.h b/storage/maria/ma_loghandler.h
index 698a8ead7b6..f33e92e9771 100644
--- a/storage/maria/ma_loghandler.h
+++ b/storage/maria/ma_loghandler.h
@@ -360,6 +360,7 @@ translog_assign_id_to_share_from_recovery(struct st_maria_share *share,
extern my_bool translog_walk_filenames(const char *directory,
my_bool (*callback)(const char *,
const char *));
+extern void dump_page(uchar *buffer, File handler);
extern my_bool translog_log_debug_info(TRN *trn,
enum translog_debug_info_type type,
uchar *info, size_t length);
@@ -386,8 +387,31 @@ void translog_set_group_commit_interval(uint32 interval);
ma_loghandler_for_recovery.h ?
*/
+/*
+ Information from transaction log file header
+*/
+
+typedef struct st_loghandler_file_info
+{
+ /*
+ LSN_IMPOSSIBLE for current file (not finished file).
+ Maximum LSN of the record which parts stored in the
+ file.
+ */
+ LSN max_lsn;
+ ulonglong timestamp; /* Time stamp */
+ ulong maria_version; /* Version of maria loghandler */
+ ulong mysql_version; /* Version of mysql server */
+ ulong server_id; /* Server ID */
+ ulong page_size; /* Loghandler page size */
+ ulong file_number; /* Number of the file (from the file header) */
+} LOGHANDLER_FILE_INFO;
+
#define SHARE_ID_MAX 65535 /* array's size */
+extern void translog_fill_overhead_table();
+extern void translog_interpret_file_header(LOGHANDLER_FILE_INFO *desc,
+ uchar *page_buff);
extern LSN translog_first_lsn_in_log();
extern LSN translog_first_theoretical_lsn();
extern LSN translog_next_LSN(TRANSLOG_ADDRESS addr, TRANSLOG_ADDRESS horizon);
diff --git a/storage/maria/ma_open.c b/storage/maria/ma_open.c
index 63e1801a39a..0890ff7e000 100644
--- a/storage/maria/ma_open.c
+++ b/storage/maria/ma_open.c
@@ -130,6 +130,8 @@ static MARIA_HA *maria_clone_internal(MARIA_SHARE *share, const char *name,
info.s=share;
info.cur_row.lastpos= HA_OFFSET_ERROR;
+ /* Impossible first index to force initialization in _ma_check_index() */
+ info.lastinx= ~0;
info.update= (short) (HA_STATE_NEXT_FOUND+HA_STATE_PREV_FOUND);
info.opt_flag=READ_CHECK_USED;
info.this_unique= (ulong) info.dfile.file; /* Uniq number in process */
diff --git a/storage/maria/ma_pagecache.c b/storage/maria/ma_pagecache.c
index 441310a60ea..42a42b65b8d 100644
--- a/storage/maria/ma_pagecache.c
+++ b/storage/maria/ma_pagecache.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2008 MySQL AB
+/* Copyright (C) 2000-2008 MySQL AB, 2008-2011 Monty Program Ab
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
@@ -158,6 +158,7 @@ struct st_pagecache_hash_link
#define PCBLOCK_IN_FLUSH 16 /* block is in flush operation */
#define PCBLOCK_CHANGED 32 /* block buffer contains a dirty page */
#define PCBLOCK_DIRECT_W 64 /* possible direct write to the block */
+#define PCBLOCK_DEL_WRITE 128 /* should be written on delete */
/* page status, returned by find_block */
#define PAGE_READ 0
@@ -759,6 +760,8 @@ ulong init_pagecache(PAGECACHE *pagecache, size_t use_mem,
{
if (blocks < 8)
{
+ my_message(ENOMEM, "Not enough memory to allocate 8 pagecache pages",
+ MYF(0));
my_errno= ENOMEM;
goto err;
}
@@ -1025,6 +1028,7 @@ finish:
*/
static inline void inc_counter_for_resize_op(PAGECACHE *pagecache)
{
+ safe_mutex_assert_owner(&pagecache->cache_lock);
pagecache->cnt_for_resize_op++;
}
@@ -1037,6 +1041,7 @@ static inline void dec_counter_for_resize_op(PAGECACHE *pagecache)
{
#ifdef THREAD
struct st_my_thread_var *last_thread;
+ safe_mutex_assert_owner(&pagecache->cache_lock);
if (!--pagecache->cnt_for_resize_op &&
(last_thread= pagecache->resize_queue.last_thread))
{
@@ -1085,6 +1090,37 @@ void change_pagecache_param(PAGECACHE *pagecache, uint division_limit,
/*
+ Check that pagecache was used and cleaned up properly.
+*/
+
+#ifndef DBUG_OFF
+void check_pagecache_is_cleaned_up(PAGECACHE *pagecache)
+{
+ DBUG_ENTER("check_pagecache_is_cleaned_up");
+ /*
+ Ensure we called inc_counter_for_resize_op and dec_counter_for_resize_op
+ the same number of times. (If not, a resize() could never happen.
+ */
+ DBUG_ASSERT(pagecache->cnt_for_resize_op == 0);
+
+ if (pagecache->disk_blocks > 0)
+ {
+ if (pagecache->block_mem)
+ {
+ uint i;
+ for (i=0 ; i < pagecache->blocks_used ; i++)
+ {
+ DBUG_ASSERT(pagecache->block_root[i].status == 0);
+ DBUG_ASSERT(pagecache->block_root[i].type == PAGECACHE_EMPTY_PAGE);
+ }
+ }
+ }
+ DBUG_VOID_RETURN;
+}
+#endif
+
+
+/*
Removes page cache from memory. Does NOT flush pages to disk.
SYNOPSIS
@@ -1106,6 +1142,10 @@ void end_pagecache(PAGECACHE *pagecache, my_bool cleanup)
if (pagecache->disk_blocks > 0)
{
+#ifndef DBUG_OFF
+ check_pagecache_is_cleaned_up(pagecache);
+#endif
+
if (pagecache->block_mem)
{
my_large_free(pagecache->block_mem, MYF(0));
@@ -1178,7 +1218,7 @@ static void link_to_file_list(PAGECACHE *pagecache,
link_changed(block, &pagecache->file_blocks[FILE_HASH(*file)]);
if (block->status & PCBLOCK_CHANGED)
{
- block->status&= ~PCBLOCK_CHANGED;
+ block->status&= ~(PCBLOCK_CHANGED | PCBLOCK_DEL_WRITE);
block->rec_lsn= LSN_MAX;
pagecache->blocks_changed--;
pagecache->global_blocks_changed--;
@@ -2037,12 +2077,12 @@ restart:
KEYCACHE_DBUG_PRINT("find_block", ("block is dirty"));
- pagecache_pthread_mutex_unlock(&pagecache->cache_lock);
/*
The call is thread safe because only the current
thread might change the block->hash_link value
*/
DBUG_ASSERT(block->pins == 0);
+ pagecache_pthread_mutex_unlock(&pagecache->cache_lock);
error= pagecache_fwrite(pagecache,
&block->hash_link->file,
block->buffer,
@@ -2250,19 +2290,23 @@ static my_bool pagecache_wait_lock(PAGECACHE *pagecache,
&pagecache->cache_lock);
}
while(thread->next);
+ inc_counter_for_resize_op(pagecache);
#else
DBUG_ASSERT(0);
#endif
PCBLOCK_INFO(block);
if ((block->status & (PCBLOCK_REASSIGNED | PCBLOCK_IN_SWITCH)) ||
+ !block->hash_link ||
file.file != block->hash_link->file.file ||
pageno != block->hash_link->pageno)
{
DBUG_PRINT("info", ("the block 0x%lx changed => need retry "
"status: %x files %d != %d or pages %lu != %lu",
(ulong)block, block->status,
- file.file, block->hash_link->file.file,
- (ulong) pageno, (ulong) block->hash_link->pageno));
+ file.file,
+ block->hash_link ? block->hash_link->file.file : -1,
+ (ulong) pageno,
+ (ulong) (block->hash_link ? block->hash_link->pageno : 0)));
DBUG_RETURN(1);
}
DBUG_RETURN(0);
@@ -2611,12 +2655,12 @@ static void read_block(PAGECACHE *pagecache,
*/
pagecache->global_cache_read++;
- /* Page is not in buffer yet, is to be read from disk */
- pagecache_pthread_mutex_unlock(&pagecache->cache_lock);
/*
+ Page is not in buffer yet, is to be read from disk
Here other threads may step in and register as secondary readers.
They will register in block->wqueue[COND_FOR_REQUESTED].
*/
+ pagecache_pthread_mutex_unlock(&pagecache->cache_lock);
error= pagecache_fread(pagecache, &block->hash_link->file,
block->buffer,
block->hash_link->pageno,
@@ -3432,6 +3476,31 @@ no_key_cache: /* Key cache is not used */
/*
+ @brief Set/reset flag that page always should be flushed on delete
+
+ @param pagecache pointer to a page cache data structure
+ @param link direct link to page (returned by read or write)
+ @param write write on delete flag value
+
+*/
+
+void pagecache_set_write_on_delete_by_link(PAGECACHE_BLOCK_LINK *block)
+{
+ DBUG_ENTER("pagecache_set_write_on_delete_by_link");
+ DBUG_PRINT("enter", ("fd: %d block 0x%lx %d -> TRUE",
+ block->hash_link->file.file,
+ (ulong) block,
+ (int) block->status & PCBLOCK_DEL_WRITE));
+ DBUG_ASSERT(block->pins); /* should be pinned */
+ DBUG_ASSERT(block->wlocks); /* should be write locked */
+
+ block->status|= PCBLOCK_DEL_WRITE;
+
+ DBUG_VOID_RETURN;
+}
+
+
+/*
@brief Delete page from the buffer (common part for link and file/page)
@param pagecache pointer to a page cache data structure
@@ -3450,20 +3519,29 @@ static my_bool pagecache_delete_internal(PAGECACHE *pagecache,
my_bool flush)
{
my_bool error= 0;
+ if (block->status & PCBLOCK_IN_FLUSH)
+ {
+ /*
+ this call is just 'hint' for the cache to free the page so we will
+ not interferes with flushing process but must return success
+ */
+ goto out;
+ }
if (block->status & PCBLOCK_CHANGED)
{
+ flush= (flush || (block->status & PCBLOCK_DEL_WRITE));
if (flush)
{
/* The block contains a dirty page - push it out of the cache */
KEYCACHE_DBUG_PRINT("find_block", ("block is dirty"));
- pagecache_pthread_mutex_unlock(&pagecache->cache_lock);
/*
The call is thread safe because only the current
thread might change the block->hash_link value
*/
DBUG_ASSERT(block->pins == 1);
+ pagecache_pthread_mutex_unlock(&pagecache->cache_lock);
error= pagecache_fwrite(pagecache,
&block->hash_link->file,
block->buffer,
@@ -3478,7 +3556,26 @@ static my_bool pagecache_delete_internal(PAGECACHE *pagecache,
block->status|= PCBLOCK_ERROR;
block->error= (int16) my_errno;
my_debug_put_break_here();
- goto err;
+ goto out;
+ }
+ }
+ else
+ {
+ PAGECACHE_FILE *filedesc= &block->hash_link->file;
+ /* We are not going to write the page but have to call callbacks */
+ DBUG_PRINT("info", ("flush_callback :0x%lx"
+ "write_callback: 0x%lx data: 0x%lx",
+ (ulong) filedesc->flush_log_callback,
+ (ulong) filedesc->write_callback,
+ (ulong) filedesc->callback_data));
+ if ((*filedesc->flush_log_callback)
+ (block->buffer, block->hash_link->pageno, filedesc->callback_data) ||
+ (*filedesc->write_callback)
+ (block->buffer, block->hash_link->pageno, filedesc->callback_data))
+ {
+ DBUG_PRINT("error", ("flush or write callback problem"));
+ error= 1;
+ goto out;
}
}
pagecache->blocks_changed--;
@@ -3497,8 +3594,17 @@ static my_bool pagecache_delete_internal(PAGECACHE *pagecache,
page_link->requests--;
/* See NOTE for pagecache_unlock about registering requests. */
free_block(pagecache, block);
+ dec_counter_for_resize_op(pagecache);
+ return 0;
-err:
+out:
+ /* Cache is locked, so we can relese page before freeing it */
+ if (make_lock_and_pin(pagecache, block,
+ PAGECACHE_LOCK_WRITE_UNLOCK,
+ PAGECACHE_UNPIN, FALSE))
+ DBUG_ASSERT(0);
+ page_link->requests--;
+ unreg_request(pagecache, block, 1);
dec_counter_for_resize_op(pagecache);
return error;
}
@@ -3549,6 +3655,8 @@ my_bool pagecache_delete_by_link(PAGECACHE *pagecache,
*/
DBUG_ASSERT((block->status &
(PCBLOCK_IN_SWITCH | PCBLOCK_REASSIGNED)) == 0);
+
+ inc_counter_for_resize_op(pagecache);
/*
make_lock_and_pin() can't fail here, because we are keeping pin on the
block and it can't be evicted (which is cause of lock fail and retry)
@@ -3665,6 +3773,7 @@ restart:
if (!page_link)
{
DBUG_PRINT("info", ("There is no such page in the cache"));
+ dec_counter_for_resize_op(pagecache);
pagecache_pthread_mutex_unlock(&pagecache->cache_lock);
DBUG_RETURN(0);
}
@@ -3677,6 +3786,7 @@ restart:
"reassigned" : "in switch")));
PCBLOCK_INFO(block);
page_link->requests--;
+ dec_counter_for_resize_op(pagecache);
goto end;
}
/* See NOTE for pagecache_unlock about registering requests. */
@@ -4087,6 +4197,7 @@ static void free_block(PAGECACHE *pagecache, PAGECACHE_BLOCK_LINK *block)
("block: %u hash_link 0x%lx",
PCBLOCK_NUMBER(pagecache, block),
(long) block->hash_link));
+ safe_mutex_assert_owner(&pagecache->cache_lock);
if (block->hash_link)
{
/*
@@ -4105,6 +4216,7 @@ static void free_block(PAGECACHE *pagecache, PAGECACHE_BLOCK_LINK *block)
DBUG_ASSERT(block->rlocks == 0);
DBUG_ASSERT(block->rlocks_queue == 0);
DBUG_ASSERT(block->pins == 0);
+ DBUG_ASSERT((block->status & ~(PCBLOCK_ERROR | PCBLOCK_READ | PCBLOCK_IN_FLUSH | PCBLOCK_CHANGED | PCBLOCK_REASSIGNED | PCBLOCK_DEL_WRITE)) == 0);
block->status= 0;
#ifndef DBUG_OFF
block->type= PAGECACHE_EMPTY_PAGE;
@@ -4114,6 +4226,8 @@ static void free_block(PAGECACHE *pagecache, PAGECACHE_BLOCK_LINK *block)
KEYCACHE_DBUG_PRINT("free_block",
("block is freed"));
unreg_request(pagecache, block, 0);
+ DBUG_ASSERT(block->requests == 0);
+ DBUG_ASSERT(block->next_used != 0);
block->hash_link= NULL;
/* Remove the free block from the LRU ring. */
@@ -4223,7 +4337,6 @@ static int flush_cached_blocks(PAGECACHE *pagecache,
DBUG_PRINT("info", ("block: %u (0x%lx) to be flushed",
PCBLOCK_NUMBER(pagecache, block), (ulong)block));
PCBLOCK_INFO(block);
- pagecache_pthread_mutex_unlock(&pagecache->cache_lock);
DBUG_PRINT("info", ("block: %u (0x%lx) pins: %u",
PCBLOCK_NUMBER(pagecache, block), (ulong)block,
block->pins));
@@ -4237,6 +4350,7 @@ static int flush_cached_blocks(PAGECACHE *pagecache,
content (see StaleFilePointersInFlush in ma_checkpoint.c).
@todo change argument of functions to be File.
*/
+ pagecache_pthread_mutex_unlock(&pagecache->cache_lock);
error= pagecache_fwrite(pagecache, &block->hash_link->file,
block->buffer,
block->hash_link->pageno,
@@ -4431,6 +4545,7 @@ static int flush_pagecache_blocks_int(PAGECACHE *pagecache,
KEYCACHE_DBUG_ASSERT(count<= pagecache->blocks_used);
}
}
+ count++; /* Allocate one extra for easy end-of-buffer test */
/* Allocate a new buffer only if its bigger than the one we have */
if (count > FLUSH_CACHE &&
!(cache=
@@ -4468,22 +4583,24 @@ restart:
DBUG_ASSERT(filter_res == FLUSH_FILTER_OK);
}
{
+ DBUG_ASSERT(!(block->status & PCBLOCK_IN_FLUSH));
/*
- Mark the block with BLOCK_IN_FLUSH in order not to let
- other threads to use it for new pages and interfere with
- our sequence of flushing dirty file pages
+ We care only for the blocks for which flushing was not
+ initiated by other threads as a result of page swapping
*/
- block->status|= PCBLOCK_IN_FLUSH;
-
if (! (block->status & PCBLOCK_IN_SWITCH))
{
- /*
- We care only for the blocks for which flushing was not
- initiated by other threads as a result of page swapping
+ /*
+ Mark the block with BLOCK_IN_FLUSH in order not to let
+ other threads to use it for new pages and interfere with
+ our sequence of flushing dirty file pages
*/
+ block->status|= PCBLOCK_IN_FLUSH;
+
reg_requests(pagecache, block, 1);
if (type != FLUSH_IGNORE_CHANGED)
{
+ *pos++= block;
/* It's not a temporary file */
if (pos == end)
{
@@ -4503,7 +4620,6 @@ restart:
*/
goto restart;
}
- *pos++= block;
}
else
{
diff --git a/storage/maria/ma_pagecache.h b/storage/maria/ma_pagecache.h
index 821728ef374..475729bd46d 100644
--- a/storage/maria/ma_pagecache.h
+++ b/storage/maria/ma_pagecache.h
@@ -251,6 +251,7 @@ extern void pagecache_unpin(PAGECACHE *pagecache,
extern void pagecache_unpin_by_link(PAGECACHE *pagecache,
PAGECACHE_BLOCK_LINK *link,
LSN lsn);
+extern void pagecache_set_write_on_delete_by_link(PAGECACHE_BLOCK_LINK *block);
/* Results of flush operation (bit field in fact) */
diff --git a/storage/maria/ma_recovery.c b/storage/maria/ma_recovery.c
index 7a7286e26f9..d2c7bf3d381 100644
--- a/storage/maria/ma_recovery.c
+++ b/storage/maria/ma_recovery.c
@@ -28,6 +28,7 @@
#include "trnman.h"
#include "ma_key_recover.h"
#include "ma_recovery_util.h"
+#include "hash.h"
struct st_trn_for_recovery /* used only in the REDO phase */
{
@@ -58,6 +59,7 @@ static ulonglong now; /**< for tracking execution time of phases */
static int (*save_error_handler_hook)(uint, const char *,myf);
static uint recovery_warnings; /**< count of warnings */
static uint recovery_found_crashed_tables;
+HASH tables_to_redo; /* For maria_read_log */
#define prototype_redo_exec_hook(R) \
static int exec_REDO_LOGREC_ ## R(const TRANSLOG_HEADER_BUFFER *rec)
@@ -184,6 +186,21 @@ static void print_preamble()
}
+static my_bool table_is_part_of_recovery_set(LEX_STRING *file_name)
+{
+ uint offset =0;
+ if (!tables_to_redo.records)
+ return 1; /* Default, recover table */
+
+ /* Skip base directory */
+ if (file_name->str[0] == '.' &&
+ (file_name->str[1] == '/' || file_name->str[1] == '\\'))
+ offset= 2;
+ /* Only recover if table is in hash */
+ return my_hash_search(&tables_to_redo, (uchar*) file_name->str + offset,
+ file_name->length - offset) != 0;
+}
+
/**
@brief Recovers from the last checkpoint.
@@ -1643,8 +1660,8 @@ prototype_redo_exec_hook(REDO_FREE_BLOCKS)
}
buff= log_record_buffer.str;
- if (_ma_apply_redo_free_blocks(info, current_group_end_lsn,
- buff + FILEID_STORE_SIZE))
+ if (_ma_apply_redo_free_blocks(info, current_group_end_lsn, rec->lsn,
+ buff))
goto end;
error= 0;
end:
@@ -3015,10 +3032,11 @@ static MARIA_HA *get_MARIA_HA_from_REDO_record(const
page= page_korr(rec->header + FILEID_STORE_SIZE);
llstr(page, llbuf);
break;
+ case LOGREC_REDO_FREE_BLOCKS:
/*
- For REDO_FREE_BLOCKS, no need to look at dirty pages list: it does not
- read data pages, only reads/modifies bitmap page(s) which is cheap.
+ We are checking against the dirty pages in _ma_apply_redo_free_blocks()
*/
+ break;
default:
break;
}
@@ -3036,6 +3054,12 @@ static MARIA_HA *get_MARIA_HA_from_REDO_record(const
share= info->s;
tprint(tracef, ", '%s'", share->open_file_name.str);
DBUG_ASSERT(in_redo_phase);
+ if (!table_is_part_of_recovery_set(&share->open_file_name))
+ {
+ tprint(tracef, ", skipped by user\n");
+ return NULL;
+ }
+
if (cmp_translog_addr(rec->lsn, share->lsn_of_file_id) <= 0)
{
/*
@@ -3069,7 +3093,6 @@ static MARIA_HA *get_MARIA_HA_from_REDO_record(const
REDO_INSERT_ROW_BLOBS will consult list by itself, as it covers several
pages.
*/
- tprint(tracef, " page %s", llbuf);
if (_ma_redo_not_needed_for_page(sid, rec->lsn, page,
index_page_redo_entry))
return NULL;
@@ -3106,6 +3129,13 @@ static MARIA_HA *get_MARIA_HA_from_UNDO_record(const
}
share= info->s;
tprint(tracef, ", '%s'", share->open_file_name.str);
+
+ if (!table_is_part_of_recovery_set(&share->open_file_name))
+ {
+ tprint(tracef, ", skipped by user\n");
+ return NULL;
+ }
+
if (cmp_translog_addr(rec->lsn, share->lsn_of_file_id) <= 0)
{
tprint(tracef, ", table's LOGREC_FILE_ID has LSN (%lu,0x%lx) more recent"
diff --git a/storage/maria/ma_recovery.h b/storage/maria/ma_recovery.h
index 0bfcdd17d39..5b22c4fd9b2 100644
--- a/storage/maria/ma_recovery.h
+++ b/storage/maria/ma_recovery.h
@@ -30,4 +30,6 @@ int maria_apply_log(LSN lsn, LSN lsn_end, enum maria_apply_log_way apply,
FILE *trace_file,
my_bool execute_undo_phase, my_bool skip_DDLs,
my_bool take_checkpoints, uint *warnings_count);
+/* Table of tables to recover */
+extern HASH tables_to_redo;
C_MODE_END
diff --git a/storage/maria/ma_recovery_util.c b/storage/maria/ma_recovery_util.c
index 19e61daf4ef..ed9d8efc81b 100644
--- a/storage/maria/ma_recovery_util.c
+++ b/storage/maria/ma_recovery_util.c
@@ -129,16 +129,20 @@ my_bool _ma_redo_not_needed_for_page(uint16 shortid, LSN lsn,
Next 2 bytes: table's short id
Next 5 bytes: page number
*/
+ char llbuf[22];
uint64 file_and_page_id=
(((uint64)((index << 16) | shortid)) << 40) | page;
struct st_dirty_page *dirty_page= (struct st_dirty_page *)
hash_search(&all_dirty_pages,
(uchar *)&file_and_page_id, sizeof(file_and_page_id));
- DBUG_PRINT("info", ("in dirty pages list: %d", dirty_page != NULL));
+ DBUG_PRINT("info", ("page %lld in dirty pages list: %d",
+ (ulonglong) page,
+ dirty_page != NULL));
if ((dirty_page == NULL) ||
cmp_translog_addr(lsn, dirty_page->rec_lsn) < 0)
{
- tprint(tracef, ", ignoring because of dirty_pages list\n");
+ tprint(tracef, ", ignoring page %s because of dirty_pages list\n",
+ llstr((ulonglong) page, llbuf));
return TRUE;
}
}
diff --git a/storage/maria/ma_rkey.c b/storage/maria/ma_rkey.c
index daf1fd5a60c..85b3b463f49 100644
--- a/storage/maria/ma_rkey.c
+++ b/storage/maria/ma_rkey.c
@@ -43,7 +43,7 @@ int maria_rkey(MARIA_HA *info, uchar *buf, int inx, const uchar *key_data,
info->update&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED);
info->last_key_func= search_flag;
- keyinfo= share->keyinfo + inx;
+ keyinfo= info->last_key.keyinfo;
key_buff= info->lastkey_buff+info->s->base.max_key_length;
diff --git a/storage/maria/ma_rnext.c b/storage/maria/ma_rnext.c
index be960eccfe0..c49bbb19e83 100644
--- a/storage/maria/ma_rnext.c
+++ b/storage/maria/ma_rnext.c
@@ -30,6 +30,7 @@ int maria_rnext(MARIA_HA *info, uchar *buf, int inx)
uint flag;
MARIA_SHARE *share= info->s;
MARIA_KEYDEF *keyinfo;
+ uint update_mask= HA_STATE_NEXT_FOUND;
DBUG_ENTER("maria_rnext");
if ((inx = _ma_check_index(info,inx)) < 0)
@@ -61,6 +62,20 @@ int maria_rnext(MARIA_HA *info, uchar *buf, int inx)
error= _ma_search_first(info, keyinfo, share->state.key_root[inx]);
break;
}
+ /*
+ "search first" failed. This means we have no pivot for
+ "search next", or in other words MI_INFO::lastkey is
+ likely uninitialized.
+
+ Normally SQL layer would never request "search next" if
+ "search first" failed. But HANDLER may do anything.
+
+ As mi_rnext() without preceeding mi_rkey()/mi_rfirst()
+ equals to mi_rfirst(), we must restore original state
+ as if failing mi_rfirst() was not called.
+ */
+ if (error)
+ update_mask|= HA_STATE_PREV_FOUND;
}
else
{
@@ -104,7 +119,7 @@ int maria_rnext(MARIA_HA *info, uchar *buf, int inx)
/* Don't clear if database-changed */
info->update&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED);
- info->update|= HA_STATE_NEXT_FOUND;
+ info->update|= update_mask;
if (error)
{
diff --git a/storage/maria/ma_rsame.c b/storage/maria/ma_rsame.c
index 4bdbfd526ba..a5953cd09cb 100644
--- a/storage/maria/ma_rsame.c
+++ b/storage/maria/ma_rsame.c
@@ -19,7 +19,7 @@
Find current row with read on position or read on key
@notes
- If inx >= 0 find record using key
+ If inx >= 0 find record using key else re-read row on last position
@warning
This function is not row version safe.
@@ -29,6 +29,7 @@
@retval 0 Ok
@retval HA_ERR_KEY_NOT_FOUND Row is deleted
@retval HA_ERR_END_OF_FILE End of file
+ @retval HA_ERR_WRONG_INDEX Wrong inx argument
*/
@@ -36,10 +37,10 @@ int maria_rsame(MARIA_HA *info, uchar *record, int inx)
{
DBUG_ENTER("maria_rsame");
- if (inx != -1 && ! maria_is_key_active(info->s->state.key_map, inx))
+ if (inx >= 0 && _ma_check_index(info, inx) < 0)
{
DBUG_PRINT("error", ("wrong index usage"));
- DBUG_RETURN(my_errno=HA_ERR_WRONG_INDEX);
+ DBUG_RETURN(my_errno);
}
if (info->cur_row.lastpos == HA_OFFSET_ERROR ||
info->update & HA_STATE_DELETED)
@@ -55,8 +56,7 @@ int maria_rsame(MARIA_HA *info, uchar *record, int inx)
if (inx >= 0)
{
- MARIA_KEYDEF *keyinfo= info->s->keyinfo + inx;
- info->lastinx= inx;
+ MARIA_KEYDEF *keyinfo= info->last_key.keyinfo;
(*keyinfo->make_key)(info, &info->last_key, (uint) inx,
info->lastkey_buff, record,
info->cur_row.lastpos,
diff --git a/storage/maria/ma_rt_index.c b/storage/maria/ma_rt_index.c
index 62474dbbad8..bd1b9038ccf 100644
--- a/storage/maria/ma_rt_index.c
+++ b/storage/maria/ma_rt_index.c
@@ -134,7 +134,6 @@ static int maria_rtree_find_req(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
tmp_key.data_length= key_data_length;
info->cur_row.lastpos= _ma_row_pos_from_key(&tmp_key);
- info->last_key.keyinfo= keyinfo;
info->last_key.data_length= key_data_length;
info->last_key.ref_length= share->base.rec_reflength;
info->last_key.flag= 0;
diff --git a/storage/maria/ma_rt_split.c b/storage/maria/ma_rt_split.c
index 856edc60490..6f32a60c073 100644
--- a/storage/maria/ma_rt_split.c
+++ b/storage/maria/ma_rt_split.c
@@ -544,8 +544,7 @@ int maria_rtree_split_page(const MARIA_KEY *key, MARIA_PAGE *page,
}
DBUG_PRINT("rtree", ("split new block: %lu", (ulong) *new_page_offs));
- my_afree(new_page);
-
+ my_afree(new_page_buff);
split_err:
my_afree(coord_buf);
DBUG_RETURN(err_code);
diff --git a/storage/maria/ma_search.c b/storage/maria/ma_search.c
index 9f1e8e2554b..45592f101ed 100644
--- a/storage/maria/ma_search.c
+++ b/storage/maria/ma_search.c
@@ -38,12 +38,18 @@ int _ma_check_index(MARIA_HA *info, int inx)
if (info->lastinx != inx) /* Index changed */
{
info->lastinx = inx;
+ info->last_key.keyinfo= info->s->keyinfo + inx;
+ info->last_key.flag= 0;
info->page_changed=1;
info->update= ((info->update & (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED)) |
HA_STATE_NEXT_FOUND | HA_STATE_PREV_FOUND);
}
- if (info->opt_flag & WRITE_CACHE_USED && flush_io_cache(&info->rec_cache))
+ if ((info->opt_flag & WRITE_CACHE_USED) && flush_io_cache(&info->rec_cache))
+ {
+ if (unlikely(!my_errno))
+ my_errno= HA_ERR_INTERNAL_ERROR; /* Impossible */
return(-1);
+ }
return(inx);
} /* _ma_check_index */
@@ -95,6 +101,7 @@ int _ma_search(register MARIA_HA *info, MARIA_KEY *key, uint32 nextflag,
@note
Position to row is stored in info->lastpos
+ Last used key is stored in info->last_key
@return
@retval 0 ok (key found)
@@ -120,6 +127,7 @@ static int _ma_search_no_save(register MARIA_HA *info, MARIA_KEY *key,
(ulong) (pos / info->s->block_size),
nextflag, (ulong) info->cur_row.lastpos));
DBUG_EXECUTE("key", _ma_print_key(DBUG_FILE, key););
+ DBUG_ASSERT(info->last_key.keyinfo == key->keyinfo);
if (pos == HA_OFFSET_ERROR)
{
@@ -180,7 +188,6 @@ static int _ma_search_no_save(register MARIA_HA *info, MARIA_KEY *key,
}
}
- info->last_key.keyinfo= keyinfo;
if ((nextflag & (SEARCH_SMALLER | SEARCH_LAST)) && flag != 0)
{
uint not_used[2];
@@ -1696,7 +1703,7 @@ int _ma_search_next(register MARIA_HA *info, MARIA_KEY *key,
}
tmp_key.data= lastkey;
- info->last_key.keyinfo= tmp_key.keyinfo= keyinfo;
+ tmp_key.keyinfo= keyinfo;
if (nextflag & SEARCH_BIGGER) /* Next key */
{
@@ -1778,8 +1785,6 @@ int _ma_search_first(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
first_pos= page.buff + share->keypage_header + page.node;
} while ((pos= _ma_kpos(page.node, first_pos)) != HA_OFFSET_ERROR);
- info->last_key.keyinfo= keyinfo;
-
if (!(*keyinfo->get_key)(&info->last_key, page.flag, page.node, &first_pos))
DBUG_RETURN(-1); /* Crashed */
@@ -1830,8 +1835,6 @@ int _ma_search_last(MARIA_HA *info, MARIA_KEYDEF *keyinfo,
end_of_page= page.buff + page.size;
} while ((pos= _ma_kpos(page.node, end_of_page)) != HA_OFFSET_ERROR);
- info->last_key.keyinfo= keyinfo;
-
if (!_ma_get_last_key(&info->last_key, &page, end_of_page))
DBUG_RETURN(-1);
info->cur_row.lastpos= _ma_row_pos_from_key(&info->last_key);
diff --git a/storage/maria/ma_sort.c b/storage/maria/ma_sort.c
index 5c36c2fba75..5c5bd8f8d6c 100644
--- a/storage/maria/ma_sort.c
+++ b/storage/maria/ma_sort.c
@@ -275,12 +275,13 @@ static ha_rows find_all_keys(MARIA_SORT_PARAM *info, uint keys,
idx=error=0;
sort_keys[0]= (uchar*) (sort_keys+keys);
+ info->sort_info->info->in_check_table= 1;
while (!(error=(*info->key_read)(info,sort_keys[idx])))
{
if (info->real_key_length > info->key_length)
{
if (write_key(info,sort_keys[idx],tempfile_for_exceptions))
- DBUG_RETURN(HA_POS_ERROR); /* purecov: inspected */
+ goto err; /* purecov: inspected */
continue;
}
@@ -289,7 +290,7 @@ static ha_rows find_all_keys(MARIA_SORT_PARAM *info, uint keys,
if (info->write_keys(info,sort_keys,idx-1,
(BUFFPEK *)alloc_dynamic(buffpek),
tempfile))
- DBUG_RETURN(HA_POS_ERROR); /* purecov: inspected */
+ goto err; /* purecov: inspected */
sort_keys[0]=(uchar*) (sort_keys+keys);
memcpy(sort_keys[0],sort_keys[idx-1],(size_t) info->key_length);
@@ -298,18 +299,23 @@ static ha_rows find_all_keys(MARIA_SORT_PARAM *info, uint keys,
sort_keys[idx]=sort_keys[idx-1]+info->key_length;
}
if (error > 0)
- DBUG_RETURN(HA_POS_ERROR); /* Aborted by get_key */ /* purecov: inspected */
+ goto err; /* purecov: inspected */
if (buffpek->elements)
{
if (info->write_keys(info,sort_keys,idx,(BUFFPEK *)alloc_dynamic(buffpek),
tempfile))
- DBUG_RETURN(HA_POS_ERROR); /* purecov: inspected */
+ goto err; /* purecov: inspected */
*maxbuffer=buffpek->elements-1;
}
else
*maxbuffer=0;
+ info->sort_info->info->in_check_table= 0;
DBUG_RETURN((*maxbuffer)*(keys-1)+idx);
+
+err:
+ info->sort_info->info->in_check_table= 0; /* purecov: inspected */
+ DBUG_RETURN(HA_POS_ERROR); /* purecov: inspected */
} /* find_all_keys */
diff --git a/storage/maria/ma_unique.c b/storage/maria/ma_unique.c
index a90578c2162..2fcca9cbe10 100644
--- a/storage/maria/ma_unique.c
+++ b/storage/maria/ma_unique.c
@@ -34,6 +34,7 @@ my_bool _ma_check_unique(MARIA_HA *info, MARIA_UNIQUEDEF *def, uchar *record,
MARIA_KEYDEF *keyinfo= &info->s->keyinfo[def->key];
uchar *key_buff= info->lastkey_buff2;
MARIA_KEY key;
+ int error= 0;
DBUG_ENTER("_ma_check_unique");
DBUG_PRINT("enter",("unique_hash: %lu", (ulong) unique_hash));
@@ -44,12 +45,18 @@ my_bool _ma_check_unique(MARIA_HA *info, MARIA_UNIQUEDEF *def, uchar *record,
/* The above changed info->lastkey_buff2. Inform maria_rnext_same(). */
info->update&= ~HA_STATE_RNEXT_SAME;
+ /* Setup that unique key is active key */
+ info->last_key.keyinfo= keyinfo;
+
+ /* any key pointer in data is destroyed */
+ info->lastinx= ~0;
+
DBUG_ASSERT(key.data_length == MARIA_UNIQUE_HASH_LENGTH);
if (_ma_search(info, &key, SEARCH_FIND, info->s->state.key_root[def->key]))
{
info->page_changed=1; /* Can't optimize read next */
info->cur_row.lastpos= lastpos;
- DBUG_RETURN(0); /* No matching rows */
+ goto end;
}
for (;;)
@@ -63,7 +70,8 @@ my_bool _ma_check_unique(MARIA_HA *info, MARIA_UNIQUEDEF *def, uchar *record,
info->page_changed= 1; /* Can't optimize read next */
info->cur_row.lastpos= lastpos;
DBUG_PRINT("info",("Found duplicate"));
- DBUG_RETURN(1); /* Found identical */
+ error= 1; /* Found identical */
+ goto end;
}
DBUG_ASSERT(info->last_key.data_length == MARIA_UNIQUE_HASH_LENGTH);
if (_ma_search_next(info, &info->last_key, SEARCH_BIGGER,
@@ -72,9 +80,12 @@ my_bool _ma_check_unique(MARIA_HA *info, MARIA_UNIQUEDEF *def, uchar *record,
{
info->page_changed= 1; /* Can't optimize read next */
info->cur_row.lastpos= lastpos;
- DBUG_RETURN(0); /* end of tree */
+ break; /* end of tree */
}
}
+
+end:
+ DBUG_RETURN(error);
}
diff --git a/storage/maria/ma_write.c b/storage/maria/ma_write.c
index 02eeec754ee..49f86fe291b 100644
--- a/storage/maria/ma_write.c
+++ b/storage/maria/ma_write.c
@@ -22,8 +22,6 @@
#include "ma_key_recover.h"
#include "ma_blockrec.h"
-#define MAX_POINTER_LENGTH 8
-
/* Functions declared in this file */
static int w_search(MARIA_HA *info, uint32 comp_flag,
@@ -802,7 +800,7 @@ int _ma_insert(register MARIA_HA *info, MARIA_KEY *key,
#endif
if (t_length > 0)
{
- if (t_length >= keyinfo->maxlength*2+MAX_POINTER_LENGTH)
+ if (t_length >= keyinfo->maxlength*2+MARIA_INDEX_OVERHEAD_SIZE)
{
my_errno=HA_ERR_CRASHED;
DBUG_RETURN(-1);
@@ -811,7 +809,7 @@ int _ma_insert(register MARIA_HA *info, MARIA_KEY *key,
}
else
{
- if (-t_length >= keyinfo->maxlength*2+MAX_POINTER_LENGTH)
+ if (-t_length >= keyinfo->maxlength*2+MARIA_INDEX_OVERHEAD_SIZE)
{
my_errno=HA_ERR_CRASHED;
DBUG_RETURN(-1);
diff --git a/storage/maria/maria_chk.c b/storage/maria/maria_chk.c
index 4e19d5878ea..2b280a1eff3 100644
--- a/storage/maria/maria_chk.c
+++ b/storage/maria/maria_chk.c
@@ -1211,7 +1211,7 @@ static int maria_chk(HA_CHECK *param, char *filename)
{ /* Change temp file to org file */
VOID(my_close(info->dfile.file, MYF(MY_WME))); /* Close new file */
error|=maria_change_to_newfile(filename,MARIA_NAME_DEXT,DATA_TMP_EXT,
- MYF(0));
+ 0, MYF(0));
if (_ma_open_datafile(info,info->s, NullS, -1))
error=1;
param->out_flag&= ~O_NEW_DATA; /* We are using new datafile */
@@ -1339,21 +1339,19 @@ static int maria_chk(HA_CHECK *param, char *filename)
maria_lock_database(info, F_UNLCK);
end2:
- end_pagecache(maria_pagecache, 1);
if (maria_close(info))
{
_ma_check_print_error(param, default_close_errmsg, my_errno, filename);
DBUG_RETURN(1);
}
+ end_pagecache(maria_pagecache, 1);
if (error == 0)
{
if (param->out_flag & O_NEW_DATA)
error|=maria_change_to_newfile(filename,MARIA_NAME_DEXT,DATA_TMP_EXT,
+ param->backup_time,
((param->testflag & T_BACKUP_DATA) ?
MYF(MY_REDEL_MAKE_BACKUP) : MYF(0)));
- if (param->out_flag & O_NEW_INDEX)
- error|=maria_change_to_newfile(filename,MARIA_NAME_IEXT,INDEX_TMP_EXT,
- MYF(0));
}
if (opt_transaction_logging &&
share->base.born_transactional && !error &&
@@ -1457,7 +1455,8 @@ static void descript(HA_CHECK *param, register MARIA_HA *info, char *name)
printf("UUID: %s\n", buff);
pos=buff;
if (share->state.changed & STATE_CRASHED)
- strmov(buff,"crashed");
+ strmov(buff, share->state.changed & STATE_CRASHED_ON_REPAIR ?
+ "crashed on repair" : "crashed");
else
{
if (share->state.open_count)
diff --git a/storage/maria/maria_def.h b/storage/maria/maria_def.h
index b998ac4f3a0..2fbc84bae5f 100644
--- a/storage/maria/maria_def.h
+++ b/storage/maria/maria_def.h
@@ -152,11 +152,13 @@ typedef struct st_maria_state_info
#define MARIA_COLUMNDEF_SIZE (2*7+1+1+4)
#define MARIA_BASE_INFO_SIZE (MY_UUID_SIZE + 5*8 + 6*4 + 11*2 + 6 + 5*2 + 1 + 16)
#define MARIA_INDEX_BLOCK_MARGIN 16 /* Safety margin for .MYI tables */
+#define MARIA_MAX_POINTER_LENGTH 7 /* Node pointer */
/* Internal management bytes needed to store 2 transid/key on an index page */
#define MARIA_MAX_PACK_TRANSID_SIZE (TRANSID_SIZE+1)
#define MARIA_TRANSID_PACK_OFFSET (256- TRANSID_SIZE - 1)
#define MARIA_MIN_TRANSID_PACK_OFFSET (MARIA_TRANSID_PACK_OFFSET-TRANSID_SIZE)
-#define MARIA_INDEX_OVERHEAD_SIZE (MARIA_MAX_PACK_TRANSID_SIZE * 2)
+#define MARIA_INDEX_OVERHEAD_SIZE (MARIA_MAX_PACK_TRANSID_SIZE * 2 + \
+ MARIA_MAX_POINTER_LENGTH)
#define MARIA_DELETE_KEY_NR 255 /* keynr for deleted blocks */
/*
@@ -568,6 +570,7 @@ struct st_maria_handler
my_bool was_locked; /* Was locked in panic */
my_bool append_insert_at_end; /* Set if concurrent insert */
my_bool quick_mode;
+ my_bool in_check_table; /* We are running check tables */
/* Marker if key_del_changed */
/* If info->keyread_buff can't be used for rnext */
my_bool page_changed;
diff --git a/storage/maria/maria_dump_log.c b/storage/maria/maria_dump_log.c
new file mode 100644
index 00000000000..f01eee1ad96
--- /dev/null
+++ b/storage/maria/maria_dump_log.c
@@ -0,0 +1,190 @@
+/* Copyright (C) 2007 MySQL AB & Sanja Belkin
+
+ 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 "maria_def.h"
+#include <my_getopt.h>
+extern void translog_example_table_init();
+static const char *load_default_groups[]= { "aria_dump_log",0 };
+static void get_options(int *argc,char * * *argv);
+#ifndef DBUG_OFF
+#if defined(__WIN__)
+const char *default_dbug_option= "d:t:i:O,\\aria_dump_log.trace";
+#else
+const char *default_dbug_option= "d:t:i:o,/tmp/aria_dump_log.trace";
+#endif
+#endif
+static ulonglong opt_offset;
+static ulong opt_pages;
+static const char *opt_file= NULL;
+static File handler= -1;
+static my_bool opt_unit= 0;
+static struct my_option my_long_options[] =
+{
+#ifdef IMPLTMENTED
+ {"body", 'b',
+ "Print chunk body dump",
+ (uchar **) &opt_body, (uchar **) &opt_body, 0,
+ GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+#endif
+#ifndef DBUG_OFF
+ {"debug", '#', "Output debug log. Often the argument is 'd:t:o,filename'.",
+ 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
+#endif
+ {"file", 'f', "Path to file which will be read",
+ (uchar**) &opt_file, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"help", '?', "Display this help and exit.",
+ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
+ { "offset", 'o', "Start reading log from this offset",
+ (uchar**) &opt_offset, (uchar**) &opt_offset,
+ 0, GET_ULL, REQUIRED_ARG, 0, 0, ~(longlong) 0, 0, 0, 0 },
+ { "pages", 'n', "Number of pages to read",
+ (uchar**) &opt_pages, (uchar**) &opt_pages, 0,
+ GET_ULONG, REQUIRED_ARG, (long) ~(ulong) 0,
+ (long) 1, (long) ~(ulong) 0, (long) 0,
+ (long) 1, 0},
+ {"unit-test", 'U',
+ "Use unit test record table (for logs created by unittests",
+ (uchar **) &opt_unit, (uchar **) &opt_unit, 0,
+ GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"version", 'V', "Print version and exit.",
+ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
+ { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
+};
+
+
+static void print_version(void)
+{
+ VOID(printf("%s Ver 1.0 for %s on %s\n",
+ my_progname_short, SYSTEM_TYPE, MACHINE_TYPE));
+ NETWARE_SET_SCREEN_MODE(1);
+}
+
+
+static void usage(void)
+{
+ print_version();
+ puts("Copyright (C) 2008 MySQL AB");
+ puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,");
+ puts("and you are welcome to modify and redistribute it under the GPL license\n");
+
+ puts("Dump content of aria log pages.");
+ VOID(printf("\nUsage: %s -f file OPTIONS\n", my_progname_short));
+ my_print_help(my_long_options);
+ print_defaults("my", load_default_groups);
+ my_print_variables(my_long_options);
+}
+
+
+static my_bool
+get_one_option(int optid __attribute__((unused)),
+ const struct my_option *opt __attribute__((unused)),
+ char *argument __attribute__((unused)))
+{
+ switch (optid) {
+ case '?':
+ usage();
+ exit(0);
+ case 'V':
+ print_version();
+ exit(0);
+#ifndef DBUG_OFF
+ case '#':
+ DBUG_SET_INITIAL(argument ? argument : default_dbug_option);
+ break;
+#endif
+ }
+ return 0;
+}
+
+
+static void get_options(int *argc,char ***argv)
+{
+ int ho_error;
+
+ if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
+ exit(ho_error);
+
+ if (opt_file == NULL)
+ {
+ usage();
+ exit(1);
+ }
+}
+
+
+/**
+ @brief maria_dump_log main function.
+*/
+
+int main(int argc, char **argv)
+{
+ char **default_argv;
+ uchar buffer[TRANSLOG_PAGE_SIZE];
+ MY_INIT(argv[0]);
+
+ load_defaults("my", load_default_groups, &argc, &argv);
+ default_argv= argv;
+ get_options(&argc, &argv);
+
+ if (opt_unit)
+ translog_example_table_init();
+ else
+ translog_table_init();
+ translog_fill_overhead_table();
+
+ maria_data_root= (char *)".";
+
+ if ((handler= my_open(opt_file, O_RDONLY, MYF(MY_WME))) < 0)
+ {
+ fprintf(stderr, "Can't open file: '%s' errno: %d\n",
+ opt_file, my_errno);
+ goto err;
+ }
+ if (my_seek(handler, opt_offset, SEEK_SET, MYF(MY_WME)) !=
+ opt_offset)
+ {
+ fprintf(stderr, "Can't set position %lld file: '%s' errno: %d\n",
+ opt_offset, opt_file, my_errno);
+ goto err;
+ }
+ for (;
+ opt_pages;
+ opt_offset+= TRANSLOG_PAGE_SIZE, opt_pages--)
+ {
+ if (my_pread(handler, buffer, TRANSLOG_PAGE_SIZE, opt_offset,
+ MYF(MY_NABP)))
+ {
+ if (my_errno == HA_ERR_FILE_TOO_SHORT)
+ goto end;
+ fprintf(stderr, "Can't read page at position %lld file: '%s' "
+ "errno: %d\n", opt_offset, opt_file, my_errno);
+ goto err;
+ }
+ printf("Page by offset %llu (0x%llx)\n", opt_offset, opt_offset);
+ dump_page(buffer, handler);
+ }
+
+end:
+ my_close(handler, MYF(0));
+ free_defaults(default_argv);
+ exit(0);
+ return 0; /* No compiler warning */
+
+err:
+ my_close(handler, MYF(0));
+ fprintf(stderr, "%s: FAILED\n", my_progname_short);
+ free_defaults(default_argv);
+ exit(1);
+}
diff --git a/storage/maria/maria_pack.c b/storage/maria/maria_pack.c
index 29f8bedff44..983a38e69e7 100644
--- a/storage/maria/maria_pack.c
+++ b/storage/maria/maria_pack.c
@@ -690,6 +690,8 @@ static int compress(PACK_MRG_INFO *mrg,char *result_table)
error|=my_close(new_file,MYF(MY_WME));
if (!result_table)
{
+ (void) flush_pagecache_blocks(isam_file->s->pagecache, &isam_file->dfile,
+ FLUSH_RELEASE);
error|=my_close(isam_file->dfile.file, MYF(MY_WME));
isam_file->dfile.file= -1; /* Tell maria_close file is closed */
isam_file->s->bitmap.file.file= -1;
@@ -736,7 +738,7 @@ static int compress(PACK_MRG_INFO *mrg,char *result_table)
VOID(my_delete(new_name,MYF(MY_WME)));
}
else
- error=my_redel(org_name,new_name,MYF(MY_WME | MY_COPYTIME));
+ error=my_redel(org_name, new_name, 0, MYF(MY_WME | MY_COPYTIME));
}
if (! error)
error=save_state(isam_file,mrg,new_length,glob_crc);
@@ -763,13 +765,13 @@ static int compress(PACK_MRG_INFO *mrg,char *result_table)
DBUG_RETURN(0);
err:
- end_pagecache(maria_pagecache, 1);
free_counts_and_tree_and_queue(huff_trees,trees,huff_counts,fields);
if (new_file >= 0)
VOID(my_close(new_file,MYF(0)));
if (join_maria_file >= 0)
VOID(my_close(join_maria_file,MYF(0)));
mrg_close(mrg);
+ end_pagecache(maria_pagecache, 1);
VOID(fprintf(stderr, "Aborted: %s is not compressed\n", org_name));
DBUG_RETURN(-1);
}
diff --git a/storage/maria/maria_read_log.c b/storage/maria/maria_read_log.c
index de45eb0bcb6..7a630e274e3 100644
--- a/storage/maria/maria_read_log.c
+++ b/storage/maria/maria_read_log.c
@@ -192,14 +192,18 @@ static struct my_option my_long_options[] =
{"display-only", 'd', "display brief info read from records' header",
&opt_display_only, &opt_display_only, 0, GET_BOOL,
NO_ARG,0, 0, 0, 0, 0, 0},
+ { "end-lsn", 'e', "Stop applying at this lsn. If end-lsn is used, UNDO:s "
+ "will not be applied", &opt_end_lsn, &opt_end_lsn,
+ 0, GET_ULL, REQUIRED_ARG, 0, 0, ~(longlong) 0, 0, 0, 0 },
{"aria-log-dir-path", 'l',
"Path to the directory where to store transactional log",
(uchar **) &maria_data_root, (uchar **) &maria_data_root, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- { "page-buffer-size", 'P', "",
+ { "page-buffer-size", 'P',
+ "The size of the buffer used for index blocks for Maria tables",
&opt_page_buffer_size, &opt_page_buffer_size, 0,
GET_ULONG, REQUIRED_ARG, (long) USE_BUFFER_INIT,
- (long) USE_BUFFER_INIT, (long) ~(ulong) 0, (long) MALLOC_OVERHEAD,
+ 1024L*1024L, (long) ~(ulong) 0, (long) MALLOC_OVERHEAD,
(long) IO_SIZE, 0},
{ "start-from-lsn", 'o', "Start reading log from this lsn",
&opt_start_from_lsn, &opt_start_from_lsn,
@@ -207,15 +211,12 @@ static struct my_option my_long_options[] =
{"start-from-checkpoint", 'C', "Start applying from last checkpoint",
&opt_start_from_checkpoint, &opt_start_from_checkpoint, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- { "end-lsn", 'e', "Stop applying at this lsn. If end-lsn is used, UNDO:s "
- "will not be applied", &opt_end_lsn, &opt_end_lsn,
- 0, GET_ULL, REQUIRED_ARG, 0, 0, ~(longlong) 0, 0, 0, 0 },
{"silent", 's', "Print less information during apply/undo phase",
&opt_silent, &opt_silent, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"verbose", 'v', "Print more information during apply/undo phase",
- &maria_recovery_verbose, &maria_recovery_verbose, 0,
- GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"tables-to-redo", 'T',
+ "List of tables sepearated with , that we should apply REDO on. Use this if you only want to recover some tables",
+ 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"tmpdir", 't', "Path for temporary files. Multiple paths can be specified, "
"separated by "
#if defined( __WIN__) || defined(__NETWARE__)
@@ -227,6 +228,9 @@ static struct my_option my_long_options[] =
{"undo", 'u', "Apply UNDO records to tables. (disable with --disable-undo)",
(uchar **) &opt_apply_undo, (uchar **) &opt_apply_undo, 0,
GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
+ {"verbose", 'v', "Print more information during apply/undo phase",
+ &maria_recovery_verbose, &maria_recovery_verbose, 0,
+ GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"version", 'V', "Print version and exit.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
@@ -245,7 +249,7 @@ static void print_version(void)
static void usage(void)
{
print_version();
- puts("Copyright (C) 2007 MySQL AB");
+ puts("Copyright (C) 2007 MySQL AB, 2009-2011 Monty Program Ab");
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,");
puts("and you are welcome to modify and redistribute it under the GPL license\n");
@@ -266,10 +270,18 @@ static void usage(void)
#include <help_end.h>
+static uchar* my_hash_get_string(const uchar *record, size_t *length,
+ my_bool first __attribute__ ((unused)))
+{
+ *length= (size_t) (strcend((const char*) record,',')- (const char*) record);
+ return (uchar*) record;
+}
+
+
static my_bool
get_one_option(int optid __attribute__((unused)),
const struct my_option *opt __attribute__((unused)),
- char *argument __attribute__((unused)))
+ char *argument)
{
switch (optid) {
case '?':
@@ -278,6 +290,23 @@ get_one_option(int optid __attribute__((unused)),
case 'V':
print_version();
exit(0);
+ case 'T':
+ {
+ char *pos;
+ if (!my_hash_inited(&tables_to_redo))
+ {
+ my_hash_init2(&tables_to_redo, 16, &my_charset_bin,
+ 16, 0, 0, my_hash_get_string, 0, HASH_UNIQUE);
+ }
+ do
+ {
+ pos= strcend(argument, ',');
+ if (pos != argument) /* Skip empty strings */
+ my_hash_insert(&tables_to_redo, (uchar*) argument);
+ argument= pos+1;
+ } while (*(pos++));
+ break;
+ }
#ifndef DBUG_OFF
case '#':
DBUG_SET_INITIAL(argument ? argument : default_dbug_option);
@@ -290,6 +319,7 @@ get_one_option(int optid __attribute__((unused)),
static void get_options(int *argc,char ***argv)
{
int ho_error;
+ my_bool need_help= 0;
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
exit(ho_error);
@@ -297,8 +327,23 @@ static void get_options(int *argc,char ***argv)
if (!opt_apply)
opt_apply_undo= FALSE;
- if (((opt_display_only + opt_apply) != 1) || (*argc > 0))
+ if (*argc > 0)
+ {
+ need_help= 1;
+ fprintf(stderr, "Too many arguments given\n");
+ }
+ if ((opt_display_only + opt_apply) != 1)
+ {
+ need_help= 1;
+ fprintf(stderr,
+ "You must use one and only one of the options 'display-only' or "
+ "'apply'\n");
+ }
+
+ if (need_help)
{
+ fflush(stderr);
+ need_help =1;
usage();
exit(1);
}
diff --git a/storage/maria/plug.in b/storage/maria/plug.in
index 008d82250c8..c48928be44f 100644
--- a/storage/maria/plug.in
+++ b/storage/maria/plug.in
@@ -1,8 +1,7 @@
MYSQL_STORAGE_ENGINE(aria,, [Aria Storage Engine],
[Crash-safe tables with MyISAM heritage], [default,max,max-no-ndb])
MYSQL_PLUGIN_DIRECTORY(aria, [storage/maria])
-MYSQL_PLUGIN_STATIC(aria, [libaria.a])
-MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS(aria, [ha_maria.cc])
+MYSQL_PLUGIN_STATIC(aria, [libaria_s.la], [libaria_embedded.la])
MYSQL_PLUGIN_ACTIONS(aria, [
# AC_CONFIG_FILES(storage/maria/unittest/Makefile)
diff --git a/storage/maria/unittest/CMakeLists.txt b/storage/maria/unittest/CMakeLists.txt
index 3d732f6245d..a6e8736daab 100644
--- a/storage/maria/unittest/CMakeLists.txt
+++ b/storage/maria/unittest/CMakeLists.txt
@@ -13,8 +13,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib
${CMAKE_SOURCE_DIR}/unittest/mytap)
diff --git a/storage/maria/unittest/Makefile.am b/storage/maria/unittest/Makefile.am
index b5bc8587066..557e14b0515 100644
--- a/storage/maria/unittest/Makefile.am
+++ b/storage/maria/unittest/Makefile.am
@@ -110,6 +110,3 @@ ma_pagecache_rwconsist2_1k_t_CPPFLAGS = -DTEST_PAGE_SIZE=1024
# so we don't build lockman-t and lockman1-t and lockman2-t
CLEANFILES = aria_log_control page_cache_test_file_1 \
aria_log.????????
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/maria/unittest/ma_pagecache_consist.c b/storage/maria/unittest/ma_pagecache_consist.c
index 7dbdba433c6..0a9e5737c7e 100644
--- a/storage/maria/unittest/ma_pagecache_consist.c
+++ b/storage/maria/unittest/ma_pagecache_consist.c
@@ -476,6 +476,7 @@ int main(int argc __attribute__((unused)),
pthread_mutex_unlock(&LOCK_thread_count);
DBUG_PRINT("info", ("thread ended"));
+ flush_pagecache_blocks(&pagecache, &file1, FLUSH_IGNORE_CHANGED);
end_pagecache(&pagecache, 1);
DBUG_PRINT("info", ("Page cache ended"));
diff --git a/storage/maria/unittest/ma_pagecache_rwconsist.c b/storage/maria/unittest/ma_pagecache_rwconsist.c
index a1a22b5e18d..ff386c48414 100644
--- a/storage/maria/unittest/ma_pagecache_rwconsist.c
+++ b/storage/maria/unittest/ma_pagecache_rwconsist.c
@@ -341,6 +341,7 @@ int main(int argc __attribute__((unused)),
pthread_mutex_unlock(&LOCK_thread_count);
DBUG_PRINT("info", ("thread ended"));
+ flush_pagecache_blocks(&pagecache, &file1, FLUSH_IGNORE_CHANGED);
end_pagecache(&pagecache, 1);
DBUG_PRINT("info", ("Page cache ended"));
diff --git a/storage/maria/unittest/ma_test_loghandler_multithread-t.c b/storage/maria/unittest/ma_test_loghandler_multithread-t.c
index 354f5d12e08..dbf47ad2ee1 100644
--- a/storage/maria/unittest/ma_test_loghandler_multithread-t.c
+++ b/storage/maria/unittest/ma_test_loghandler_multithread-t.c
@@ -269,11 +269,6 @@ int main(int argc __attribute__((unused)),
int *param, error;
int rc;
- /* Disabled until Sanja tests */
- plan(1);
- ok(1, "disabled");
- exit(0);
-
plan(WRITERS + FLUSHERS +
ITERATIONS * WRITERS * 3 + FLUSH_ITERATIONS * FLUSHERS );
diff --git a/storage/maria/unittest/ma_test_loghandler_pagecache-t.c b/storage/maria/unittest/ma_test_loghandler_pagecache-t.c
index 1644aa4885c..1d21d8c6a23 100644
--- a/storage/maria/unittest/ma_test_loghandler_pagecache-t.c
+++ b/storage/maria/unittest/ma_test_loghandler_pagecache-t.c
@@ -168,7 +168,7 @@ int main(int argc __attribute__((unused)), char *argv[])
PAGECACHE_PIN_LEFT_UNPINNED,
PAGECACHE_WRITE_DELAY,
0, LSN_IMPOSSIBLE);
- flush_pagecache_blocks(&pagecache, &file1, FLUSH_FORCE_WRITE);
+ flush_pagecache_blocks(&pagecache, &file1, FLUSH_RELEASE);
}
my_close(file1.file, MYF(MY_WME));
if ((file1.file= my_open(first_translog_file, O_RDONLY, MYF(MY_WME))) < 0)
diff --git a/storage/myisam/CMakeLists.txt b/storage/myisam/CMakeLists.txt
index 7744f4337ef..2d0d1bca7a4 100644
--- a/storage/myisam/CMakeLists.txt
+++ b/storage/myisam/CMakeLists.txt
@@ -15,9 +15,6 @@
INCLUDE("${PROJECT_SOURCE_DIR}/storage/mysql_storage_engine.cmake")
INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-
SET(MYISAM_SOURCES ft_boolean_search.c ft_nlq_search.c ft_parser.c ft_static.c ft_stem.c
ha_myisam.cc
ft_myisam.c
diff --git a/storage/myisam/Makefile.am b/storage/myisam/Makefile.am
index ea942672856..b232a6a1d07 100644
--- a/storage/myisam/Makefile.am
+++ b/storage/myisam/Makefile.am
@@ -31,6 +31,10 @@ EXTRA_DIST = mi_test_all.sh mi_test_all.res ft_stem.c CMakeLists.txt plug.in
pkgdata_DATA =
pkglib_LIBRARIES = libmyisam.a
+noinst_LTLIBRARIES = libmyisam.la libmyisam_s.la \
+ @plugin_myisam_embedded_static_target@
+EXTRA_LTLIBRARIES = libmyisam_embedded.la
+
bin_PROGRAMS = myisamchk myisamlog myisampack myisam_ftdump
myisamchk_DEPENDENCIES= $(LIBRARIES)
myisamchk_LDADD= @CLIENT_EXTRA_LDFLAGS@ libmyisam.a \
@@ -83,7 +87,8 @@ sp_test_LDADD = @CLIENT_EXTRA_LDFLAGS@ libmyisam.a \
$(top_builddir)/mysys/libmysys.a \
$(top_builddir)/dbug/libdbug.a \
$(top_builddir)/strings/libmystrings.a @ZLIB_LIBS@
-libmyisam_a_SOURCES = mi_open.c mi_extra.c mi_info.c mi_rkey.c \
+
+libmyisam_la_SOURCES = mi_open.c mi_extra.c mi_info.c mi_rkey.c \
mi_rnext.c mi_rnext_same.c \
mi_search.c mi_page.c mi_key.c mi_locking.c \
mi_rrnd.c mi_scan.c mi_cache.c \
@@ -98,8 +103,19 @@ libmyisam_a_SOURCES = mi_open.c mi_extra.c mi_info.c mi_rkey.c \
mi_keycache.c mi_preload.c \
ft_parser.c ft_stopwords.c ft_static.c \
ft_update.c ft_boolean_search.c ft_nlq_search.c \
- sort.c ha_myisam.cc ft_myisam.c \
+ sort.c ft_myisam.c \
rt_index.c rt_key.c rt_mbr.c rt_split.c sp_key.c
+libmyisam_s_la_SOURCES = ha_myisam.cc
+libmyisam_s_la_CXXFLAGS = $(AM_CXXFLAGS)
+libmyisam_s_la_LIBADD = libmyisam.la
+libmyisam_embedded_la_SOURCES = ha_myisam.cc
+libmyisam_embedded_la_CXXFLAGS = $(AM_CXXFLAGS) @plugin_embedded_defs@
+libmyisam_embedded_la_LIBADD = libmyisam.la
+
+libmyisam_a_SOURCES=
+libmyisam.a: libmyisam.la
+ $(CP) .libs/libmyisam.a $@
+
CLEANFILES = test?.MY? FT?.MY? isam.log mi_test_all rt_test.MY? sp_test.MY?
# Move to automake rules ?
@@ -149,6 +165,3 @@ SUFFIXES = .sh
$< > $@-t
@CHMOD@ +x $@-t
@MV@ $@-t $@
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index 583c8b5395a..cfe8141417a 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -33,7 +33,7 @@ ulong myisam_recover_options= HA_RECOVER_NONE;
/* bits in myisam_recover_options */
const char *myisam_recover_names[] =
-{ "DEFAULT", "BACKUP", "FORCE", "QUICK", NullS};
+{ "DEFAULT", "BACKUP", "FORCE", "QUICK", "BACKUP_ALL", NullS};
TYPELIB myisam_recover_typelib= {array_elements(myisam_recover_names)-1,"",
myisam_recover_names, NULL};
@@ -545,6 +545,7 @@ ha_myisam::ha_myisam(handlerton *hton, TABLE_SHARE *table_arg)
:handler(hton, table_arg), file(0),
int_table_flags(HA_NULL_IN_KEY | HA_CAN_FULLTEXT | HA_CAN_SQL_HANDLER |
HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE |
+ HA_CAN_VIRTUAL_COLUMNS |
HA_DUPLICATE_POS | HA_CAN_INDEX_BLOBS | HA_AUTO_PART_KEY |
HA_FILE_BASED | HA_CAN_GEOMETRY | HA_NO_TRANSACTIONS |
HA_CAN_INSERT_DELAYED | HA_CAN_BIT_FIELD | HA_CAN_RTREEKEYS |
@@ -1055,6 +1056,7 @@ int ha_myisam::repair(THD* thd, HA_CHECK_OPT *check_opt)
T_SILENT | T_FORCE_CREATE | T_CALC_CHECKSUM |
(check_opt->flags & T_EXTEND ? T_REP : T_REP_BY_SORT));
param.sort_buffer_length= thd->variables.myisam_sort_buff_size;
+ param.backup_time= check_opt->start_time;
start_records=file->state->records;
while ((error=repair(thd,param,0)) && param.retry_repair)
{
@@ -1659,8 +1661,18 @@ bool ha_myisam::check_and_repair(THD *thd)
if ((marked_crashed= mi_is_crashed(file)) || check(thd, &check_opt))
{
sql_print_warning("Recovering table: '%s'",table->s->path.str);
+ if (myisam_recover_options & (HA_RECOVER_FULL_BACKUP | HA_RECOVER_BACKUP))
+ {
+ char buff[MY_BACKUP_NAME_EXTRA_LENGTH+1];
+ my_create_backup_name(buff, "", check_opt.start_time);
+ sql_print_information("Making backup of data with extension '%s'", buff);
+ }
+ if (myisam_recover_options & HA_RECOVER_FULL_BACKUP)
+ mi_make_backup_of_index(file, check_opt.start_time,
+ MYF(MY_WME | ME_JUST_WARNING));
check_opt.flags=
- ((myisam_recover_options & HA_RECOVER_BACKUP ? T_BACKUP_DATA : 0) |
+ (((myisam_recover_options &
+ (HA_RECOVER_BACKUP | HA_RECOVER_FULL_BACKUP)) ? T_BACKUP_DATA : 0) |
(marked_crashed ? 0 : T_QUICK) |
(myisam_recover_options & HA_RECOVER_FORCE ? 0 : T_SAFE_REPAIR) |
T_AUTO_REPAIR);
diff --git a/storage/myisam/ha_myisam.h b/storage/myisam/ha_myisam.h
index 9d8791c7eff..d8f307c4aa7 100644
--- a/storage/myisam/ha_myisam.h
+++ b/storage/myisam/ha_myisam.h
@@ -29,6 +29,7 @@
#define HA_RECOVER_BACKUP 2 /* Make a backupfile on recover */
#define HA_RECOVER_FORCE 4 /* Recover even if we loose rows */
#define HA_RECOVER_QUICK 8 /* Don't check rows in data file */
+#define HA_RECOVER_FULL_BACKUP 16 /* Make a copy of index file too */
extern ulong myisam_sort_buffer_size;
extern TYPELIB myisam_recover_typelib;
@@ -132,7 +133,6 @@ class ha_myisam: public handler
int assign_to_keycache(THD* thd, HA_CHECK_OPT* check_opt);
int preload_keys(THD* thd, HA_CHECK_OPT* check_opt);
bool check_if_incompatible_data(HA_CREATE_INFO *info, uint table_changes);
- bool check_if_supported_virtual_columns(void) { return TRUE;}
#ifdef HAVE_REPLICATION
int dump(THD* thd, int fd);
int net_read_dump(NET* net);
diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c
index d24dba3d6b3..e92c9879e57 100644
--- a/storage/myisam/mi_check.c
+++ b/storage/myisam/mi_check.c
@@ -1736,7 +1736,9 @@ err:
my_close(new_file,MYF(0));
info->dfile=new_file= -1;
if (change_to_newfile(share->data_file_name,MI_NAME_DEXT,
- DATA_TMP_EXT, share->base.raid_chunks,
+ DATA_TMP_EXT,
+ param->backup_time,
+ share->base.raid_chunks,
(param->testflag & T_BACKUP_DATA ?
MYF(MY_REDEL_MAKE_BACKUP): MYF(0))) ||
mi_open_datafile(info,share,name,-1))
@@ -1997,8 +1999,8 @@ int mi_sort_index(HA_CHECK *param, register MI_INFO *info, char * name)
VOID(my_close(share->kfile,MYF(MY_WME)));
share->kfile = -1;
VOID(my_close(new_file,MYF(MY_WME)));
- if (change_to_newfile(share->index_file_name,MI_NAME_IEXT,INDEX_TMP_EXT,0,
- MYF(0)) ||
+ if (change_to_newfile(share->index_file_name,MI_NAME_IEXT,INDEX_TMP_EXT,
+ 0, 0, MYF(0)) ||
mi_open_keyfile(share))
goto err2;
info->lock_type= F_UNLCK; /* Force mi_readinfo to lock */
@@ -2127,6 +2129,7 @@ err:
int change_to_newfile(const char * filename, const char * old_ext,
const char * new_ext,
+ time_t backup_time,
uint raid_chunks __attribute__((unused)),
myf MyFlags)
{
@@ -2142,7 +2145,7 @@ int change_to_newfile(const char * filename, const char * old_ext,
(void) fn_format(old_filename,filename,"",old_ext,2+4+32);
return my_redel(old_filename,
fn_format(new_filename,old_filename,"",new_ext,2+4),
- MYF(MY_WME | MY_LINK_WARNING | MyFlags));
+ backup_time, MYF(MY_WME | MY_LINK_WARNING | MyFlags));
} /* change_to_newfile */
@@ -2551,7 +2554,8 @@ err:
my_close(new_file,MYF(0));
info->dfile=new_file= -1;
if (change_to_newfile(share->data_file_name,MI_NAME_DEXT,
- DATA_TMP_EXT, share->base.raid_chunks,
+ DATA_TMP_EXT, param->backup_time,
+ share->base.raid_chunks,
(param->testflag & T_BACKUP_DATA ?
MYF(MY_REDEL_MAKE_BACKUP): MYF(0))) ||
mi_open_datafile(info,share,name,-1))
@@ -3089,7 +3093,8 @@ err:
my_close(new_file,MYF(0));
info->dfile=new_file= -1;
if (change_to_newfile(share->data_file_name,MI_NAME_DEXT,
- DATA_TMP_EXT, share->base.raid_chunks,
+ DATA_TMP_EXT, param->backup_time,
+ share->base.raid_chunks,
(param->testflag & T_BACKUP_DATA ?
MYF(MY_REDEL_MAKE_BACKUP): MYF(0))) ||
mi_open_datafile(info,share,name,-1))
@@ -4751,3 +4756,10 @@ set_data_file_type(MI_SORT_INFO *sort_info, MYISAM_SHARE *share)
share->delete_record=tmp.delete_record;
}
}
+
+int mi_make_backup_of_index(MI_INFO *info, time_t backup_time, myf flags)
+{
+ char backup_name[FN_REFLEN + MY_BACKUP_NAME_EXTRA_LENGTH];
+ my_create_backup_name(backup_name, info->s->index_file_name, backup_time);
+ return my_copy(info->s->index_file_name, backup_name, flags);
+}
diff --git a/storage/myisam/mi_close.c b/storage/myisam/mi_close.c
index a8d678494f5..6173f8b3bff 100644
--- a/storage/myisam/mi_close.c
+++ b/storage/myisam/mi_close.c
@@ -61,7 +61,7 @@ int mi_close(register MI_INFO *info)
if (flag)
{
DBUG_EXECUTE_IF("crash_before_flush_keys",
- if (share->kfile >= 0) abort(););
+ if (share->kfile >= 0) DBUG_ABORT(););
if (share->kfile >= 0 &&
flush_key_blocks(share->key_cache, share->kfile,
&share->dirty_part_map,
diff --git a/storage/myisam/mi_open.c b/storage/myisam/mi_open.c
index 9fc82846e91..9d69f8622e8 100644
--- a/storage/myisam/mi_open.c
+++ b/storage/myisam/mi_open.c
@@ -119,7 +119,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
dflt_key_cache);
DBUG_EXECUTE_IF("myisam_pretend_crashed_table_on_open",
- if (strstr(name, "/crashed"))
+ if (strstr(name, "crashed"))
{
my_errno= HA_ERR_CRASHED;
goto err;
diff --git a/storage/myisam/mi_range.c b/storage/myisam/mi_range.c
index aabbe1277c4..60d51637591 100644
--- a/storage/myisam/mi_range.c
+++ b/storage/myisam/mi_range.c
@@ -193,12 +193,11 @@ static double _mi_search_pos(register MI_INFO *info,
register my_off_t pos)
{
int flag;
- uint nod_flag,keynr,max_keynr;
+ uint nod_flag,keynr,UNINIT_VAR(max_keynr);
my_bool after_key;
uchar *keypos,*buff;
double offset;
DBUG_ENTER("_mi_search_pos");
- LINT_INIT(max_keynr);
if (pos == HA_OFFSET_ERROR)
DBUG_RETURN(0.5);
diff --git a/storage/myisam/mi_search.c b/storage/myisam/mi_search.c
index 52e28f8a5e9..1f8399f25ca 100644
--- a/storage/myisam/mi_search.c
+++ b/storage/myisam/mi_search.c
@@ -296,9 +296,9 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
flag is the value returned by ha_key_cmp and as treated as final
*/
int flag=0, my_flag=-1;
- uint nod_flag, length, len, matched, cmplen, kseg_len;
- uint prefix_len,suffix_len;
- int key_len_skip, seg_len_pack, key_len_left;
+ uint nod_flag, UNINIT_VAR(length), len, matched, cmplen, kseg_len;
+ uint UNINIT_VAR(prefix_len), suffix_len;
+ int key_len_skip, UNINIT_VAR(seg_len_pack), key_len_left;
uchar *end, *kseg, *vseg;
const uchar *sort_order= keyinfo->seg->charset->sort_order;
uchar tt_buff[HA_MAX_KEY_BUFF+2], *t_buff=tt_buff+2;
@@ -308,10 +308,6 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
uint length_pack;
DBUG_ENTER("_mi_prefix_search");
- LINT_INIT(length);
- LINT_INIT(prefix_len);
- LINT_INIT(seg_len_pack);
-
t_buff[0]=0; /* Avoid bugs */
end= page+mi_getint(page);
nod_flag=mi_test_if_nod(page);
diff --git a/storage/myisam/myisamchk.c b/storage/myisam/myisamchk.c
index 592426a3690..8c54d7f0411 100644
--- a/storage/myisam/myisamchk.c
+++ b/storage/myisam/myisamchk.c
@@ -1032,7 +1032,7 @@ static int myisamchk(HA_CHECK *param, char * filename)
{ /* Change temp file to org file */
VOID(my_close(info->dfile,MYF(MY_WME))); /* Close new file */
error|=change_to_newfile(filename,MI_NAME_DEXT,DATA_TMP_EXT,
- raid_chunks,
+ 0, raid_chunks,
MYF(0));
if (mi_open_datafile(info,info->s, NULL, -1))
error=1;
@@ -1165,12 +1165,9 @@ end2:
{
if (param->out_flag & O_NEW_DATA)
error|=change_to_newfile(filename,MI_NAME_DEXT,DATA_TMP_EXT,
- raid_chunks,
+ param->backup_time, raid_chunks,
((param->testflag & T_BACKUP_DATA) ?
MYF(MY_REDEL_MAKE_BACKUP) : MYF(0)));
- if (param->out_flag & O_NEW_INDEX)
- error|=change_to_newfile(filename,MI_NAME_IEXT,INDEX_TMP_EXT,0,
- MYF(0));
}
VOID(fflush(stdout)); VOID(fflush(stderr));
if (param->error_printed)
@@ -1242,7 +1239,8 @@ static void descript(HA_CHECK *param, register MI_INFO *info, char * name)
}
pos=buff;
if (share->state.changed & STATE_CRASHED)
- strmov(buff,"crashed");
+ strmov(buff, share->state.changed & STATE_CRASHED_ON_REPAIR ?
+ "crashed on repair" : "crashed");
else
{
if (share->state.open_count)
diff --git a/storage/myisam/myisampack.c b/storage/myisam/myisampack.c
index f2b28a008fc..ba3ff3cdf0d 100644
--- a/storage/myisam/myisampack.c
+++ b/storage/myisam/myisampack.c
@@ -720,7 +720,7 @@ static int compress(PACK_MRG_INFO *mrg,char *result_table)
VOID(my_delete(new_name,MYF(MY_WME)));
}
else
- error=my_redel(org_name,new_name,MYF(MY_WME | MY_COPYTIME));
+ error=my_redel(org_name, new_name, 0, MYF(MY_WME | MY_COPYTIME));
}
if (! error)
error=save_state(isam_file,mrg,new_length,glob_crc);
diff --git a/storage/myisam/plug.in b/storage/myisam/plug.in
index e92b5e56d7f..95b29336493 100644
--- a/storage/myisam/plug.in
+++ b/storage/myisam/plug.in
@@ -1,7 +1,6 @@
dnl MYSQL_STORAGE_ENGINE(myisam,no, [MyISAM Storage Engine],
dnl [Traditional non-transactional MySQL tables])
dnl MYSQL_PLUGIN_DIRECTORY(myisam, [storage/myisam])
-dnl MYSQL_PLUGIN_STATIC(myisam, [libmyisam.a])
+dnl MYSQL_PLUGIN_STATIC(myisam, [libmyisam_s.la], [libmyisam_embedded.la])
dnl MYSQL_PLUGIN_MANDATORY(myisam) dnl Default
-dnl MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS(myisam, [ha_myisam.cc])
diff --git a/storage/myisam/rt_index.c b/storage/myisam/rt_index.c
index 575cc32eb56..6a825bab1fa 100644
--- a/storage/myisam/rt_index.c
+++ b/storage/myisam/rt_index.c
@@ -481,17 +481,13 @@ static uchar *rtree_pick_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key,
uint key_length, uchar *page_buf, uint nod_flag)
{
double increase;
- double best_incr;
+ double UNINIT_VAR(best_incr);
double area;
- double best_area;
+ double UNINIT_VAR(best_area);
uchar *best_key= NULL;
uchar *k = rt_PAGE_FIRST_KEY(page_buf, nod_flag);
uchar *last = rt_PAGE_END(page_buf);
- LINT_INIT(best_area);
- LINT_INIT(best_key);
- LINT_INIT(best_incr);
-
for (; k < last; k = rt_PAGE_NEXT_KEY(k, key_length, nod_flag))
{
/* The following is safe as -1.0 is an exact number */
diff --git a/storage/myisam/rt_split.c b/storage/myisam/rt_split.c
index 03d22de68fa..0b7cc43e062 100644
--- a/storage/myisam/rt_split.c
+++ b/storage/myisam/rt_split.c
@@ -178,18 +178,13 @@ static int split_rtree_node(SplitStruct *node, int n_entries,
double **d_buffer, int n_dim)
{
SplitStruct *cur;
- SplitStruct *a;
- SplitStruct *b;
+ SplitStruct *UNINIT_VAR(a), *UNINIT_VAR(b);
double *g1 = reserve_coords(d_buffer, n_dim);
double *g2 = reserve_coords(d_buffer, n_dim);
- SplitStruct *next;
- int next_node;
+ SplitStruct *UNINIT_VAR(next);
+ int UNINIT_VAR(next_node);
int i;
SplitStruct *end = node + n_entries;
- LINT_INIT(a);
- LINT_INIT(b);
- LINT_INIT(next);
- LINT_INIT(next_node);
if (all_size < min_size * 2)
{
diff --git a/storage/myisammrg/CMakeLists.txt b/storage/myisammrg/CMakeLists.txt
index 60cfffc67ff..c545d04a780 100755
--- a/storage/myisammrg/CMakeLists.txt
+++ b/storage/myisammrg/CMakeLists.txt
@@ -12,8 +12,6 @@
# 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
INCLUDE("${PROJECT_SOURCE_DIR}/storage/mysql_storage_engine.cmake")
diff --git a/storage/myisammrg/Makefile.am b/storage/myisammrg/Makefile.am
index 1ca51bc9d03..28a0e532bae 100644
--- a/storage/myisammrg/Makefile.am
+++ b/storage/myisammrg/Makefile.am
@@ -27,18 +27,25 @@ LDADD =
DEFS = @DEFS@
pkglib_LIBRARIES = libmyisammrg.a
+noinst_LTLIBRARIES = libmyisammrg.la libmyisammrg_s.la \
+ @plugin_myisammrg_embedded_static_target@
+EXTRA_LTLIBRARIES = libmyisammrg_embedded.la
noinst_HEADERS = myrg_def.h ha_myisammrg.h
-noinst_LIBRARIES = libmyisammrg.a
-libmyisammrg_a_SOURCES = myrg_open.c myrg_extra.c myrg_info.c myrg_locking.c \
+libmyisammrg_la_SOURCES = myrg_open.c myrg_extra.c myrg_info.c myrg_locking.c \
myrg_rrnd.c myrg_update.c myrg_delete.c myrg_rsame.c \
myrg_panic.c myrg_close.c myrg_create.c myrg_static.c \
myrg_rkey.c myrg_rfirst.c myrg_rlast.c myrg_rnext.c \
myrg_rprev.c myrg_queue.c myrg_write.c myrg_range.c \
- ha_myisammrg.cc \
myrg_rnext_same.c myrg_records.c
+libmyisammrg_s_la_SOURCES = ha_myisammrg.cc
+libmyisammrg_s_la_CXXFLAGS = $(AM_CXXFLAGS)
+libmyisammrg_s_la_LIBADD = libmyisammrg.la
+libmyisammrg_embedded_la_SOURCES = ha_myisammrg.cc
+libmyisammrg_embedded_la_CXXFLAGS = $(AM_CXXFLAGS) @plugin_embedded_defs@
+libmyisammrg_embedded_la_LIBADD = libmyisammrg.la
+libmyisammrg_a_SOURCES=
+libmyisammrg.a: libmyisammrg.la
+ $(CP) .libs/libmyisammrg.a $@
EXTRA_DIST = CMakeLists.txt plug.in
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc
index c61d65572cb..ff2d01e09c0 100644
--- a/storage/myisammrg/ha_myisammrg.cc
+++ b/storage/myisammrg/ha_myisammrg.cc
@@ -1057,9 +1057,9 @@ THR_LOCK_DATA **ha_myisammrg::store_lock(THD *thd,
/*
When MERGE table is open, but not yet attached, other threads
- could flush it, which means call mysql_lock_abort_for_thread()
+ could flush it, which means calling mysql_lock_abort_for_thread()
on this threads TABLE. 'children_attached' is FALSE in this
- situaton. Since the table is not locked, return no lock data.
+ situation. Since the table is not locked, return no lock data.
*/
if (!this->file->children_attached)
goto end; /* purecov: tested */
diff --git a/storage/myisammrg/plug.in b/storage/myisammrg/plug.in
index 1f94e07d881..a2654373fba 100644
--- a/storage/myisammrg/plug.in
+++ b/storage/myisammrg/plug.in
@@ -1,6 +1,5 @@
MYSQL_STORAGE_ENGINE(myisammrg,no,[MyISAM MERGE Engine],
[Merge multiple MySQL tables into one])
MYSQL_PLUGIN_DIRECTORY(myisammrg,[storage/myisammrg])
-MYSQL_PLUGIN_STATIC(myisammrg, [libmyisammrg.a])
+MYSQL_PLUGIN_STATIC(myisammrg, [libmyisammrg_s.la], [libmyisammrg_embedded.la])
MYSQL_PLUGIN_MANDATORY(myisammrg)
-MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS(myisammrg, [ha_myisammrg.cc])
diff --git a/storage/ndb/Makefile.am b/storage/ndb/Makefile.am
index 5e519ec1c98..0da8ec136c9 100644
--- a/storage/ndb/Makefile.am
+++ b/storage/ndb/Makefile.am
@@ -44,6 +44,3 @@ all-windoze-dsp: windoze
find . -name '*.dsp' | grep -v SCCS | xargs unix2dos
$(top_srcdir)/storage/ndb/config/make-win-dsw.sh | unix2dos > ndb.dsw
tar cvfz ndb-win-dsp.tar.gz ndb.dsw `find . -name '*.dsp' | grep -v SCCS`
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/ndb/docs/Makefile.am b/storage/ndb/docs/Makefile.am
index 66d116c02b7..b0166d40779 100644
--- a/storage/ndb/docs/Makefile.am
+++ b/storage/ndb/docs/Makefile.am
@@ -127,6 +127,3 @@ testdoc: DUMMY
cd $(top_srcdir)/storage/ndb ; $(DOXYGEN) $(DOXYDIR)/Doxyfile.test
windoze-dsp:
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/ndb/include/Makefile.am b/storage/ndb/include/Makefile.am
index 9e6ad016d75..34a243d82a1 100644
--- a/storage/ndb/include/Makefile.am
+++ b/storage/ndb/include/Makefile.am
@@ -63,6 +63,3 @@ dist-hook:
-rm -rf `find $(distdir) -type d -name SCCS`
windoze-dsp:
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/ndb/include/kernel/signaldata/FsOpenReq.hpp b/storage/ndb/include/kernel/signaldata/FsOpenReq.hpp
index 8126267f946..95dbf5204f1 100644
--- a/storage/ndb/include/kernel/signaldata/FsOpenReq.hpp
+++ b/storage/ndb/include/kernel/signaldata/FsOpenReq.hpp
@@ -203,7 +203,7 @@ Uint32 FsOpenReq::getVersion(const Uint32 fileNumber[]){
inline
void FsOpenReq::setVersion(Uint32 fileNumber[], Uint8 val){
const Uint32 t = fileNumber[3];
- fileNumber[3] = t & 0x00FFFFFF | (((Uint32)val) << 24);
+ fileNumber[3] = (t & 0x00FFFFFF) | (((Uint32)val) << 24);
}
inline
@@ -214,7 +214,7 @@ Uint32 FsOpenReq::getSuffix(const Uint32 fileNumber[]){
inline
void FsOpenReq::setSuffix(Uint32 fileNumber[], Uint8 val){
const Uint32 t = fileNumber[3];
- fileNumber[3] = t & 0xFF00FFFF | (((Uint32)val) << 16);
+ fileNumber[3] = (t & 0xFF00FFFF) | (((Uint32)val) << 16);
}
inline
@@ -225,7 +225,7 @@ Uint32 FsOpenReq::v1_getDisk(const Uint32 fileNumber[]){
inline
void FsOpenReq::v1_setDisk(Uint32 fileNumber[], Uint8 val){
const Uint32 t = fileNumber[3];
- fileNumber[3] = t & 0xFFFF00FF | (((Uint32)val) << 8);
+ fileNumber[3] = (t & 0xFFFF00FF) | (((Uint32)val) << 8);
}
inline
@@ -266,7 +266,7 @@ Uint32 FsOpenReq::v1_getP(const Uint32 fileNumber[]){
inline
void FsOpenReq::v1_setP(Uint32 fileNumber[], Uint8 val){
const Uint32 t = fileNumber[3];
- fileNumber[3] = t & 0xFFFFFF00 | val;
+ fileNumber[3] = (t & 0xFFFFFF00) | val;
}
/****************/
diff --git a/storage/ndb/include/ndbapi/NdbDictionary.hpp b/storage/ndb/include/ndbapi/NdbDictionary.hpp
index 0e782ba9214..8a23802e797 100644
--- a/storage/ndb/include/ndbapi/NdbDictionary.hpp
+++ b/storage/ndb/include/ndbapi/NdbDictionary.hpp
@@ -20,7 +20,7 @@
class Ndb;
struct charset_info_st;
-typedef struct charset_info_st CHARSET_INFO;
+typedef const struct charset_info_st CHARSET_INFO;
/**
* @class NdbDictionary
diff --git a/storage/ndb/include/ndbapi/NdbError.hpp b/storage/ndb/include/ndbapi/NdbError.hpp
index aa27caf78f9..b752e578bc1 100644
--- a/storage/ndb/include/ndbapi/NdbError.hpp
+++ b/storage/ndb/include/ndbapi/NdbError.hpp
@@ -66,7 +66,7 @@ struct NdbError {
/**
* The error code indicates a permanent error.<br>
- * (Includes classificatons: NdbError::PermanentError,
+ * (Includes classifications: NdbError::PermanentError,
* NdbError::ApplicationError, NdbError::NoDataFound,
* NdbError::ConstraintViolation, NdbError::SchemaError,
* NdbError::UserDefinedError, NdbError::InternalError, and,
diff --git a/storage/ndb/include/util/File.hpp b/storage/ndb/include/util/File.hpp
index b9d348683ec..bbddc24583a 100644
--- a/storage/ndb/include/util/File.hpp
+++ b/storage/ndb/include/util/File.hpp
@@ -31,7 +31,7 @@ public:
* Returns time for last contents modification of a file.
*
* @param aFileName a filename to check.
- * @return the time for last contents modificaton of the file.
+ * @return the time for last contents modification of the file.
*/
static time_t mtime(const char* aFileName);
diff --git a/storage/ndb/include/util/NdbSqlUtil.hpp b/storage/ndb/include/util/NdbSqlUtil.hpp
index 8d063f1908b..77bb79aca82 100644
--- a/storage/ndb/include/util/NdbSqlUtil.hpp
+++ b/storage/ndb/include/util/NdbSqlUtil.hpp
@@ -20,7 +20,6 @@
#include <kernel/ndb_limits.h>
struct charset_info_st;
-typedef struct charset_info_st CHARSET_INFO;
class NdbSqlUtil {
public:
diff --git a/storage/ndb/src/Makefile.am b/storage/ndb/src/Makefile.am
index 627347daf02..e879249bed6 100644
--- a/storage/ndb/src/Makefile.am
+++ b/storage/ndb/src/Makefile.am
@@ -48,6 +48,3 @@ libndbclient.dsp: Makefile \
@$(top_srcdir)/storage/ndb/config/win-sources $@ dummy.cpp
@$(top_srcdir)/storage/ndb/config/win-libraries $@ LIB $(libndbclient_la_LIBADD)
@touch dummy.cpp
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/ndb/src/common/Makefile.am b/storage/ndb/src/common/Makefile.am
index 9d601c7a18a..34e9871da55 100644
--- a/storage/ndb/src/common/Makefile.am
+++ b/storage/ndb/src/common/Makefile.am
@@ -28,6 +28,3 @@ libcommon_la_LIBADD = \
util/libgeneral.la
windoze-dsp:
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/ndb/src/common/debugger/Makefile.am b/storage/ndb/src/common/debugger/Makefile.am
index 56910ee8ea4..30b8563af6d 100644
--- a/storage/ndb/src/common/debugger/Makefile.am
+++ b/storage/ndb/src/common/debugger/Makefile.am
@@ -22,9 +22,6 @@ libtrace_la_SOURCES = SignalLoggerManager.cpp DebuggerNames.cpp BlockNames.cpp E
include $(top_srcdir)/storage/ndb/config/common.mk.am
include $(top_srcdir)/storage/ndb/config/type_kernel.mk.am
-# Don't update the files from bitkeeper
-%::SCCS/s.%
-
windoze-dsp: libtrace.dsp
libtrace.dsp: Makefile \
diff --git a/storage/ndb/src/common/debugger/signaldata/Makefile.am b/storage/ndb/src/common/debugger/signaldata/Makefile.am
index 280cd6a5a39..028049cf67b 100644
--- a/storage/ndb/src/common/debugger/signaldata/Makefile.am
+++ b/storage/ndb/src/common/debugger/signaldata/Makefile.am
@@ -43,9 +43,6 @@ libsignaldataprint_la_SOURCES = \
include $(top_srcdir)/storage/ndb/config/common.mk.am
include $(top_srcdir)/storage/ndb/config/type_ndbapi.mk.am
-# Don't update the files from bitkeeper
-%::SCCS/s.%
-
windoze-dsp: libsignaldataprint.dsp
libsignaldataprint.dsp: Makefile \
diff --git a/storage/ndb/src/common/logger/Makefile.am b/storage/ndb/src/common/logger/Makefile.am
index 77615212e0d..870946c1e9d 100644
--- a/storage/ndb/src/common/logger/Makefile.am
+++ b/storage/ndb/src/common/logger/Makefile.am
@@ -22,8 +22,6 @@ liblogger_la_SOURCES = $(SOURCE_WIN) SysLogHandler.cpp
include $(top_srcdir)/storage/ndb/config/common.mk.am
include $(top_srcdir)/storage/ndb/config/type_ndbapi.mk.am
-# Don't update the files from bitkeeper
-%::SCCS/s.%
windoze-dsp: liblogger.dsp
liblogger.dsp: Makefile \
diff --git a/storage/ndb/src/common/mgmcommon/Makefile.am b/storage/ndb/src/common/mgmcommon/Makefile.am
index ad56e8c1459..2b41c2bfdd9 100644
--- a/storage/ndb/src/common/mgmcommon/Makefile.am
+++ b/storage/ndb/src/common/mgmcommon/Makefile.am
@@ -25,9 +25,6 @@ include $(top_srcdir)/storage/ndb/config/common.mk.am
include $(top_srcdir)/storage/ndb/config/type_ndbapi.mk.am
include $(top_srcdir)/storage/ndb/config/type_mgmapiclient.mk.am
-# Don't update the files from bitkeeper
-%::SCCS/s.%
-
windoze-dsp: libmgmsrvcommon.dsp
libmgmsrvcommon.dsp: Makefile \
diff --git a/storage/ndb/src/common/portlib/Makefile.am b/storage/ndb/src/common/portlib/Makefile.am
index f427b2170b4..84d9cc754a8 100644
--- a/storage/ndb/src/common/portlib/Makefile.am
+++ b/storage/ndb/src/common/portlib/Makefile.am
@@ -54,6 +54,3 @@ libportlib.dsp: Makefile \
@$(top_srcdir)/storage/ndb/config/win-includes $@ $(INCLUDES)
@$(top_srcdir)/storage/ndb/config/win-sources $@ $(WIN_src)
@$(top_srcdir)/storage/ndb/config/win-libraries $@ LIB $(LDADD)
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/ndb/src/common/transporter/Makefile.am b/storage/ndb/src/common/transporter/Makefile.am
index 83ac3b6121d..ccf51b352b1 100644
--- a/storage/ndb/src/common/transporter/Makefile.am
+++ b/storage/ndb/src/common/transporter/Makefile.am
@@ -32,9 +32,6 @@ INCLUDES_LOC = -I$(top_srcdir)/storage/ndb/include/mgmapi -I$(top_srcdir)/storag
include $(top_srcdir)/storage/ndb/config/common.mk.am
include $(top_srcdir)/storage/ndb/config/type_util.mk.am
-# Don't update the files from bitkeeper
-%::SCCS/s.%
-
windoze-dsp: libtransporter.dsp
libtransporter.dsp: Makefile \
diff --git a/storage/ndb/src/common/util/Makefile.am b/storage/ndb/src/common/util/Makefile.am
index 5379a425c49..4a69924192e 100644
--- a/storage/ndb/src/common/util/Makefile.am
+++ b/storage/ndb/src/common/util/Makefile.am
@@ -46,9 +46,6 @@ testBitmask.o: $(testBitmask_SOURCES)
include $(top_srcdir)/storage/ndb/config/common.mk.am
include $(top_srcdir)/storage/ndb/config/type_util.mk.am
-# Don't update the files from bitkeeper
-%::SCCS/s.%
-
windoze-dsp: libgeneral.dsp
libgeneral.dsp: Makefile \
diff --git a/storage/ndb/src/cw/Makefile.am b/storage/ndb/src/cw/Makefile.am
index d9a40002062..3695e197cfb 100644
--- a/storage/ndb/src/cw/Makefile.am
+++ b/storage/ndb/src/cw/Makefile.am
@@ -16,6 +16,3 @@
SUBDIRS = cpcd
windoze-dsp:
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/ndb/src/cw/cpcd/Makefile.am b/storage/ndb/src/cw/cpcd/Makefile.am
index efc828e21a9..722ceaf22e8 100644
--- a/storage/ndb/src/cw/cpcd/Makefile.am
+++ b/storage/ndb/src/cw/cpcd/Makefile.am
@@ -28,7 +28,4 @@ include $(top_srcdir)/storage/ndb/config/type_util.mk.am
ndb_cpcd_LDFLAGS = -static @ndb_bin_am_ldflags@
-# Don't update the files from bitkeeper
-%::SCCS/s.%
-
windoze-dsp:
diff --git a/storage/ndb/src/kernel/Makefile.am b/storage/ndb/src/kernel/Makefile.am
index 343d5eeab6d..9596c53da37 100644
--- a/storage/ndb/src/kernel/Makefile.am
+++ b/storage/ndb/src/kernel/Makefile.am
@@ -70,6 +70,3 @@ storage/ndbd.dsp: Makefile \
@$(top_srcdir)/storage/ndb/config/win-includes $@ $(INCLUDES)
@$(top_srcdir)/storage/ndb/config/win-sources $@ $(ndbd_SOURCES)
@$(top_srcdir)/storage/ndb/config/win-libraries $@ LINK $(LDADD)
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/ndb/src/kernel/blocks/Makefile.am b/storage/ndb/src/kernel/blocks/Makefile.am
index ebb2e48ad14..f17f274defb 100644
--- a/storage/ndb/src/kernel/blocks/Makefile.am
+++ b/storage/ndb/src/kernel/blocks/Makefile.am
@@ -64,10 +64,4 @@ ndb_print_file_LDFLAGS = @ndb_bin_am_ldflags@ \
include $(top_srcdir)/storage/ndb/config/common.mk.am
include $(top_srcdir)/storage/ndb/config/type_kernel.mk.am
-# Don't update the files from bitkeeper
-%::SCCS/s.%
-
windoze-dsp:
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/ndb/src/kernel/blocks/backup/Makefile.am b/storage/ndb/src/kernel/blocks/backup/Makefile.am
index 4594e0fe717..bfeede8a984 100644
--- a/storage/ndb/src/kernel/blocks/backup/Makefile.am
+++ b/storage/ndb/src/kernel/blocks/backup/Makefile.am
@@ -24,6 +24,3 @@ ndb_print_backup_file_LDFLAGS = @ndb_bin_am_ldflags@ \
include $(top_srcdir)/storage/ndb/config/common.mk.am
include $(top_srcdir)/storage/ndb/config/type_kernel.mk.am
-# Don't update the files from bitkeeper
-%::SCCS/s.%
-
diff --git a/storage/ndb/src/kernel/blocks/dbdict/Makefile.am b/storage/ndb/src/kernel/blocks/dbdict/Makefile.am
index 0ee3df7036d..678aa54684e 100644
--- a/storage/ndb/src/kernel/blocks/dbdict/Makefile.am
+++ b/storage/ndb/src/kernel/blocks/dbdict/Makefile.am
@@ -30,6 +30,3 @@ ndb_print_schema_file_LDFLAGS = @ndb_bin_am_ldflags@ \
$(top_builddir)/dbug/libdbug.a \
$(top_builddir)/mysys/libmysys.a \
$(top_builddir)/strings/libmystrings.a
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/ndb/src/kernel/blocks/dbdih/Makefile.am b/storage/ndb/src/kernel/blocks/dbdih/Makefile.am
index 1c84714289d..651c966cad1 100644
--- a/storage/ndb/src/kernel/blocks/dbdih/Makefile.am
+++ b/storage/ndb/src/kernel/blocks/dbdih/Makefile.am
@@ -24,6 +24,3 @@ ndb_print_sys_file_LDFLAGS = @ndb_bin_am_ldflags@ \
include $(top_srcdir)/storage/ndb/config/common.mk.am
include $(top_srcdir)/storage/ndb/config/type_kernel.mk.am
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/ndb/src/kernel/blocks/dblqh/Makefile.am b/storage/ndb/src/kernel/blocks/dblqh/Makefile.am
index b545096dc83..74ac3fd3a17 100644
--- a/storage/ndb/src/kernel/blocks/dblqh/Makefile.am
+++ b/storage/ndb/src/kernel/blocks/dblqh/Makefile.am
@@ -26,6 +26,3 @@ ndbd_redo_log_reader_LDFLAGS = @ndb_bin_am_ldflags@ \
$(top_builddir)/dbug/libdbug.a \
$(top_builddir)/mysys/libmysys.a \
$(top_builddir)/strings/libmystrings.a
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
index 8c096681b58..e25c15d50a0 100644
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
@@ -2253,7 +2253,7 @@ int Dbtup::interpreterNextLab(Signal* signal,
if(AttributeOffset::getCharsetFlag(TattrDesc2))
{
Uint32 pos = AttributeOffset::getCharsetPos(TattrDesc2);
- cs = tabptr.p->charsetArray[pos];
+ cs = (void*) tabptr.p->charsetArray[pos];
}
const NdbSqlUtil::Type& sqlType = NdbSqlUtil::getType(typeId);
diff --git a/storage/ndb/src/kernel/blocks/dbtup/Makefile.am b/storage/ndb/src/kernel/blocks/dbtup/Makefile.am
index 7feda3d8ac5..9fe51d30fab 100644
--- a/storage/ndb/src/kernel/blocks/dbtup/Makefile.am
+++ b/storage/ndb/src/kernel/blocks/dbtup/Makefile.am
@@ -23,6 +23,3 @@ test_varpage_LDFLAGS = @ndb_bin_am_ldflags@ \
$(top_builddir)/mysys/libmysys.a \
$(top_builddir)/dbug/libdbug.a \
$(top_builddir)/strings/libmystrings.a
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/ndb/src/kernel/error/Makefile.am b/storage/ndb/src/kernel/error/Makefile.am
index 6db5c0e4ede..9d3c460eae8 100644
--- a/storage/ndb/src/kernel/error/Makefile.am
+++ b/storage/ndb/src/kernel/error/Makefile.am
@@ -22,9 +22,6 @@ liberror_a_SOURCES = TimeModule.cpp \
include $(top_srcdir)/storage/ndb/config/common.mk.am
include $(top_srcdir)/storage/ndb/config/type_kernel.mk.am
-# Don't update the files from bitkeeper
-%::SCCS/s.%
-
windoze-dsp: liberror.dsp
liberror.dsp: Makefile \
diff --git a/storage/ndb/src/kernel/vm/Makefile.am b/storage/ndb/src/kernel/vm/Makefile.am
index 4964b4ea85a..fdc7854e822 100644
--- a/storage/ndb/src/kernel/vm/Makefile.am
+++ b/storage/ndb/src/kernel/vm/Makefile.am
@@ -43,9 +43,6 @@ INCLUDES_LOC = -I$(top_srcdir)/storage/ndb/src/mgmapi
include $(top_srcdir)/storage/ndb/config/common.mk.am
include $(top_srcdir)/storage/ndb/config/type_kernel.mk.am
-# Don't update the files from bitkeeper
-%::SCCS/s.%
-
windoze-dsp: libkernel.dsp
libkernel.dsp: Makefile \
diff --git a/storage/ndb/src/mgmapi/Makefile.am b/storage/ndb/src/mgmapi/Makefile.am
index 96ee65d7d9e..ed4404245b7 100644
--- a/storage/ndb/src/mgmapi/Makefile.am
+++ b/storage/ndb/src/mgmapi/Makefile.am
@@ -29,9 +29,6 @@ include $(top_srcdir)/storage/ndb/config/type_util.mk.am
#ndbtest_PROGRAMS = ndb_test_mgmapi
-# Don't update the files from bitkeeper
-%::SCCS/s.%
-
windoze-dsp: libmgmapi.dsp
libmgmapi.dsp: Makefile \
diff --git a/storage/ndb/src/mgmclient/Makefile.am b/storage/ndb/src/mgmclient/Makefile.am
index 41f659cf68d..4cb5990e75f 100644
--- a/storage/ndb/src/mgmclient/Makefile.am
+++ b/storage/ndb/src/mgmclient/Makefile.am
@@ -44,9 +44,6 @@ LDADD_LOC = $(noinst_LTLIBRARIES) \
ndb_mgm_LDFLAGS = @ndb_bin_am_ldflags@
-# Don't update the files from bitkeeper
-%::SCCS/s.%
-
windoze-dsp: ndb_mgm.dsp libndbmgmclient.dsp
ndb_mgm.dsp: Makefile \
diff --git a/storage/ndb/src/mgmsrv/Makefile.am b/storage/ndb/src/mgmsrv/Makefile.am
index 3f37280d7a5..3ae70155554 100644
--- a/storage/ndb/src/mgmsrv/Makefile.am
+++ b/storage/ndb/src/mgmsrv/Makefile.am
@@ -57,9 +57,6 @@ include $(top_srcdir)/storage/ndb/config/type_ndbapi.mk.am
ndb_mgmd_LDFLAGS = @ndb_bin_am_ldflags@
-# Don't update the files from bitkeeper
-%::SCCS/s.%
-
windoze-dsp: ndb_mgmd.dsp
ndb_mgmd.dsp: Makefile \
diff --git a/storage/ndb/src/ndbapi/Makefile.am b/storage/ndb/src/ndbapi/Makefile.am
index 8ff427772b0..6a18649039d 100644
--- a/storage/ndb/src/ndbapi/Makefile.am
+++ b/storage/ndb/src/ndbapi/Makefile.am
@@ -71,9 +71,6 @@ ndberror_check_LDFLAGS = \
$(top_builddir)/mysys/libmysys.a \
$(top_builddir)/strings/libmystrings.a
-# Don't update the files from bitkeeper
-%::SCCS/s.%
-
windoze-dsp: libndbapi.dsp
libndbapi.dsp: Makefile \
diff --git a/storage/ndb/test/Makefile.am b/storage/ndb/test/Makefile.am
index c746f526769..57e9db7b543 100644
--- a/storage/ndb/test/Makefile.am
+++ b/storage/ndb/test/Makefile.am
@@ -21,6 +21,3 @@ dist-hook:
-rm -rf `find $(distdir) -type d -name SCCS`
windoze-dsp:
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/storage/ndb/test/ndbapi/Makefile.am b/storage/ndb/test/ndbapi/Makefile.am
index 81bb346417f..81ac588ba3e 100644
--- a/storage/ndb/test/ndbapi/Makefile.am
+++ b/storage/ndb/test/ndbapi/Makefile.am
@@ -125,10 +125,6 @@ testBackup_LDADD = $(LDADD) bank/libbank.a
testSRBank_LDADD = bank/libbank.a $(LDADD)
NdbRepStress_LDADD = $(LDADD) $(top_builddir)/libmysql_r/libmysqlclient_r.la
-# Don't update the files from bitkeeper
-%::SCCS/s.%
-
-
windoze-dsp: flexBench.dsp testBasic.dsp testBlobs.dsp \
testScan.dsp
diff --git a/storage/ndb/test/ndbapi/bank/Makefile.am b/storage/ndb/test/ndbapi/bank/Makefile.am
index 8e6c0f23eea..aee3ec57449 100644
--- a/storage/ndb/test/ndbapi/bank/Makefile.am
+++ b/storage/ndb/test/ndbapi/bank/Makefile.am
@@ -32,7 +32,4 @@ LDADD_LOC = $(noinst_LIBRARIES)
include $(top_srcdir)/storage/ndb/config/common.mk.am
include $(top_srcdir)/storage/ndb/config/type_ndbapitest.mk.am
-# Don't update the files from bitkeeper
-%::SCCS/s.%
-
windoze-dsp:
diff --git a/storage/ndb/test/run-test/Makefile.am b/storage/ndb/test/run-test/Makefile.am
index 54ca0c009b2..e1bc71fb4a9 100644
--- a/storage/ndb/test/run-test/Makefile.am
+++ b/storage/ndb/test/run-test/Makefile.am
@@ -51,7 +51,4 @@ wrappers_SCRIPTS=atrt-testBackup atrt-mysql-test-run
EXTRA_DIST = $(test_DATA) $(test_SCRIPTS) $(wrappers_SCRIPTS) README.ATRT atrt.hpp
-# Don't update the files from bitkeeper
-%::SCCS/s.%
-
windoze-dsp:
diff --git a/storage/ndb/test/src/Makefile.am b/storage/ndb/test/src/Makefile.am
index 1e4f30c3f39..148304adc47 100644
--- a/storage/ndb/test/src/Makefile.am
+++ b/storage/ndb/test/src/Makefile.am
@@ -31,9 +31,6 @@ INCLUDES_LOC = -I$(top_srcdir)/storage/ndb/src/common/mgmcommon -I$(top_srcdir)/
include $(top_srcdir)/storage/ndb/config/common.mk.am
include $(top_srcdir)/storage/ndb/config/type_ndbapitest.mk.am
-# Don't update the files from bitkeeper
-%::SCCS/s.%
-
windoze-dsp: libNDBT.dsp
libNDBT.dsp: Makefile \
diff --git a/storage/ndb/test/tools/Makefile.am b/storage/ndb/test/tools/Makefile.am
index da715caa1cb..6a93b1a36ba 100644
--- a/storage/ndb/test/tools/Makefile.am
+++ b/storage/ndb/test/tools/Makefile.am
@@ -43,7 +43,4 @@ include $(top_srcdir)/storage/ndb/config/type_ndbapitest.mk.am
ndb_cpcc_LDADD = $(LDADD)
ndb_cpcc_LDFLAGS = -static
-# Don't update the files from bitkeeper
-%::SCCS/s.%
-
windoze-dsp:
diff --git a/storage/ndb/tools/Makefile.am b/storage/ndb/tools/Makefile.am
index de0f36963bf..ef74198e2bd 100644
--- a/storage/ndb/tools/Makefile.am
+++ b/storage/ndb/tools/Makefile.am
@@ -75,9 +75,6 @@ ndb_select_count_LDFLAGS = @ndb_bin_am_ldflags@
ndb_restore_LDFLAGS = @ndb_bin_am_ldflags@
ndb_config_LDFLAGS = @ndb_bin_am_ldflags@
-# Don't update the files from bitkeeper
-%::SCCS/s.%
-
windoze-dsp: \
ndb_waiter.dsp \
ndb_drop_table.dsp \
diff --git a/storage/oqgraph/ha_oqgraph.cc b/storage/oqgraph/ha_oqgraph.cc
index e0c66134858..cf9ef3d8997 100644
--- a/storage/oqgraph/ha_oqgraph.cc
+++ b/storage/oqgraph/ha_oqgraph.cc
@@ -748,19 +748,19 @@ int ha_oqgraph::fill_record(byte *record, const open_query::row &row)
if (row.latch_indicator)
{
field[0]->set_notnull();
- field[0]->store((longlong) row.latch);
+ field[0]->store((longlong) row.latch, 0);
}
if (row.orig_indicator)
{
field[1]->set_notnull();
- field[1]->store((longlong) row.orig);
+ field[1]->store((longlong) row.orig, 0);
}
if (row.dest_indicator)
{
field[2]->set_notnull();
- field[2]->store((longlong) row.dest);
+ field[2]->store((longlong) row.dest, 0);
}
if (row.weight_indicator)
@@ -772,13 +772,13 @@ int ha_oqgraph::fill_record(byte *record, const open_query::row &row)
if (row.seq_indicator)
{
field[4]->set_notnull();
- field[4]->store((longlong) row.seq);
+ field[4]->store((longlong) row.seq, 0);
}
if (row.link_indicator)
{
field[5]->set_notnull();
- field[5]->store((longlong) row.link);
+ field[5]->store((longlong) row.link, 0);
}
if (ptrdiff)
diff --git a/storage/oqgraph/plug.in b/storage/oqgraph/plug.in
index 38c8310a915..d5ebe2e232a 100644
--- a/storage/oqgraph/plug.in
+++ b/storage/oqgraph/plug.in
@@ -1,7 +1,6 @@
MYSQL_STORAGE_ENGINE(oqgraph,,[Graph Storage Engine],
[Open Query Graph Computation Engine], [])
MYSQL_PLUGIN_DYNAMIC(oqgraph, [ha_oqgraph.la])
-MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS(oqgraph, [ha_oqgraph.cc])
MYSQL_PLUGIN_ACTIONS(oqgraph,[
AC_LANG_PUSH([C++])
AC_MSG_CHECKING([whether compiler supports -fvisibility-inlines-hidden])
diff --git a/storage/pbxt/CMakeLists.txt b/storage/pbxt/CMakeLists.txt
index 6da0717043c..0263d65afaa 100644
--- a/storage/pbxt/CMakeLists.txt
+++ b/storage/pbxt/CMakeLists.txt
@@ -27,9 +27,6 @@ INCLUDE("${PROJECT_SOURCE_DIR}/storage/mysql_storage_engine.cmake")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMYSQL_SERVER")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMYSQL_SERVER")
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DMYSQL_SERVER -DSAFEMALLOC -DSAFE_MUTEX -DDEBUG")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DMYSQL_SERVER -DSAFEMALLOC -DSAFE_MUTEX -DDEBUG")
-
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/regex
${CMAKE_SOURCE_DIR}/extra/yassl/include)
diff --git a/storage/pbxt/plug.in b/storage/pbxt/plug.in
index 02c5d8adcbe..c0dc06d9702 100644
--- a/storage/pbxt/plug.in
+++ b/storage/pbxt/plug.in
@@ -1,8 +1,7 @@
MYSQL_STORAGE_ENGINE(pbxt,no, [PBXT Storage Engine],
[MVCC-based transactional engine], [max,max-no-ndb])
MYSQL_PLUGIN_DIRECTORY(pbxt, [storage/pbxt])
-MYSQL_PLUGIN_STATIC(pbxt, [src/libpbxt.a])
+MYSQL_PLUGIN_STATIC(pbxt, [src/libpbxt_s.la], [src/libpbxt_s_embedded.la])
MYSQL_PLUGIN_ACTIONS(pbxt, [
# AC_CONFIG_FILES(storage/pbxt/src/Makefile)
])
-MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS(pbxt, [[src/ha_pbxt.cc],[src/myxt_xt.cc],[src/discover_xt.cc]])
diff --git a/storage/pbxt/src/Makefile.am b/storage/pbxt/src/Makefile.am
index fc4c4ef8f1e..4c5467d24d0 100644
--- a/storage/pbxt/src/Makefile.am
+++ b/storage/pbxt/src/Makefile.am
@@ -26,25 +26,31 @@ noinst_HEADERS = bsearch_xt.h cache_xt.h ccutils_xt.h database_xt.h \
pbms.h xt_config.h xt_defs.h xt_errno.h locklist_xt.h
EXTRA_LTLIBRARIES = libpbxt.la
-libpbxt_la_SOURCES = bsearch_xt.cc cache_xt.cc ccutils_xt.cc database_xt.cc \
+non_mysql_internal_sources = bsearch_xt.cc cache_xt.cc ccutils_xt.cc database_xt.cc \
datadic_xt.cc datalog_xt.cc filesys_xt.cc hashtab_xt.cc \
- ha_pbxt.cc heap_xt.cc index_xt.cc linklist_xt.cc \
- memory_xt.cc myxt_xt.cc pthread_xt.cc restart_xt.cc \
+ heap_xt.cc index_xt.cc linklist_xt.cc \
+ memory_xt.cc pthread_xt.cc restart_xt.cc \
sortedlist_xt.cc strutil_xt.cc \
tabcache_xt.cc table_xt.cc trace_xt.cc thread_xt.cc \
- systab_xt.cc ha_xtsys.cc discover_xt.cc backup_xt.cc \
+ systab_xt.cc ha_xtsys.cc backup_xt.cc \
util_xt.cc xaction_xt.cc xactlog_xt.cc lock_xt.cc locklist_xt.cc
-
-libpbxt_la_LDFLAGS = -module
+mysql_internal_sources = ha_pbxt.cc myxt_xt.cc discover_xt.cc
+libpbxt_la_SOURCES = $(non_mysql_internal_sources) $(mysql_internal_sources)
# These are the warning Drizzle uses:
# DRIZZLE_WARNINGS = -W -Wall -Wextra -pedantic -Wundef -Wredundant-decls -Wno-strict-aliasing -Wno-long-long -Wno-unused-parameter
-libpbxt_la_CXXFLAGS = $(AM_CXXFLAGS) -DMYSQL_DYNAMIC_PLUGIN
-libpbxt_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN -std=c99
+libpbxt_la_CXXFLAGS = -shared $(AM_CXXFLAGS) -DMYSQL_DYNAMIC_PLUGIN
+libpbxt_la_CFLAGS = -shared $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN -std=c99
+libpbxt_la_LDFLAGS = -module
+
+noinst_LTLIBRARIES = libpbxt_s.la libpbxt_s_embedded.la libpbxt_s_common.la
-EXTRA_LIBRARIES = libpbxt.a
-noinst_LIBRARIES = libpbxt.a
-libpbxt_a_SOURCES = $(libpbxt_la_SOURCES)
+libpbxt_s_common_la_SOURCES = $(non_mysql_internal_sources)
+libpbxt_s_la_SOURCES = $(mysql_internal_sources)
+libpbxt_s_la_LIBADD = libpbxt_s_common.la
+libpbxt_s_embedded_la_SOURCES = $(mysql_internal_sources)
+libpbxt_s_embedded_la_CXXFLAGS = $(AM_CXXFLAGS) @plugin_embedded_defs@
+libpbxt_s_embedded_la_LIBADD = libpbxt_s_common.la
EXTRA_DIST = pbms_enabled.cc win_inttypes.h
diff --git a/storage/pbxt/src/ha_pbxt.cc b/storage/pbxt/src/ha_pbxt.cc
index ef0ae582c07..8640c079a37 100644
--- a/storage/pbxt/src/ha_pbxt.cc
+++ b/storage/pbxt/src/ha_pbxt.cc
@@ -1615,7 +1615,7 @@ static int pbxt_prepare(handlerton *hton, THD *thd, bool all)
static XTThreadPtr ha_temp_open_global_database(handlerton *hton, THD **ret_thd, int *temp_thread, const char *thread_name, int *err)
{
THD *thd;
- XTThreadPtr self = NULL;
+ XTThreadPtr volatile self = NULL;
*temp_thread = 0;
if ((thd = current_thd))
diff --git a/storage/pbxt/src/table_xt.cc b/storage/pbxt/src/table_xt.cc
index 2d93f161ac9..a9fec660697 100644
--- a/storage/pbxt/src/table_xt.cc
+++ b/storage/pbxt/src/table_xt.cc
@@ -1822,8 +1822,8 @@ xtPublic void xt_tab_check_free_lists(XTThreadPtr self, XTOpenTablePtr ot, bool
}
if (free_count != tab->tab_rec_fnum) {
if (correct_count) {
- tab->tab_rec_fnum = free_count;
- tab->tab_head_rec_fnum = free_count;
+ tab->tab_rec_fnum = (uint) free_count;
+ tab->tab_head_rec_fnum = (uint) free_count;
tab->tab_flush_pending = TRUE;
xt_logf(XT_NT_INFO, "Table %s: free record count (%llu) has been set to the number of records on the list: %llu\n", table_name, (u_llong) tab->tab_rec_fnum, (u_llong) free_count);
}
@@ -1875,8 +1875,8 @@ xtPublic void xt_tab_check_free_lists(XTThreadPtr self, XTOpenTablePtr ot, bool
* The correct way to do this at run time would be to add the change to the
* transaction log, so that it is applied by the writer.
*/
- tab->tab_row_fnum = free_count;
- tab->tab_head_row_fnum = free_count;
+ tab->tab_row_fnum = (uint) free_count;
+ tab->tab_head_row_fnum = (uint) free_count;
tab->tab_flush_pending = TRUE;
xt_logf(XT_NT_INFO, "Table %s: free row count (%llu) has been set to the number of rows on the list: %llu\n", table_name, (u_llong) tab->tab_row_fnum, (u_llong) free_count);
}
@@ -4450,10 +4450,10 @@ xtPublic int xt_tab_maybe_committed(XTOpenTablePtr ot, xtRecordID rec_id, xtXact
xtXactID rec_xn_id = 0;
xtBool wait = FALSE;
xtXactID wait_xn_id = 0;
- xtRowID row_id;
+ xtRowID row_id= 0;
xtRecordID var_rec_id;
xtXactID xn_id;
- register XTTableHPtr tab;
+ register XTTableHPtr tab = 0;
#ifdef TRACE_VARIATIONS_IN_DUP_CHECK
char t_buf[500];
int len;
@@ -4628,7 +4628,8 @@ xtPublic int xt_tab_maybe_committed(XTOpenTablePtr ot, xtRecordID rec_id, xtXact
return FALSE;
failed:
- XT_TAB_ROW_UNLOCK(&tab->tab_row_rwlock[row_id % XT_ROW_RWLOCKS], ot->ot_thread);
+ if (tab)
+ XT_TAB_ROW_UNLOCK(&tab->tab_row_rwlock[row_id % XT_ROW_RWLOCKS], ot->ot_thread);
return XT_ERR;
}
diff --git a/storage/sphinx/Makefile.am b/storage/sphinx/Makefile.am
index 5f58d673547..67d01d08484 100644
--- a/storage/sphinx/Makefile.am
+++ b/storage/sphinx/Makefile.am
@@ -30,26 +30,25 @@ DEFS= @DEFS@ -D_REENTRANT -D_PTHREADS -DMYSQL_SERVER
noinst_HEADERS = ha_sphinx.h
-EXTRA_LTLIBRARIES = ha_sphinx.la
+EXTRA_LTLIBRARIES = libsphinx.la ha_sphinx.la
pkgplugin_LTLIBRARIES = @plugin_sphinx_shared_target@ sphinx.la
ha_sphinx_la_LDFLAGS = -module -rpath $(MYSQLLIBdir) \
-L$(top_builddir)/libservices -lmysqlservices
-ha_sphinx_la_CXXFLAGS= $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
+ha_sphinx_la_CXXFLAGS= $(AM_CXXFLAGS) -DMYSQL_DYNAMIC_PLUGIN
ha_sphinx_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
ha_sphinx_la_SOURCES = ha_sphinx.cc
sphinx_la_LDFLAGS = -module
-sphinx_la_CXXFLAGS = $(AM_CFLAGS)
+sphinx_la_CXXFLAGS = $(AM_CXXFLAGS)
sphinx_la_CFLAGS = $(AM_CFLAGS)
sphinx_la_SOURCES = snippets_udf.cc
-EXTRA_LIBRARIES = libsphinx.a
-noinst_LIBRARIES = @plugin_sphinx_static_target@
-libsphinx_a_CXXFLAGS = $(AM_CFLAGS)
-libsphinx_a_CFLAGS = $(AM_CFLAGS)
-libsphinx_a_SOURCES= ha_sphinx.cc
+noinst_LTLIBRARIES = @plugin_sphinx_static_target@
+libsphinx_la_CXXFLAGS = $(AM_CXXFLAGS)
+libsphinx_la_CFLAGS = $(AM_CFLAGS)
+libsphinx_la_SOURCES= ha_sphinx.cc
-EXTRA_DIST = CMakeLists.txt
+EXTRA_DIST = CMakeLists.txt plug.in
# Don't update the files from bitkeeper
%::SCCS/s.%
diff --git a/storage/sphinx/ha_sphinx.cc b/storage/sphinx/ha_sphinx.cc
index e88464eb16c..6f4f12a318c 100644
--- a/storage/sphinx/ha_sphinx.cc
+++ b/storage/sphinx/ha_sphinx.cc
@@ -2671,7 +2671,7 @@ int ha_sphinx::get_rec ( byte * buf, const byte *, uint )
if ( pCur < sBuf+sizeof(sBuf)-16 ) // 10 chars per 32bit value plus some safety bytes
{
sprintf ( pCur, "%u", uEntry );
- while ( *pCur ) *pCur++;
+ while ( *pCur ) pCur++;
if ( uValue>1 )
*pCur++ = ','; // non-trailing commas
}
diff --git a/storage/sphinx/plug.in b/storage/sphinx/plug.in
index 6c96e41ae52..2c07584465e 100644
--- a/storage/sphinx/plug.in
+++ b/storage/sphinx/plug.in
@@ -1,6 +1,6 @@
MYSQL_STORAGE_ENGINE(sphinx,,[Sphinx Storage Engine],
[SE client for Sphinx search daemon], [])
MYSQL_PLUGIN_DIRECTORY(sphinx, [storage/sphinx])
-MYSQL_PLUGIN_STATIC(sphinx, [libsphinx.a])
+MYSQL_PLUGIN_STATIC(sphinx, [libsphinx.la])
MYSQL_PLUGIN_DYNAMIC(sphinx, [ha_sphinx.la])
diff --git a/storage/xtradb/CMakeLists.txt b/storage/xtradb/CMakeLists.txt
index 759bb525bdf..9782f43fb27 100644
--- a/storage/xtradb/CMakeLists.txt
+++ b/storage/xtradb/CMakeLists.txt
@@ -16,8 +16,6 @@
# This is the CMakeLists for InnoDB Plugin
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
# Starting at 5.1.38, MySQL CMake files are simplified. But the plugin
# CMakeLists.txt still needs to work with previous versions of MySQL.
@@ -42,12 +40,20 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/zlib
${CMAKE_SOURCE_DIR}/extra/yassl/include)
-# Removing compiler optimizations for innodb/mem/* files on 64-bit Windows
-# due to 64-bit compiler error, See MySQL Bug #19424, #36366, #34297
-IF (MSVC AND $(WIN64))
- SET_SOURCE_FILES_PROPERTIES(mem/mem0mem.c mem/mem0pool.c
- PROPERTIES COMPILE_FLAGS -Od)
-ENDIF (MSVC AND $(WIN64))
+
+IF(MSVC)
+ # Removing compiler optimizations for innodb/mem/* files on 64-bit Windows
+ # due to 64-bit compiler error, See MySQL Bug #19424, #36366, #34297
+ IF(CMAKE_SIZEOF_VOID_P MATCHES 8)
+ SET_SOURCE_FILES_PROPERTIES(mem/mem0mem.c mem/mem0pool.c
+ PROPERTIES COMPILE_FLAGS -Od)
+ ENDIF()
+ # Avoid "unreferenced label" warning in generated file
+ SET_SOURCE_FILES_PROPERTIES(pars/pars0grm.c
+ PROPERTIES COMPILE_FLAGS "/wd4102")
+ SET_SOURCE_FILES_PROPERTIES(pars/lexyy.c
+ PROPERTIES COMPILE_FLAGS "/wd4003")
+ENDIF()
SET(XTRADB_SOURCES btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c btr/btr0sea.c
buf/buf0buddy.c buf/buf0buf.c buf/buf0flu.c buf/buf0lru.c buf/buf0rea.c
diff --git a/storage/xtradb/ChangeLog b/storage/xtradb/ChangeLog
index 43f87a1baf5..0cd8ac8a7e6 100644
--- a/storage/xtradb/ChangeLog
+++ b/storage/xtradb/ChangeLog
@@ -1,7 +1,73 @@
+2010-10-24 The InnoDB Team
+
+ * row/row0mysql.c
+ Fix Bug #57700 Latching order violation in
+ row_truncate_table_for_mysql()
+
+2010-10-20 The InnoDB Team
+
+ * dict/dict0load.c
+ Fix Bug #57616 Sig 11 in dict_load_table() when failed to load
+ index or foreign key
+
+2010-10-19 The InnoDB Team
+
+ * btr/btr0cur.c, buf/buf0buf.c, buf/buf0flu.c, handler/ha_innodb.cc,
+ ibuf/ibuf0ibuf.c, include/btr0cur.h, include/buf0flu.h,
+ include/ibuf0ibuf.h, include/row0mysql.h,
+ row/row0mysql.c, row/row0sel.c,
+ innodb_bug56680.test, innodb_bug56680.result:
+ Fix Bug #56680 InnoDB may return wrong results from a
+ case-insensitive covering index
+
+2010-10-18 The InnoDB Team
+
+ * handler/ha_innodb.cc, handler/ha_innodb.h, innodb_bug57252.result,
+ innodb_bug57252.test:
+ Fix Bug#57252 disabling innobase_stats_on_metadata disables ANALYZE
+
+2010-10-14 The InnoDB Team
+
+ * handler/ha_innodb.cc, innodb_bug56143.result, innodb_bug56143.test:
+ Fix Bug#56143 too many foreign keys causes output of show create
+ table to become invalid
+
+2010-10-14 The InnoDB Team
+
+ * srv/srv0start.c:
+ Fix Bug#57397 io_handler_thread() will never cleanup
+
+2010-10-11 The InnoDB Team
+
+ * row/row0sel.c
+ Fix Bug #57345 btr_pcur_store_position abort for load with
+ concurrent lock/unlock tables
+
+2010-10-11 The InnoDB Team
+
+ * row/row0mysql.c, innodb_bug56947.result, innodb_bug56947.test:
+ Fix Bug #56947 InnoDB leaks memory when failing to create a table
+
+2010-10-06 The InnoDB Team
+
+ * row/row0mysql.c, innodb_bug57255.result, innodb_bug57255.test
+ Fix Bug #57255 Cascade Delete results in "Got error -1 from
+ storage engine"
+
+2010-09-27 The InnoDB Team
+
+ * row/row0sel.c, innodb_bug56716.result, innodb_bug56716.test:
+ Fix Bug#56716 InnoDB locks a record gap without locking the table
+
+2010-09-06 The InnoDB Team
+
+ * dict/dict0load.c, innodb_bug53756.test innodb_bug53756.result:
+ Fix Bug#53756 ALTER TABLE ADD PRIMARY KEY affects crash recovery
+
2010-08-24 The InnoDB Team
* handler/ha_innodb.c, dict/dict0dict.c:
- Fix Bug #55832 selects crash too easily when innodb_force_recovery>3
+ Fix Bug#55832 selects crash too easily when innodb_force_recovery>3
2010-08-03 The InnoDB Team
@@ -19,15 +85,14 @@
2010-08-03 The InnoDB Team
* include/ut0mem.h, ut/ut0mem.c:
- Fix Bug #55627 segv in ut_free pars_lexer_close innobase_shutdown
+ Fix Bug#55627 segv in ut_free pars_lexer_close innobase_shutdown
innodb-use-sys-malloc=0
2010-08-01 The InnoDB Team
- * handler/ha_innodb.cc
- Fix Bug #55382 Assignment with SELECT expressions takes unexpected
+ * handler/ha_innodb.cc:
+ Fix Bug#55382 Assignment with SELECT expressions takes unexpected
S locks in READ COMMITTED
->>>>>>> MERGE-SOURCE
2010-07-27 The InnoDB Team
@@ -48,8 +113,8 @@
2010-06-29 The InnoDB Team
- * btr/btr0cur.c, include/btr0cur.h,
- include/row0mysql.h, row/row0merge.c, row/row0sel.c:
+ * btr/btr0cur.c, include/btr0cur.h, include/row0mysql.h,
+ row/row0merge.c, row/row0sel.c:
Fix Bug#54358 READ UNCOMMITTED access failure of off-page DYNAMIC
or COMPRESSED columns
diff --git a/storage/xtradb/Makefile.am b/storage/xtradb/Makefile.am
index 0a6d7ddefb6..02eeaa1e456 100644
--- a/storage/xtradb/Makefile.am
+++ b/storage/xtradb/Makefile.am
@@ -229,9 +229,8 @@ noinst_HEADERS= \
handler/innodb_patch_info.h \
mem/mem0dbg.c
-EXTRA_LIBRARIES= libxtradb.a
-noinst_LIBRARIES= @plugin_xtradb_static_target@
-libxtradb_a_SOURCES= \
+noinst_LTLIBRARIES= @plugin_xtradb_static_target@
+libxtradb_la_SOURCES= \
btr/btr0btr.c \
btr/btr0cur.c \
btr/btr0pcur.c \
@@ -326,20 +325,17 @@ libxtradb_a_SOURCES= \
ut/ut0vec.c \
ut/ut0wqueue.c
-libxtradb_a_CXXFLAGS= $(AM_CXXFLAGS)
-libxtradb_a_CFLAGS= $(AM_CFLAGS)
+libxtradb_la_CXXFLAGS= $(AM_CXXFLAGS)
+libxtradb_la_CFLAGS= $(AM_CFLAGS)
-EXTRA_LTLIBRARIES= ha_xtradb.la
+EXTRA_LTLIBRARIES= libxtradb.la ha_xtradb.la
pkgplugin_LTLIBRARIES= @plugin_xtradb_shared_target@
ha_xtradb_la_LDFLAGS= -module -rpath $(pkgplugindir) -L$(top_builddir)/libservices -lmysqlservices
ha_xtradb_la_CXXFLAGS= -shared $(AM_CXXFLAGS) $(INNODB_DYNAMIC_CFLAGS)
ha_xtradb_la_CFLAGS= -shared $(AM_CFLAGS) $(INNODB_DYNAMIC_CFLAGS)
-ha_xtradb_la_SOURCES= $(libxtradb_a_SOURCES)
+ha_xtradb_la_SOURCES= $(libxtradb_la_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/xtradb/btr/btr0btr.c b/storage/xtradb/btr/btr0btr.c
index ff047095aa4..4d6cd8d80fc 100644
--- a/storage/xtradb/btr/btr0btr.c
+++ b/storage/xtradb/btr/btr0btr.c
@@ -1925,7 +1925,6 @@ btr_page_split_and_insert(
buf_block_t* left_block;
buf_block_t* right_block;
buf_block_t* insert_block;
- page_t* insert_page;
page_cur_t* page_cursor;
rec_t* first_rec;
byte* buf = 0; /* remove warning */
@@ -2183,8 +2182,6 @@ insert_empty:
insert_block = right_block;
}
- insert_page = buf_block_get_frame(insert_block);
-
/* 7. Reposition the cursor for insert and try insertion */
page_cursor = btr_cur_get_page_cur(cursor);
@@ -2196,8 +2193,12 @@ insert_empty:
#ifdef UNIV_ZIP_DEBUG
{
+ page_t* insert_page
+ = buf_block_get_frame(insert_block);
+
page_zip_des_t* insert_page_zip
= buf_block_get_page_zip(insert_block);
+
ut_a(!insert_page_zip
|| page_zip_validate(insert_page_zip, insert_page));
}
@@ -2590,7 +2591,6 @@ btr_compress(
ulint n_recs;
ulint max_ins_size;
ulint max_ins_size_reorg;
- ulint level;
block = btr_cur_get_block(cursor);
page = btr_cur_get_page(cursor);
@@ -2600,7 +2600,6 @@ btr_compress(
ut_ad(mtr_memo_contains(mtr, dict_index_get_lock(index),
MTR_MEMO_X_LOCK));
ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
- level = btr_page_get_level(page, mtr);
space = dict_index_get_space(index);
zip_size = dict_table_zip_size(index->table);
diff --git a/storage/xtradb/btr/btr0cur.c b/storage/xtradb/btr/btr0cur.c
index 3fc2b48162a..daa94a549a0 100644
--- a/storage/xtradb/btr/btr0cur.c
+++ b/storage/xtradb/btr/btr0cur.c
@@ -1803,7 +1803,7 @@ func_exit:
See if there is enough place in the page modification log to log
an update-in-place.
@return TRUE if enough place */
-static
+UNIV_INTERN
ibool
btr_cur_update_alloc_zip(
/*=====================*/
@@ -2013,7 +2013,6 @@ btr_cur_optimistic_update(
page_t* page;
page_zip_des_t* page_zip;
rec_t* rec;
- rec_t* orig_rec;
ulint max_size;
ulint new_rec_size;
ulint old_rec_size;
@@ -2027,7 +2026,7 @@ btr_cur_optimistic_update(
block = btr_cur_get_block(cursor);
page = buf_block_get_frame(block);
- orig_rec = rec = btr_cur_get_rec(cursor);
+ rec = btr_cur_get_rec(cursor);
index = cursor->index;
ut_ad(!!page_rec_is_comp(rec) == dict_table_is_comp(index->table));
ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
@@ -4673,12 +4672,17 @@ btr_free_externally_stored_field(
}
for (;;) {
+#ifdef UNIV_SYNC_DEBUG
buf_block_t* rec_block;
+#endif /* UNIV_SYNC_DEBUG */
buf_block_t* ext_block;
mtr_start(&mtr);
- rec_block = buf_page_get(page_get_space_id(
+#ifdef UNIV_SYNC_DEBUG
+ rec_block =
+#endif /* UNIV_SYNC_DEBUG */
+ buf_page_get(page_get_space_id(
page_align(field_ref)),
rec_zip_size,
page_get_page_no(
diff --git a/storage/xtradb/btr/btr0pcur.c b/storage/xtradb/btr/btr0pcur.c
index 537c26f6bf2..f95a5487c94 100644
--- a/storage/xtradb/btr/btr0pcur.c
+++ b/storage/xtradb/btr/btr0pcur.c
@@ -467,7 +467,6 @@ btr_pcur_move_backward_from_page(
mtr_t* mtr) /*!< in: mtr */
{
ulint prev_page_no;
- ulint space;
page_t* page;
buf_block_t* prev_block;
ulint latch_mode;
@@ -503,7 +502,6 @@ btr_pcur_move_backward_from_page(
page = btr_pcur_get_page(cursor);
prev_page_no = btr_page_get_prev(page, mtr);
- space = buf_block_get_space(btr_pcur_get_block(cursor));
if (prev_page_no == FIL_NULL) {
} else if (btr_pcur_is_before_first_on_page(cursor)) {
diff --git a/storage/xtradb/btr/btr0sea.c b/storage/xtradb/btr/btr0sea.c
index 6628333d32a..c78f791480c 100644
--- a/storage/xtradb/btr/btr0sea.c
+++ b/storage/xtradb/btr/btr0sea.c
@@ -1620,7 +1620,6 @@ btr_search_update_hash_on_delete(
rec_t* rec;
ulint fold;
dulint index_id;
- ibool found;
ulint offsets_[REC_OFFS_NORMAL_SIZE];
mem_heap_t* heap = NULL;
rec_offs_init(offsets_);
@@ -1653,7 +1652,7 @@ btr_search_update_hash_on_delete(
}
rw_lock_x_lock(&btr_search_latch);
- found = ha_search_and_delete_if_found(table, fold, rec);
+ ha_search_and_delete_if_found(table, fold, rec);
rw_lock_x_unlock(&btr_search_latch);
}
diff --git a/storage/xtradb/buf/buf0buf.c b/storage/xtradb/buf/buf0buf.c
index 1c08bd6d0bf..1e9624fce50 100644
--- a/storage/xtradb/buf/buf0buf.c
+++ b/storage/xtradb/buf/buf0buf.c
@@ -53,10 +53,6 @@ Created 11/5/1995 Heikki Tuuri
#include "page0zip.h"
#include "trx0trx.h"
#include "srv0start.h"
-#include "que0que.h"
-#include "read0read.h"
-#include "row0row.h"
-#include "ha_prototypes.h"
/* prototypes for new functions added to ha_innodb.cc */
trx_t* innobase_get_trx();
@@ -314,30 +310,6 @@ read-ahead or flush occurs */
UNIV_INTERN ibool buf_debug_prints = FALSE;
#endif /* UNIV_DEBUG */
-/* Buffer pool shared memory segment information */
-typedef struct buf_shm_info_struct buf_shm_info_t;
-
-struct buf_shm_info_struct {
- char head_str[8];
- ulint binary_id;
- ibool is_new; /* during initializing */
- ibool clean; /* clean shutdowned and free */
- ibool reusable; /* reusable */
- ulint buf_pool_size; /* backup value */
- ulint page_size; /* backup value */
- ulint frame_offset; /* offset of the first frame based on chunk->mem */
- ulint zip_hash_offset;
- ulint zip_hash_n;
-
- ulint checksum;
-
- buf_pool_t buf_pool_backup;
- buf_chunk_t chunk_backup;
-
- ib_uint64_t dummy;
-};
-
-#define BUF_SHM_INFO_HEAD "XTRA_SHM"
#endif /* !UNIV_HOTBACKUP */
/********************************************************************//**
@@ -784,45 +756,6 @@ buf_block_init(
#endif /* UNIV_SYNC_DEBUG */
}
-static
-void
-buf_block_reuse(
-/*============*/
- buf_block_t* block,
- ptrdiff_t frame_offset)
-{
- /* block_init */
- block->frame += frame_offset;
-
- UNIV_MEM_DESC(block->frame, UNIV_PAGE_SIZE, block);
-
- block->index = NULL;
-
-#ifdef UNIV_DEBUG
- /* recreate later */
- block->page.in_page_hash = FALSE;
- block->page.in_zip_hash = FALSE;
-#endif /* UNIV_DEBUG */
-
-#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
- block->n_pointers = 0;
-#endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */
-
- if (block->page.zip.data)
- block->page.zip.data += frame_offset;
-
- block->is_hashed = FALSE;
-
- mutex_create(&block->mutex, SYNC_BUF_BLOCK);
-
- rw_lock_create(&block->lock, SYNC_LEVEL_VARYING);
- ut_ad(rw_lock_validate(&(block->lock)));
-
-#ifdef UNIV_SYNC_DEBUG
- rw_lock_create(&block->debug_latch, SYNC_NO_ORDER_CHECK);
-#endif /* UNIV_SYNC_DEBUG */
-}
-
/********************************************************************//**
Allocates a chunk of buffer frames.
@return chunk, or NULL on failure */
@@ -835,188 +768,26 @@ buf_chunk_init(
{
buf_block_t* block;
byte* frame;
- ulint zip_hash_n = 0;
- ulint zip_hash_mem_size = 0;
- hash_table_t* zip_hash_tmp = NULL;
ulint i;
- buf_shm_info_t* shm_info = NULL;
/* Round down to a multiple of page size,
although it already should be. */
mem_size = ut_2pow_round(mem_size, UNIV_PAGE_SIZE);
-
- srv_buffer_pool_shm_is_reused = FALSE;
-
- if (srv_buffer_pool_shm_key) {
- /* zip_hash size */
- zip_hash_n = (mem_size / UNIV_PAGE_SIZE) * 2;
- zip_hash_mem_size = ut_2pow_round(hash_create_needed(zip_hash_n)
- + (UNIV_PAGE_SIZE - 1), UNIV_PAGE_SIZE);
- }
-
/* Reserve space for the block descriptors. */
mem_size += ut_2pow_round((mem_size / UNIV_PAGE_SIZE) * (sizeof *block)
+ (UNIV_PAGE_SIZE - 1), UNIV_PAGE_SIZE);
- if (srv_buffer_pool_shm_key) {
- mem_size += ut_2pow_round(sizeof(buf_shm_info_t)
- + (UNIV_PAGE_SIZE - 1), UNIV_PAGE_SIZE);
- mem_size += zip_hash_mem_size;
- }
chunk->mem_size = mem_size;
-
- if (srv_buffer_pool_shm_key) {
- ulint binary_id;
- ibool is_new;
-
- ut_a(buf_pool->n_chunks == 1);
-
- fprintf(stderr,
- "InnoDB: Warning: The innodb_buffer_pool_shm_key option has been specified.\n"
- "InnoDB: Do not change the following between restarts of the server while this option is being used:\n"
- "InnoDB: * the mysqld executable between restarts of the server.\n"
- "InnoDB: * the value of innodb_buffer_pool_size.\n"
- "InnoDB: * the value of innodb_page_size.\n"
- "InnoDB: * datafiles created by InnoDB during this session.\n"
- "InnoDB: Otherwise, data corruption in datafiles may result.\n");
-
- /* FIXME: This is vague id still */
- binary_id = (ulint) ((byte*)mtr_commit - (byte*)btr_root_get)
- + (ulint) ((byte*)os_get_os_version - (byte*)buf_calc_page_new_checksum)
- + (ulint) ((byte*)page_dir_find_owner_slot - (byte*)dfield_data_is_binary_equal)
- + (ulint) ((byte*)que_graph_publish - (byte*)dict_casedn_str)
- + (ulint) ((byte*)read_view_oldest_copy_or_open_new - (byte*)fil_space_get_version)
- + (ulint) ((byte*)rec_get_n_extern_new - (byte*)fsp_get_size_low)
- + (ulint) ((byte*)row_get_trx_id_offset - (byte*)ha_create_func)
- + (ulint) ((byte*)srv_set_io_thread_op_info - (byte*)thd_is_replication_slave_thread)
- + (ulint) ((byte*)mutex_create_func - (byte*)ibuf_inside)
- + (ulint) ((byte*)trx_set_detailed_error - (byte*)lock_check_trx_id_sanity)
- + (ulint) ((byte*)ut_time - (byte*)mem_heap_strdup);
-
- chunk->mem = os_shm_alloc(&chunk->mem_size, srv_buffer_pool_shm_key, &is_new);
-
- if (UNIV_UNLIKELY(chunk->mem == NULL)) {
- return(NULL);
- }
-init_again:
-#ifdef UNIV_SET_MEM_TO_ZERO
- if (is_new) {
- memset(chunk->mem, '\0', chunk->mem_size);
- }
-#endif
- /* for ut_fold_binary_32(), these values should be 32-bit aligned */
- ut_a(sizeof(buf_shm_info_t) % 4 == 0);
- ut_a((ulint)chunk->mem % 4 == 0);
- ut_a(chunk->mem_size % 4 == 0);
-
- shm_info = chunk->mem;
-
- zip_hash_tmp = (hash_table_t*)((byte*)chunk->mem + chunk->mem_size - zip_hash_mem_size);
-
- if (is_new) {
- strncpy(shm_info->head_str, BUF_SHM_INFO_HEAD, 8);
- shm_info->binary_id = binary_id;
- shm_info->is_new = TRUE; /* changed to FALSE when the initialization is finished */
- shm_info->clean = FALSE; /* changed to TRUE when free the segment. */
- shm_info->reusable = FALSE; /* changed to TRUE when validation is finished. */
- shm_info->buf_pool_size = srv_buf_pool_size;
- shm_info->page_size = srv_page_size;
- shm_info->zip_hash_offset = chunk->mem_size - zip_hash_mem_size;
- shm_info->zip_hash_n = zip_hash_n;
- } else {
- ulint checksum;
-
- if (strncmp(shm_info->head_str, BUF_SHM_INFO_HEAD, 8)) {
- fprintf(stderr,
- "InnoDB: Error: The shared memory segment seems not to be for buffer pool.\n");
- return(NULL);
- }
- if (shm_info->binary_id != binary_id) {
- fprintf(stderr,
- "InnoDB: Error: The shared memory segment seems not to be for this binary.\n");
- return(NULL);
- }
- if (shm_info->is_new) {
- fprintf(stderr,
- "InnoDB: Error: The shared memory was not initialized yet.\n");
- return(NULL);
- }
- if (shm_info->buf_pool_size != srv_buf_pool_size) {
- fprintf(stderr,
- "InnoDB: Error: srv_buf_pool_size is different (shm=%lu current=%lu).\n",
- shm_info->buf_pool_size, srv_buf_pool_size);
- return(NULL);
- }
- if (shm_info->page_size != srv_page_size) {
- fprintf(stderr,
- "InnoDB: Error: srv_page_size is different (shm=%lu current=%lu).\n",
- shm_info->page_size, srv_page_size);
- return(NULL);
- }
- if (!shm_info->reusable) {
- fprintf(stderr,
- "InnoDB: Warning: The shared memory has unrecoverable contents.\n"
- "InnoDB: The shared memory segment is initialized.\n");
- is_new = TRUE;
- goto init_again;
- }
- if (!shm_info->clean) {
- fprintf(stderr,
- "InnoDB: Warning: The shared memory was not shut down cleanly.\n"
- "InnoDB: The shared memory segment is initialized.\n");
- is_new = TRUE;
- goto init_again;
- }
-
- ut_a(shm_info->zip_hash_offset == chunk->mem_size - zip_hash_mem_size);
- ut_a(shm_info->zip_hash_n == zip_hash_n);
-
- /* check checksum */
- if (srv_buffer_pool_shm_checksum) {
- checksum = ut_fold_binary_32((byte*)chunk->mem + sizeof(buf_shm_info_t),
- chunk->mem_size - sizeof(buf_shm_info_t));
- } else {
- checksum = BUF_NO_CHECKSUM_MAGIC;
- }
-
- if (shm_info->checksum != BUF_NO_CHECKSUM_MAGIC
- && shm_info->checksum != checksum) {
- fprintf(stderr,
- "InnoDB: Error: checksum of the shared memory is not match. "
- "(stored=%lu calculated=%lu)\n",
- shm_info->checksum, checksum);
- return(NULL);
- }
-
- /* flag to use the segment. */
- shm_info->clean = FALSE; /* changed to TRUE when free the segment. */
- }
-
- /* init zip_hash contents */
- if (is_new) {
- hash_create_init(zip_hash_tmp, zip_hash_n);
- } else {
- /* adjust offset is done later */
- hash_create_reuse(zip_hash_tmp);
-
- srv_buffer_pool_shm_is_reused = TRUE;
- }
- } else {
chunk->mem = os_mem_alloc_large(&chunk->mem_size);
if (UNIV_UNLIKELY(chunk->mem == NULL)) {
return(NULL);
}
- }
/* Allocate the block descriptors from
the start of the memory block. */
- if (srv_buffer_pool_shm_key) {
- chunk->blocks = (buf_block_t*)((byte*)chunk->mem + sizeof(buf_shm_info_t));
- } else {
chunk->blocks = chunk->mem;
- }
/* Align a pointer to the first frame. Note that when
os_large_page_size is smaller than UNIV_PAGE_SIZE,
@@ -1024,13 +795,8 @@ init_again:
it is bigger, we may allocate more blocks than requested. */
frame = ut_align(chunk->mem, UNIV_PAGE_SIZE);
- if (srv_buffer_pool_shm_key) {
- /* reserve zip_hash space and always -1 for reproductibity */
- chunk->size = (chunk->mem_size - zip_hash_mem_size) / UNIV_PAGE_SIZE - 1;
- } else {
chunk->size = chunk->mem_size / UNIV_PAGE_SIZE
- (frame != chunk->mem);
- }
/* Subtract the space needed for block descriptors. */
{
@@ -1044,98 +810,6 @@ init_again:
chunk->size = size;
}
- if (shm_info && !(shm_info->is_new)) {
- /* convert the shared memory segment for reuse */
- ptrdiff_t phys_offset;
- ptrdiff_t logi_offset;
- ptrdiff_t blocks_offset;
- byte* previous_frame_address;
-
- if (chunk->size < shm_info->chunk_backup.size) {
- fprintf(stderr,
- "InnoDB: Error: The buffer pool became smaller because of allocated address.\n"
- "InnoDB: Retrying may avoid this situation.\n");
- shm_info->clean = TRUE; /* release the flag for retrying */
- return(NULL);
- }
-
- chunk->size = shm_info->chunk_backup.size;
- phys_offset = frame - ((byte*)chunk->mem + shm_info->frame_offset);
- logi_offset = frame - chunk->blocks[0].frame;
- previous_frame_address = chunk->blocks[0].frame;
- blocks_offset = (byte*)chunk->blocks - (byte*)shm_info->chunk_backup.blocks;
-
- if (phys_offset || logi_offset || blocks_offset) {
- fprintf(stderr,
- "InnoDB: Buffer pool in the shared memory segment should be converted.\n"
- "InnoDB: Previous frames in address : %p\n"
- "InnoDB: Previous frames were located : %p\n"
- "InnoDB: Current frames should be located: %p\n"
- "InnoDB: Pysical offset : %ld (%#lx)\n"
- "InnoDB: Logical offset (frames) : %ld (%#lx)\n"
- "InnoDB: Logical offset (blocks) : %ld (%#lx)\n",
- (byte*)chunk->mem + shm_info->frame_offset,
- chunk->blocks[0].frame, frame,
- (long) phys_offset, (ulong) phys_offset, (long) logi_offset, (ulong) logi_offset,
- (long) blocks_offset, (ulong) blocks_offset);
- } else {
- fprintf(stderr,
- "InnoDB: Buffer pool in the shared memory segment can be used as it is.\n");
- }
-
- if (phys_offset) {
- fprintf(stderr,
- "InnoDB: Aligning physical offset...");
-
- memmove(frame, (byte*)chunk->mem + shm_info->frame_offset,
- chunk->size * UNIV_PAGE_SIZE);
-
- fprintf(stderr,
- " Done.\n");
- }
-
- /* buf_block_t */
- block = chunk->blocks;
- for (i = chunk->size; i--; ) {
- buf_block_reuse(block, logi_offset);
- block++;
- }
-
- if (logi_offset || blocks_offset) {
- fprintf(stderr,
- "InnoDB: Aligning logical offset...");
-
-
- /* buf_pool_t buf_pool_backup */
- UT_LIST_OFFSET(flush_list, buf_page_t, shm_info->buf_pool_backup.flush_list,
- previous_frame_address, logi_offset, blocks_offset);
- UT_LIST_OFFSET(free, buf_page_t, shm_info->buf_pool_backup.free,
- previous_frame_address, logi_offset, blocks_offset);
- UT_LIST_OFFSET(LRU, buf_page_t, shm_info->buf_pool_backup.LRU,
- previous_frame_address, logi_offset, blocks_offset);
- if (shm_info->buf_pool_backup.LRU_old)
- shm_info->buf_pool_backup.LRU_old =
- (buf_page_t*)((byte*)(shm_info->buf_pool_backup.LRU_old)
- + (((byte*)shm_info->buf_pool_backup.LRU_old > previous_frame_address)
- ? logi_offset : blocks_offset));
-
- UT_LIST_OFFSET(unzip_LRU, buf_block_t, shm_info->buf_pool_backup.unzip_LRU,
- previous_frame_address, logi_offset, blocks_offset);
-
- UT_LIST_OFFSET(zip_list, buf_page_t, shm_info->buf_pool_backup.zip_clean,
- previous_frame_address, logi_offset, blocks_offset);
- for (i = 0; i < BUF_BUDDY_SIZES_MAX; i++) {
- UT_LIST_OFFSET(zip_list, buf_page_t, shm_info->buf_pool_backup.zip_free[i],
- previous_frame_address, logi_offset, blocks_offset);
- }
-
- HASH_OFFSET(zip_hash_tmp, buf_page_t, hash,
- previous_frame_address, logi_offset, blocks_offset);
-
- fprintf(stderr,
- " Done.\n");
- }
- } else {
/* Init block structs and assign frames for them. Then we
assign the frames to the first blocks (we already mapped the
memory above). */
@@ -1159,11 +833,6 @@ init_again:
block++;
frame += UNIV_PAGE_SIZE;
}
- }
-
- if (shm_info) {
- shm_info->frame_offset = chunk->blocks[0].frame - (byte*)chunk->mem;
- }
return(chunk);
}
@@ -1345,8 +1014,6 @@ buf_chunk_free(
UNIV_MEM_UNDESC(block);
}
- ut_a(!srv_buffer_pool_shm_key);
-
os_mem_free_large(chunk->mem, chunk->mem_size);
}
@@ -1396,10 +1063,7 @@ buf_pool_init(void)
srv_buf_pool_curr_size = buf_pool->curr_size * UNIV_PAGE_SIZE;
buf_pool->page_hash = hash_create(2 * buf_pool->curr_size);
- /* zip_hash is allocated to shm when srv_buffer_pool_shm_key is enabled */
- if (!srv_buffer_pool_shm_key) {
buf_pool->zip_hash = hash_create(2 * buf_pool->curr_size);
- }
buf_pool->last_printout_time = time(NULL);
@@ -1414,86 +1078,6 @@ buf_pool_init(void)
--------------------------- */
/* All fields are initialized by mem_zalloc(). */
- if (srv_buffer_pool_shm_key) {
- buf_shm_info_t* shm_info;
-
- ut_a((byte*)chunk->blocks == (byte*)chunk->mem + sizeof(buf_shm_info_t));
- shm_info = chunk->mem;
-
- buf_pool->zip_hash = (hash_table_t*)((byte*)chunk->mem + shm_info->zip_hash_offset);
-
- if(shm_info->is_new) {
- shm_info->is_new = FALSE; /* initialization was finished */
- } else {
- buf_block_t* block = chunk->blocks;
- buf_page_t* b;
-
- /* shm_info->buf_pool_backup should be converted */
- /* at buf_chunk_init(). So copy simply. */
- buf_pool->flush_list = shm_info->buf_pool_backup.flush_list;
- buf_pool->freed_page_clock = shm_info->buf_pool_backup.freed_page_clock;
- buf_pool->free = shm_info->buf_pool_backup.free;
- buf_pool->LRU = shm_info->buf_pool_backup.LRU;
- buf_pool->LRU_old = shm_info->buf_pool_backup.LRU_old;
- buf_pool->LRU_old_len = shm_info->buf_pool_backup.LRU_old_len;
- buf_pool->unzip_LRU = shm_info->buf_pool_backup.unzip_LRU;
- buf_pool->zip_clean = shm_info->buf_pool_backup.zip_clean;
- for (i = 0; i < BUF_BUDDY_SIZES_MAX; i++) {
- buf_pool->zip_free[i] = shm_info->buf_pool_backup.zip_free[i];
- }
-
- for (i = 0; i < chunk->size; i++, block++) {
- if (buf_block_get_state(block)
- == BUF_BLOCK_FILE_PAGE) {
- ut_d(block->page.in_page_hash = TRUE);
- HASH_INSERT(buf_page_t, hash, buf_pool->page_hash,
- buf_page_address_fold(
- block->page.space,
- block->page.offset),
- &block->page);
- }
- }
-
- for (b = UT_LIST_GET_FIRST(buf_pool->zip_clean); b;
- b = UT_LIST_GET_NEXT(zip_list, b)) {
- ut_ad(!b->in_flush_list);
- ut_ad(b->in_LRU_list);
-
- ut_d(b->in_page_hash = TRUE);
- HASH_INSERT(buf_page_t, hash, buf_pool->page_hash,
- buf_page_address_fold(b->space, b->offset), b);
- }
-
- for (b = UT_LIST_GET_FIRST(buf_pool->flush_list); b;
- b = UT_LIST_GET_NEXT(flush_list, b)) {
- ut_ad(b->in_flush_list);
- ut_ad(b->in_LRU_list);
-
- switch (buf_page_get_state(b)) {
- case BUF_BLOCK_ZIP_DIRTY:
- ut_d(b->in_page_hash = TRUE);
- HASH_INSERT(buf_page_t, hash, buf_pool->page_hash,
- buf_page_address_fold(b->space,
- b->offset), b);
- break;
- case BUF_BLOCK_FILE_PAGE:
- /* uncompressed page */
- break;
- case BUF_BLOCK_ZIP_FREE:
- case BUF_BLOCK_ZIP_PAGE:
- case BUF_BLOCK_NOT_USED:
- case BUF_BLOCK_READY_FOR_USE:
- case BUF_BLOCK_MEMORY:
- case BUF_BLOCK_REMOVE_HASH:
- ut_error;
- break;
- }
- }
-
-
- }
- }
-
mutex_exit(&LRU_list_mutex);
rw_lock_x_unlock(&page_hash_latch);
buf_pool_mutex_exit();
@@ -1518,34 +1102,6 @@ buf_pool_free(void)
buf_chunk_t* chunk;
buf_chunk_t* chunks;
- if (srv_buffer_pool_shm_key) {
- buf_shm_info_t* shm_info;
-
- ut_a(buf_pool->n_chunks == 1);
-
- chunk = buf_pool->chunks;
- shm_info = chunk->mem;
- ut_a((byte*)chunk->blocks == (byte*)chunk->mem + sizeof(buf_shm_info_t));
-
- /* validation the shared memory segment doesn't have unrecoverable contents. */
- /* Currently, validation became not needed */
- shm_info->reusable = TRUE;
-
- memcpy(&(shm_info->buf_pool_backup), buf_pool, sizeof(buf_pool_t));
- memcpy(&(shm_info->chunk_backup), chunk, sizeof(buf_chunk_t));
-
- if (srv_fast_shutdown < 2) {
- if (srv_buffer_pool_shm_checksum) {
- shm_info->checksum = ut_fold_binary_32((byte*)chunk->mem + sizeof(buf_shm_info_t),
- chunk->mem_size - sizeof(buf_shm_info_t));
- } else {
- shm_info->checksum = BUF_NO_CHECKSUM_MAGIC;
- }
- shm_info->clean = TRUE;
- }
-
- os_shm_free(chunk->mem, chunk->mem_size);
- } else {
chunks = buf_pool->chunks;
chunk = chunks + buf_pool->n_chunks;
@@ -1554,13 +1110,10 @@ buf_pool_free(void)
would fail at shutdown. */
os_mem_free_large(chunk->mem, chunk->mem_size);
}
- }
mem_free(buf_pool->chunks);
hash_table_free(buf_pool->page_hash);
- if (!srv_buffer_pool_shm_key) {
hash_table_free(buf_pool->zip_hash);
- }
mem_free(buf_pool);
buf_pool = NULL;
}
@@ -1755,11 +1308,6 @@ try_again:
//buf_pool_mutex_enter();
mutex_enter(&LRU_list_mutex);
- if (srv_buffer_pool_shm_key) {
- /* Cannot support shrink */
- goto func_done;
- }
-
shrink_again:
if (buf_pool->n_chunks <= 1) {
@@ -2003,11 +1551,6 @@ void
buf_pool_resize(void)
/*=================*/
{
- if (srv_buffer_pool_shm_key) {
- /* Cannot support resize */
- return;
- }
-
//buf_pool_mutex_enter();
mutex_enter(&LRU_list_mutex);
@@ -2968,6 +2511,30 @@ wait_until_unfixed:
bytes. */
UNIV_MEM_ASSERT_RW(&block->page, sizeof block->page);
#endif
+#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
+ if (mode == BUF_GET_IF_IN_POOL && ibuf_debug) {
+ /* Try to evict the block from the buffer pool, to use the
+ insert buffer as much as possible. */
+
+ if (buf_LRU_free_block(&block->page, TRUE, NULL)
+ == BUF_LRU_FREED) {
+ buf_pool_mutex_exit();
+ mutex_exit(&block->mutex);
+ fprintf(stderr,
+ "innodb_change_buffering_debug evict %u %u\n",
+ (unsigned) space, (unsigned) offset);
+ return(NULL);
+ } else if (buf_flush_page_try(block)) {
+ fprintf(stderr,
+ "innodb_change_buffering_debug flush %u %u\n",
+ (unsigned) space, (unsigned) offset);
+ guess = block;
+ goto loop;
+ }
+
+ /* Failed to evict the page; change it directly */
+ }
+#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
buf_block_buf_fix_inc(block, file, line);
diff --git a/storage/xtradb/buf/buf0flu.c b/storage/xtradb/buf/buf0flu.c
index 0a03d583549..0ef91137aef 100644
--- a/storage/xtradb/buf/buf0flu.c
+++ b/storage/xtradb/buf/buf0flu.c
@@ -129,11 +129,16 @@ buf_flush_delete_from_flush_rbt(
buf_page_t* bpage) /*!< in: bpage to be removed. */
{
+#ifdef UNIV_DEBUG
ibool ret = FALSE;
+#endif /* UNIV_DEBUG */
//ut_ad(buf_pool_mutex_own());
ut_ad(mutex_own(&flush_list_mutex));
- ret = rbt_delete(buf_pool->flush_rbt, &bpage);
+#ifdef UNIV_DEBUG
+ ret =
+#endif /* UNIV_DEBUG */
+ rbt_delete(buf_pool->flush_rbt, &bpage);
ut_ad(ret);
}
@@ -1059,6 +1064,82 @@ buf_flush_write_block_low(
}
}
+# if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
+/********************************************************************//**
+Writes a flushable page asynchronously from the buffer pool to a file.
+NOTE: buf_pool_mutex and block->mutex must be held upon entering this
+function, and they will be released by this function after flushing.
+This is loosely based on buf_flush_batch() and buf_flush_page().
+@return TRUE if the page was flushed and the mutexes released */
+UNIV_INTERN
+ibool
+buf_flush_page_try(
+/*===============*/
+ buf_block_t* block) /*!< in/out: buffer control block */
+{
+ ut_ad(buf_pool_mutex_own());
+ ut_ad(buf_block_get_state(block) == BUF_BLOCK_FILE_PAGE);
+ ut_ad(mutex_own(&block->mutex));
+
+ if (!buf_flush_ready_for_flush(&block->page, BUF_FLUSH_LRU)) {
+ return(FALSE);
+ }
+
+ if (buf_pool->n_flush[BUF_FLUSH_LRU] > 0
+ || buf_pool->init_flush[BUF_FLUSH_LRU]) {
+ /* There is already a flush batch of the same type running */
+ return(FALSE);
+ }
+
+ buf_pool->init_flush[BUF_FLUSH_LRU] = TRUE;
+
+ buf_page_set_io_fix(&block->page, BUF_IO_WRITE);
+
+ buf_page_set_flush_type(&block->page, BUF_FLUSH_LRU);
+
+ if (buf_pool->n_flush[BUF_FLUSH_LRU]++ == 0) {
+
+ os_event_reset(buf_pool->no_flush[BUF_FLUSH_LRU]);
+ }
+
+ /* VERY IMPORTANT:
+ Because any thread may call the LRU flush, even when owning
+ locks on pages, to avoid deadlocks, we must make sure that the
+ s-lock is acquired on the page without waiting: this is
+ accomplished because buf_flush_ready_for_flush() must hold,
+ and that requires the page not to be bufferfixed. */
+
+ rw_lock_s_lock_gen(&block->lock, BUF_IO_WRITE);
+
+ /* Note that the s-latch is acquired before releasing the
+ buf_pool mutex: this ensures that the latch is acquired
+ immediately. */
+
+ mutex_exit(&block->mutex);
+ buf_pool_mutex_exit();
+
+ /* Even though block is not protected by any mutex at this
+ point, it is safe to access block, because it is io_fixed and
+ oldest_modification != 0. Thus, it cannot be relocated in the
+ buffer pool or removed from flush_list or LRU_list. */
+
+ buf_flush_write_block_low(&block->page);
+
+ buf_pool_mutex_enter();
+ buf_pool->init_flush[BUF_FLUSH_LRU] = FALSE;
+
+ if (buf_pool->n_flush[BUF_FLUSH_LRU] == 0) {
+ /* The running flush batch has ended */
+ os_event_set(buf_pool->no_flush[BUF_FLUSH_LRU]);
+ }
+
+ buf_pool_mutex_exit();
+ buf_flush_buffered_writes();
+
+ return(TRUE);
+}
+# endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
+
/********************************************************************//**
Writes a flushable page asynchronously from the buffer pool to a file.
NOTE: in simulated aio we must call
@@ -1303,7 +1384,6 @@ buf_flush_batch(
buf_page_t* bpage;
buf_page_t* prev_bpage = NULL;
ulint page_count = 0;
- ulint old_page_count;
ulint space;
ulint offset;
ulint remaining = 0;
@@ -1396,15 +1476,9 @@ flush_next:
mutex_exit(&LRU_list_mutex);
}
- old_page_count = page_count;
-
/* Try to flush also all the neighbors */
page_count += buf_flush_try_neighbors(
space, offset, flush_type, srv_flush_neighbor_pages);
- /* fprintf(stderr,
- "Flush type %lu, page no %lu, neighb %lu\n",
- flush_type, offset,
- page_count - old_page_count); */
//buf_pool_mutex_enter();
if (flush_type == BUF_FLUSH_LRU) {
diff --git a/storage/xtradb/dict/dict0crea.c b/storage/xtradb/dict/dict0crea.c
index a6d0e11740a..992a7000eda 100644
--- a/storage/xtradb/dict/dict0crea.c
+++ b/storage/xtradb/dict/dict0crea.c
@@ -693,7 +693,6 @@ dict_create_index_tree_step(
{
dict_index_t* index;
dict_table_t* sys_indexes;
- dict_table_t* table;
dtuple_t* search_tuple;
ulint zip_size;
btr_pcur_t pcur;
@@ -702,7 +701,6 @@ dict_create_index_tree_step(
ut_ad(mutex_own(&(dict_sys->mutex)));
index = node->index;
- table = node->table;
sys_indexes = dict_sys->sys_indexes;
diff --git a/storage/xtradb/dict/dict0dict.c b/storage/xtradb/dict/dict0dict.c
index 1d0517f5cc7..40380067bd2 100644
--- a/storage/xtradb/dict/dict0dict.c
+++ b/storage/xtradb/dict/dict0dict.c
@@ -4791,7 +4791,6 @@ dict_index_print_low(
{
ib_int64_t n_vals;
ulint i;
- const char* type_string;
ut_ad(mutex_own(&(dict_sys->mutex)));
@@ -4806,14 +4805,6 @@ dict_index_print_low(
dict_index_stat_mutex_exit(index);
- if (dict_index_is_clust(index)) {
- type_string = "clustered index";
- } else if (dict_index_is_unique(index)) {
- type_string = "unique index";
- } else {
- type_string = "secondary index";
- }
-
fprintf(stderr,
" INDEX: name %s, id %lu %lu, fields %lu/%lu,"
" uniq %lu, type %lu\n"
diff --git a/storage/xtradb/dict/dict0load.c b/storage/xtradb/dict/dict0load.c
index 43c0810fe67..19de5bf8264 100644
--- a/storage/xtradb/dict/dict0load.c
+++ b/storage/xtradb/dict/dict0load.c
@@ -1024,13 +1024,13 @@ err_exit:
if (err != DB_SUCCESS) {
dict_table_remove_from_cache(table);
table = NULL;
+ } else {
+ table->fk_max_recusive_level = 0;
}
} else if (!srv_force_recovery) {
dict_table_remove_from_cache(table);
table = NULL;
}
-
- table->fk_max_recusive_level = 0;
#if 0
if (err != DB_SUCCESS && table != NULL) {
diff --git a/storage/xtradb/eval/eval0eval.c b/storage/xtradb/eval/eval0eval.c
index 589b0fa1576..dcd416adeee 100644
--- a/storage/xtradb/eval/eval0eval.c
+++ b/storage/xtradb/eval/eval0eval.c
@@ -384,18 +384,13 @@ eval_notfound(
/*==========*/
func_node_t* func_node) /*!< in: function node */
{
- que_node_t* arg1;
- que_node_t* arg2;
sym_node_t* cursor;
sel_node_t* sel_node;
ibool ibool_val;
- arg1 = func_node->args;
- arg2 = que_node_get_next(arg1);
-
ut_ad(func_node->func == PARS_NOTFOUND_TOKEN);
- cursor = arg1;
+ cursor = func_node->args;
ut_ad(que_node_get_type(cursor) == QUE_NODE_SYMBOL);
diff --git a/storage/xtradb/ha/hash0hash.c b/storage/xtradb/ha/hash0hash.c
index 0f4fc55d895..30c304dafcd 100644
--- a/storage/xtradb/ha/hash0hash.c
+++ b/storage/xtradb/ha/hash0hash.c
@@ -128,70 +128,6 @@ hash_create(
}
/*************************************************************//**
-*/
-UNIV_INTERN
-ulint
-hash_create_needed(
-/*===============*/
- ulint n)
-{
- ulint prime;
- ulint offset;
-
- prime = ut_find_prime(n);
-
- offset = (sizeof(hash_table_t) + 7) / 8;
- offset *= 8;
-
- return(offset + sizeof(hash_cell_t) * prime);
-}
-
-UNIV_INTERN
-void
-hash_create_init(
-/*=============*/
- hash_table_t* table,
- ulint n)
-{
- ulint prime;
- ulint offset;
-
- prime = ut_find_prime(n);
-
- offset = (sizeof(hash_table_t) + 7) / 8;
- offset *= 8;
-
- table->array = (hash_cell_t*)(((byte*)table) + offset);
- table->n_cells = prime;
-# if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
- table->adaptive = FALSE;
-# endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */
- table->n_mutexes = 0;
- table->mutexes = NULL;
- table->heaps = NULL;
- table->heap = NULL;
- ut_d(table->magic_n = HASH_TABLE_MAGIC_N);
-
- /* Initialize the cell array */
- hash_table_clear(table);
-}
-
-UNIV_INTERN
-void
-hash_create_reuse(
-/*==============*/
- hash_table_t* table)
-{
- ulint offset;
-
- offset = (sizeof(hash_table_t) + 7) / 8;
- offset *= 8;
-
- table->array = (hash_cell_t*)(((byte*)table) + offset);
- ut_ad(table->magic_n == HASH_TABLE_MAGIC_N);
-}
-
-/*************************************************************//**
Frees a hash table. */
UNIV_INTERN
void
diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc
index ec79c3309f9..ee060f61c75 100644
--- a/storage/xtradb/handler/ha_innodb.cc
+++ b/storage/xtradb/handler/ha_innodb.cc
@@ -194,7 +194,6 @@ 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_use_sys_stats_table = FALSE;
-static my_bool innobase_buffer_pool_shm_checksum = TRUE;
static char* internal_innobase_data_file_path = NULL;
@@ -1472,7 +1471,7 @@ UNIV_INTERN
ha_innobase::ha_innobase(handlerton *hton, TABLE_SHARE *table_arg)
:handler(hton, table_arg),
int_table_flags(HA_REC_NOT_IN_SEQ |
- HA_NULL_IN_KEY |
+ HA_NULL_IN_KEY | HA_CAN_VIRTUAL_COLUMNS |
HA_CAN_INDEX_BLOBS |
HA_CAN_SQL_HANDLER |
HA_PRIMARY_KEY_REQUIRED_FOR_POSITION |
@@ -2427,7 +2426,6 @@ innobase_change_buffering_inited_ok:
srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite;
srv_use_checksums = (ibool) innobase_use_checksums;
srv_fast_checksum = (ibool) innobase_fast_checksum;
- srv_buffer_pool_shm_checksum = (ibool) innobase_buffer_pool_shm_checksum;
#ifdef HAVE_LARGE_PAGES
if ((os_use_large_pages = (ibool) my_use_large_pages))
@@ -4633,7 +4631,7 @@ build_template(
ulint n_requested_fields = 0;
ibool fetch_all_in_key = FALSE;
ibool fetch_primary_key_cols = FALSE;
- ulint i, sql_idx, innodb_idx=0;
+ ulint sql_idx, innodb_idx=0;
/* byte offset of the end of last requested column */
ulint mysql_prefix_len = 0;
@@ -4756,17 +4754,18 @@ include_field:
n_requested_fields++;
templ->col_no = innodb_idx;
+ templ->clust_rec_field_no = dict_col_get_clust_pos(
+ &index->table->cols[innodb_idx], clust_index);
+ ut_ad(templ->clust_rec_field_no != ULINT_UNDEFINED);
if (index == clust_index) {
- templ->rec_field_no = dict_col_get_clust_pos(
- &index->table->cols[innodb_idx], index);
+ templ->rec_field_no = templ->clust_rec_field_no;
} else {
templ->rec_field_no = dict_index_get_nth_col_pos(
index, innodb_idx);
- }
-
- if (templ->rec_field_no == ULINT_UNDEFINED) {
- prebuilt->need_to_access_clustered = TRUE;
+ if (templ->rec_field_no == ULINT_UNDEFINED) {
+ prebuilt->need_to_access_clustered = TRUE;
+ }
}
if (field->null_ptr) {
@@ -4817,12 +4816,10 @@ skip_field:
if (index != clust_index && prebuilt->need_to_access_clustered) {
/* Change rec_field_no's to correspond to the clustered index
record */
- for (i = 0; i < n_requested_fields; i++) {
+ for (ulint i = 0; i < n_requested_fields; i++) {
templ = prebuilt->mysql_template + i;
- templ->rec_field_no = dict_col_get_clust_pos(
- &index->table->cols[templ->col_no],
- clust_index);
+ templ->rec_field_no = templ->clust_rec_field_no;
}
}
}
@@ -6769,8 +6766,8 @@ create_options_are_valid(
? "COMPRESSED"
: "DYNAMIC";
- /* These two ROW_FORMATs require
- srv_file_per_table and srv_file_format */
+ /* These two ROW_FORMATs require srv_file_per_table
+ and srv_file_format > Antelope */
if (!srv_file_per_table) {
push_warning_printf(
thd,
@@ -6780,7 +6777,6 @@ create_options_are_valid(
" requires innodb_file_per_table.",
row_format_name);
ret = FALSE;
-
}
if (srv_file_format < DICT_TF_FORMAT_ZIP) {
@@ -6979,6 +6975,8 @@ ha_innobase::create(
ulint ssize, ksize;
ulint key_block_size = create_info->key_block_size;
+ /* Set 'flags' to the correct key_block_size.
+ It will be zero if key_block_size is an invalid number.*/
for (ssize = ksize = 1; ssize <= DICT_TF_ZSSIZE_MAX;
ssize++, ksize <<= 1) {
if (key_block_size == ksize) {
@@ -7019,10 +7017,10 @@ ha_innobase::create(
row_type = form->s->row_type;
if (flags) {
- /* KEY_BLOCK_SIZE was specified. */
- if (!(create_info->used_fields & HA_CREATE_USED_ROW_FORMAT)) {
- /* ROW_FORMAT was not specified;
- default to ROW_FORMAT=COMPRESSED */
+ /* if KEY_BLOCK_SIZE was specified on this statement and
+ ROW_FORMAT was not, automatically change ROW_FORMAT to COMPRESSED.*/
+ if ( (create_info->used_fields & HA_CREATE_USED_KEY_BLOCK_SIZE)
+ && !(create_info->used_fields & HA_CREATE_USED_ROW_FORMAT)) {
row_type = ROW_TYPE_COMPRESSED;
} else if (row_type != ROW_TYPE_COMPRESSED) {
/* ROW_FORMAT other than COMPRESSED
@@ -7041,7 +7039,7 @@ ha_innobase::create(
flags = 0;
}
} else {
- /* No KEY_BLOCK_SIZE */
+ /* flags == 0 means no KEY_BLOCK_SIZE.*/
if (row_type == ROW_TYPE_COMPRESSED) {
/* ROW_FORMAT=COMPRESSED without
KEY_BLOCK_SIZE implies half the
@@ -7429,7 +7427,6 @@ innobase_drop_database(
ulint len = 0;
trx_t* trx;
char* ptr;
- int error;
char* namebuf;
THD* thd = current_thd;
@@ -7472,7 +7469,7 @@ innobase_drop_database(
#else
trx = innobase_trx_allocate(thd);
#endif
- error = row_drop_database_for_mysql(namebuf, trx);
+ row_drop_database_for_mysql(namebuf, trx);
my_free(namebuf, MYF(0));
/* Flush the log to reduce probability that the .frm files and
@@ -7937,9 +7934,12 @@ Returns statistics information of the table to the MySQL interpreter,
in various fields of the handle object. */
UNIV_INTERN
int
-ha_innobase::info(
-/*==============*/
- uint flag) /*!< in: what information MySQL requests */
+ha_innobase::info_low(
+/*==================*/
+ uint flag, /*!< in: what information MySQL
+ requests */
+ bool called_from_analyze) /* in: TRUE if called from
+ ::analyze() */
{
dict_table_t* ib_table;
dict_index_t* index;
@@ -7970,8 +7970,7 @@ ha_innobase::info(
ib_table = prebuilt->table;
if (flag & HA_STATUS_TIME) {
- if ((innobase_stats_on_metadata
- || thd_sql_command(user_thd) == SQLCOM_ANALYZE)
+ if ((called_from_analyze || innobase_stats_on_metadata)
&& !share->ib_table->is_corrupt) {
/* In sql_show we call with this flag: update
then statistics so that they are up-to-date */
@@ -8242,6 +8241,18 @@ func_exit:
DBUG_RETURN(0);
}
+/*********************************************************************//**
+Returns statistics information of the table to the MySQL interpreter,
+in various fields of the handle object. */
+UNIV_INTERN
+int
+ha_innobase::info(
+/*==============*/
+ uint flag) /*!< in: what information MySQL requests */
+{
+ return(info_low(flag, false /* not called from analyze */));
+}
+
/**********************************************************************//**
Updates index cardinalities of the table, based on 8 random dives into
each index tree. This does NOT calculate exact statistics on the table.
@@ -8258,7 +8269,8 @@ ha_innobase::analyze(
}
/* Simply call ::info() with all the flags */
- info(HA_STATUS_TIME | HA_STATUS_CONST | HA_STATUS_VARIABLE);
+ info_low(HA_STATUS_TIME | HA_STATUS_CONST | HA_STATUS_VARIABLE,
+ true /* called from analyze */);
if (share->ib_table->is_corrupt) {
return(HA_ADMIN_CORRUPT);
@@ -8567,8 +8579,6 @@ ha_innobase::get_foreign_key_create_info(void)
flen = ftell(srv_dict_tmpfile);
if (flen < 0) {
flen = 0;
- } else if (flen > 64000 - 1) {
- flen = 64000 - 1;
}
/* allocate buffer for the string, and
@@ -9341,12 +9351,9 @@ innodb_show_status(
mutex_exit(&srv_monitor_file_mutex);
- bool result = FALSE;
+ stat_print(thd, innobase_hton_name, (uint) strlen(innobase_hton_name),
+ STRING_WITH_LEN(""), str, flen);
- if (stat_print(thd, innobase_hton_name, (uint) strlen(innobase_hton_name),
- STRING_WITH_LEN(""), str, flen)) {
- result= TRUE;
- }
my_free(str, MYF(0));
DBUG_RETURN(FALSE);
@@ -9884,7 +9891,11 @@ ha_innobase::innobase_peek_autoinc(void)
auto_inc = dict_table_autoinc_read(innodb_table);
- ut_a(auto_inc > 0);
+ if (auto_inc == 0) {
+ ut_print_timestamp(stderr);
+ fprintf(stderr, " InnoDB: AUTOINC next value generation "
+ "is disabled for '%s'\n", innodb_table->name);
+ }
dict_table_autoinc_unlock(innodb_table);
@@ -11394,16 +11405,6 @@ static MYSQL_SYSVAR_LONGLONG(buffer_pool_size, innobase_buffer_pool_size,
"The size of the memory buffer InnoDB uses to cache data and indexes of its tables.",
NULL, NULL, 128*1024*1024L, 32*1024*1024L, LONGLONG_MAX, 1024*1024L);
-static MYSQL_SYSVAR_UINT(buffer_pool_shm_key, srv_buffer_pool_shm_key,
- PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
- "[experimental] The key value of shared memory segment for the buffer pool. 0 (default) disables the feature.",
- NULL, NULL, 0, 0, INT_MAX32, 0);
-
-static MYSQL_SYSVAR_BOOL(buffer_pool_shm_checksum, innobase_buffer_pool_shm_checksum,
- PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
- "Enable buffer_pool_shm checksum validation (enabled by default).",
- NULL, NULL, TRUE);
-
static MYSQL_SYSVAR_ULONG(commit_concurrency, innobase_commit_concurrency,
PLUGIN_VAR_RQCMDARG,
"Helps in performance tuning in heavily concurrent environments.",
@@ -11535,6 +11536,13 @@ static MYSQL_SYSVAR_STR(change_buffering, innobase_change_buffering,
innodb_change_buffering_validate,
innodb_change_buffering_update, "inserts");
+#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
+static MYSQL_SYSVAR_UINT(change_buffering_debug, ibuf_debug,
+ PLUGIN_VAR_RQCMDARG,
+ "Debug flags for InnoDB change buffering (0=none)",
+ NULL, NULL, 0, 0, 1, 0);
+#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
+
static MYSQL_SYSVAR_ULONG(read_ahead_threshold, srv_read_ahead_threshold,
PLUGIN_VAR_RQCMDARG,
"Number of pages that must be accessed sequentially for InnoDB to "
@@ -11669,8 +11677,6 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
MYSQL_SYSVAR(additional_mem_pool_size),
MYSQL_SYSVAR(autoextend_increment),
MYSQL_SYSVAR(buffer_pool_size),
- MYSQL_SYSVAR(buffer_pool_shm_key),
- MYSQL_SYSVAR(buffer_pool_shm_checksum),
MYSQL_SYSVAR(checksums),
MYSQL_SYSVAR(fast_checksum),
MYSQL_SYSVAR(commit_concurrency),
@@ -11746,6 +11752,9 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
MYSQL_SYSVAR(dict_size_limit),
MYSQL_SYSVAR(use_sys_malloc),
MYSQL_SYSVAR(change_buffering),
+#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
+ MYSQL_SYSVAR(change_buffering_debug),
+#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
MYSQL_SYSVAR(read_ahead_threshold),
MYSQL_SYSVAR(io_capacity),
MYSQL_SYSVAR(auto_lru_dump),
diff --git a/storage/xtradb/handler/ha_innodb.h b/storage/xtradb/handler/ha_innodb.h
index 2c14549cbfc..c60a5eae19e 100644
--- a/storage/xtradb/handler/ha_innodb.h
+++ b/storage/xtradb/handler/ha_innodb.h
@@ -110,6 +110,7 @@ class ha_innobase: public handler
ulint innobase_update_autoinc(ulonglong auto_inc);
void innobase_initialize_autoinc();
dict_index_t* innobase_get_index(uint keynr);
+ int info_low(uint flag, bool called_from_analyze);
/* Init values for the class: */
public:
@@ -221,7 +222,6 @@ class ha_innobase: public handler
/** @} */
bool check_if_incompatible_data(HA_CREATE_INFO *info,
uint table_changes);
- bool check_if_supported_virtual_columns(void) { return TRUE; }
};
/* Some accessor functions which the InnoDB plugin needs, but which
diff --git a/storage/xtradb/handler/i_s.cc b/storage/xtradb/handler/i_s.cc
index 0f656528315..0793daf7650 100644
--- a/storage/xtradb/handler/i_s.cc
+++ b/storage/xtradb/handler/i_s.cc
@@ -816,7 +816,7 @@ i_s_innodb_buffer_pool_pages_index_fill(
if (fil_page_get_type(frame) == FIL_PAGE_INDEX) {
index_id = btr_page_get_index_id(frame);
- table->field[0]->store(ut_conv_dulint_to_longlong(index_id));
+ table->field[0]->store(ut_conv_dulint_to_longlong(index_id), 0);
table->field[1]->store(block->page.space);
table->field[2]->store(block->page.offset);
table->field[3]->store(page_get_n_recs(frame));
@@ -2248,6 +2248,7 @@ trx_i_s_common_fill_table(
deadlock occurs between the mysqld server and mysql client,
see http://bugs.mysql.com/29900 ; when that bug is resolved
we can enable the DBUG_RETURN(ret) above */
+ ret++; // silence a gcc46 warning
DBUG_RETURN(0);
#endif
}
diff --git a/storage/xtradb/handler/innodb_patch_info.h b/storage/xtradb/handler/innodb_patch_info.h
index e68f12d0fec..38b97411340 100644
--- a/storage/xtradb/handler/innodb_patch_info.h
+++ b/storage/xtradb/handler/innodb_patch_info.h
@@ -47,6 +47,5 @@ struct innodb_enhancement {
{"innodb_fast_checksum","Using the checksum on 32bit-unit calculation","incompatible for unpatched ver.","http://www.percona.com/docs/wiki/percona-xtradb"},
{"innodb_files_extend","allow >4GB transaction log files, and can vary universal page size of datafiles","incompatible for unpatched ver.","http://www.percona.com/docs/wiki/percona-xtradb"},
{"innodb_sys_tables_sys_indexes","Expose InnoDB SYS_TABLES and SYS_INDEXES schema tables","","http://www.percona.com/docs/wiki/percona-xtradb"},
-{"innodb_buffer_pool_shm","Put buffer pool contents to shared memory segment and reuse it at clean restart [experimental]","","http://www.percona.com/docs/wiki/percona-xtradb"},
{NULL, NULL, NULL, NULL}
};
diff --git a/storage/xtradb/ibuf/ibuf0ibuf.c b/storage/xtradb/ibuf/ibuf0ibuf.c
index e01c2d6b800..12dbc29be23 100644
--- a/storage/xtradb/ibuf/ibuf0ibuf.c
+++ b/storage/xtradb/ibuf/ibuf0ibuf.c
@@ -49,6 +49,7 @@ Created 7/19/1997 Heikki Tuuri
#include "btr0cur.h"
#include "btr0pcur.h"
#include "btr0btr.h"
+#include "row0upd.h"
#include "sync0sync.h"
#include "dict0boot.h"
#include "fut0lst.h"
@@ -170,6 +171,11 @@ access order rules. */
/** Operations that can currently be buffered. */
UNIV_INTERN ibuf_use_t ibuf_use = IBUF_USE_INSERT;
+#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
+/** Flag to control insert buffer debugging. */
+UNIV_INTERN uint ibuf_debug;
+#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
+
/** The insert buffer control structure */
UNIV_INTERN ibuf_t* ibuf = NULL;
@@ -2886,9 +2892,80 @@ During merge, inserts to an index page a secondary index entry extracted
from the insert buffer. */
static
void
+ibuf_insert_to_index_page_low(
+/*==========================*/
+ const dtuple_t* entry, /*!< in: buffered entry to insert */
+ buf_block_t* block, /*!< in/out: index page where the buffered
+ entry should be placed */
+ dict_index_t* index, /*!< in: record descriptor */
+ mtr_t* mtr, /*!< in/out: mtr */
+ page_cur_t* page_cur)/*!< in/out: cursor positioned on the record
+ after which to insert the buffered entry */
+{
+ const page_t* page;
+ ulint space;
+ ulint page_no;
+ ulint zip_size;
+ const page_t* bitmap_page;
+ ulint old_bits;
+
+ if (UNIV_LIKELY
+ (page_cur_tuple_insert(page_cur, entry, index, 0, mtr) != NULL)) {
+ return;
+ }
+
+ /* If the record did not fit, reorganize */
+
+ btr_page_reorganize(block, index, mtr);
+ page_cur_search(block, index, entry, PAGE_CUR_LE, page_cur);
+
+ /* This time the record must fit */
+
+ if (UNIV_LIKELY
+ (page_cur_tuple_insert(page_cur, entry, index, 0, mtr) != NULL)) {
+ return;
+ }
+
+ page = buf_block_get_frame(block);
+
+ ut_print_timestamp(stderr);
+
+ fprintf(stderr,
+ " InnoDB: Error: Insert buffer insert fails;"
+ " page free %lu, dtuple size %lu\n",
+ (ulong) page_get_max_insert_size(page, 1),
+ (ulong) rec_get_converted_size(index, entry, 0));
+ fputs("InnoDB: Cannot insert index record ", stderr);
+ dtuple_print(stderr, entry);
+ fputs("\nInnoDB: The table where this index record belongs\n"
+ "InnoDB: is now probably corrupt. Please run CHECK TABLE on\n"
+ "InnoDB: that table.\n", stderr);
+
+ space = page_get_space_id(page);
+ zip_size = buf_block_get_zip_size(block);
+ page_no = page_get_page_no(page);
+
+ bitmap_page = ibuf_bitmap_get_map_page(space, page_no, zip_size, mtr);
+ old_bits = ibuf_bitmap_page_get_bits(bitmap_page, page_no, zip_size,
+ IBUF_BITMAP_FREE, mtr);
+
+ fprintf(stderr,
+ "InnoDB: space %lu, page %lu, zip_size %lu, bitmap bits %lu\n",
+ (ulong) space, (ulong) page_no,
+ (ulong) zip_size, (ulong) old_bits);
+
+ fputs("InnoDB: Submit a detailed bug report"
+ " to http://bugs.mysql.com\n", stderr);
+}
+
+/************************************************************************
+During merge, inserts to an index page a secondary index entry extracted
+from the insert buffer. */
+static
+void
ibuf_insert_to_index_page(
/*======================*/
- dtuple_t* entry, /*!< in: buffered entry to insert */
+ const dtuple_t* entry, /*!< in: buffered entry to insert */
buf_block_t* block, /*!< in/out: index page where the buffered entry
should be placed */
dict_index_t* index, /*!< in: record descriptor */
@@ -2898,11 +2975,10 @@ ibuf_insert_to_index_page(
ulint low_match;
page_t* page = buf_block_get_frame(block);
rec_t* rec;
- page_t* bitmap_page;
- ulint old_bits;
ut_ad(ibuf_inside());
ut_ad(dtuple_check_typed(entry));
+ ut_ad(!buf_block_align(page)->is_hashed);
if (UNIV_UNLIKELY(dict_table_is_comp(index->table)
!= (ibool)!!page_is_comp(page))) {
@@ -2940,71 +3016,86 @@ dump:
low_match = page_cur_search(block, index, entry,
PAGE_CUR_LE, &page_cur);
- if (low_match == dtuple_get_n_fields(entry)) {
+ if (UNIV_UNLIKELY(low_match == dtuple_get_n_fields(entry))) {
+ mem_heap_t* heap;
+ upd_t* update;
+ ulint* offsets;
page_zip_des_t* page_zip;
rec = page_cur_get_rec(&page_cur);
- page_zip = buf_block_get_page_zip(block);
- btr_cur_del_unmark_for_ibuf(rec, page_zip, mtr);
- } else {
- rec = page_cur_tuple_insert(&page_cur, entry, index, 0, mtr);
+ /* This is based on
+ row_ins_sec_index_entry_by_modify(BTR_MODIFY_LEAF). */
+ ut_ad(rec_get_deleted_flag(rec, page_is_comp(page)));
- if (UNIV_LIKELY(rec != NULL)) {
+ heap = mem_heap_create(1024);
+
+ offsets = rec_get_offsets(rec, index, NULL, ULINT_UNDEFINED,
+ &heap);
+ update = row_upd_build_sec_rec_difference_binary(
+ index, entry, rec, NULL, heap);
+
+ page_zip = buf_block_get_page_zip(block);
+
+ if (update->n_fields == 0) {
+ /* The records only differ in the delete-mark.
+ Clear the delete-mark, like we did before
+ Bug #56680 was fixed. */
+ btr_cur_del_unmark_for_ibuf(rec, page_zip, mtr);
+updated_in_place:
+ mem_heap_free(heap);
return;
}
- /* If the record did not fit, reorganize */
-
- btr_page_reorganize(block, index, mtr);
- page_cur_search(block, index, entry, PAGE_CUR_LE, &page_cur);
+ /* Copy the info bits. Clear the delete-mark. */
+ update->info_bits = rec_get_info_bits(rec, page_is_comp(page));
+ update->info_bits &= ~REC_INFO_DELETED_FLAG;
+
+ /* We cannot invoke btr_cur_optimistic_update() here,
+ because we do not have a btr_cur_t or que_thr_t,
+ as the insert buffer merge occurs at a very low level. */
+ if (!row_upd_changes_field_size_or_external(index, offsets,
+ update)
+ && (!page_zip || btr_cur_update_alloc_zip(
+ page_zip, block, index,
+ rec_offs_size(offsets), FALSE, mtr))) {
+ /* This is the easy case. Do something similar
+ to btr_cur_update_in_place(). */
+ row_upd_rec_in_place(rec, index, offsets,
+ update, page_zip);
+ goto updated_in_place;
+ }
- /* This time the record must fit */
- if (UNIV_UNLIKELY
- (!page_cur_tuple_insert(&page_cur, entry, index,
- 0, mtr))) {
- ulint space;
- ulint page_no;
- ulint zip_size;
+ /* A collation may identify values that differ in
+ storage length.
+ Some examples (1 or 2 bytes):
+ utf8_turkish_ci: I = U+0131 LATIN SMALL LETTER DOTLESS I
+ utf8_general_ci: S = U+00DF LATIN SMALL LETTER SHARP S
+ utf8_general_ci: A = U+00E4 LATIN SMALL LETTER A WITH DIAERESIS
- ut_print_timestamp(stderr);
+ latin1_german2_ci: SS = U+00DF LATIN SMALL LETTER SHARP S
- fprintf(stderr,
- " InnoDB: Error: Insert buffer insert"
- " fails; page free %lu,"
- " dtuple size %lu\n",
- (ulong) page_get_max_insert_size(
- page, 1),
- (ulong) rec_get_converted_size(
- index, entry, 0));
- fputs("InnoDB: Cannot insert index record ",
- stderr);
- dtuple_print(stderr, entry);
- fputs("\nInnoDB: The table where"
- " this index record belongs\n"
- "InnoDB: is now probably corrupt."
- " Please run CHECK TABLE on\n"
- "InnoDB: that table.\n", stderr);
+ Examples of a character (3-byte UTF-8 sequence)
+ identified with 2 or 4 characters (1-byte UTF-8 sequences):
- space = page_get_space_id(page);
- zip_size = buf_block_get_zip_size(block);
- page_no = page_get_page_no(page);
+ utf8_unicode_ci: 'II' = U+2171 SMALL ROMAN NUMERAL TWO
+ utf8_unicode_ci: '(10)' = U+247D PARENTHESIZED NUMBER TEN
+ */
- bitmap_page = ibuf_bitmap_get_map_page(
- space, page_no, zip_size, mtr);
- old_bits = ibuf_bitmap_page_get_bits(
- bitmap_page, page_no, zip_size,
- IBUF_BITMAP_FREE, mtr);
+ /* Delete the different-length record, and insert the
+ buffered one. */
- fprintf(stderr,
- "InnoDB: space %lu, page %lu,"
- " zip_size %lu, bitmap bits %lu\n",
- (ulong) space, (ulong) page_no,
- (ulong) zip_size, (ulong) old_bits);
+ lock_rec_store_on_page_infimum(block, rec);
+ page_cur_delete_rec(&page_cur, index, offsets, mtr);
+ page_cur_move_to_prev(&page_cur);
+ mem_heap_free(heap);
- fputs("InnoDB: Submit a detailed bug report"
- " to http://bugs.mysql.com\n", stderr);
- }
+ ibuf_insert_to_index_page_low(entry, block, index, mtr,
+ &page_cur);
+ lock_rec_restore_from_page_infimum(block, rec, block);
+ } else {
+ ibuf_insert_to_index_page_low(entry, block, index, mtr,
+ &page_cur);
}
}
diff --git a/storage/xtradb/include/btr0cur.h b/storage/xtradb/include/btr0cur.h
index e151fdcb563..7f6bff11f84 100644
--- a/storage/xtradb/include/btr0cur.h
+++ b/storage/xtradb/include/btr0cur.h
@@ -242,6 +242,22 @@ btr_cur_pessimistic_insert(
que_thr_t* thr, /*!< in: query thread or NULL */
mtr_t* mtr); /*!< in: mtr */
/*************************************************************//**
+See if there is enough place in the page modification log to log
+an update-in-place.
+@return TRUE if enough place */
+UNIV_INTERN
+ibool
+btr_cur_update_alloc_zip(
+/*=====================*/
+ page_zip_des_t* page_zip,/*!< in/out: compressed page */
+ buf_block_t* block, /*!< in/out: buffer page */
+ dict_index_t* index, /*!< in: the index corresponding to the block */
+ ulint length, /*!< in: size needed */
+ ibool create, /*!< in: TRUE=delete-and-insert,
+ FALSE=update-in-place */
+ mtr_t* mtr) /*!< in: mini-transaction */
+ __attribute__((nonnull, warn_unused_result));
+/*************************************************************//**
Updates a record when the update causes no size changes in its fields.
@return DB_SUCCESS or error number */
UNIV_INTERN
diff --git a/storage/xtradb/include/buf0buf.h b/storage/xtradb/include/buf0buf.h
index e06927f42f0..d6cc63bb6af 100644
--- a/storage/xtradb/include/buf0buf.h
+++ b/storage/xtradb/include/buf0buf.h
@@ -36,7 +36,6 @@ Created 11/5/1995 Heikki Tuuri
#include "ut0rbt.h"
#ifndef UNIV_HOTBACKUP
#include "os0proc.h"
-#include "srv0srv.h"
/** @name Modes for buf_page_get_gen */
/* @{ */
@@ -1302,10 +1301,7 @@ struct buf_block_struct{
/**********************************************************************//**
Compute the hash fold value for blocks in buf_pool->zip_hash. */
/* @{ */
-/* the fold should be relative when srv_buffer_pool_shm_key is enabled */
-#define BUF_POOL_ZIP_FOLD_PTR(ptr) (!srv_buffer_pool_shm_key\
- ?((ulint) (ptr) / UNIV_PAGE_SIZE)\
- :((ulint) ((byte*)ptr - (byte*)(buf_pool->chunks->blocks->frame)) / UNIV_PAGE_SIZE))
+#define BUF_POOL_ZIP_FOLD_PTR(ptr) ((ulint) (ptr) / UNIV_PAGE_SIZE)
#define BUF_POOL_ZIP_FOLD(b) BUF_POOL_ZIP_FOLD_PTR((b)->frame)
#define BUF_POOL_ZIP_FOLD_BPAGE(b) BUF_POOL_ZIP_FOLD((buf_block_t*) (b))
/* @} */
diff --git a/storage/xtradb/include/buf0flu.h b/storage/xtradb/include/buf0flu.h
index 2f7108fda1b..85957f5c448 100644
--- a/storage/xtradb/include/buf0flu.h
+++ b/storage/xtradb/include/buf0flu.h
@@ -76,6 +76,20 @@ buf_flush_init_for_writing(
ib_uint64_t newest_lsn); /*!< in: newest modification lsn
to the page */
#ifndef UNIV_HOTBACKUP
+# if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
+/********************************************************************//**
+Writes a flushable page asynchronously from the buffer pool to a file.
+NOTE: buf_pool_mutex and block->mutex must be held upon entering this
+function, and they will be released by this function after flushing.
+This is loosely based on buf_flush_batch() and buf_flush_page().
+@return TRUE if the page was flushed and the mutexes released */
+UNIV_INTERN
+ibool
+buf_flush_page_try(
+/*===============*/
+ buf_block_t* block) /*!< in/out: buffer control block */
+ __attribute__((nonnull, warn_unused_result));
+# endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
/*******************************************************************//**
This utility flushes dirty blocks from the end of the LRU list or flush_list.
NOTE 1: in the case of an LRU flush the calling thread may own latches to
diff --git a/storage/xtradb/include/fsp0types.h b/storage/xtradb/include/fsp0types.h
index 2dd2deca671..6678dacb547 100644
--- a/storage/xtradb/include/fsp0types.h
+++ b/storage/xtradb/include/fsp0types.h
@@ -42,7 +42,7 @@ fseg_alloc_free_page) */
/* @} */
/** File space extent size (one megabyte) in pages */
-#define FSP_EXTENT_SIZE (1u << (20 - UNIV_PAGE_SIZE_SHIFT))
+#define FSP_EXTENT_SIZE (1ULL << (20 - UNIV_PAGE_SIZE_SHIFT))
/** On a page of any file segment, data may be put starting from this
offset */
diff --git a/storage/xtradb/include/hash0hash.h b/storage/xtradb/include/hash0hash.h
index 492c767acc4..b17c21a45ef 100644
--- a/storage/xtradb/include/hash0hash.h
+++ b/storage/xtradb/include/hash0hash.h
@@ -49,28 +49,6 @@ hash_table_t*
hash_create(
/*========*/
ulint n); /*!< in: number of array cells */
-
-/*************************************************************//**
-*/
-UNIV_INTERN
-ulint
-hash_create_needed(
-/*===============*/
- ulint n);
-
-UNIV_INTERN
-void
-hash_create_init(
-/*=============*/
- hash_table_t* table,
- ulint n);
-
-UNIV_INTERN
-void
-hash_create_reuse(
-/*==============*/
- hash_table_t* table);
-
#ifndef UNIV_HOTBACKUP
/*************************************************************//**
Creates a mutex array to protect a hash table. */
@@ -350,33 +328,6 @@ do {\
}\
} while (0)
-/********************************************************************//**
-Align nodes with moving location.*/
-#define HASH_OFFSET(TABLE, NODE_TYPE, PTR_NAME, FADDR, FOFFSET, BOFFSET) \
-do {\
- ulint i2222;\
- ulint cell_count2222;\
-\
- cell_count2222 = hash_get_n_cells(TABLE);\
-\
- for (i2222 = 0; i2222 < cell_count2222; i2222++) {\
- NODE_TYPE* node2222;\
-\
- if ((TABLE)->array[i2222].node) \
- (TABLE)->array[i2222].node = (void*)((byte*)(TABLE)->array[i2222].node \
- + (((TABLE)->array[i2222].node > (void*)FADDR)?FOFFSET:BOFFSET));\
- node2222 = HASH_GET_FIRST((TABLE), i2222);\
-\
- while (node2222) {\
- if (node2222->PTR_NAME) \
- node2222->PTR_NAME = (void*)((byte*)(node2222->PTR_NAME) \
- + ((((void*)node2222->PTR_NAME) > (void*)FADDR)?FOFFSET:BOFFSET));\
-\
- node2222 = node2222->PTR_NAME;\
- }\
- }\
-} while (0)
-
/************************************************************//**
Gets the mutex index for a fold value in a hash table.
@return mutex number */
diff --git a/storage/xtradb/include/ibuf0ibuf.h b/storage/xtradb/include/ibuf0ibuf.h
index 8aa21fb9d95..f8cc4471d43 100644
--- a/storage/xtradb/include/ibuf0ibuf.h
+++ b/storage/xtradb/include/ibuf0ibuf.h
@@ -48,6 +48,11 @@ typedef enum {
/** Operations that can currently be buffered. */
extern ibuf_use_t ibuf_use;
+#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
+/** Flag to control insert buffer debugging. */
+extern uint ibuf_debug;
+#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
+
/** The insert buffer control structure */
extern ibuf_t* ibuf;
diff --git a/storage/xtradb/include/os0proc.h b/storage/xtradb/include/os0proc.h
index 582cef6f803..fd46bd7db87 100644
--- a/storage/xtradb/include/os0proc.h
+++ b/storage/xtradb/include/os0proc.h
@@ -32,11 +32,6 @@ Created 9/30/1995 Heikki Tuuri
#ifdef UNIV_LINUX
#include <sys/ipc.h>
#include <sys/shm.h>
-#else
-# if defined HAVE_SYS_IPC_H && HAVE_SYS_SHM_H
-#include <sys/ipc.h>
-#include <sys/shm.h>
-# endif
#endif
typedef void* os_process_t;
@@ -75,29 +70,6 @@ os_mem_free_large(
ulint size); /*!< in: size returned by
os_mem_alloc_large() */
-
-/****************************************************************//**
-Allocates or attaches and reuses shared memory segment.
-The content is not cleared automatically.
-@return allocated memory */
-UNIV_INTERN
-void*
-os_shm_alloc(
-/*=========*/
- ulint* n, /*!< in/out: number of bytes */
- uint key,
- ibool* is_new);
-
-/****************************************************************//**
-Detach shared memory segment. */
-UNIV_INTERN
-void
-os_shm_free(
-/*========*/
- void *ptr, /*!< in: pointer returned by
- os_shm_alloc() */
- ulint size); /*!< in: size returned by
- os_shm_alloc() */
#ifndef UNIV_NONINL
#include "os0proc.ic"
#endif
diff --git a/storage/xtradb/include/os0sync.h b/storage/xtradb/include/os0sync.h
index c230a03b6db..2cf9ea0ec84 100644
--- a/storage/xtradb/include/os0sync.h
+++ b/storage/xtradb/include/os0sync.h
@@ -330,7 +330,7 @@ amount of increment. */
Returns the old value of *ptr, atomically sets *ptr to new_val */
# define os_atomic_test_and_set_byte(ptr, new_val) \
- __sync_lock_test_and_set(ptr, new_val)
+ __sync_lock_test_and_set(ptr, (byte) new_val)
#elif defined(HAVE_IB_SOLARIS_ATOMICS)
diff --git a/storage/xtradb/include/row0mysql.h b/storage/xtradb/include/row0mysql.h
index f8fab59ef80..141f4beb81e 100644
--- a/storage/xtradb/include/row0mysql.h
+++ b/storage/xtradb/include/row0mysql.h
@@ -535,6 +535,10 @@ struct mysql_row_templ_struct {
Innobase record in the current index;
not defined if template_type is
ROW_MYSQL_WHOLE_ROW */
+ ulint clust_rec_field_no; /*!< field number of the column in an
+ Innobase record in the clustered index;
+ not defined if template_type is
+ ROW_MYSQL_WHOLE_ROW */
ulint mysql_col_offset; /*!< offset of the column in the MySQL
row format */
ulint mysql_col_len; /*!< length of the column in the MySQL
diff --git a/storage/xtradb/include/row0upd.h b/storage/xtradb/include/row0upd.h
index 635d746d5a1..4e2de9bd2ec 100644
--- a/storage/xtradb/include/row0upd.h
+++ b/storage/xtradb/include/row0upd.h
@@ -167,8 +167,11 @@ row_upd_changes_field_size_or_external(
const upd_t* update);/*!< in: update vector */
#endif /* !UNIV_HOTBACKUP */
/***********************************************************//**
-Replaces the new column values stored in the update vector to the record
-given. No field size changes are allowed. */
+Replaces the new column values stored in the update vector to the
+record given. No field size changes are allowed. This function is
+usually invoked on a clustered index. The only use case for a
+secondary index is row_ins_sec_index_entry_by_modify() or its
+counterpart in ibuf_insert_to_index_page(). */
UNIV_INTERN
void
row_upd_rec_in_place(
diff --git a/storage/xtradb/include/srv0srv.h b/storage/xtradb/include/srv0srv.h
index 8c64d5cee71..8148dffd13b 100644
--- a/storage/xtradb/include/srv0srv.h
+++ b/storage/xtradb/include/srv0srv.h
@@ -57,8 +57,8 @@ extern const char srv_mysql50_table_name_prefix[9];
thread starts running */
extern os_event_t srv_lock_timeout_thread_event;
-/* This event is set to tell the purge thread to shut down */
-extern os_event_t srv_purge_thread_event;
+/* This event is set at shutdown to wakeup threads from sleep */
+extern os_event_t srv_shutdown_event;
/* If the last data file is auto-extended, we add this many pages to it
at a time */
@@ -159,10 +159,6 @@ extern ulint srv_buf_pool_curr_size; /*!< current size in bytes */
extern ulint srv_mem_pool_size;
extern ulint srv_lock_table_size;
-extern uint srv_buffer_pool_shm_key;
-extern ibool srv_buffer_pool_shm_is_reused;
-extern ibool srv_buffer_pool_shm_checksum;
-
extern ibool srv_thread_concurrency_timer_based;
extern ulint srv_n_file_io_threads;
diff --git a/storage/xtradb/include/univ.i b/storage/xtradb/include/univ.i
index 8691e3cf337..487c291ef80 100644
--- a/storage/xtradb/include/univ.i
+++ b/storage/xtradb/include/univ.i
@@ -46,8 +46,8 @@ Created 1/20/1994 Heikki Tuuri
#define INNODB_VERSION_MAJOR 1
#define INNODB_VERSION_MINOR 0
-#define INNODB_VERSION_BUGFIX 12
-#define PERCONA_INNODB_VERSION 12.1
+#define INNODB_VERSION_BUGFIX 13
+#define PERCONA_INNODB_VERSION 11.6
/* The following is the InnoDB version as shown in
SELECT plugin_version FROM information_schema.plugins;
diff --git a/storage/xtradb/include/ut0lst.h b/storage/xtradb/include/ut0lst.h
index 245dfc226c3..7b15c052978 100644
--- a/storage/xtradb/include/ut0lst.h
+++ b/storage/xtradb/include/ut0lst.h
@@ -257,48 +257,5 @@ do { \
ut_a(ut_list_node_313 == NULL); \
} while (0)
-/********************************************************************//**
-Align nodes with moving location.
-@param NAME the name of the list
-@param TYPE node type
-@param BASE base node (not a pointer to it)
-@param OFFSET offset moved */
-#define UT_LIST_OFFSET(NAME, TYPE, BASE, FADDR, FOFFSET, BOFFSET) \
-do { \
- ulint ut_list_i_313; \
- TYPE* ut_list_node_313; \
- \
- if ((BASE).start) \
- (BASE).start = (void*)((byte*)((BASE).start) \
- + (((void*)((BASE).start) > (void*)FADDR)?FOFFSET:BOFFSET));\
- if ((BASE).end) \
- (BASE).end = (void*)((byte*)((BASE).end) \
- + (((void*)((BASE).end) > (void*)FADDR)?FOFFSET:BOFFSET));\
- \
- ut_list_node_313 = (BASE).start; \
- \
- for (ut_list_i_313 = (BASE).count; ut_list_i_313--; ) { \
- ut_a(ut_list_node_313); \
- if ((ut_list_node_313->NAME).prev) \
- (ut_list_node_313->NAME).prev = (void*)((byte*)((ut_list_node_313->NAME).prev)\
- + (((void*)((ut_list_node_313->NAME).prev) > (void*)FADDR)?FOFFSET:BOFFSET));\
- if ((ut_list_node_313->NAME).next) \
- (ut_list_node_313->NAME).next = (void*)((byte*)((ut_list_node_313->NAME).next)\
- + (((void*)((ut_list_node_313->NAME).next)> (void*)FADDR)?FOFFSET:BOFFSET));\
- ut_list_node_313 = (ut_list_node_313->NAME).next; \
- } \
- \
- ut_a(ut_list_node_313 == NULL); \
- \
- ut_list_node_313 = (BASE).end; \
- \
- for (ut_list_i_313 = (BASE).count; ut_list_i_313--; ) { \
- ut_a(ut_list_node_313); \
- ut_list_node_313 = (ut_list_node_313->NAME).prev; \
- } \
- \
- ut_a(ut_list_node_313 == NULL); \
-} while (0)
-
#endif
diff --git a/storage/xtradb/include/ut0rnd.ic b/storage/xtradb/include/ut0rnd.ic
index c2043660efd..d17036d83fc 100644
--- a/storage/xtradb/include/ut0rnd.ic
+++ b/storage/xtradb/include/ut0rnd.ic
@@ -85,9 +85,6 @@ ut_rnd_gen_ulint(void)
/*==================*/
{
ulint rnd;
- ulint n_bits;
-
- n_bits = 8 * sizeof(ulint);
ut_rnd_ulint_counter = UT_RND1 * ut_rnd_ulint_counter + UT_RND2;
diff --git a/storage/xtradb/log/log0log.c b/storage/xtradb/log/log0log.c
index b9f19aeff31..3f14d84ac72 100644
--- a/storage/xtradb/log/log0log.c
+++ b/storage/xtradb/log/log0log.c
@@ -3102,7 +3102,7 @@ logs_empty_and_mark_files_at_shutdown(void)
algorithm only works if the server is idle at shutdown */
srv_shutdown_state = SRV_SHUTDOWN_CLEANUP;
- os_event_set(srv_purge_thread_event);
+ os_event_set(srv_shutdown_event);
loop:
os_thread_sleep(100000);
diff --git a/storage/xtradb/log/log0recv.c b/storage/xtradb/log/log0recv.c
index 200b3b088a7..2aaffe4c031 100644
--- a/storage/xtradb/log/log0recv.c
+++ b/storage/xtradb/log/log0recv.c
@@ -567,10 +567,8 @@ recv_synchronize_groups(
ib_uint64_t start_lsn;
ib_uint64_t end_lsn;
ib_uint64_t recovered_lsn;
- ib_uint64_t limit_lsn;
recovered_lsn = recv_sys->recovered_lsn;
- limit_lsn = recv_sys->limit_lsn;
/* Read the last recovered log block to the recovery system buffer:
the block is always incomplete */
@@ -2901,7 +2899,6 @@ recv_init_crash_recovery(void)
/*==========================*/
{
ut_a(!recv_needed_recovery);
- ut_a(!srv_buffer_pool_shm_is_reused);
recv_needed_recovery = TRUE;
@@ -2964,7 +2961,9 @@ recv_recovery_from_checkpoint_start_func(
ib_uint64_t old_scanned_lsn;
ib_uint64_t group_scanned_lsn;
ib_uint64_t contiguous_lsn;
+#ifdef UNIV_LOG_ARCHIVE
ib_uint64_t archived_lsn;
+#endif /* UNIV_LOG_ARCHIVE */
byte* buf;
byte* log_hdr_buf;
byte log_hdr_buf_base[LOG_FILE_HDR_SIZE + OS_FILE_LOG_BLOCK_SIZE];
@@ -3022,7 +3021,9 @@ recv_recovery_from_checkpoint_start_func(
checkpoint_lsn = mach_read_ull(buf + LOG_CHECKPOINT_LSN);
checkpoint_no = mach_read_ull(buf + LOG_CHECKPOINT_NO);
+#ifdef UNIV_LOG_ARCHIVE
archived_lsn = mach_read_ull(buf + LOG_CHECKPOINT_ARCHIVED_LSN);
+#endif /* UNIV_LOG_ARCHIVE */
/* Read the first log file header to print a note if this is
a recovery from a restored InnoDB Hot Backup */
diff --git a/storage/xtradb/os/os0file.c b/storage/xtradb/os/os0file.c
index 48d796c38e1..7d47203e992 100644
--- a/storage/xtradb/os/os0file.c
+++ b/storage/xtradb/os/os0file.c
@@ -1222,10 +1222,12 @@ UNIV_INTERN
void
os_file_set_nocache(
/*================*/
- int fd, /*!< in: file descriptor to alter */
- const char* file_name, /*!< in: file name, used in the
- diagnostic message */
- const char* operation_name) /*!< in: "open" or "create"; used in the
+ int fd /*!< in: file descriptor to alter */
+ __attribute__((unused)),
+ const char* file_name /*!< in: used in the diagnostic message */
+ __attribute__((unused)),
+ const char* operation_name __attribute__((unused)))
+ /*!< in: "open" or "create"; used in the
diagnostic message */
{
/* some versions of Solaris may not have DIRECTIO_ON */
@@ -1407,8 +1409,6 @@ try_again:
int create_flag;
ibool retry;
const char* mode_str = NULL;
- const char* type_str = NULL;
- const char* purpose_str = NULL;
try_again:
ut_a(name);
@@ -1428,26 +1428,9 @@ try_again:
ut_error;
}
- if (type == OS_LOG_FILE) {
- type_str = "LOG";
- } else if (type == OS_DATA_FILE) {
- type_str = "DATA";
- } else {
- ut_error;
- }
-
- if (purpose == OS_FILE_AIO) {
- purpose_str = "AIO";
- } else if (purpose == OS_FILE_NORMAL) {
- purpose_str = "NORMAL";
- } else {
- ut_error;
- }
+ ut_a(type == OS_LOG_FILE || type == OS_DATA_FILE);
+ ut_a(purpose == OS_FILE_AIO || purpose == OS_FILE_NORMAL);
-#if 0
- fprintf(stderr, "Opening file %s, mode %s, type %s, purpose %s\n",
- name, mode_str, type_str, purpose_str);
-#endif
#ifdef O_SYNC
/* We let O_SYNC only affect log files; note that we map O_DSYNC to
O_SYNC because the datasync options seemed to corrupt files in 2001
@@ -2374,7 +2357,10 @@ _os_file_read(
ulint i;
#endif /* !UNIV_HOTBACKUP */
+ /* On 64-bit Windows, ulint is 64 bits. But offset and n should be
+ no more than 32 bits. */
ut_a((offset & 0xFFFFFFFFUL) == offset);
+ ut_a((n & 0xFFFFFFFFUL) == n);
os_n_file_reads++;
os_bytes_read_since_printout += n;
@@ -2498,7 +2484,10 @@ os_file_read_no_error_handling(
ulint i;
#endif /* !UNIV_HOTBACKUP */
+ /* On 64-bit Windows, ulint is 64 bits. But offset and n should be
+ no more than 32 bits. */
ut_a((offset & 0xFFFFFFFFUL) == offset);
+ ut_a((n & 0xFFFFFFFFUL) == n);
os_n_file_reads++;
os_bytes_read_since_printout += n;
@@ -2628,7 +2617,10 @@ os_file_write(
ulint i;
#endif /* !UNIV_HOTBACKUP */
- ut_a((offset & 0xFFFFFFFF) == offset);
+ /* On 64-bit Windows, ulint is 64 bits. But offset and n should be
+ no more than 32 bits. */
+ ut_a((offset & 0xFFFFFFFFUL) == offset);
+ ut_a((n & 0xFFFFFFFFUL) == n);
os_n_file_writes++;
@@ -3398,16 +3390,17 @@ os_aio_array_reserve_slot(
offset */
ulint offset_high, /*!< in: most significant 32 bits of
offset */
- ulint len, /*!< in: length of the block to read or write */
- trx_t* trx)
+ ulint len) /*!< in: length of the block to read or write */
{
os_aio_slot_t* slot;
-#ifdef WIN_ASYNC_IO
- OVERLAPPED* control;
-#endif
ulint i;
ulint slots_per_seg;
ulint local_seg;
+#ifdef WIN_ASYNC_IO
+ OVERLAPPED* control;
+
+ ut_a((len & 0xFFFFFFFFUL) == len);
+#endif
/* No need of a mutex. Only reading constant fields */
slots_per_seg = array->n_slots / array->n_segments;
@@ -3709,6 +3702,9 @@ os_aio(
ut_ad(n % OS_FILE_LOG_BLOCK_SIZE == 0);
ut_ad(offset % OS_FILE_LOG_BLOCK_SIZE == 0);
ut_ad(os_aio_validate());
+#ifdef WIN_ASYNC_IO
+ ut_ad((n & 0xFFFFFFFFUL) == n);
+#endif
wake_later = mode & OS_AIO_SIMULATED_WAKE_LATER;
mode = mode & (~OS_AIO_SIMULATED_WAKE_LATER);
@@ -3766,7 +3762,7 @@ try_again:
trx->io_read += n;
}
slot = os_aio_array_reserve_slot(type, array, message1, message2, file,
- name, buf, offset, offset_high, n, trx);
+ name, buf, offset, offset_high, n);
if (type == OS_FILE_READ) {
if (os_aio_use_native_aio) {
#ifdef WIN_ASYNC_IO
@@ -3954,16 +3950,18 @@ os_aio_windows_handle(
/* retry failed read/write operation synchronously.
No need to hold array->mutex. */
+ ut_a((slot->len & 0xFFFFFFFFUL) == slot->len);
+
switch (slot->type) {
case OS_FILE_WRITE:
ret = WriteFile(slot->file, slot->buf,
- slot->len, &len,
+ (DWORD) slot->len, &len,
&(slot->control));
break;
case OS_FILE_READ:
ret = ReadFile(slot->file, slot->buf,
- slot->len, &len,
+ (DWORD) slot->len, &len,
&(slot->control));
break;
diff --git a/storage/xtradb/os/os0proc.c b/storage/xtradb/os/os0proc.c
index 4567d96b6f4..48922886f23 100644
--- a/storage/xtradb/os/os0proc.c
+++ b/storage/xtradb/os/os0proc.c
@@ -229,173 +229,3 @@ os_mem_free_large(
}
#endif
}
-
-/****************************************************************//**
-Allocates or attaches and reuses shared memory segment.
-The content is not cleared automatically.
-@return allocated memory */
-UNIV_INTERN
-void*
-os_shm_alloc(
-/*=========*/
- ulint* n, /*!< in/out: number of bytes */
- uint key,
- ibool* is_new)
-{
- void* ptr;
-#if defined HAVE_SYS_IPC_H && HAVE_SYS_SHM_H
- ulint size;
- int shmid;
-
- *is_new = FALSE;
- fprintf(stderr,
- "InnoDB: The shared memory segment containing the buffer pool is: key %#x (%d).\n",
- key, key);
-# if defined HAVE_LARGE_PAGES && defined UNIV_LINUX
- if (!os_use_large_pages || !os_large_page_size) {
- goto skip;
- }
-
- /* Align block size to os_large_page_size */
- ut_ad(ut_is_2pow(os_large_page_size));
- size = ut_2pow_round(*n + (os_large_page_size - 1),
- os_large_page_size);
-
- shmid = shmget((key_t)key, (size_t)size,
- IPC_CREAT | IPC_EXCL | SHM_HUGETLB | SHM_R | SHM_W);
- if (shmid < 0) {
- if (errno == EEXIST) {
- fprintf(stderr,
- "InnoDB: HugeTLB: The shared memory segment exists.\n");
- shmid = shmget((key_t)key, (size_t)size,
- SHM_HUGETLB | SHM_R | SHM_W);
- if (shmid < 0) {
- fprintf(stderr,
- "InnoDB: HugeTLB: Warning: Failed to allocate %lu bytes. (reuse) errno %d\n",
- size, errno);
- goto skip;
- } else {
- fprintf(stderr,
- "InnoDB: HugeTLB: The existent shared memory segment is used.\n");
- }
- } else {
- fprintf(stderr,
- "InnoDB: HugeTLB: Warning: Failed to allocate %lu bytes. (new) errno %d\n",
- size, errno);
- goto skip;
- }
- } else {
- *is_new = TRUE;
- fprintf(stderr,
- "InnoDB: HugeTLB: A new shared memory segment has been created .\n");
- }
-
- ptr = shmat(shmid, NULL, 0);
- if (ptr == (void *)-1) {
- fprintf(stderr,
- "InnoDB: HugeTLB: Warning: Failed to attach shared memory segment, errno %d\n",
- errno);
- ptr = NULL;
- }
-
- if (ptr) {
- *n = size;
- os_fast_mutex_lock(&ut_list_mutex);
- ut_total_allocated_memory += size;
- os_fast_mutex_unlock(&ut_list_mutex);
- UNIV_MEM_ALLOC(ptr, size);
- return(ptr);
- }
-skip:
- *is_new = FALSE;
-# endif /* HAVE_LARGE_PAGES && defined UNIV_LINUX */
-# ifdef HAVE_GETPAGESIZE
- size = getpagesize();
-# else
- size = UNIV_PAGE_SIZE;
-# endif
- /* Align block size to system page size */
- ut_ad(ut_is_2pow(size));
- size = *n = ut_2pow_round(*n + (size - 1), size);
-
- shmid = shmget((key_t)key, (size_t)size,
- IPC_CREAT | IPC_EXCL | SHM_R | SHM_W);
- if (shmid < 0) {
- if (errno == EEXIST) {
- fprintf(stderr,
- "InnoDB: A shared memory segment containing the buffer pool seems to already exist.\n");
- shmid = shmget((key_t)key, (size_t)size,
- SHM_R | SHM_W);
- if (shmid < 0) {
- fprintf(stderr,
- "InnoDB: Warning: Failed to allocate %lu bytes. (reuse) errno %d\n",
- size, errno);
- ptr = NULL;
- goto end;
- } else {
- fprintf(stderr,
- "InnoDB: The existent shared memory segment is used.\n");
- }
- } else {
- fprintf(stderr,
- "InnoDB: Warning: Failed to allocate %lu bytes. (new) errno %d\n",
- size, errno);
- ptr = NULL;
- goto end;
- }
- } else {
- *is_new = TRUE;
- fprintf(stderr,
- "InnoDB: A new shared memory segment has been created.\n");
- }
-
- ptr = shmat(shmid, NULL, 0);
- if (ptr == (void *)-1) {
- fprintf(stderr,
- "InnoDB: Warning: Failed to attach shared memory segment, errno %d\n",
- errno);
- ptr = NULL;
- }
-
- if (ptr) {
- *n = size;
- os_fast_mutex_lock(&ut_list_mutex);
- ut_total_allocated_memory += size;
- os_fast_mutex_unlock(&ut_list_mutex);
- UNIV_MEM_ALLOC(ptr, size);
- }
-end:
-#else /* HAVE_SYS_IPC_H && HAVE_SYS_SHM_H */
- fprintf(stderr, "InnoDB: shared memory segment is not supported.\n");
- ptr = NULL;
-#endif /* HAVE_SYS_IPC_H && HAVE_SYS_SHM_H */
- return(ptr);
-}
-
-/****************************************************************//**
-Detach shared memory segment. */
-UNIV_INTERN
-void
-os_shm_free(
-/*========*/
- void *ptr, /*!< in: pointer returned by
- os_shm_alloc() */
- ulint size) /*!< in: size returned by
- os_shm_alloc() */
-{
- os_fast_mutex_lock(&ut_list_mutex);
- ut_a(ut_total_allocated_memory >= size);
- os_fast_mutex_unlock(&ut_list_mutex);
-
-#if defined HAVE_SYS_IPC_H && HAVE_SYS_SHM_H
- if (!shmdt(ptr)) {
- os_fast_mutex_lock(&ut_list_mutex);
- ut_a(ut_total_allocated_memory >= size);
- ut_total_allocated_memory -= size;
- os_fast_mutex_unlock(&ut_list_mutex);
- UNIV_MEM_FREE(ptr, size);
- }
-#else /* HAVE_SYS_IPC_H && HAVE_SYS_SHM_H */
- fprintf(stderr, "InnoDB: shared memory segment is not supported.\n");
-#endif /* HAVE_SYS_IPC_H && HAVE_SYS_SHM_H */
-}
diff --git a/storage/xtradb/plug.in b/storage/xtradb/plug.in
index 37c895fb520..b68b59725d4 100644
--- a/storage/xtradb/plug.in
+++ b/storage/xtradb/plug.in
@@ -17,7 +17,7 @@
MYSQL_STORAGE_ENGINE(xtradb, xtradb, [XtraDB Storage Engine],
[XtraDB - a drop-in replacement for InnoDB], [max,max-no-ndb])
MYSQL_PLUGIN_DIRECTORY(xtradb, [storage/xtradb])
-MYSQL_PLUGIN_STATIC(xtradb, [libxtradb.a])
+MYSQL_PLUGIN_STATIC(xtradb, [libxtradb.la])
MYSQL_PLUGIN_DYNAMIC(xtradb, [ha_xtradb.la])
MYSQL_PLUGIN_ACTIONS(xtradb, [
with_plugin_innobase=$with_plugin_xtradb # for legacy code in configure.in
@@ -141,10 +141,11 @@ MYSQL_PLUGIN_ACTIONS(xtradb, [
AC_MSG_CHECKING(whether Solaris libc atomic functions are available)
# either define HAVE_IB_SOLARIS_ATOMICS or not
- AC_CHECK_FUNCS(atomic_add_long \
+ AC_CHECK_FUNCS(atomic_cas_ulong \
atomic_cas_32 \
atomic_cas_64 \
- atomic_cas_ulong,
+ atomic_add_long_nv \
+ atomic_swap_uchar,
AC_DEFINE([HAVE_IB_SOLARIS_ATOMICS], [1],
[Define to 1 if Solaris libc atomic functions \
diff --git a/storage/xtradb/que/que0que.c b/storage/xtradb/que/que0que.c
index 5c85a04d139..9c1d61c1731 100644
--- a/storage/xtradb/que/que0que.c
+++ b/storage/xtradb/que/que0que.c
@@ -1298,18 +1298,13 @@ que_run_threads_low(
que_thr_t* thr) /*!< in: query thread */
{
que_thr_t* next_thr;
- ulint cumul_resource;
ulint loop_count;
ut_ad(thr->state == QUE_THR_RUNNING);
ut_a(thr_get_trx(thr)->error_state == DB_SUCCESS);
ut_ad(!mutex_own(&kernel_mutex));
- /* cumul_resource counts how much resources the OS thread (NOT the
- query thread) has spent in this function */
-
loop_count = QUE_MAX_LOOPS_WITHOUT_CHECK;
- cumul_resource = 0;
loop:
/* Check that there is enough space in the log to accommodate
possible log entries by this query step; if the operation can touch
diff --git a/storage/xtradb/row/row0mysql.c b/storage/xtradb/row/row0mysql.c
index 56754404b65..e9b272abab4 100644
--- a/storage/xtradb/row/row0mysql.c
+++ b/storage/xtradb/row/row0mysql.c
@@ -445,7 +445,7 @@ row_mysql_convert_row_to_innobase(
row is used, as row may contain
pointers to this record! */
{
- mysql_row_templ_t* templ;
+ const mysql_row_templ_t*templ;
dfield_t* dfield;
ulint i;
@@ -1444,7 +1444,12 @@ run_again:
srv_n_rows_updated++;
}
- row_update_statistics_if_needed(prebuilt->table);
+ /* We update table statistics only if it is a DELETE or UPDATE
+ that changes indexed columns, UPDATEs that change only non-indexed
+ columns would not affect statistics. */
+ if (node->is_delete || !(node->cmpl_info & UPD_NODE_NO_ORD_CHANGE)) {
+ row_update_statistics_if_needed(prebuilt->table);
+ }
trx->op_info = "";
@@ -1599,6 +1604,9 @@ row_update_cascade_for_mysql(
trx = thr_get_trx(thr);
+ /* Increment fk_cascade_depth to record the recursive call depth on
+ a single update/delete that affects multiple tables chained
+ together with foreign key relations. */
thr->fk_cascade_depth++;
if (thr->fk_cascade_depth > FK_MAX_CASCADE_DEL) {
@@ -1610,6 +1618,12 @@ run_again:
row_upd_step(thr);
+ /* The recursive call for cascading update/delete happens
+ in above row_upd_step(), reset the counter once we come
+ out of the recursive call, so it does not accumulate for
+ different row deletes */
+ thr->fk_cascade_depth = 0;
+
err = trx->error_state;
/* Note that the cascade node is a subnode of another InnoDB
@@ -1876,15 +1890,13 @@ err_exit:
err = trx->error_state;
- if (UNIV_UNLIKELY(err != DB_SUCCESS)) {
+ switch (err) {
+ case DB_SUCCESS:
+ break;
+ case DB_OUT_OF_FILE_SPACE:
trx->error_state = DB_SUCCESS;
trx_general_rollback_for_mysql(trx, NULL);
- /* TO DO: free table? The code below will dereference
- table->name, though. */
- }
- switch (err) {
- case DB_OUT_OF_FILE_SPACE:
ut_print_timestamp(stderr);
fputs(" InnoDB: Warning: cannot create table ",
stderr);
@@ -1899,9 +1911,13 @@ err_exit:
break;
case DB_DUPLICATE_KEY:
+ default:
/* We may also get err == DB_ERROR if the .ibd file for the
table already exists */
+ trx->error_state = DB_SUCCESS;
+ trx_general_rollback_for_mysql(trx, NULL);
+ dict_mem_table_free(table);
break;
}
@@ -2816,15 +2832,6 @@ row_truncate_table_for_mysql(
trx->table_id = table->id;
- /* Lock all index trees for this table, as we will
- truncate the table/index and possibly change their metadata.
- All DML/DDL are blocked by table level lock, with
- a few exceptions such as queries into information schema
- about the table, MySQL could try to access index stats
- for this kind of query, we need to use index locks to
- sync up */
- dict_table_x_lock_indexes(table);
-
if (table->space && !table->dir_path_of_temp_table) {
/* Discard and create the single-table tablespace. */
ulint space = table->space;
@@ -2837,6 +2844,11 @@ row_truncate_table_for_mysql(
dict_hdr_get_new_id(NULL, NULL, &space);
+ /* Lock all index trees for this table. We must
+ do so after dict_hdr_get_new_id() to preserve
+ the latch order */
+ dict_table_x_lock_indexes(table);
+
if (space == ULINT_UNDEFINED
|| fil_create_new_single_table_tablespace(
space, table->name, FALSE, flags,
@@ -2870,6 +2882,15 @@ row_truncate_table_for_mysql(
FIL_IBD_FILE_INITIAL_SIZE, &mtr);
mtr_commit(&mtr);
}
+ } else {
+ /* Lock all index trees for this table, as we will
+ truncate the table/index and possibly change their metadata.
+ All DML/DDL are blocked by table level lock, with
+ a few exceptions such as queries into information schema
+ about the table, MySQL could try to access index stats
+ for this kind of query, we need to use index locks to
+ sync up */
+ dict_table_x_lock_indexes(table);
}
/* scan SYS_INDEXES for all indexes of the table */
diff --git a/storage/xtradb/row/row0purge.c b/storage/xtradb/row/row0purge.c
index 835af990672..31b255cf2d4 100644
--- a/storage/xtradb/row/row0purge.c
+++ b/storage/xtradb/row/row0purge.c
@@ -684,7 +684,9 @@ row_purge_step(
que_thr_t* thr) /*!< in: query thread */
{
purge_node_t* node;
+#ifdef UNIV_DEBUG
ulint err;
+#endif /* UNIV_DEBUG */
ut_ad(thr);
@@ -692,7 +694,10 @@ row_purge_step(
ut_ad(que_node_get_type(node) == QUE_NODE_PURGE);
- err = row_purge(node, thr);
+#ifdef UNIV_DEBUG
+ err =
+#endif /* UNIV_DEBUG */
+ row_purge(node, thr);
ut_ad(err == DB_SUCCESS);
diff --git a/storage/xtradb/row/row0sel.c b/storage/xtradb/row/row0sel.c
index a1511e35435..82ad30bb390 100644
--- a/storage/xtradb/row/row0sel.c
+++ b/storage/xtradb/row/row0sel.c
@@ -2675,39 +2675,39 @@ row_sel_store_mysql_rec(
row_prebuilt_t* prebuilt, /*!< in: prebuilt struct */
const rec_t* rec, /*!< in: Innobase record in the index
which was described in prebuilt's
- template; must be protected by
- a page latch */
+ template, or in the clustered index;
+ must be protected by a page latch */
+ ibool rec_clust, /*!< in: TRUE if rec is in the
+ clustered index instead of
+ prebuilt->index */
const ulint* offsets) /*!< in: array returned by
- rec_get_offsets() */
+ rec_get_offsets(rec) */
{
- mysql_row_templ_t* templ;
- mem_heap_t* extern_field_heap = NULL;
- mem_heap_t* heap;
- const byte* data;
- ulint len;
- ulint i;
+ mem_heap_t* extern_field_heap = NULL;
+ mem_heap_t* heap;
+ ulint i;
ut_ad(prebuilt->mysql_template);
ut_ad(prebuilt->default_rec);
ut_ad(rec_offs_validate(rec, NULL, offsets));
+ ut_ad(!rec_get_deleted_flag(rec, rec_offs_comp(offsets)));
if (UNIV_LIKELY_NULL(prebuilt->blob_heap)) {
mem_heap_free(prebuilt->blob_heap);
prebuilt->blob_heap = NULL;
}
- /* init null bytes with default values as they might be
- left uninitialized in some cases and these uninited bytes
- might be copied into mysql record buffer that leads to
- valgrind warnings */
- memcpy(mysql_rec, prebuilt->default_rec, prebuilt->null_bitmap_len);
-
for (i = 0; i < prebuilt->n_template; i++) {
- templ = prebuilt->mysql_template + i;
+ const mysql_row_templ_t*templ = prebuilt->mysql_template + i;
+ const byte* data;
+ ulint len;
+ ulint field_no;
+
+ field_no = rec_clust
+ ? templ->clust_rec_field_no : templ->rec_field_no;
- if (UNIV_UNLIKELY(rec_offs_nth_extern(offsets,
- templ->rec_field_no))) {
+ if (UNIV_UNLIKELY(rec_offs_nth_extern(offsets, field_no))) {
/* Copy an externally stored field to the temporary
heap */
@@ -2735,7 +2735,7 @@ row_sel_store_mysql_rec(
data = btr_rec_copy_externally_stored_field(
rec, offsets,
dict_table_zip_size(prebuilt->table),
- templ->rec_field_no, &len, heap);
+ field_no, &len, heap);
if (UNIV_UNLIKELY(!data)) {
/* The externally stored field
@@ -2756,8 +2756,7 @@ row_sel_store_mysql_rec(
} else {
/* Field is stored in the row. */
- data = rec_get_nth_field(rec, offsets,
- templ->rec_field_no, &len);
+ data = rec_get_nth_field(rec, offsets, field_no, &len);
if (UNIV_UNLIKELY(templ->type == DATA_BLOB)
&& len != UNIV_SQL_NULL) {
@@ -3119,7 +3118,7 @@ row_sel_pop_cached_row_for_mysql(
row_prebuilt_t* prebuilt) /*!< in: prebuilt struct */
{
ulint i;
- mysql_row_templ_t* templ;
+ const mysql_row_templ_t*templ;
byte* cached_rec;
ut_ad(prebuilt->n_fetch_cached > 0);
ut_ad(prebuilt->mysql_prefix_len <= prebuilt->mysql_row_len);
@@ -3176,15 +3175,21 @@ ibool
row_sel_push_cache_row_for_mysql(
/*=============================*/
row_prebuilt_t* prebuilt, /*!< in: prebuilt struct */
- const rec_t* rec, /*!< in: record to push; must
- be protected by a page latch */
- const ulint* offsets) /*!< in: rec_get_offsets() */
+ const rec_t* rec, /*!< in: record to push, in the index
+ which was described in prebuilt's
+ template, or in the clustered index;
+ must be protected by a page latch */
+ ibool rec_clust, /*!< in: TRUE if rec is in the
+ clustered index instead of
+ prebuilt->index */
+ const ulint* offsets) /*!< in: rec_get_offsets(rec) */
{
byte* buf;
ulint i;
ut_ad(prebuilt->n_fetch_cached < MYSQL_FETCH_CACHE_SIZE);
ut_ad(rec_offs_validate(rec, NULL, offsets));
+ ut_ad(!rec_get_deleted_flag(rec, rec_offs_comp(offsets)));
ut_a(!prebuilt->templ_contains_blob);
if (prebuilt->fetch_cache[0] == NULL) {
@@ -3213,7 +3218,7 @@ row_sel_push_cache_row_for_mysql(
if (UNIV_UNLIKELY(!row_sel_store_mysql_rec(
prebuilt->fetch_cache[
prebuilt->n_fetch_cached],
- prebuilt, rec, offsets))) {
+ prebuilt, rec, rec_clust, offsets))) {
return(FALSE);
}
@@ -3356,6 +3361,7 @@ row_search_for_mysql(
mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_;
+ ibool table_lock_waited = FALSE;
ibool problematic_use = FALSE;
rec_offs_init(offsets_);
@@ -3399,6 +3405,12 @@ row_search_for_mysql(
ut_error;
}
+ /* init null bytes with default values as they might be
+ left uninitialized in some cases and these uninited bytes
+ might be copied into mysql record buffer that leads to
+ valgrind warnings */
+ memcpy(buf, prebuilt->default_rec, prebuilt->null_bitmap_len);
+
#if 0
/* August 19, 2005 by Heikki: temporarily disable this error
print until the cursor lock count is done correctly.
@@ -3614,7 +3626,8 @@ row_search_for_mysql(
ut_ad(!rec_get_deleted_flag(rec, comp));
if (!row_sel_store_mysql_rec(buf, prebuilt,
- rec, offsets)) {
+ rec, FALSE,
+ offsets)) {
/* Only fresh inserts may contain
incomplete externally stored
columns. Pretend that such
@@ -3720,6 +3733,61 @@ release_search_latch_if_needed:
clust_index = dict_table_get_first_index(index->table);
+ /* Do some start-of-statement preparations */
+
+ if (!prebuilt->mysql_has_locked) {
+ fprintf(stderr, "InnoDB: Error: row_search_for_mysql() is called without ha_innobase::external_lock()\n");
+ if (trx->mysql_thd != NULL) {
+ innobase_mysql_print_thd(stderr, trx->mysql_thd, 600);
+ }
+ problematic_use = TRUE;
+ }
+retry_check:
+
+ if (!prebuilt->sql_stat_start) {
+ /* No need to set an intention lock or assign a read view */
+
+ if (trx->read_view == NULL
+ && prebuilt->select_lock_type == LOCK_NONE) {
+
+ fputs("InnoDB: Error: MySQL is trying to"
+ " perform a consistent read\n"
+ "InnoDB: but the read view is not assigned!\n",
+ stderr);
+ if (problematic_use) {
+ fprintf(stderr, "InnoDB: It may be caused by calling "
+ "without ha_innobase::external_lock()\n"
+ "InnoDB: For the first-aid, avoiding the crash. "
+ "But it should be fixed ASAP.\n");
+ prebuilt->sql_stat_start = TRUE;
+ goto retry_check;
+ }
+ trx_print(stderr, trx, 600);
+ fputc('\n', stderr);
+ ut_error;
+ }
+ } else if (prebuilt->select_lock_type == LOCK_NONE) {
+ /* This is a consistent read */
+ /* Assign a read view for the query */
+
+ trx_assign_read_view(trx);
+ prebuilt->sql_stat_start = FALSE;
+ } else {
+wait_table_again:
+ err = lock_table(0, index->table,
+ prebuilt->select_lock_type == LOCK_S
+ ? LOCK_IS : LOCK_IX, thr);
+
+ if (err != DB_SUCCESS) {
+
+ table_lock_waited = TRUE;
+ goto lock_table_wait;
+ }
+ prebuilt->sql_stat_start = FALSE;
+ }
+
+ /* Open or restore index cursor position */
+
if (UNIV_LIKELY(direction != 0)) {
ibool need_to_process = sel_restore_position_for_mysql(
&same_user_rec, BTR_SEARCH_LEAF,
@@ -3795,59 +3863,6 @@ release_search_latch_if_needed:
}
}
- if (!prebuilt->mysql_has_locked) {
- fprintf(stderr, "InnoDB: Error: row_search_for_mysql() is called without ha_innobase::external_lock()\n");
- if (trx->mysql_thd != NULL) {
- innobase_mysql_print_thd(stderr, trx->mysql_thd, 600);
- }
- problematic_use = TRUE;
- }
-retry_check:
-
- if (!prebuilt->sql_stat_start) {
- /* No need to set an intention lock or assign a read view */
-
- if (trx->read_view == NULL
- && prebuilt->select_lock_type == LOCK_NONE) {
-
- fputs("InnoDB: Error: MySQL is trying to"
- " perform a consistent read\n"
- "InnoDB: but the read view is not assigned!\n",
- stderr);
- if (problematic_use) {
- fprintf(stderr, "InnoDB: It may be caused by calling "
- "without ha_innobase::external_lock()\n"
- "InnoDB: For the first-aid, avoiding the crash. "
- "But it should be fixed ASAP.\n");
- prebuilt->sql_stat_start = TRUE;
- goto retry_check;
- }
- trx_print(stderr, trx, 600);
- fputc('\n', stderr);
- ut_a(0);
- }
- } else if (prebuilt->select_lock_type == LOCK_NONE) {
- /* This is a consistent read */
- /* Assign a read view for the query */
-
- trx_assign_read_view(trx);
- prebuilt->sql_stat_start = FALSE;
- } else {
- ulint lock_mode;
- if (prebuilt->select_lock_type == LOCK_S) {
- lock_mode = LOCK_IS;
- } else {
- lock_mode = LOCK_IX;
- }
- err = lock_table(0, index->table, lock_mode, thr);
-
- if (err != DB_SUCCESS) {
-
- goto lock_wait_or_error;
- }
- prebuilt->sql_stat_start = FALSE;
- }
-
rec_loop:
/*-------------------------------------------------------------*/
/* PHASE 4: Look for matching records in a loop */
@@ -4270,7 +4285,6 @@ no_gap_lock:
is necessary, because we can only get the undo
information via the clustered index record. */
- ut_ad(index != clust_index);
ut_ad(!dict_index_is_clust(index));
if (!lock_sec_rec_cons_read_sees(
@@ -4386,26 +4400,10 @@ requires_clust_rec:
goto next_rec;
}
- if (prebuilt->need_to_access_clustered) {
-
- result_rec = clust_rec;
-
- ut_ad(rec_offs_validate(result_rec, clust_index,
- offsets));
- } else {
- /* We used 'offsets' for the clust rec, recalculate
- them for 'rec' */
- offsets = rec_get_offsets(rec, index, offsets,
- ULINT_UNDEFINED, &heap);
- result_rec = rec;
- }
-
- /* result_rec can legitimately be delete-marked
- now that it has been established that it points to a
- clustered index record that exists in the read view. */
+ result_rec = clust_rec;
+ ut_ad(rec_offs_validate(result_rec, clust_index, offsets));
} else {
result_rec = rec;
- ut_ad(!rec_get_deleted_flag(rec, comp));
}
/* We found a qualifying record 'result_rec'. At this point,
@@ -4414,6 +4412,7 @@ requires_clust_rec:
ut_ad(rec_offs_validate(result_rec,
result_rec != rec ? clust_index : index,
offsets));
+ ut_ad(!rec_get_deleted_flag(result_rec, comp));
/* At this point, the clustered index record is protected
by a page latch that was acquired when pcur was positioned.
@@ -4438,6 +4437,7 @@ requires_clust_rec:
cursor. */
if (!row_sel_push_cache_row_for_mysql(prebuilt, result_rec,
+ result_rec != rec,
offsets)) {
/* Only fresh inserts may contain incomplete
externally stored columns. Pretend that such
@@ -4455,15 +4455,31 @@ requires_clust_rec:
goto next_rec;
} else {
- if (prebuilt->template_type == ROW_MYSQL_DUMMY_TEMPLATE) {
+ if (UNIV_UNLIKELY
+ (prebuilt->template_type == ROW_MYSQL_DUMMY_TEMPLATE)) {
+ /* CHECK TABLE: fetch the row */
+
+ if (result_rec != rec
+ && !prebuilt->need_to_access_clustered) {
+ /* We used 'offsets' for the clust
+ rec, recalculate them for 'rec' */
+ offsets = rec_get_offsets(rec, index, offsets,
+ ULINT_UNDEFINED,
+ &heap);
+ result_rec = rec;
+ }
+
memcpy(buf + 4, result_rec
- rec_offs_extra_size(offsets),
rec_offs_size(offsets));
mach_write_to_4(buf,
rec_offs_extra_size(offsets) + 4);
} else {
- if (!row_sel_store_mysql_rec(buf, prebuilt,
- result_rec, offsets)) {
+ /* Returning a row to MySQL */
+
+ if (!row_sel_store_mysql_rec(buf, prebuilt, result_rec,
+ result_rec != rec,
+ offsets)) {
/* Only fresh inserts may contain
incomplete externally stored
columns. Pretend that such records do
@@ -4584,6 +4600,7 @@ lock_wait_or_error:
btr_pcur_store_position(pcur, &mtr);
+lock_table_wait:
mtr_commit(&mtr);
mtr_has_extra_clust_latch = FALSE;
@@ -4601,6 +4618,14 @@ lock_wait_or_error:
thr->lock_state = QUE_THR_LOCK_NOLOCK;
mtr_start(&mtr);
+ /* Table lock waited, go try to obtain table lock
+ again */
+ if (table_lock_waited) {
+ table_lock_waited = FALSE;
+
+ goto wait_table_again;
+ }
+
sel_restore_position_for_mysql(&same_user_rec,
BTR_SEARCH_LEAF, pcur,
moves_up, &mtr);
diff --git a/storage/xtradb/row/row0umod.c b/storage/xtradb/row/row0umod.c
index 8464b0f95cc..5998dadd16d 100644
--- a/storage/xtradb/row/row0umod.c
+++ b/storage/xtradb/row/row0umod.c
@@ -114,12 +114,17 @@ row_undo_mod_clust_low(
btr_pcur_t* pcur;
btr_cur_t* btr_cur;
ulint err;
+#ifdef UNIV_DEBUG
ibool success;
+#endif /* UNIV_DEBUG */
pcur = &(node->pcur);
btr_cur = btr_pcur_get_btr_cur(pcur);
- success = btr_pcur_restore_position(mode, pcur, mtr);
+#ifdef UNIV_DEBUG
+ success =
+#endif /* UNIV_DEBUG */
+ btr_pcur_restore_position(mode, pcur, mtr);
ut_ad(success);
diff --git a/storage/xtradb/row/row0upd.c b/storage/xtradb/row/row0upd.c
index 04c3139fcc7..444003ba3f0 100644
--- a/storage/xtradb/row/row0upd.c
+++ b/storage/xtradb/row/row0upd.c
@@ -466,8 +466,11 @@ row_upd_changes_field_size_or_external(
#endif /* !UNIV_HOTBACKUP */
/***********************************************************//**
-Replaces the new column values stored in the update vector to the record
-given. No field size changes are allowed. */
+Replaces the new column values stored in the update vector to the
+record given. No field size changes are allowed. This function is
+usually invoked on a clustered index. The only use case for a
+secondary index is row_ins_sec_index_entry_by_modify() or its
+counterpart in ibuf_insert_to_index_page(). */
UNIV_INTERN
void
row_upd_rec_in_place(
diff --git a/storage/xtradb/row/row0vers.c b/storage/xtradb/row/row0vers.c
index a4fbb5289aa..b6d35363f08 100644
--- a/storage/xtradb/row/row0vers.c
+++ b/storage/xtradb/row/row0vers.c
@@ -71,7 +71,9 @@ row_vers_impl_x_locked_off_kernel(
warning */
trx_t* trx;
ulint rec_del;
+#ifdef UNIV_DEBUG
ulint err;
+#endif /* UNIV_DEBUG */
mtr_t mtr;
ulint comp;
@@ -169,9 +171,12 @@ row_vers_impl_x_locked_off_kernel(
heap2 = heap;
heap = mem_heap_create(1024);
- err = trx_undo_prev_version_build(clust_rec, &mtr, version,
- clust_index, clust_offsets,
- heap, &prev_version);
+#ifdef UNIV_DEBUG
+ err =
+#endif /* UNIV_DEBUG */
+ trx_undo_prev_version_build(clust_rec, &mtr, version,
+ clust_index, clust_offsets,
+ heap, &prev_version);
mem_heap_free(heap2); /* free version and clust_offsets */
if (prev_version == NULL) {
diff --git a/storage/xtradb/srv/srv0srv.c b/storage/xtradb/srv/srv0srv.c
index 43799aab196..637b9e2df28 100644
--- a/storage/xtradb/srv/srv0srv.c
+++ b/storage/xtradb/srv/srv0srv.c
@@ -211,11 +211,6 @@ UNIV_INTERN ulint srv_buf_pool_curr_size = 0;
UNIV_INTERN ulint srv_mem_pool_size = ULINT_MAX;
UNIV_INTERN ulint srv_lock_table_size = ULINT_MAX;
-/* key value for shm */
-UNIV_INTERN uint srv_buffer_pool_shm_key = 0;
-UNIV_INTERN ibool srv_buffer_pool_shm_is_reused = FALSE;
-UNIV_INTERN ibool srv_buffer_pool_shm_checksum = TRUE;
-
/* This parameter is deprecated. Use srv_n_io_[read|write]_threads
instead. */
UNIV_INTERN ulint srv_n_file_io_threads = ULINT_MAX;
@@ -704,7 +699,7 @@ UNIV_INTERN srv_slot_t* srv_mysql_table = NULL;
UNIV_INTERN os_event_t srv_lock_timeout_thread_event;
-UNIV_INTERN os_event_t srv_purge_thread_event;
+UNIV_INTERN os_event_t srv_shutdown_event;
UNIV_INTERN srv_sys_t* srv_sys = NULL;
@@ -1011,7 +1006,7 @@ srv_init(void)
}
srv_lock_timeout_thread_event = os_event_create(NULL);
- srv_purge_thread_event = os_event_create(NULL);
+ srv_shutdown_event = os_event_create(NULL);
for (i = 0; i < SRV_MASTER + 1; i++) {
srv_n_threads_active[i] = 0;
@@ -1130,7 +1125,7 @@ retry:
enter_innodb_with_tickets(trx);
return;
}
- os_atomic_increment_lint(&srv_conc_n_threads, -1);
+ (void) os_atomic_increment_lint(&srv_conc_n_threads, -1);
}
if (!has_yielded)
{
@@ -1160,7 +1155,7 @@ retry:
static void
srv_conc_exit_innodb_timer_based(trx_t* trx)
{
- os_atomic_increment_lint(&srv_conc_n_threads, -1);
+ (void) os_atomic_increment_lint(&srv_conc_n_threads, -1);
trx->declared_to_be_inside_innodb = FALSE;
trx->n_tickets_to_enter_innodb = 0;
return;
@@ -1367,7 +1362,7 @@ srv_conc_force_enter_innodb(
ut_ad(srv_conc_n_threads >= 0);
#ifdef HAVE_ATOMIC_BUILTINS
if (srv_thread_concurrency_timer_based) {
- os_atomic_increment_lint(&srv_conc_n_threads, 1);
+ (void) os_atomic_increment_lint(&srv_conc_n_threads, 1);
trx->declared_to_be_inside_innodb = TRUE;
trx->n_tickets_to_enter_innodb = 1;
return;
@@ -2239,7 +2234,7 @@ loop:
/* Wake up every 5 seconds to see if we need to print
monitor information. */
- os_thread_sleep(5000000);
+ os_event_wait_time(srv_shutdown_event, 5000000);
current_time = time(NULL);
@@ -2381,7 +2376,7 @@ loop:
/* When someone is waiting for a lock, we wake up every second
and check if a timeout has passed for a lock wait */
- os_thread_sleep(1000000);
+ os_event_wait_time(srv_shutdown_event, 1000000);
srv_lock_timeout_active = TRUE;
@@ -2546,7 +2541,7 @@ loop:
fflush(stderr);
- os_thread_sleep(1000000);
+ os_event_wait_time(srv_shutdown_event, 1000000);
if (srv_shutdown_state < SRV_SHUTDOWN_CLEANUP) {
@@ -2590,7 +2585,7 @@ srv_LRU_dump_restore_thread(
last_dump_time = time(NULL);
loop:
- os_thread_sleep(5000000);
+ os_event_wait_time(srv_shutdown_event, 5000000);
if (srv_shutdown_state >= SRV_SHUTDOWN_CLEANUP) {
goto exit_func;
@@ -2754,7 +2749,7 @@ loop:
if (!skip_sleep) {
- os_thread_sleep(1000000);
+ os_event_wait_time(srv_shutdown_event, 1000000);
srv_main_sleeps++;
/*
@@ -3340,10 +3335,10 @@ loop:
mutex_exit(&kernel_mutex);
sleep_ms = 10;
- os_event_reset(srv_purge_thread_event);
+ os_event_reset(srv_shutdown_event);
}
- os_event_wait_time(srv_purge_thread_event, sleep_ms * 1000);
+ os_event_wait_time(srv_shutdown_event, sleep_ms * 1000);
history_len = trx_sys->rseg_history_len;
if (history_len > 1000)
diff --git a/storage/xtradb/srv/srv0start.c b/storage/xtradb/srv/srv0start.c
index b36faf2d2d7..27804e78a32 100644
--- a/storage/xtradb/srv/srv0start.c
+++ b/storage/xtradb/srv/srv0start.c
@@ -463,7 +463,6 @@ io_handler_thread(
the aio array */
{
ulint segment;
- ulint i;
segment = *((ulint*)arg);
@@ -471,7 +470,7 @@ io_handler_thread(
fprintf(stderr, "Io handler thread %lu starts, id %lu\n", segment,
os_thread_pf(os_thread_get_curr_id()));
#endif
- for (i = 0;; i++) {
+ while (srv_shutdown_state != SRV_SHUTDOWN_EXIT_THREADS) {
fil_aio_wait(segment);
mutex_enter(&ios_mutex);
@@ -479,8 +478,6 @@ io_handler_thread(
mutex_exit(&ios_mutex);
}
- thr_local_free(os_thread_get_curr_id());
-
/* We count the number of threads in os_thread_exit(). A created
thread should always use that to exit and not use return() to exit.
The thread actually never comes here because it is exited in an
@@ -1719,8 +1716,6 @@ innobase_start_or_create_for_mysql(void)
Note that this is not as heavy weight as it seems. At
this point there will be only ONE page in the buf_LRU
and there must be no page in the buf_flush list. */
- /* buffer_pool_shm should not be reused when recovery was needed. */
- if (!srv_buffer_pool_shm_is_reused)
buf_pool_invalidate();
/* We always try to do a recovery, even if the database had
@@ -2093,7 +2088,7 @@ innobase_shutdown_for_mysql(void)
#ifdef __NETWARE__
if (!panic_shutdown)
#endif
- logs_empty_and_mark_files_at_shutdown();
+ logs_empty_and_mark_files_at_shutdown();
if (srv_conc_n_threads != 0) {
fprintf(stderr,
diff --git a/storage/xtradb/sync/sync0rw.c b/storage/xtradb/sync/sync0rw.c
index 9e10f6e943b..f1018522fdf 100644
--- a/storage/xtradb/sync/sync0rw.c
+++ b/storage/xtradb/sync/sync0rw.c
@@ -247,12 +247,11 @@ rw_lock_create_func(
lock->mutex.cmutex_name = cmutex_name;
ut_d(lock->mutex.mutex_type = 1);
-#else /* INNODB_RW_LOCKS_USE_ATOMICS */
-# ifdef UNIV_DEBUG
- UT_NOT_USED(cfile_name);
- UT_NOT_USED(cline);
-# endif
#endif /* INNODB_RW_LOCKS_USE_ATOMICS */
+#if defined(INNODB_RW_LOCKS_USE_ATOMICS) || !defined(UNIV_DEBUG)
+ (void) cfile_name;
+ (void) cline;
+#endif
lock->lock_word = X_LOCK_DECR;
lock->waiters = 0;
diff --git a/storage/xtradb/sync/sync0sync.c b/storage/xtradb/sync/sync0sync.c
index 225f28df78e..71b444dbe54 100644
--- a/storage/xtradb/sync/sync0sync.c
+++ b/storage/xtradb/sync/sync0sync.c
@@ -266,6 +266,9 @@ mutex_create_func(
#ifdef UNIV_DEBUG
mutex->cfile_name = cfile_name;
mutex->cline = cline;
+#else
+ (void) cfile_name;
+ (void) cline;
#endif /* UNIV_DEBUG */
mutex->count_os_wait = 0;
mutex->cmutex_name= cmutex_name;
diff --git a/storage/xtradb/trx/trx0i_s.c b/storage/xtradb/trx/trx0i_s.c
index 5bc8302d0c0..c0b9a73a68c 100644
--- a/storage/xtradb/trx/trx0i_s.c
+++ b/storage/xtradb/trx/trx0i_s.c
@@ -157,10 +157,6 @@ struct trx_i_s_cache_struct {
ullint last_read; /*!< last time the cache was read;
measured in microseconds since
epoch */
- mutex_t last_read_mutex;/*!< mutex protecting the
- last_read member - it is updated
- inside a shared lock of the
- rw_lock member */
i_s_table_cache_t innodb_trx; /*!< innodb_trx table */
i_s_table_cache_t innodb_locks; /*!< innodb_locks table */
i_s_table_cache_t innodb_lock_waits;/*!< innodb_lock_waits table */
@@ -1101,13 +1097,6 @@ can_cache_be_updated(
{
ullint now;
- /* Here we read cache->last_read without acquiring its mutex
- because last_read is only updated when a shared rw lock on the
- whole cache is being held (see trx_i_s_cache_end_read()) and
- we are currently holding an exclusive rw lock on the cache.
- So it is not possible for last_read to be updated while we are
- reading it. */
-
#ifdef UNIV_SYNC_DEBUG
ut_a(rw_lock_own(&cache->rw_lock, RW_LOCK_EX));
#endif
@@ -1205,6 +1194,12 @@ trx_i_s_possibly_fetch_data_into_cache(
/*===================================*/
trx_i_s_cache_t* cache) /*!< in/out: cache */
{
+ ullint now;
+
+#ifdef UNIV_SYNC_DEBUG
+ ut_a(rw_lock_own(&cache->rw_lock, RW_LOCK_EX));
+#endif
+
if (!can_cache_be_updated(cache)) {
return(1);
@@ -1217,6 +1212,10 @@ trx_i_s_possibly_fetch_data_into_cache(
mutex_exit(&kernel_mutex);
+ /* update cache last read time */
+ now = ut_time_us(NULL);
+ cache->last_read = now;
+
return(0);
}
@@ -1247,16 +1246,12 @@ trx_i_s_cache_init(
release kernel_mutex
release trx_i_s_cache_t::rw_lock
acquire trx_i_s_cache_t::rw_lock, S
- acquire trx_i_s_cache_t::last_read_mutex
- release trx_i_s_cache_t::last_read_mutex
release trx_i_s_cache_t::rw_lock */
rw_lock_create(&cache->rw_lock, SYNC_TRX_I_S_RWLOCK);
cache->last_read = 0;
- mutex_create(&cache->last_read_mutex, SYNC_TRX_I_S_LAST_READ);
-
table_cache_init(&cache->innodb_trx, sizeof(i_s_trx_row_t));
table_cache_init(&cache->innodb_locks, sizeof(i_s_locks_row_t));
table_cache_init(&cache->innodb_lock_waits,
@@ -1307,18 +1302,10 @@ trx_i_s_cache_end_read(
/*===================*/
trx_i_s_cache_t* cache) /*!< in: cache */
{
- ullint now;
-
#ifdef UNIV_SYNC_DEBUG
ut_a(rw_lock_own(&cache->rw_lock, RW_LOCK_SHARED));
#endif
- /* update cache last read time */
- now = ut_time_us(NULL);
- mutex_enter(&cache->last_read_mutex);
- cache->last_read = now;
- mutex_exit(&cache->last_read_mutex);
-
rw_lock_s_unlock(&cache->rw_lock);
}
diff --git a/storage/xtradb/trx/trx0purge.c b/storage/xtradb/trx/trx0purge.c
index 1c317665878..5a8b42af3af 100644
--- a/storage/xtradb/trx/trx0purge.c
+++ b/storage/xtradb/trx/trx0purge.c
@@ -330,9 +330,10 @@ trx_purge_add_update_undo_to_history(
trx_undo_t* undo;
trx_rseg_t* rseg;
trx_rsegf_t* rseg_header;
+#ifdef UNIV_DEBUG
trx_usegf_t* seg_header;
+#endif /* UNIV_DEBUG */
trx_ulogf_t* undo_header;
- trx_upagef_t* page_header;
ulint hist_size;
undo = trx->update_undo;
@@ -347,8 +348,9 @@ trx_purge_add_update_undo_to_history(
rseg->page_no, mtr);
undo_header = undo_page + undo->hdr_offset;
+#ifdef UNIV_DEBUG
seg_header = undo_page + TRX_UNDO_SEG_HDR;
- page_header = undo_page + TRX_UNDO_PAGE_HDR;
+#endif /* UNIV_DEBUG */
if (undo->state != TRX_UNDO_CACHED) {
/* The undo log segment will not be reused */
@@ -681,7 +683,6 @@ trx_purge_rseg_get_next_history_log(
{
page_t* undo_page;
trx_ulogf_t* log_hdr;
- trx_usegf_t* seg_hdr;
fil_addr_t prev_log_addr;
trx_id_t trx_no;
ibool del_marks;
@@ -702,7 +703,6 @@ trx_purge_rseg_get_next_history_log(
undo_page = trx_undo_page_get_s_latched(rseg->space, rseg->zip_size,
rseg->last_page_no, &mtr);
log_hdr = undo_page + rseg->last_offset;
- seg_hdr = undo_page + TRX_UNDO_SEG_HDR;
/* Increase the purge page count by one for every handled log */
@@ -1094,12 +1094,8 @@ trx_purge_rec_release(
/*==================*/
trx_undo_inf_t* cell) /*!< in: storage cell */
{
- trx_undo_arr_t* arr;
-
mutex_enter(&(purge_sys->mutex));
- arr = purge_sys->arr;
-
trx_purge_arr_remove_info(cell);
mutex_exit(&(purge_sys->mutex));
diff --git a/storage/xtradb/trx/trx0roll.c b/storage/xtradb/trx/trx0roll.c
index c925478cdf4..1a43e419214 100644
--- a/storage/xtradb/trx/trx0roll.c
+++ b/storage/xtradb/trx/trx0roll.c
@@ -740,13 +740,8 @@ trx_undo_arr_remove_info(
undo_no_t undo_no)/*!< in: undo number */
{
trx_undo_inf_t* cell;
- ulint n_used;
- ulint n;
ulint i;
- n_used = arr->n_used;
- n = 0;
-
for (i = 0;; i++) {
cell = trx_undo_arr_get_nth_info(arr, i);
diff --git a/storage/xtradb/trx/trx0sys.c b/storage/xtradb/trx/trx0sys.c
index 11581a3f2ae..a9fb5bb38d8 100644
--- a/storage/xtradb/trx/trx0sys.c
+++ b/storage/xtradb/trx/trx0sys.c
@@ -245,7 +245,9 @@ trx_sys_create_doublewrite_buf(void)
{
buf_block_t* block;
buf_block_t* block2;
+#ifdef UNIV_SYNC_DEBUG
buf_block_t* new_block;
+#endif /* UNIV_SYNC_DEBUG */
byte* doublewrite;
byte* fseg_header;
ulint page_no;
@@ -348,8 +350,11 @@ start_again:
the page position in the tablespace, then the page
has not been written to in doublewrite. */
- new_block = buf_page_get(TRX_SYS_SPACE, 0, page_no,
- RW_X_LATCH, &mtr);
+#ifdef UNIV_SYNC_DEBUG
+ new_block =
+#endif /* UNIV_SYNC_DEBUG */
+ buf_page_get(TRX_SYS_SPACE, 0, page_no,
+ RW_X_LATCH, &mtr);
buf_block_dbg_add_level(new_block,
SYNC_NO_ORDER_CHECK);
@@ -492,7 +497,10 @@ start_again:
the page position in the tablespace, then the page
has not been written to in doublewrite. */
- new_block = buf_page_get(TRX_DOUBLEWRITE_SPACE, 0, page_no,
+#ifdef UNIV_SYNC_DEBUG
+ new_block =
+#endif /* UNIV_SYNC_DEBUG */
+ buf_page_get(TRX_DOUBLEWRITE_SPACE, 0, page_no,
RW_X_LATCH, &mtr);
buf_block_dbg_add_level(new_block,
SYNC_NO_ORDER_CHECK);
@@ -1659,7 +1667,7 @@ trx_sys_print_mysql_binlog_offset_from_page(
/* THESE ARE COPIED FROM NON-HOTBACKUP PART OF THE INNODB SOURCE TREE
- (This code duplicaton should be fixed at some point!)
+ (This code duplication should be fixed at some point!)
*/
#define TRX_SYS_SPACE 0 /* the SYSTEM tablespace */
diff --git a/storage/xtradb/trx/trx0trx.c b/storage/xtradb/trx/trx0trx.c
index 9584f0c4c46..75bbe1b342a 100644
--- a/storage/xtradb/trx/trx0trx.c
+++ b/storage/xtradb/trx/trx0trx.c
@@ -1893,7 +1893,6 @@ trx_prepare_off_kernel(
/*===================*/
trx_t* trx) /*!< in: transaction */
{
- page_t* update_hdr_page;
trx_rseg_t* rseg;
ib_uint64_t lsn = 0;
mtr_t mtr;
@@ -1926,7 +1925,7 @@ trx_prepare_off_kernel(
}
if (trx->update_undo) {
- update_hdr_page = trx_undo_set_state_at_prepare(
+ trx_undo_set_state_at_prepare(
trx, trx->update_undo, &mtr);
}
diff --git a/storage/xtradb/trx/trx0undo.c b/storage/xtradb/trx/trx0undo.c
index ec4beb5660a..6f06de593a9 100644
--- a/storage/xtradb/trx/trx0undo.c
+++ b/storage/xtradb/trx/trx0undo.c
@@ -1066,14 +1066,11 @@ trx_undo_truncate_end(
ulint last_page_no;
trx_undo_rec_t* rec;
trx_undo_rec_t* trunc_here;
- trx_rseg_t* rseg;
mtr_t mtr;
ut_ad(mutex_own(&(trx->undo_mutex)));
ut_ad(mutex_own(&(trx->rseg->mutex)));
- rseg = trx->rseg;
-
for (;;) {
mtr_start(&mtr);
@@ -1864,21 +1861,11 @@ trx_undo_set_state_at_finish(
if (undo->size == 1
&& mach_read_from_2(page_hdr + TRX_UNDO_PAGE_FREE)
- < TRX_UNDO_PAGE_REUSE_LIMIT) {
+ < TRX_UNDO_PAGE_REUSE_LIMIT
+ && UT_LIST_GET_LEN(rseg->update_undo_list) < 500
+ && UT_LIST_GET_LEN(rseg->insert_undo_list) < 500) {
- /* This is a heuristic to avoid the problem of all UNDO
- slots ending up in one of the UNDO lists. Previously if
- the server crashed with all the slots in one of the lists,
- transactions that required the slots of a different type
- would fail for lack of slots. */
-
- if (UT_LIST_GET_LEN(rseg->update_undo_list) < 500
- && UT_LIST_GET_LEN(rseg->insert_undo_list) < 500) {
-
- state = TRX_UNDO_CACHED;
- } else {
- state = TRX_UNDO_TO_FREE;
- }
+ state = TRX_UNDO_CACHED;
} else if (undo->type == TRX_UNDO_INSERT) {
@@ -1906,7 +1893,6 @@ trx_undo_set_state_at_prepare(
mtr_t* mtr) /*!< in: mtr */
{
trx_usegf_t* seg_hdr;
- trx_upagef_t* page_hdr;
trx_ulogf_t* undo_header;
page_t* undo_page;
ulint offset;
@@ -1924,7 +1910,6 @@ trx_undo_set_state_at_prepare(
undo->hdr_page_no, mtr);
seg_hdr = undo_page + TRX_UNDO_SEG_HDR;
- page_hdr = undo_page + TRX_UNDO_PAGE_HDR;
/*------------------------------*/
undo->state = TRX_UNDO_PREPARED;
diff --git a/strings/CMakeLists.txt b/strings/CMakeLists.txt
index ec9e9a3a3af..3e13a93c4c9 100755
--- a/strings/CMakeLists.txt
+++ b/strings/CMakeLists.txt
@@ -13,8 +13,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG -DSAFEMALLOC -DSAFE_MUTEX")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
diff --git a/strings/Makefile.am b/strings/Makefile.am
index 9b0c1a33250..6a09abe7479 100644
--- a/strings/Makefile.am
+++ b/strings/Makefile.am
@@ -17,6 +17,7 @@
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include
pkglib_LIBRARIES = libmystrings.a
+noinst_LTLIBRARIES = libmystrings.la
# Exact one of ASSEMBLER_X
if ASSEMBLER_x86
@@ -37,7 +38,7 @@ CSRCS = strxmov.c bmove_upp.c strappend.c strcont.c strend.c strfill.c strcend.
endif
endif
-libmystrings_a_SOURCES = $(ASRCS) $(CSRCS)
+libmystrings_la_SOURCES = $(ASRCS) $(CSRCS)
noinst_PROGRAMS = conf_to_src
CLEANFILES = str_test uctypedump test_decimal
# Default charset definitions
@@ -56,9 +57,9 @@ EXTRA_DIST = ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc
t_ctype.h my_strchr.c CMakeLists.txt \
CHARSET_INFO.txt strmov_overlapp.c
-libmystrings_a_LIBADD=
-conf_to_src_SOURCES = conf_to_src.c xml.c ctype.c bcmp.c
-conf_to_src_LDADD=
+libmystrings_la_LIBADD=
+conf_to_src_SOURCES = conf_to_src.c
+conf_to_src_LDADD = libmystrings.a
#force static linking of conf_to_src - essential when linking against
#custom installation of libc
conf_to_src_LDFLAGS= @NOINST_LDFLAGS@
@@ -66,6 +67,9 @@ conf_to_src_LDFLAGS= @NOINST_LDFLAGS@
# This is because the dependency tracking misses @FOO@ vars in sources.
#strtoull.o: @CHARSET_OBJS@
+libmystrings_a_SOURCES=
+libmystrings.a: libmystrings.la
+ $(CP) .libs/libmystrings.a $@
FLAGS=$(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) @NOINST_LDFLAGS@
diff --git a/strings/conf_to_src.c b/strings/conf_to_src.c
index 0f1644b27e8..8bd4b682142 100644
--- a/strings/conf_to_src.c
+++ b/strings/conf_to_src.c
@@ -271,7 +271,7 @@ fprint_copyright(FILE *file)
int
main(int argc, char **argv __attribute__((unused)))
{
- CHARSET_INFO ncs;
+ struct charset_info_st ncs;
CHARSET_INFO *cs;
char filename[256];
FILE *f= stdout;
diff --git a/support-files/MacOSX/Makefile.am b/support-files/MacOSX/Makefile.am
index 3f11107d714..7d4384a2a56 100644
--- a/support-files/MacOSX/Makefile.am
+++ b/support-files/MacOSX/Makefile.am
@@ -52,6 +52,3 @@ SUFFIXES = .sh
-e 's!@''MYSQLD_USER''@!@MYSQLD_USER@!' \
$< > $@-t
@MV@ $@-t $@
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/support-files/RHEL4-SElinux/Makefile.am b/support-files/RHEL4-SElinux/Makefile.am
index 52292136877..d2143a5285c 100644
--- a/support-files/RHEL4-SElinux/Makefile.am
+++ b/support-files/RHEL4-SElinux/Makefile.am
@@ -18,6 +18,3 @@
## Process this file with automake to create Makefile.in
EXTRA_DIST = mysql.fc mysql.te
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 245c9ce8666..30afebb46bd 100755
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -15,7 +15,6 @@
# About "mysqlclient_notls", see note in "client/CMakeLists.txt"
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
ADD_DEFINITIONS("-DMYSQL_CLIENT")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index 789ba236a87..770e35832e1 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -18341,6 +18341,107 @@ static void test_bug54041()
}
+/**
+ Bug#47485: mysql_store_result returns a result set for a prepared statement
+*/
+static void test_bug47485()
+{
+ MYSQL_STMT *stmt;
+ MYSQL_RES *res;
+ MYSQL_BIND bind[2];
+ int rc;
+ const char* sql_select = "SELECT 1, 'a'";
+ int int_data;
+ char str_data[16];
+ my_bool is_null[2];
+ my_bool error[2];
+ unsigned long length[2];
+
+ DBUG_ENTER("test_bug47485");
+ myheader("test_bug47485");
+
+ stmt= mysql_stmt_init(mysql);
+ check_stmt(stmt);
+ rc= mysql_stmt_prepare(stmt, sql_select, strlen(sql_select));
+ check_execute(stmt, rc);
+
+ rc= mysql_stmt_execute(stmt);
+ check_execute(stmt, rc);
+
+ res = mysql_store_result(mysql);
+ DIE_UNLESS(res == NULL);
+
+ mysql_stmt_reset(stmt);
+
+ rc= mysql_stmt_execute(stmt);
+ check_execute(stmt, rc);
+
+ res = mysql_use_result(mysql);
+ DIE_UNLESS(res == NULL);
+
+ mysql_stmt_reset(stmt);
+
+ memset(bind, 0, sizeof(bind));
+ bind[0].buffer_type= MYSQL_TYPE_LONG;
+ bind[0].buffer= (char *)&int_data;
+ bind[0].is_null= &is_null[0];
+ bind[0].length= &length[0];
+ bind[0].error= &error[0];
+
+ bind[1].buffer_type= MYSQL_TYPE_STRING;
+ bind[1].buffer= (char *)str_data;
+ bind[1].buffer_length= sizeof(str_data);
+ bind[1].is_null= &is_null[1];
+ bind[1].length= &length[1];
+ bind[1].error= &error[1];
+
+ rc= mysql_stmt_bind_result(stmt, bind);
+ check_execute(stmt, rc);
+
+ rc= mysql_stmt_execute(stmt);
+ check_execute(stmt, rc);
+
+ rc= mysql_stmt_store_result(stmt);
+ check_execute(stmt, rc);
+
+ while (!(rc= mysql_stmt_fetch(stmt)))
+ ;
+
+ DIE_UNLESS(rc == MYSQL_NO_DATA);
+
+ mysql_stmt_reset(stmt);
+
+ memset(bind, 0, sizeof(bind));
+ bind[0].buffer_type= MYSQL_TYPE_LONG;
+ bind[0].buffer= (char *)&int_data;
+ bind[0].is_null= &is_null[0];
+ bind[0].length= &length[0];
+ bind[0].error= &error[0];
+
+ bind[1].buffer_type= MYSQL_TYPE_STRING;
+ bind[1].buffer= (char *)str_data;
+ bind[1].buffer_length= sizeof(str_data);
+ bind[1].is_null= &is_null[1];
+ bind[1].length= &length[1];
+ bind[1].error= &error[1];
+
+ rc= mysql_stmt_bind_result(stmt, bind);
+ check_execute(stmt, rc);
+
+ rc= mysql_stmt_execute(stmt);
+ check_execute(stmt, rc);
+
+ while (!(rc= mysql_stmt_fetch(stmt)))
+ ;
+
+ DIE_UNLESS(rc == MYSQL_NO_DATA);
+
+ mysql_stmt_close(stmt);
+
+ DBUG_VOID_RETURN;
+}
+
+
/*
Read and parse arguments and MySQL options from my.cnf
*/
@@ -18664,6 +18765,7 @@ static struct my_tests_st my_tests[]= {
{ "test_bug44495", test_bug44495 },
{ "test_bug42373", test_bug42373 },
{ "test_bug54041", test_bug54041 },
+ { "test_bug47485", test_bug47485 },
{ 0, 0 }
};
diff --git a/unittest/examples/Makefile.am b/unittest/examples/Makefile.am
index a1627a58b4e..3e64c7ceddc 100644
--- a/unittest/examples/Makefile.am
+++ b/unittest/examples/Makefile.am
@@ -22,6 +22,3 @@ LDADD = -lmytap
# We omit core-t here, since it will always fail.
noinst_PROGRAMS = simple-t skip-t todo-t skip_all-t no_plan-t
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/unittest/examples/skip-t.c b/unittest/examples/skip-t.c
index 092353fcc48..c8c910b31ff 100644
--- a/unittest/examples/skip-t.c
+++ b/unittest/examples/skip-t.c
@@ -18,11 +18,11 @@
int main() {
plan(4);
- ok(1, NULL);
- ok(1, NULL);
+ ok1(1);
+ ok1(1);
SKIP_BLOCK_IF(1, 2, "Example of skipping a few test points in a test") {
- ok(1, NULL);
- ok(1, NULL);
+ ok1(1);
+ ok1(1);
}
return exit_status();
}
diff --git a/unittest/examples/skip_all-t.c b/unittest/examples/skip_all-t.c
index a4c8648fbe4..826fa22e82f 100644
--- a/unittest/examples/skip_all-t.c
+++ b/unittest/examples/skip_all-t.c
@@ -31,9 +31,9 @@ int main() {
if (!has_feature())
skip_all("Example of skipping an entire test");
plan(4);
- ok(1, NULL);
- ok(1, NULL);
- ok(1, NULL);
- ok(1, NULL);
+ ok1(1);
+ ok1(1);
+ ok1(1);
+ ok1(1);
return exit_status();
}
diff --git a/unittest/examples/todo-t.c b/unittest/examples/todo-t.c
index 2de409447ba..2751da5e010 100644
--- a/unittest/examples/todo-t.c
+++ b/unittest/examples/todo-t.c
@@ -21,15 +21,15 @@
int main()
{
plan(4);
- ok(1, NULL);
- ok(1, NULL);
+ ok1(1);
+ ok1(1);
/*
Tests in the todo region is expected to fail. If they don't,
something is strange.
*/
todo_start("Need to fix these");
- ok(0, NULL);
- ok(0, NULL);
+ ok1(0);
+ ok1(0);
todo_end();
return exit_status();
}
diff --git a/unittest/mysys/CMakeLists.txt b/unittest/mysys/CMakeLists.txt
index e13a55d2e1e..d8ce63f3c05 100644
--- a/unittest/mysys/CMakeLists.txt
+++ b/unittest/mysys/CMakeLists.txt
@@ -13,9 +13,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/unittest/mytap)
ADD_EXECUTABLE(bitmap-t bitmap-t.c)
diff --git a/unittest/mysys/Makefile.am b/unittest/mysys/Makefile.am
index 3aa9e58b6ec..07b9b94ab01 100644
--- a/unittest/mysys/Makefile.am
+++ b/unittest/mysys/Makefile.am
@@ -26,6 +26,3 @@ LDADD = $(top_builddir)/unittest/mytap/libmytap.a \
EXTRA_DIST = CMakeLists.txt
noinst_PROGRAMS = bitmap-t base64-t my_atomic-t lf-t waiting_threads-t \
my_vsnprintf-t
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/unittest/mytap/CMakeLists.txt b/unittest/mytap/CMakeLists.txt
index 2c0893226fa..0579f075953 100644
--- a/unittest/mytap/CMakeLists.txt
+++ b/unittest/mytap/CMakeLists.txt
@@ -13,8 +13,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
ADD_LIBRARY(mytap tap.c)
diff --git a/unittest/mytap/Makefile.am b/unittest/mytap/Makefile.am
index 8feefb134bb..b14b65a6f5d 100644
--- a/unittest/mytap/Makefile.am
+++ b/unittest/mytap/Makefile.am
@@ -23,6 +23,3 @@ libmytap_a_SOURCES = tap.c
EXTRA_DIST = CMakeLists.txt
SUBDIRS = . t
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/unittest/mytap/t/Makefile.am b/unittest/mytap/t/Makefile.am
index e89a088bb3a..bce72a88c05 100644
--- a/unittest/mytap/t/Makefile.am
+++ b/unittest/mytap/t/Makefile.am
@@ -20,6 +20,3 @@ AM_LDFLAGS = -L$(top_builddir)/unittest/mytap
LDADD = -lmytap
noinst_PROGRAMS = basic-t
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/unittest/mytap/t/basic-t.c b/unittest/mytap/t/basic-t.c
index c0ceb5bf190..b588521d192 100644
--- a/unittest/mytap/t/basic-t.c
+++ b/unittest/mytap/t/basic-t.c
@@ -22,7 +22,7 @@ int main() {
plan(5);
ok(1 == 1, "testing basic functions");
ok(2 == 2, " ");
- ok(3 == 3, NULL);
+ ok1(3 == 3);
if (1 == 1)
skip(2, "Sensa fragoli");
else {
diff --git a/unittest/mytap/tap.c b/unittest/mytap/tap.c
index 2f1747d7167..550920d9d3e 100644
--- a/unittest/mytap/tap.c
+++ b/unittest/mytap/tap.c
@@ -244,6 +244,23 @@ ok(int pass, char const *fmt, ...)
emit_endl();
}
+void
+ok1(int const pass)
+{
+ va_list ap;
+
+ memset(&ap, 0, sizeof(ap));
+
+ if (!pass && *g_test.todo == '\0')
+ ++g_test.failed;
+
+ vemit_tap(pass, NULL, ap);
+
+ if (*g_test.todo != '\0')
+ emit_dir("todo", g_test.todo);
+
+ emit_endl();
+}
void
skip(int how_many, char const *fmt, ...)
diff --git a/unittest/mytap/tap.h b/unittest/mytap/tap.h
index a75d0a4932b..ee04f7dc049 100644
--- a/unittest/mytap/tap.h
+++ b/unittest/mytap/tap.h
@@ -121,8 +121,8 @@ void plan(int count);
@endcode
@param pass Zero if the test failed, non-zero if it passed.
- @param fmt Format string in printf() format. NULL is allowed, in
- which case nothing is printed.
+ @param fmt Format string in printf() format. NULL is not allowed,
+ use ok1() in this case.
*/
void ok(int pass, char const *fmt, ...)
@@ -130,6 +130,17 @@ void ok(int pass, char const *fmt, ...)
/**
+ Report test result as a TAP line.
+
+ Same as ok() but does not take a message to be printed.
+
+ @param pass Zero if the test failed, non-zero if it passed.
+*/
+
+void ok1(int const pass);
+
+
+/**
Skip a determined number of tests.
Function to print that <em>how_many</em> tests have been skipped.
diff --git a/unittest/strings/Makefile.am b/unittest/strings/Makefile.am
index 5b18d89f58e..3e5a0f3e9cb 100644
--- a/unittest/strings/Makefile.am
+++ b/unittest/strings/Makefile.am
@@ -22,6 +22,3 @@ LDADD = $(top_builddir)/unittest/mytap/libmytap.a \
$(top_builddir)/strings/libmystrings.a
noinst_PROGRAMS = strings-t
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/unittest/unit.pl b/unittest/unit.pl
index a1aab376fdf..be6424ec798 100644
--- a/unittest/unit.pl
+++ b/unittest/unit.pl
@@ -65,7 +65,7 @@ sub _find_test_files (@) {
my @dirs = @_;
my @files;
find sub {
- $File::Find::prune = 1 if /^SCCS$/;
+ $File::Find::prune = 1 if /^(SCCS|\.libs)$/;
push(@files, $File::Find::name) if -x _ && (/-t\z/ || /-t\.exe\z/);
}, @dirs;
return @files;
diff --git a/vio/CMakeLists.txt b/vio/CMakeLists.txt
index 164bcde7c4b..e1bd57d150f 100755
--- a/vio/CMakeLists.txt
+++ b/vio/CMakeLists.txt
@@ -13,8 +13,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG -DSAFEMALLOC -DSAFE_MUTEX")
ADD_DEFINITIONS(-DUSE_SYMDIR)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/extra/yassl/include)
diff --git a/vio/Makefile.am b/vio/Makefile.am
index c70af1008cd..588cd3ea0c4 100644
--- a/vio/Makefile.am
+++ b/vio/Makefile.am
@@ -17,9 +17,15 @@ INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \
$(openssl_includes)
LDADD = @CLIENT_EXTRA_LDFLAGS@ $(openssl_libs) $(yassl_libs)
pkglib_LIBRARIES = libvio.a
+noinst_LTLIBRARIES = libvio.la
noinst_HEADERS = vio_priv.h
-libvio_a_SOURCES = vio.c viosocket.c viossl.c viosslfactories.c
+libvio_la_SOURCES = vio.c viosocket.c viossl.c viosslfactories.c
EXTRA_DIST= CMakeLists.txt
+
+libvio_a_SOURCES=
+libvio.a: libvio.la
+ $(CP) .libs/libvio.a $@
+
diff --git a/win/configure-mariadb.bat b/win/configure-mariadb.bat
new file mode 100644
index 00000000000..834d73732b8
--- /dev/null
+++ b/win/configure-mariadb.bat
@@ -0,0 +1,8 @@
+cscript win\configure.js ^
+ WITH_EXAMPLE_STORAGE_ENGINE ^
+ WITH_FEDERATEDX_STORAGE_ENGINE ^
+ WITH_MERGE_STORAGE_ENGINE ^
+ WITH_PARTITION_STORAGE_ENGINE ^
+ WITH_MARIA_STORAGE_ENGINE ^
+ WITH_PBXT_STORAGE_ENGINE ^
+ WITH_XTRADB_STORAGE_ENGINE